Package cinfony :: Module rdk
[frames] | no frames]

Module rdk

source code


rdkit - A Cinfony module for accessing the RDKit from CPython

Global variables:
  Chem and AllChem - the underlying RDKit Python bindings
  informats - a dictionary of supported input formats
  outformats - a dictionary of supported output formats
  descs - a list of supported descriptors
  fps - a list of supported fingerprint types
  forcefields - a list of supported forcefields

Classes
  Outputfile
Represent a file to which *output* is to be sent.
  Molecule
Represent an rdkit Molecule.
  Atom
Represent an rdkit Atom.
  Smarts
A Smarts Pattern Matcher
  MoleculeData
Store molecule data in a dictionary-type object
  Fingerprint
A Molecular Fingerprint.
Functions
 
readfile(format, filename)
Iterate over the molecules in a file.
source code
 
readstring(format, string)
Read in a molecule from a string.
source code
Variables
  aggdraw = None
  fps = ['rdkit', 'layered', 'maccs', 'atompairs', 'torsions', '...
A list of supported fingerprint types
  descs = ['Chi4v', 'Chi4n', 'SMR_VSA10', 'SMR_VSA7', 'MolWt', '...
A list of supported descriptors
  informats = {'inchi': 'InChI', 'mol': 'MDL MOL file', 'mol2': ...
A dictionary of supported input formats
  outformats = {'can': 'Canonical SMILES', 'inchi': 'InChI', 'in...
A dictionary of supported output formats
  forcefields = ['uff']
A list of supported forcefields
  __package__ = 'cinfony'
Function Details

readfile(format, filename)

source code 
Iterate over the molecules in a file.

Required parameters:
   format - see the informats variable for a list of available
            input formats
   filename

You can access the first molecule in a file using the next() method
of the iterator:
    mol = readfile("smi", "myfile.smi").next()

You can make a list of the molecules in a file using:
    mols = list(readfile("smi", "myfile.smi"))

You can iterate over the molecules in a file as shown in the
following code snippet:
>>> atomtotal = 0
>>> for mol in readfile("sdf", "head.sdf"):
...     atomtotal += len(mol.atoms)
...
>>> print atomtotal
43

readstring(format, string)

source code 
Read in a molecule from a string.

Required parameters:
   format - see the informats variable for a list of available
            input formats
   string

Example:
>>> input = "C1=CC=CS1"
>>> mymol = readstring("smi", input)
>>> len(mymol.atoms)
5


Variables Details

fps

A list of supported fingerprint types

Value:
['rdkit', 'layered', 'maccs', 'atompairs', 'torsions', 'morgan']

descs

A list of supported descriptors

Value:
['Chi4v',
 'Chi4n',
 'SMR_VSA10',
 'SMR_VSA7',
 'MolWt',
 'VSA_EState10',
 'TPSA',
 'EState_VSA8',
...

informats

A dictionary of supported input formats

Value:
{'inchi': 'InChI',
 'mol': 'MDL MOL file',
 'mol2': 'Tripos MOL2 file',
 'sdf': 'MDL SDF file',
 'smi': 'SMILES'}

outformats

A dictionary of supported output formats

Value:
{'can': 'Canonical SMILES',
 'inchi': 'InChI',
 'inchikey': 'InChIKey',
 'mol': 'MDL MOL file',
 'sdf': 'MDL SDF file',
 'smi': 'SMILES'}