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

Module indy

source code


indy - A Cinfony module for accessing Indigo from CPython, Jython or IronPython

Global variables:
  indigo - the underlying Indigo() object
  informats - a dictionary of supported input formats
  outformats - a dictionary of supported output formats
  fps - a list of supported fingerprint types

Classes
  Outputfile
Represent a file to which *output* is to be sent.
  Molecule
Represent an Indigo Molecule.
  Atom
Represent an Indigo 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
  indigo = Indigo()
  indigoInchi = IndigoInchi(indigo)
  fps = ['sim', 'sub', 'sub-res', 'sub-tau', 'full']
A list of supported fingerprint types
  informats = {'cml': 'Chemical Markup Language', 'inchi': 'InCh...
A dictionary of supported input formats
  outformats = {'can': 'Canonical SMILES', 'cml': 'Chemical Mark...
A dictionary of supported output formats
  __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

informats

A dictionary of supported input formats

Value:
{'cml': 'Chemical Markup Language',
 'inchi': 'InChI',
 'mol': 'MDL MOL file',
 'rdf': 'MDL RDF file',
 'sdf': 'MDL SDF file',
 'smi': 'SMILES'}

outformats

A dictionary of supported output formats

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