File: bench_cartridge.sql

package info (click to toggle)
rdkit 201403-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 62,288 kB
  • ctags: 15,156
  • sloc: cpp: 125,376; python: 55,674; java: 4,831; ansic: 4,178; xml: 2,499; sql: 1,775; yacc: 1,551; lex: 1,051; makefile: 353; fortran: 183; sh: 148; cs: 93
file content (30 lines) | stat: -rw-r--r-- 1,478 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
SET client_min_messages = warning;
\set ECHO none
drop extension if exists rdkit cascade;
drop table if exists mols,zinc_frags,zinc_leads,pubchem_pieces;
create extension rdkit;
\timing
\set ECHO all
RESET client_min_messages;
select id,mol_from_smiles(smiles::cstring) m into mols from raw_data;
create index molidx on mols using gist(m);
select id,mol_from_smiles(smiles::cstring) m into zinc_frags from zinc_frags_raw;
select id,mol_from_smiles(smiles::cstring) m into zinc_leads from zinc_leads_raw;
select mol_from_smiles(smiles::cstring) m into pubchem_pieces from pubchem_pieces_raw;

select count(*) from mols cross join zinc_frags qt where mols.m@>qt.m;
select count(*) from mols cross join zinc_leads qt where mols.m@>qt.m;
select count(*) from mols cross join pubchem_pieces qt where mols.m@>qt.m;

drop table if exists fps,zinc_frags_fps,zinc_leads_fps;
select id,morganbv_fp(m) mfp2 into fps from mols;
create index mfp2_idx on fps using gist(mfp2);
select id,morganbv_fp(m) mfp2 into zinc_leads_fps from zinc_leads;
select id,morganbv_fp(m) mfp2 into zinc_frags_fps from zinc_frags;

set rdkit.tanimoto_threshold=0.8;
select count(*) from fps cross join zinc_leads_fps qt where fps.mfp2%qt.mfp2;
select count(*) from fps cross join zinc_frags_fps qt where fps.mfp2%qt.mfp2;
set rdkit.tanimoto_threshold=0.6;
select count(*) from fps cross join zinc_leads_fps qt where fps.mfp2%qt.mfp2;
select count(*) from fps cross join zinc_frags_fps qt where fps.mfp2%qt.mfp2;