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

Module jchem

source code


jchem - A Cinfony module for accessing ChemAxon's JChem from CPython and Jython

Global variables:
  chemaxon - the underlying JChem Java library
  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 a JChem Molecule.
  Fingerprint
A Molecular Fingerprint.
  Atom
Represent an Atom.
  Smarts
A Smarts Pattern Matcher
  MoleculeData
Store molecule data in a dictionary-type object
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
  classpath = []
  chemaxon = JPackage("chemaxon")
  descs = ['TPSA', 'HDon', 'LogP', 'Mass', 'HAcc', 'Heavy', 'Rot...
A list of supported descriptors
  fps = ['ecfp']
A list of supported fingerprint types
  forcefields = ['mmff94']
A list of supported forcefields
  informats = {'cdx': 'ChemDraw sketch file', 'cdxml': 'ChemDraw...
A dictionary of supported input formats
  outformats = {'cdx': 'ChemDraw sketch file', 'cdxml': 'ChemDra...
A dictionary of supported output formats
  ECFPConfiguration = '<?xml version="1.0" encoding="UTF-8"?>\n<...
  __package__ = 'cinfony'
  cls = '__hash__'
Function Details

readfile(format, filename)

source code 
Iterate over the molecules in a file.

Required parameters:
   format - Ignored, but needed for compatibility with other cinfony
            modules and also good for readability
   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 - Ignored, but needed for compatibility with other cinfony
            modules and also good for readability
   string

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


Variables Details

descs

A list of supported descriptors

Value:
['TPSA',
 'HDon',
 'LogP',
 'Mass',
 'HAcc',
 'Heavy',
 'RotatableBondsCount']

informats

A dictionary of supported input formats

Value:
{'cdx': 'ChemDraw sketch file',
 'cdxml': 'ChemDraw sketch file',
 'cml': 'Chemical Markup Language',
 'cube': 'Gaussian cube',
 'cxsmi': 'ChemAxon exntended SMILES',
 'gout': 'Gaussian output format',
 'inchi': 'InChI',
 'mol': 'MDL MOL',
...

outformats

A dictionary of supported output formats

Value:
{'cdx': 'ChemDraw sketch file',
 'cdxml': 'ChemDraw sketch file',
 'cml': 'CML',
 'cube': 'Gaussian cube',
 'cxsmi': 'ChemAxon exntended SMILES',
 'gjf': 'Gaussian input format',
 'inchi': 'InChI',
 'inchikey': 'InChIKey',
...

ECFPConfiguration

Value:
'''<?xml version="1.0" encoding="UTF-8"?>
<ECFPConfiguration Version="0.1">

    <Parameters Length="1024" Diameter="4" Counts="no"/>

    <IdentifierConfiguration>
        <!-- Default atom properties (switched on by Value=1) -->
        <Property Name="AtomicNumber" Value="1"/>
...