View USRCAT-ZINC-screen.sql
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 |
View credo-rest-usrcat.py
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}) |
View sample.cif
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] |
View pgopeneye-benchmark.sql
-- 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 |
View fetch-all-descendants.py
@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) |
View chemcomprdmol-hybrid-method.py
@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) |
View credimus-urllib2.py
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, |
View openeye-multimcs-chembl-threshold.sql
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 |
View unichem-fdw-query.sql
SELECT * | |
FROM credo.unichem_pdb_to_kegg | |
LIMIT 10; | |
het_id compound_id | |
------ ----------- | |
LQZ C07073 | |
HC4 C00811 | |
DC5 C14355 | |
POD C10874 |
View usrcat-query.sql
-- 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