chapter 8


Molecular Fragments and Fingerprints

This chapter shows ways in which molecular fragments can be used to speed up searches for chemical structures. Both path-based and fragment-based methods are discussed. Using bit-string fingerprints representing the presence or absence of various fragments, several types of molecular similarity are explained. Finally, it is shown how tables of fragments along with parameter values for these fragments can be used to compute theoretical molecular properties. [view wordle] [hide wordle]

Page  
91
Select cansmi From atable Where cansmi=cansmiles('c1ccccc1O');
Select cansmi From atable Where matches(cansmi,'c1ccccc1O');
92
Select cansmi From atable Where C_count>=6 and O_count>=1
   And matches(cansmi, 'c1ccccc1O');
93
Select cansmi From atable Where (fkey&key('c1ccccc1O')=fkey)
   And matches(smiles,'c1ccccc1O');
Create Table fragments (description Text, smarts Text, abit Integer);
94
Select abit from fragments Where matches('c1ccccc1O', smarts);
Select B'1'::bit(50)>>abit-1 from fragments
   Where matches('c1ccccc1O', smarts);
Create Function key(text) Returns bit varying As $$
  Select orsum(B'1'::bit(50)>>abit-1) from fragments
   Where matches($1, smarts);
$$ Language SQL;
96
Create Function tanimoto(bit, bit) Returns Real As
  'Select nbits_set($1 & $2)::real / 
  (nbits_set($1) + nbits_set($2) - nbits_set($1 & $2))::real; '
Language SQL;
97
Create Function amw(character varying) Returns Numeric As $EOSQL$
  Select sum(weight*count_matches($1,smarts)) From amw; 
$EOSQL$ Language SQL; 
Select amw('c1ccccc1O');
Select amw(smiles) from structure;
98
Create Table tpsa (psa Numeric, smarts Text, description Text);
Create Function gnova.tpsa(text) Returns Numeric As $EOSQL$ 
  Select sum(psa*count_matches($1,smarts)) From tpsa; 
$EOSQL$ Language SQL;