This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
WITH conformer AS | |
( | |
SELECT openeye.omega('CC1=CC(=C(N1C2=CC(=CC(=C2)C(F)(F)F)C(F)(F)F)C)/C=C\3/C(=O)N=C(S3)NC4=CC=CC=C4') as oeb | |
), | |
query AS | |
( | |
SELECT openeye.usrcat(oeb) AS usr_moments | |
FROM conformer | |
), | |
screen AS |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
headers = {'accept': 'application/json'} | |
files = {'file': open('/home/adrian/Dropbox/OSM-S-35-I.sdf')} | |
response = requests.post('http://marid.bioc.cam.ac.uk/credo/chemcomps/sim/usr/', | |
headers=headers, files=files, params={'usrcat':'t', 'limit':25}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
loop_ | |
_pdbx_struct_oper_list.id | |
_pdbx_struct_oper_list.type | |
_pdbx_struct_oper_list.name | |
_pdbx_struct_oper_list.symmetry_operation | |
_pdbx_struct_oper_list.matrix[1][1] | |
_pdbx_struct_oper_list.matrix[1][2] | |
_pdbx_struct_oper_list.matrix[1][3] | |
_pdbx_struct_oper_list.vector[1] | |
_pdbx_struct_oper_list.matrix[2][1] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- set search_path = public, openeye; | |
DO $$ | |
DECLARE | |
molregno integer; | |
fp oefp; | |
BEGIN | |
FOR molregno, fp IN SELECT cfp.molregno, cfp.circular_fp | |
FROM chembl.compound_oefps cfp | |
ORDER BY random() LIMIT 100 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@paginate | |
def fetch_all_descendants(self, fragment_id, *expr, **kwargs): | |
""" | |
Returns all the descending fragments of the fragment with the given | |
fragment_id using an recursive SQL query. | |
""" | |
# query part that will be used in both parts of the recursive query | |
query = Fragment.query.with_entities(Fragment.fragment_id) | |
query = query.join(FragmentHierarchy, FragmentHierarchy.child_id==Fragment.fragment_id) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@hybrid_method | |
@requires.rdkit | |
def contains(self, smiles): | |
return self.rdmol.HasSubstructMatch(MolFromSmiles(str(smiles))) | |
@contains.expression | |
def contains(self, smiles): | |
return self.rdmol.op('OPERATOR(rdkit.@>)')(smiles) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import urllib2 | |
import json | |
headers = {'Accept' : 'application/json'} | |
req = urllib2.Request('http://marid.bioc.cam.ac.uk/credo/chemcomps/001', headers=headers) | |
resp = urllib2.urlopen(req) | |
jsondata = json.load(resp) | |
# output | |
{u'data': [7464, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT assay_id, | |
count(DISTINCT molregno) AS compounds, | |
openeye.multimcs(array_agg(ism), threshold:=0.8) AS mcs | |
FROM chembl.target_dictionary | |
JOIN chembl.assay2target USING(tid) | |
JOIN chembl.activities a USING(assay_id) | |
JOIN chembl.compound_smiles cs USING(molregno) | |
WHERE protein_accession = 'P53779' | |
GROUP BY assay_id | |
HAVING count(DISTINCT molregno) >= 5 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT * | |
FROM credo.unichem_pdb_to_kegg | |
LIMIT 10; | |
het_id compound_id | |
------ ----------- | |
LQZ C07073 | |
HC4 C00811 | |
DC5 C14355 | |
POD C10874 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- select a query molecule | |
WITH query AS | |
( | |
SELECT * | |
FROM dude.usr_moments_fnta | |
WHERE category = 'ACTIVE' AND mol_idx = 1 AND conformer = 0 | |
) | |
-- run the virtual screen with the given query | |
SELECT category, mol_idx, MAX(sq.similarity) as similarity | |
FROM ( |
NewerOlder