Chemistry Reference
In-Depth Information
Create Function tanimoto(bit, bit)
Returns Real As $EOSQL$
Select nbits_set($1 & $2)::real /
(nbits_set($1) + nbits_set($2) - nbits_set($1 & $2))::real;
$EOSQL$ Language SQL;
A.4.4
Euclid
The euclid function is used to compute the Euclidian distance of two
bitstrings. The input bit strings would have been computed with the
public166keys function or another equivalent fragment key or finger-
print function.
Create Function tanimoto(bit, bit)
Returns Real As $EOSQL$
Select sqrt((nbits_set($1 & $2) + nbits_set(~$1 & ~$2))::real /
length($1))::real;
$EOSQL$ Language SQL;
A.4.5 Hamming
The hamming function is used to compute the hamming similarity of
two bit strings. The input bit strings would have been computed with the
public166keys function or another equivalent fragment key or finger-
print function.
Create Function tanimoto(bit, bit)
Returns Real As $EOSQL$
Select ((nbits_set($1 & ~$2) + nbits_set(~$1 & $2))::real /
length($1))::real;
$EOSQL$ Language SQL;
A.4.6 Nbits_set
The nbits _ set function returns the number of bits set to 1 in a bit
string. This function is written here using python. Another C language
version of this function is shown later in this Appendix.
Create Or Replace Function nbits_set(bits bit) Returns Integer
As $EOPY$
return bits.count('1');
$EOPY$ Language plpythonu Immutable;
A.4.7
Amw
This function computes the average molecular weight of an input SMILES
structure. It uses the table of atomic weights and SMARTS shown in Table
A.2. It relies on the count _ matches function described in Chapter 7.
Search WWH ::




Custom Search