Package cinfony :: Module cdk :: Class Molecule
[frames] | no frames]

Class Molecule

source code

object --+
         |
        Molecule

Represent a cdkjpype Molecule.

Required parameters:
   Molecule -- a CDK Molecule or any type of cinfony Molecule

Attributes:
   atoms, data, exactmass, formula, molwt, title

Methods:
   addh(), calcfp(), calcdesc(), draw(), removeh(), write()

The underlying CDK Molecule can be accessed using the attribute:
   Molecule

Instance Methods
 
__init__(self, Molecule)
x.__init__(...) initializes x; see help(type(x)) for signature
source code
 
__iter__(self)
Iterate over the Atoms of the Molecule.
source code
 
__str__(self)
str(x)
source code
 
addh(self)
Add hydrogens.
source code
 
removeh(self)
Remove hydrogens.
source code
 
write(self, format='smi', filename=None, overwrite=False)
Write the molecule to a file or return a string.
source code
 
calcfp(self, fp='daylight')
Calculate a molecular fingerprint.
source code
 
calcdesc(self, descnames=[])
Calculate descriptor values.
source code
 
draw(self, show=True, filename=None, update=False, usecoords=False)
Create a 2D depiction of the molecule.
source code

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __subclasshook__

Properties
  atoms
  data
  formula
  exactmass
  molwt
  title

Inherited from object: __class__

Method Details

__init__(self, Molecule)
(Constructor)

source code 

x.__init__(...) initializes x; see help(type(x)) for signature

Overrides: object.__init__
(inherited documentation)

__iter__(self)

source code 
Iterate over the Atoms of the Molecule.

This allows constructions such as the following:
   for atom in mymol:
       print atom

__str__(self)
(Informal representation operator)

source code 

str(x)

Overrides: object.__str__
(inherited documentation)

write(self, format='smi', filename=None, overwrite=False)

source code 
Write the molecule to a file or return a string.

Optional parameters:
   format -- see the informats variable for a list of available
             output formats (default is "smi")
   filename -- default is None
   overwite -- if the output file already exists, should it
               be overwritten? (default is False)

If a filename is specified, the result is written to a file.
Otherwise, a string is returned containing the result.

To write multiple molecules to the same file you should use
the Outputfile class.

calcfp(self, fp='daylight')

source code 
Calculate a molecular fingerprint.

Optional parameters:
   fptype -- the fingerprint type (default is "daylight"). See the
             fps variable for a list of of available fingerprint
             types.

calcdesc(self, descnames=[])

source code 
Calculate descriptor values.

Optional parameter:
   descnames -- a list of names of descriptors

If descnames is not specified, all available descriptors are
calculated. See the descs variable for a list of available
descriptors.

draw(self, show=True, filename=None, update=False, usecoords=False)

source code 
Create a 2D depiction of the molecule.

There is no option to display or write an image file of
the depiction. For this, you should use the CDK from
Jython or else the depiction engine of one of the other
toolkits.

When using jpype, arguments will be ignored: calling this function is
equivalent to calling the draw() method of one of the other Cinfony
modules with parameters:
   show=False, filename=None, update=True, usecoords=False


Property Details

atoms

Get Method:
unreachable.atoms(self)

data

Get Method:
unreachable.data(self)

formula

Get Method:
unreachable.formula(self)

exactmass

Get Method:
unreachable.exactmass(self)

molwt

Get Method:
unreachable.molwt(self)

title

Get Method:
_gettitle(self)
Set Method:
_settitle(self, val)