Skip to content

Instantly share code, notes, and snippets.

View hemahecodes's full-sized avatar

Helena Martín Hernández hemahecodes

  • Nostrum Biodiscovery
  • Barcelona, Spain
View GitHub Profile
@hemahecodes
hemahecodes / frag_pele_rdkit.py
Last active April 4, 2022 14:09
Merging fragment and core using RDKit for FragPELE
from rdkit.Chem import rdchem
from rdkit import Chem
# Import molecules
core = Chem.MolFromPDBFile('../FFF/core.pdb')
fragment = Chem.MolFromPDBFile('../FFF/fragment.pdb')
# Merge both molecules
combo = Chem.CombineMols(core,fragment)
@hemahecodes
hemahecodes / glide_analysis.sh
Created April 4, 2022 14:07
Glide Docking Analysis
SCHRODINGER="Path to Schrodinger"
$SCHRODINGER/utilities/glide_sort actives.maegz -o actives_sorted.mae -R
$SCHRODINGER/utilities/glide_sort decoys.maegz -o decoys_sorted.mae -R
$SCHRODINGER/glide_merge actives_sorted.mae decoys_sorted.mae -o glide_results.mae -R
$SCHRODINGER/run enrichment.py
@hemahecodes
hemahecodes / enrichment.py
Last active July 1, 2022 11:46
Enrichment Analysis Glide Schrodinger Python
import schrodinger
from schrodinger.analysis.enrichment import calculator
efcalc = calculator.Calculator(
actives = "actives.txt", # Active titles, one per line.
results = "glide_docking_results.mae", # Glide pv file.
total_decoys = 1093 # Number of decoys
)
efcalc.report() # Print default report to standard out.
efcalc.savePlot() # Create default graph png.
print(efcalc.calcBEDROC(alpha=20)) # Print the BEDROC metric value
@hemahecodes
hemahecodes / PDBAtom.py
Created November 22, 2022 13:46
Parse PDB Files to get Atom information.
import sys
class PDBAtom:
"""
It defines a PDB Atom object.
"""
def __init__(self, line):
self.type = self._get_type(line) # from columns 1-7
self.ser_num = self._get_serial_number(line) # from columns 7-11
self.at_name = self._get_atom_name(line) # from columns 13-16