Skip to content

Instantly share code, notes, and snippets.

View leelasd's full-sized avatar
🏠
Working from home

Leela S. Dodda leelasd

🏠
Working from home
View GitHub Profile
@leelasd
leelasd / dataset_clustering.py
Created February 9, 2022 17:45 — forked from bitsnaps/dataset_clustering.py
Clustering using AgglomerativeClustering and silhouette scoring
# dataset.csv
# ID,Height,time_of_day,resolution
# 272,1.567925,1.375000,0.594089
# 562,1.807508,1.458333,0.594089
# 585,2.693542,0.416667,0.594089
# 610,1.036305,1.458333,0.594089
# 633,1.117111,0.416667,0.594089
# 658,1.542407,1.458333,0.594089
# 681,1.930844,0.416667,0.594089
# 802,1.505548,1.458333,0.594089
from openmmtools.constants import kB
from simtk import unit
import numpy as np
from tqdm import tqdm
from IPython.core.display import display, HTML
from IPython.display import SVG
from rdkit.Chem.Draw import IPythonConsole
import mdtraj as md
#from utils import *
import nglview
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@leelasd
leelasd / test.input
Created September 30, 2017 16:47
LAMMPS Single Point Energy
units real
atom_style full
dimension 3
boundary p p p
bond_style harmonic
angle_style harmonic
dihedral_style opls
improper_style cvff
@leelasd
leelasd / approved_drugs.csv
Created November 16, 2021 14:27
CSV generated by the Python script
We can't make this file beautiful and searchable because it's too large.
compound_chembl_id,canonical_smiles,molregno,structure_type,first_in_class,indication_class,first_approval
CHEMBL1000,O=C(O)COCCN1CCN(C(c2ccccc2)c2ccc(Cl)cc2)CC1,111185,MOL,0,Antihistaminic,1995.0
CHEMBL100116,CC(C)=CCN1CCC2(C)c3cc(O)ccc3CC1C2C,165474,MOL,0,,1967.0
CHEMBL1002,CC(C)(C)NC[C@H](O)c1ccc(O)c(CO)c1,111482,MOL,0,Bronchodilator; Asthma Prophylactic,1999.0
CHEMBL100259,O=c1ccn([C@@H]2O[C@H](CO)[C@@H](O)[C@H]2O)c(=O)[nH]1,161181,MOL,0,,
CHEMBL1003,O=C([O-])[C@H]1/C(=C/CO)O[C@@H]2CC(=O)N21.[K+],111491,MOL,0,Inhibitor (beta-lactamase),1984.0
CHEMBL1004,CN(C)CCOC(C)(c1ccccc1)c1ccccn1,111498,MOL,0,Antihistaminic,1948.0
CHEMBL1005,CCC(=O)N(c1ccccc1)C1(C(=O)OC)CCN(CCC(=O)OC)CC1,111871,MOL,0,Analgesic,1996.0
CHEMBL1006,NCCCNCCSP(=O)(O)O,112480,MOL,0,Protectant (topical); Radioprotector,1995.0
CHEMBL1007,CC(C)C[C@H](NC(=O)CNC(=O)[C@H](Cc1ccc(O)cc1)NC(=O)[C@H](CO)NC(=O)[C@H](Cc1c[nH]c2ccccc12)NC(=O)[C@H](Cc1cnc[nH]1)NC(=O)[C@@H]1CCC(=O)N1)C(=O)N[C@@H](CCCNC(=N)N)C(=O)N1CCC[C@H]1C(=O)NCC(N)=O,112560,BOTH,0,Gonad
@leelasd
leelasd / extract_approved_drugs.py
Created November 16, 2021 14:19
Extract approved Drugs from Chembl 29 local database
import psycopg2
import pandas as pd
import pandas.io.sql as sqlio
con = psycopg2.connect(database="chembl_29", user="leelasd", password="", host="127.0.0.1", port="5432")
print("Database opened successfully")
sql="""SELECT DISTINCT m.chembl_id AS compound_chembl_id,s.canonical_smiles,
m.molregno,
@leelasd
leelasd / PermeabilityDataFromChembl.py
Created November 16, 2021 03:36
Extract Permeability Data from Chembl SQL database
import psycopg2
import pandas as pd
import pandas.io.sql as sqlio
con = psycopg2.connect(database="chembl_29", user="leelasd", password="", host="127.0.0.1", port="5432")
print("Database opened successfully")
sql="""SELECT m.chembl_id AS compound_chembl_id,
s.canonical_smiles,
r.compound_key,
@leelasd
leelasd / retrieve_bioactivity_info_from_chembl.py
Created November 15, 2021 03:30 — forked from avrilcoghlan/retrieve_bioactivity_info_from_chembl.py
Python script to query the ChEMBL database to retrieve a list of compounds with bioactivities for certain target proteins, and then retrieve information on the molecular properties of those compounds
import pandas as pd # uses pandas python module to view and analyse data
import requests # this is used to access json files
#====================================================================#
# using a list of known targets, find compounds that are active on these targets:
def find_bioactivities_for_targets(targets):
targets = ",".join(targets) # join the targets into a suitable string to fulfil the search conditions of the ChEMBL api
@leelasd
leelasd / conf_gen.py
Created March 3, 2017 18:37 — forked from tdudgeon/conf_gen.py
Conformer generation using RDKit
import sys
from rdkit import Chem
from rdkit.Chem import AllChem, TorsionFingerprints
from rdkit.ML.Cluster import Butina
def gen_conformers(mol, numConfs=100, maxAttempts=1000, pruneRmsThresh=0.1, useExpTorsionAnglePrefs=True, useBasicKnowledge=True, enforceChirality=True):
ids = AllChem.EmbedMultipleConfs(mol, numConfs=numConfs, maxAttempts=maxAttempts, pruneRmsThresh=pruneRmsThresh, useExpTorsionAnglePrefs=useExpTorsionAnglePrefs, useBasicKnowledge=useBasicKnowledge, enforceChirality=enforceChirality, numThreads=0)
return list(ids)
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.