Package Chem :: Module MACCSkeys
[hide private]
[frames] | no frames]

Module MACCSkeys

source code

SMARTS definitions for the publically available MACCS keys
and a MACCS fingerprinter



Functions [hide private]
 
_InitKeys(keyList, keyDict)
*Internal Use Only*...
source code
 
GenMACCSKeys(mol, **kwargs)
generates the MACCS fingerprint for a molecules **Arguments** - mol: the molecule to be fingerprinted - any extra keyword arguments are ignored **Returns** a _DataStructs.SparseBitVect_ containing the fingerprint.
source code
 
FingerprintMol(mol, **kwargs)
generates the MACCS fingerprint for a molecules **Arguments** - mol: the molecule to be fingerprinted - any extra keyword arguments are ignored **Returns** a _DataStructs.SparseBitVect_ containing the fingerprint.
source code
 
_test() source code
Variables [hide private]
  smartsPatts = {1: ('?', 0), 2: ('[#103,#104]', 0), 3: ('[Ge,As...
  maccsKeys = None
Function Details [hide private]

_InitKeys(keyList, keyDict)

source code 
*Internal Use Only*

generates SMARTS patterns for the keys, run once

GenMACCSKeys(mol, **kwargs)

source code 
generates the MACCS fingerprint for a molecules

 **Arguments**

   - mol: the molecule to be fingerprinted

   - any extra keyword arguments are ignored
   
 **Returns**

    a _DataStructs.SparseBitVect_ containing the fingerprint.

>>> m = Chem.MolFromSmiles('CNO')
>>> bv = GenMACCSKeys(m)
>>> tuple(bv.GetOnBits())
(24, 68, 69, 71, 93, 94, 102, 124, 131, 139, 151, 158, 160, 161, 164)
>>> bv = GenMACCSKeys(Chem.MolFromSmiles('CCC'))
>>> tuple(bv.GetOnBits())
(74, 114, 149, 155, 160)

FingerprintMol(mol, **kwargs)

source code 
generates the MACCS fingerprint for a molecules

 **Arguments**

   - mol: the molecule to be fingerprinted

   - any extra keyword arguments are ignored
   
 **Returns**

    a _DataStructs.SparseBitVect_ containing the fingerprint.

>>> m = Chem.MolFromSmiles('CNO')
>>> bv = GenMACCSKeys(m)
>>> tuple(bv.GetOnBits())
(24, 68, 69, 71, 93, 94, 102, 124, 131, 139, 151, 158, 160, 161, 164)
>>> bv = GenMACCSKeys(Chem.MolFromSmiles('CCC'))
>>> tuple(bv.GetOnBits())
(74, 114, 149, 155, 160)


Variables Details [hide private]

smartsPatts

Value:
{1: ('?', 0),
 2: ('[#103,#104]', 0),
 3: ('[Ge,As,Se,Sn,Sb,Te,Tl,Pb,Bi]', 0),
 4: ('[Ac,Th,Pa,U,Np,Pu,Am,Cm,Bk,Cf,Es,Fm,Md,No,Lr]', 0),
 5: ('[Sc,Ti,Y,Zr,Hf]', 0),
 6: ('[La,Ce,Pr,Nd,Pm,Sm,Eu,Gd,Tb,Dy,Ho,Er,Tm,Yb,Lu]', 0),
 7: ('[V,Cr,Mn,Nb,Mo,Tc,Ta,W,Re]', 0),
 8: ('[!C;!c;!#1]1~*~*~*~1', 0),
...