|
|
|
|
@@ -8,8 +8,16 @@
|
|
|
|
|
<td valign=bottom> <br>
|
|
|
|
|
<font color="#ffffff" face="helvetica, arial"> <br><big><big><strong>pybel</strong></big></big></font></td
|
|
|
|
|
><td align=right valign=bottom
|
|
|
|
|
><font color="#ffffff" face="helvetica, arial"><a href=".">index</a><br><a href="file:///D|/tools/cinfony/trunk/cinfony/pybel.py">d:\tools\cinfony\trunk\cinfony\pybel.py</a></font></td></tr></table>
|
|
|
|
|
<p></p>
|
|
|
|
|
><font color="#ffffff" face="helvetica, arial"><br></font></td></tr></table>
|
|
|
|
|
<p><tt>pybel - A Python module for accessing OpenBabel<br>
|
|
|
|
|
<br>
|
|
|
|
|
Global variables:<br>
|
|
|
|
|
ob - the underlying SWIG bindings for OpenBabel<br>
|
|
|
|
|
informats - a dictionary of supported input formats<br>
|
|
|
|
|
outformats - a dictionary of supported output formats<br>
|
|
|
|
|
descs - a list of supported descriptors<br>
|
|
|
|
|
fps - a list of supported fingerprint types<br>
|
|
|
|
|
forcefields - a list of supported forcefields</tt></p>
|
|
|
|
|
<p>
|
|
|
|
|
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
|
|
|
|
|
<tr bgcolor="#aa55cc">
|
|
|
|
|
@@ -19,12 +27,11 @@
|
|
|
|
|
<tr><td bgcolor="#aa55cc"><tt> </tt></td><td> </td>
|
|
|
|
|
<td width="100%"><table width="100%" summary="list"><tr><td width="25%" valign=top><a href="Image.html">Image</a><br>
|
|
|
|
|
<a href="math.html">math</a><br>
|
|
|
|
|
</td><td width="25%" valign=top><a href="oasa.html">oasa</a><br>
|
|
|
|
|
<a href="openbabel.html">openbabel</a><br>
|
|
|
|
|
</td><td width="25%" valign=top><a href="os.html">os</a><br>
|
|
|
|
|
<a href="ImageTk.html">ImageTk</a><br>
|
|
|
|
|
</td><td width="25%" valign=top><a href="tempfile.html">tempfile</a><br>
|
|
|
|
|
<a href="Tkinter.html">Tkinter</a><br>
|
|
|
|
|
</td><td width="25%" valign=top><a href="openbabel.html">openbabel</a><br>
|
|
|
|
|
<a href="os.html">os</a><br>
|
|
|
|
|
</td><td width="25%" valign=top><a href="ImageTk.html">ImageTk</a><br>
|
|
|
|
|
<a href="tempfile.html">tempfile</a><br>
|
|
|
|
|
</td><td width="25%" valign=top><a href="Tkinter.html">Tkinter</a><br>
|
|
|
|
|
</td></tr></table></td></tr></table><p>
|
|
|
|
|
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
|
|
|
|
|
<tr bgcolor="#ee77aa">
|
|
|
|
|
@@ -60,7 +67,7 @@ Required parameter:<br>
|
|
|
|
|
Attributes:<br>
|
|
|
|
|
atomicmass, atomicnum, cidx, coords, coordidx, exactmass,<br>
|
|
|
|
|
formalcharge, heavyvalence, heterovalence, hyb, idx,<br>
|
|
|
|
|
implicitvalence, index, isotope, partialcharge, spin, type,<br>
|
|
|
|
|
implicitvalence, isotope, partialcharge, spin, type,<br>
|
|
|
|
|
valence, vector.<br>
|
|
|
|
|
<br>
|
|
|
|
|
(refer to the Open Babel library documentation for more info).<br>
|
|
|
|
|
@@ -69,24 +76,90 @@ The original Open Babel atom can be accessed&
|
|
|
|
|
OBAtom<br> </tt></td></tr>
|
|
|
|
|
<tr><td> </td>
|
|
|
|
|
<td width="100%">Methods defined here:<br>
|
|
|
|
|
<dl><dt><a name="Atom-__getattr__"><strong>__getattr__</strong></a>(self, attr)</dt></dl>
|
|
|
|
|
|
|
|
|
|
<dl><dt><a name="Atom-__init__"><strong>__init__</strong></a>(self, OBAtom)</dt></dl>
|
|
|
|
|
|
|
|
|
|
<dl><dt><a name="Atom-__str__"><strong>__str__</strong></a>(self)</dt><dd><tt>Create a string representation of the atom.<br>
|
|
|
|
|
<br>
|
|
|
|
|
>>> a = <a href="#Atom">Atom</a>()<br>
|
|
|
|
|
>>> print a<br>
|
|
|
|
|
<a href="#Atom">Atom</a>: 0 (0.0, 0.0, 0.0)</tt></dd></dl>
|
|
|
|
|
<dl><dt><a name="Atom-__str__"><strong>__str__</strong></a>(self)</dt></dl>
|
|
|
|
|
|
|
|
|
|
<hr>
|
|
|
|
|
Data descriptors defined here:<br>
|
|
|
|
|
<dl><dt><strong>__dict__</strong></dt>
|
|
|
|
|
<dd><tt>dictionary for instance variables (if defined)</tt></dd>
|
|
|
|
|
Properties defined here:<br>
|
|
|
|
|
<dl><dt><strong>atomicmass</strong></dt>
|
|
|
|
|
<dd><dl><dt><a name="-<em>get</em>"><strong><em>get</em></strong></a> = atomicmass(self)</dt></dl>
|
|
|
|
|
</dd>
|
|
|
|
|
</dl>
|
|
|
|
|
<dl><dt><strong>__weakref__</strong></dt>
|
|
|
|
|
<dd><tt>list of weak references to the object (if defined)</tt></dd>
|
|
|
|
|
<dl><dt><strong>atomicnum</strong></dt>
|
|
|
|
|
<dd><dl><dt><a name="-<em>get</em>"><strong><em>get</em></strong></a> = atomicnum(self)</dt></dl>
|
|
|
|
|
</dd>
|
|
|
|
|
</dl>
|
|
|
|
|
<dl><dt><strong>cidx</strong></dt>
|
|
|
|
|
<dd><dl><dt><a name="-<em>get</em>"><strong><em>get</em></strong></a> = cidx(self)</dt></dl>
|
|
|
|
|
</dd>
|
|
|
|
|
</dl>
|
|
|
|
|
<dl><dt><strong>coordidx</strong></dt>
|
|
|
|
|
<dd><dl><dt><a name="-<em>get</em>"><strong><em>get</em></strong></a> = coordidx(self)</dt></dl>
|
|
|
|
|
</dd>
|
|
|
|
|
</dl>
|
|
|
|
|
<dl><dt><strong>coords</strong></dt>
|
|
|
|
|
<dd><dl><dt><a name="-<em>get</em>"><strong><em>get</em></strong></a> = coords(self)</dt></dl>
|
|
|
|
|
</dd>
|
|
|
|
|
</dl>
|
|
|
|
|
<dl><dt><strong>exactmass</strong></dt>
|
|
|
|
|
<dd><dl><dt><a name="-<em>get</em>"><strong><em>get</em></strong></a> = exactmass(self)</dt></dl>
|
|
|
|
|
</dd>
|
|
|
|
|
</dl>
|
|
|
|
|
<dl><dt><strong>formalcharge</strong></dt>
|
|
|
|
|
<dd><dl><dt><a name="-<em>get</em>"><strong><em>get</em></strong></a> = formalcharge(self)</dt></dl>
|
|
|
|
|
</dd>
|
|
|
|
|
</dl>
|
|
|
|
|
<dl><dt><strong>heavyvalence</strong></dt>
|
|
|
|
|
<dd><dl><dt><a name="-<em>get</em>"><strong><em>get</em></strong></a> = heavyvalence(self)</dt></dl>
|
|
|
|
|
</dd>
|
|
|
|
|
</dl>
|
|
|
|
|
<dl><dt><strong>heterovalence</strong></dt>
|
|
|
|
|
<dd><dl><dt><a name="-<em>get</em>"><strong><em>get</em></strong></a> = heterovalence(self)</dt></dl>
|
|
|
|
|
</dd>
|
|
|
|
|
</dl>
|
|
|
|
|
<dl><dt><strong>hyb</strong></dt>
|
|
|
|
|
<dd><dl><dt><a name="-<em>get</em>"><strong><em>get</em></strong></a> = hyb(self)</dt></dl>
|
|
|
|
|
</dd>
|
|
|
|
|
</dl>
|
|
|
|
|
<dl><dt><strong>idx</strong></dt>
|
|
|
|
|
<dd><dl><dt><a name="-<em>get</em>"><strong><em>get</em></strong></a> = idx(self)</dt></dl>
|
|
|
|
|
</dd>
|
|
|
|
|
</dl>
|
|
|
|
|
<dl><dt><strong>implicitvalence</strong></dt>
|
|
|
|
|
<dd><dl><dt><a name="-<em>get</em>"><strong><em>get</em></strong></a> = implicitvalence(self)</dt></dl>
|
|
|
|
|
</dd>
|
|
|
|
|
</dl>
|
|
|
|
|
<dl><dt><strong>isotope</strong></dt>
|
|
|
|
|
<dd><dl><dt><a name="-<em>get</em>"><strong><em>get</em></strong></a> = isotope(self)</dt></dl>
|
|
|
|
|
</dd>
|
|
|
|
|
</dl>
|
|
|
|
|
<dl><dt><strong>partialcharge</strong></dt>
|
|
|
|
|
<dd><dl><dt><a name="-<em>get</em>"><strong><em>get</em></strong></a> = partialcharge(self)</dt></dl>
|
|
|
|
|
</dd>
|
|
|
|
|
</dl>
|
|
|
|
|
<dl><dt><strong>spin</strong></dt>
|
|
|
|
|
<dd><dl><dt><a name="-<em>get</em>"><strong><em>get</em></strong></a> = spin(self)</dt></dl>
|
|
|
|
|
</dd>
|
|
|
|
|
</dl>
|
|
|
|
|
<dl><dt><strong>type</strong></dt>
|
|
|
|
|
<dd><dl><dt><a name="-<em>get</em>"><strong><em>get</em></strong></a> = type(self)</dt></dl>
|
|
|
|
|
</dd>
|
|
|
|
|
</dl>
|
|
|
|
|
<dl><dt><strong>valence</strong></dt>
|
|
|
|
|
<dd><dl><dt><a name="-<em>get</em>"><strong><em>get</em></strong></a> = valence(self)</dt></dl>
|
|
|
|
|
</dd>
|
|
|
|
|
</dl>
|
|
|
|
|
<dl><dt><strong>vector</strong></dt>
|
|
|
|
|
<dd><dl><dt><a name="-<em>get</em>"><strong><em>get</em></strong></a> = vector(self)</dt></dl>
|
|
|
|
|
</dd>
|
|
|
|
|
</dl>
|
|
|
|
|
<hr>
|
|
|
|
|
Data and other attributes defined here:<br>
|
|
|
|
|
<dl><dt><strong>__dict__</strong> = <dictproxy object><dd><tt>dictionary for instance variables (if defined)</tt></dl>
|
|
|
|
|
|
|
|
|
|
<dl><dt><strong>__weakref__</strong> = <attribute '__weakref__' of 'Atom' objects><dd><tt>list of weak references to the <a href="__builtin__.html#object">object</a> (if defined)</tt></dl>
|
|
|
|
|
|
|
|
|
|
</td></tr></table> <p>
|
|
|
|
|
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
|
|
|
|
|
<tr bgcolor="#ffc8d8">
|
|
|
|
|
@@ -97,10 +170,10 @@ Data descriptors defined here:<br>
|
|
|
|
|
<td colspan=2><tt>A Molecular <a href="#Fingerprint">Fingerprint</a>.<br>
|
|
|
|
|
<br>
|
|
|
|
|
Required parameters:<br>
|
|
|
|
|
obFingerprint -- a vector calculated by OBFingerprint.FindFingerprint()<br>
|
|
|
|
|
fingerprint -- a vector calculated by OBFingerprint.FindFingerprint()<br>
|
|
|
|
|
<br>
|
|
|
|
|
Attributes:<br>
|
|
|
|
|
fp -- the original obFingerprint<br>
|
|
|
|
|
fp -- the underlying fingerprint <a href="__builtin__.html#object">object</a><br>
|
|
|
|
|
bits -- a list of bits set in the <a href="#Fingerprint">Fingerprint</a><br>
|
|
|
|
|
<br>
|
|
|
|
|
Methods:<br>
|
|
|
|
|
@@ -109,22 +182,24 @@ Methods:<br>
|
|
|
|
|
tanimoto = a | b<br> </tt></td></tr>
|
|
|
|
|
<tr><td> </td>
|
|
|
|
|
<td width="100%">Methods defined here:<br>
|
|
|
|
|
<dl><dt><a name="Fingerprint-__getattr__"><strong>__getattr__</strong></a>(self, attr)</dt></dl>
|
|
|
|
|
|
|
|
|
|
<dl><dt><a name="Fingerprint-__init__"><strong>__init__</strong></a>(self, obFingerprint)</dt></dl>
|
|
|
|
|
<dl><dt><a name="Fingerprint-__init__"><strong>__init__</strong></a>(self, fingerprint)</dt></dl>
|
|
|
|
|
|
|
|
|
|
<dl><dt><a name="Fingerprint-__or__"><strong>__or__</strong></a>(self, other)</dt></dl>
|
|
|
|
|
|
|
|
|
|
<dl><dt><a name="Fingerprint-__str__"><strong>__str__</strong></a>(self)</dt></dl>
|
|
|
|
|
|
|
|
|
|
<hr>
|
|
|
|
|
Data descriptors defined here:<br>
|
|
|
|
|
<dl><dt><strong>__dict__</strong></dt>
|
|
|
|
|
<dd><tt>dictionary for instance variables (if defined)</tt></dd>
|
|
|
|
|
</dl>
|
|
|
|
|
<dl><dt><strong>__weakref__</strong></dt>
|
|
|
|
|
<dd><tt>list of weak references to the object (if defined)</tt></dd>
|
|
|
|
|
Properties defined here:<br>
|
|
|
|
|
<dl><dt><strong>bits</strong></dt>
|
|
|
|
|
<dd><dl><dt><a name="-<em>get</em>"><strong><em>get</em></strong></a> = bits(self)</dt></dl>
|
|
|
|
|
</dd>
|
|
|
|
|
</dl>
|
|
|
|
|
<hr>
|
|
|
|
|
Data and other attributes defined here:<br>
|
|
|
|
|
<dl><dt><strong>__dict__</strong> = <dictproxy object><dd><tt>dictionary for instance variables (if defined)</tt></dl>
|
|
|
|
|
|
|
|
|
|
<dl><dt><strong>__weakref__</strong> = <attribute '__weakref__' of 'Fingerprint' objects><dd><tt>list of weak references to the <a href="__builtin__.html#object">object</a> (if defined)</tt></dl>
|
|
|
|
|
|
|
|
|
|
</td></tr></table> <p>
|
|
|
|
|
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
|
|
|
|
|
<tr bgcolor="#ffc8d8">
|
|
|
|
|
@@ -132,32 +207,24 @@ Data descriptors defined here:<br>
|
|
|
|
|
<font color="#000000" face="helvetica, arial"><a name="Molecule">class <strong>Molecule</strong></a>(<a href="__builtin__.html#object">__builtin__.object</a>)</font></td></tr>
|
|
|
|
|
|
|
|
|
|
<tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td>
|
|
|
|
|
<td colspan=2><tt>Represent a Pybel molecule.<br>
|
|
|
|
|
<td colspan=2><tt>Represent a Pybel <a href="#Molecule">Molecule</a>.<br>
|
|
|
|
|
<br>
|
|
|
|
|
Required parameter:<br>
|
|
|
|
|
OBMol -- an Open Babel OBMol<br>
|
|
|
|
|
or<br>
|
|
|
|
|
<a href="#Molecule">Molecule</a> -- any type of cinfony <a href="#Molecule">Molecule</a> (e.g. one from cinfony.rdkit)<br>
|
|
|
|
|
<br>
|
|
|
|
|
If a cinfony <a href="#Molecule">Molecule</a> is provided it will be converted into a pybel <a href="#Molecule">Molecule</a>. <br>
|
|
|
|
|
OBMol -- an Open Babel OBMol or any type of cinfony <a href="#Molecule">Molecule</a><br>
|
|
|
|
|
<br>
|
|
|
|
|
Attributes:<br>
|
|
|
|
|
atoms, charge, data, dim, energy, exactmass, flags, formula, <br>
|
|
|
|
|
mod, molwt, spin, sssr, title, unitcell.<br>
|
|
|
|
|
atoms, charge, conformers, data, dim, energy, exactmass, formula, <br>
|
|
|
|
|
molwt, spin, sssr, title, unitcell.<br>
|
|
|
|
|
(refer to the Open Babel library documentation for more info).<br>
|
|
|
|
|
<br>
|
|
|
|
|
Methods:<br>
|
|
|
|
|
<a href="#Molecule-addh">addh</a>(), <a href="#Molecule-calcfp">calcfp</a>(), <a href="#Molecule-calcdesc">calcdesc</a>(), <a href="#Molecule-draw">draw</a>(), <a href="#Molecule-localopt">localopt</a>(), <a href="#Molecule-make3D">make3D</a>(), <a href="#Molecule-removeh">removeh</a>(), <a href="#Molecule-write">write</a>() <br>
|
|
|
|
|
<a href="#Molecule-addh">addh</a>(), <a href="#Molecule-calcfp">calcfp</a>(), <a href="#Molecule-calcdesc">calcdesc</a>(), <a href="#Molecule-draw">draw</a>(), <a href="#Molecule-localopt">localopt</a>(), <a href="#Molecule-make3D">make3D</a>(), <a href="#Molecule-removeh">removeh</a>(),<br>
|
|
|
|
|
<a href="#Molecule-write">write</a>() <br>
|
|
|
|
|
<br>
|
|
|
|
|
The original Open Babel molecule can be accessed using the attribute:<br>
|
|
|
|
|
The underlying Open Babel molecule can be accessed using the attribute:<br>
|
|
|
|
|
OBMol<br> </tt></td></tr>
|
|
|
|
|
<tr><td> </td>
|
|
|
|
|
<td width="100%">Methods defined here:<br>
|
|
|
|
|
<dl><dt><a name="Molecule-__getattr__"><strong>__getattr__</strong></a>(self, attr)</dt><dd><tt>Return the value of an attribute<br>
|
|
|
|
|
<br>
|
|
|
|
|
Note: The values are calculated on-the-fly. You may want to store the value in<br>
|
|
|
|
|
a variable if you repeatedly access the same attribute.</tt></dd></dl>
|
|
|
|
|
|
|
|
|
|
<dl><dt><a name="Molecule-__init__"><strong>__init__</strong></a>(self, OBMol)</dt></dl>
|
|
|
|
|
|
|
|
|
|
<dl><dt><a name="Molecule-__iter__"><strong>__iter__</strong></a>(self)</dt><dd><tt>Iterate over the Atoms of the <a href="#Molecule">Molecule</a>.<br>
|
|
|
|
|
@@ -175,17 +242,16 @@ This allows constructions such as the following:<b
|
|
|
|
|
Optional parameter:<br>
|
|
|
|
|
descnames -- a list of names of descriptors<br>
|
|
|
|
|
<br>
|
|
|
|
|
If descnames is not specified, the full list of Open Babel<br>
|
|
|
|
|
descriptors is calculated: LogP, PSA and MR.</tt></dd></dl>
|
|
|
|
|
If descnames is not specified, all available descriptors are<br>
|
|
|
|
|
calculated. See the descs variable for a list of available<br>
|
|
|
|
|
descriptors.</tt></dd></dl>
|
|
|
|
|
|
|
|
|
|
<dl><dt><a name="Molecule-calcfp"><strong>calcfp</strong></a>(self, fptype<font color="#909090">='FP2'</font>)</dt><dd><tt>Calculate a molecular fingerprint.<br>
|
|
|
|
|
<br>
|
|
|
|
|
Optional parameters:<br>
|
|
|
|
|
fptype -- the name of the Open Babel fingerprint type.<br>
|
|
|
|
|
<br>
|
|
|
|
|
If fptype is not specified, the FP2 fingerprint type<br>
|
|
|
|
|
is used. See the Open Babel library documentation for more<br>
|
|
|
|
|
details.</tt></dd></dl>
|
|
|
|
|
fptype -- the fingerprint type (default is "FP2"). See the<br>
|
|
|
|
|
fps variable for a list of of available fingerprint<br>
|
|
|
|
|
types.</tt></dd></dl>
|
|
|
|
|
|
|
|
|
|
<dl><dt><a name="Molecule-draw"><strong>draw</strong></a>(self, show<font color="#909090">=True</font>, filename<font color="#909090">=None</font>, update<font color="#909090">=False</font>, usecoords<font color="#909090">=False</font>)</dt><dd><tt>Create a 2D depiction of the molecule.<br>
|
|
|
|
|
<br>
|
|
|
|
|
@@ -201,20 +267,22 @@ Optional parameters:<br>
|
|
|
|
|
OASA is used for 2D coordinate generation and depiction. Tkinter and<br>
|
|
|
|
|
Python Imaging Library are required for image display.</tt></dd></dl>
|
|
|
|
|
|
|
|
|
|
<dl><dt><a name="Molecule-localopt"><strong>localopt</strong></a>(self, forcefield<font color="#909090">='MMFF94'</font>, steps<font color="#909090">=500</font>)</dt><dd><tt>Locally optimize the coordinates.<br>
|
|
|
|
|
<dl><dt><a name="Molecule-localopt"><strong>localopt</strong></a>(self, forcefield<font color="#909090">='mmff94'</font>, steps<font color="#909090">=500</font>)</dt><dd><tt>Locally optimize the coordinates.<br>
|
|
|
|
|
<br>
|
|
|
|
|
Optional parameters:<br>
|
|
|
|
|
forcefield -- default is "MMFF94"<br>
|
|
|
|
|
forcefield -- default is "mmff94". See the forcefields variable<br>
|
|
|
|
|
for a list of available forcefields.<br>
|
|
|
|
|
steps -- default is 500<br>
|
|
|
|
|
<br>
|
|
|
|
|
If the molecule does not have 2D or 3D coordinates, <a href="#Molecule-make3D">make3D</a>() is<br>
|
|
|
|
|
If the molecule does not have any coordinates, <a href="#Molecule-make3D">make3D</a>() is<br>
|
|
|
|
|
called before the optimization. Note that the molecule needs<br>
|
|
|
|
|
to have explicit hydrogens. If not, call <a href="#Molecule-addh">addh</a>().</tt></dd></dl>
|
|
|
|
|
|
|
|
|
|
<dl><dt><a name="Molecule-make3D"><strong>make3D</strong></a>(self, forcefield<font color="#909090">='MMFF94'</font>, steps<font color="#909090">=50</font>)</dt><dd><tt>Generate 3D coordinates.<br>
|
|
|
|
|
<dl><dt><a name="Molecule-make3D"><strong>make3D</strong></a>(self, forcefield<font color="#909090">='mmff94'</font>, steps<font color="#909090">=50</font>)</dt><dd><tt>Generate 3D coordinates.<br>
|
|
|
|
|
<br>
|
|
|
|
|
Optional parameters:<br>
|
|
|
|
|
forcefield -- default is "MMFF94"<br>
|
|
|
|
|
forcefield -- default is "mmff94". See the forcefields variable<br>
|
|
|
|
|
for a list of available forcefields.<br>
|
|
|
|
|
steps -- default is 50<br>
|
|
|
|
|
<br>
|
|
|
|
|
Once coordinates are generated, hydrogens are added and a quick<br>
|
|
|
|
|
@@ -224,26 +292,83 @@ to improve the coordinates further.</tt></dd></dl>
|
|
|
|
|
|
|
|
|
|
<dl><dt><a name="Molecule-removeh"><strong>removeh</strong></a>(self)</dt><dd><tt>Remove hydrogens.</tt></dd></dl>
|
|
|
|
|
|
|
|
|
|
<dl><dt><a name="Molecule-write"><strong>write</strong></a>(self, format<font color="#909090">='SMI'</font>, filename<font color="#909090">=None</font>, overwrite<font color="#909090">=False</font>)</dt><dd><tt>Write the molecule to a file or return a string.<br>
|
|
|
|
|
<dl><dt><a name="Molecule-write"><strong>write</strong></a>(self, format<font color="#909090">='smi'</font>, filename<font color="#909090">=None</font>, overwrite<font color="#909090">=False</font>)</dt><dd><tt>Write the molecule to a file or return a string.<br>
|
|
|
|
|
<br>
|
|
|
|
|
Optional parameters:<br>
|
|
|
|
|
format -- default is "SMI"<br>
|
|
|
|
|
format -- see the informats variable for a list of available<br>
|
|
|
|
|
output formats (default is "smi")<br>
|
|
|
|
|
filename -- default is None<br>
|
|
|
|
|
overwite -- default is False<br>
|
|
|
|
|
overwite -- if the output file already exists, should it<br>
|
|
|
|
|
be overwritten? (default is False)<br>
|
|
|
|
|
<br>
|
|
|
|
|
If a filename is specified, the result is written to a file.<br>
|
|
|
|
|
Otherwise, a string is returned containing the result.<br>
|
|
|
|
|
The overwrite flag is ignored if a filename is not specified.<br>
|
|
|
|
|
It controls whether to overwrite an existing file.</tt></dd></dl>
|
|
|
|
|
<br>
|
|
|
|
|
To write multiple molecules to the same file you should use<br>
|
|
|
|
|
the <a href="#Outputfile">Outputfile</a> class.</tt></dd></dl>
|
|
|
|
|
|
|
|
|
|
<hr>
|
|
|
|
|
Data descriptors defined here:<br>
|
|
|
|
|
<dl><dt><strong>__dict__</strong></dt>
|
|
|
|
|
<dd><tt>dictionary for instance variables (if defined)</tt></dd>
|
|
|
|
|
Properties defined here:<br>
|
|
|
|
|
<dl><dt><strong>atoms</strong></dt>
|
|
|
|
|
<dd><dl><dt><a name="-<em>get</em>"><strong><em>get</em></strong></a> = atoms(self)</dt></dl>
|
|
|
|
|
</dd>
|
|
|
|
|
</dl>
|
|
|
|
|
<dl><dt><strong>__weakref__</strong></dt>
|
|
|
|
|
<dd><tt>list of weak references to the object (if defined)</tt></dd>
|
|
|
|
|
<dl><dt><strong>charge</strong></dt>
|
|
|
|
|
<dd><dl><dt><a name="-<em>get</em>"><strong><em>get</em></strong></a> = charge(self)</dt></dl>
|
|
|
|
|
</dd>
|
|
|
|
|
</dl>
|
|
|
|
|
<dl><dt><strong>conformers</strong></dt>
|
|
|
|
|
<dd><dl><dt><a name="-<em>get</em>"><strong><em>get</em></strong></a> = conformers(self)</dt></dl>
|
|
|
|
|
</dd>
|
|
|
|
|
</dl>
|
|
|
|
|
<dl><dt><strong>data</strong></dt>
|
|
|
|
|
<dd><dl><dt><a name="-<em>get</em>"><strong><em>get</em></strong></a> = data(self)</dt></dl>
|
|
|
|
|
</dd>
|
|
|
|
|
</dl>
|
|
|
|
|
<dl><dt><strong>dim</strong></dt>
|
|
|
|
|
<dd><dl><dt><a name="-<em>get</em>"><strong><em>get</em></strong></a> = dim(self)</dt></dl>
|
|
|
|
|
</dd>
|
|
|
|
|
</dl>
|
|
|
|
|
<dl><dt><strong>energy</strong></dt>
|
|
|
|
|
<dd><dl><dt><a name="-<em>get</em>"><strong><em>get</em></strong></a> = energy(self)</dt></dl>
|
|
|
|
|
</dd>
|
|
|
|
|
</dl>
|
|
|
|
|
<dl><dt><strong>exactmass</strong></dt>
|
|
|
|
|
<dd><dl><dt><a name="-<em>get</em>"><strong><em>get</em></strong></a> = exactmass(self)</dt></dl>
|
|
|
|
|
</dd>
|
|
|
|
|
</dl>
|
|
|
|
|
<dl><dt><strong>formula</strong></dt>
|
|
|
|
|
<dd><dl><dt><a name="-<em>get</em>"><strong><em>get</em></strong></a> = formula(self)</dt></dl>
|
|
|
|
|
</dd>
|
|
|
|
|
</dl>
|
|
|
|
|
<dl><dt><strong>molwt</strong></dt>
|
|
|
|
|
<dd><dl><dt><a name="-<em>get</em>"><strong><em>get</em></strong></a> = molwt(self)</dt></dl>
|
|
|
|
|
</dd>
|
|
|
|
|
</dl>
|
|
|
|
|
<dl><dt><strong>spin</strong></dt>
|
|
|
|
|
<dd><dl><dt><a name="-<em>get</em>"><strong><em>get</em></strong></a> = spin(self)</dt></dl>
|
|
|
|
|
</dd>
|
|
|
|
|
</dl>
|
|
|
|
|
<dl><dt><strong>sssr</strong></dt>
|
|
|
|
|
<dd><dl><dt><a name="-<em>get</em>"><strong><em>get</em></strong></a> = sssr(self)</dt></dl>
|
|
|
|
|
</dd>
|
|
|
|
|
</dl>
|
|
|
|
|
<dl><dt><strong>title</strong></dt>
|
|
|
|
|
<dd><dl><dt><a name="-<em>get</em>"><strong><em>get</em></strong></a> = _gettitle(self)</dt></dl>
|
|
|
|
|
</dd>
|
|
|
|
|
<dd><dl><dt><a name="-<em>set</em>"><strong><em>set</em></strong></a> = _settitle(self, val)</dt></dl>
|
|
|
|
|
</dd>
|
|
|
|
|
</dl>
|
|
|
|
|
<dl><dt><strong>unitcell</strong></dt>
|
|
|
|
|
<dd><dl><dt><a name="-<em>get</em>"><strong><em>get</em></strong></a> = unitcell(self)</dt></dl>
|
|
|
|
|
</dd>
|
|
|
|
|
</dl>
|
|
|
|
|
<hr>
|
|
|
|
|
Data and other attributes defined here:<br>
|
|
|
|
|
<dl><dt><strong>__dict__</strong> = <dictproxy object><dd><tt>dictionary for instance variables (if defined)</tt></dl>
|
|
|
|
|
|
|
|
|
|
<dl><dt><strong>__weakref__</strong> = <attribute '__weakref__' of 'Molecule' objects><dd><tt>list of weak references to the <a href="__builtin__.html#object">object</a> (if defined)</tt></dl>
|
|
|
|
|
|
|
|
|
|
</td></tr></table> <p>
|
|
|
|
|
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
|
|
|
|
|
<tr bgcolor="#ffc8d8">
|
|
|
|
|
@@ -309,13 +434,11 @@ NSC --> 1<br>
|
|
|
|
|
<dl><dt><a name="MoleculeData-values"><strong>values</strong></a>(self)</dt></dl>
|
|
|
|
|
|
|
|
|
|
<hr>
|
|
|
|
|
Data descriptors defined here:<br>
|
|
|
|
|
<dl><dt><strong>__dict__</strong></dt>
|
|
|
|
|
<dd><tt>dictionary for instance variables (if defined)</tt></dd>
|
|
|
|
|
</dl>
|
|
|
|
|
<dl><dt><strong>__weakref__</strong></dt>
|
|
|
|
|
<dd><tt>list of weak references to the object (if defined)</tt></dd>
|
|
|
|
|
</dl>
|
|
|
|
|
Data and other attributes defined here:<br>
|
|
|
|
|
<dl><dt><strong>__dict__</strong> = <dictproxy object><dd><tt>dictionary for instance variables (if defined)</tt></dl>
|
|
|
|
|
|
|
|
|
|
<dl><dt><strong>__weakref__</strong> = <attribute '__weakref__' of 'MoleculeData' objects><dd><tt>list of weak references to the <a href="__builtin__.html#object">object</a> (if defined)</tt></dl>
|
|
|
|
|
|
|
|
|
|
</td></tr></table> <p>
|
|
|
|
|
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
|
|
|
|
|
<tr bgcolor="#ffc8d8">
|
|
|
|
|
@@ -331,13 +454,17 @@ are to be written to the same file you&n
|
|
|
|
|
class.<br>
|
|
|
|
|
<br>
|
|
|
|
|
Required parameters:<br>
|
|
|
|
|
format<br>
|
|
|
|
|
format - see the outformats variable for a list of available<br>
|
|
|
|
|
output formats<br>
|
|
|
|
|
filename<br>
|
|
|
|
|
<br>
|
|
|
|
|
Optional parameters:<br>
|
|
|
|
|
overwrite (default is False) -- if the output file already exists,<br>
|
|
|
|
|
should it be overwritten?<br>
|
|
|
|
|
overwrite -- if the output file already exists, should it<br>
|
|
|
|
|
be overwritten? (default is False)<br>
|
|
|
|
|
<br>
|
|
|
|
|
Methods:<br>
|
|
|
|
|
<a href="#Outputfile-write">write</a>(molecule), <a href="#Outputfile-close">close</a>()<br> </tt></td></tr>
|
|
|
|
|
<a href="#Outputfile-write">write</a>(molecule)<br>
|
|
|
|
|
<a href="#Outputfile-close">close</a>()<br> </tt></td></tr>
|
|
|
|
|
<tr><td> </td>
|
|
|
|
|
<td width="100%">Methods defined here:<br>
|
|
|
|
|
<dl><dt><a name="Outputfile-__init__"><strong>__init__</strong></a>(self, format, filename, overwrite<font color="#909090">=False</font>)</dt></dl>
|
|
|
|
|
@@ -350,13 +477,11 @@ Required parameters:<br>
|
|
|
|
|
molecule</tt></dd></dl>
|
|
|
|
|
|
|
|
|
|
<hr>
|
|
|
|
|
Data descriptors defined here:<br>
|
|
|
|
|
<dl><dt><strong>__dict__</strong></dt>
|
|
|
|
|
<dd><tt>dictionary for instance variables (if defined)</tt></dd>
|
|
|
|
|
</dl>
|
|
|
|
|
<dl><dt><strong>__weakref__</strong></dt>
|
|
|
|
|
<dd><tt>list of weak references to the object (if defined)</tt></dd>
|
|
|
|
|
</dl>
|
|
|
|
|
Data and other attributes defined here:<br>
|
|
|
|
|
<dl><dt><strong>__dict__</strong> = <dictproxy object><dd><tt>dictionary for instance variables (if defined)</tt></dl>
|
|
|
|
|
|
|
|
|
|
<dl><dt><strong>__weakref__</strong> = <attribute '__weakref__' of 'Outputfile' objects><dd><tt>list of weak references to the <a href="__builtin__.html#object">object</a> (if defined)</tt></dl>
|
|
|
|
|
|
|
|
|
|
</td></tr></table> <p>
|
|
|
|
|
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
|
|
|
|
|
<tr bgcolor="#ffc8d8">
|
|
|
|
|
@@ -391,13 +516,11 @@ Required parameters:<br>
|
|
|
|
|
molecule</tt></dd></dl>
|
|
|
|
|
|
|
|
|
|
<hr>
|
|
|
|
|
Data descriptors defined here:<br>
|
|
|
|
|
<dl><dt><strong>__dict__</strong></dt>
|
|
|
|
|
<dd><tt>dictionary for instance variables (if defined)</tt></dd>
|
|
|
|
|
</dl>
|
|
|
|
|
<dl><dt><strong>__weakref__</strong></dt>
|
|
|
|
|
<dd><tt>list of weak references to the object (if defined)</tt></dd>
|
|
|
|
|
</dl>
|
|
|
|
|
Data and other attributes defined here:<br>
|
|
|
|
|
<dl><dt><strong>__dict__</strong> = <dictproxy object><dd><tt>dictionary for instance variables (if defined)</tt></dl>
|
|
|
|
|
|
|
|
|
|
<dl><dt><strong>__weakref__</strong> = <attribute '__weakref__' of 'Smarts' objects><dd><tt>list of weak references to the <a href="__builtin__.html#object">object</a> (if defined)</tt></dl>
|
|
|
|
|
|
|
|
|
|
</td></tr></table></td></tr></table><p>
|
|
|
|
|
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
|
|
|
|
|
<tr bgcolor="#eeaa77">
|
|
|
|
|
@@ -408,18 +531,19 @@ Data descriptors defined here:<br>
|
|
|
|
|
<td width="100%"><dl><dt><a name="-readfile"><strong>readfile</strong></a>(format, filename)</dt><dd><tt>Iterate over the molecules in a file.<br>
|
|
|
|
|
<br>
|
|
|
|
|
Required parameters:<br>
|
|
|
|
|
format<br>
|
|
|
|
|
format - see the informats variable for a list of available<br>
|
|
|
|
|
input formats<br>
|
|
|
|
|
filename<br>
|
|
|
|
|
<br>
|
|
|
|
|
You can access the first molecule in a file using:<br>
|
|
|
|
|
You can access the first molecule in a file using the next() method<br>
|
|
|
|
|
of the iterator:<br>
|
|
|
|
|
mol = <a href="#-readfile">readfile</a>("smi", "myfile.smi").next()<br>
|
|
|
|
|
<br>
|
|
|
|
|
You can make a list of the molecules in a file using:<br>
|
|
|
|
|
mols = [mol for mol in <a href="#-readfile">readfile</a>("smi", "myfile.smi")]<br>
|
|
|
|
|
mols = list(<a href="#-readfile">readfile</a>("smi", "myfile.smi"))<br>
|
|
|
|
|
<br>
|
|
|
|
|
You can iterate over the molecules in a file as shown in the<br>
|
|
|
|
|
following code snippet...<br>
|
|
|
|
|
<br>
|
|
|
|
|
following code snippet:<br>
|
|
|
|
|
>>> atomtotal = 0<br>
|
|
|
|
|
>>> for mol in <a href="#-readfile">readfile</a>("sdf","head.sdf"):<br>
|
|
|
|
|
... atomtotal += len(mol.atoms)<br>
|
|
|
|
|
@@ -429,9 +553,11 @@ following code snippet...<br>
|
|
|
|
|
<dl><dt><a name="-readstring"><strong>readstring</strong></a>(format, string)</dt><dd><tt>Read in a molecule from a string.<br>
|
|
|
|
|
<br>
|
|
|
|
|
Required parameters:<br>
|
|
|
|
|
format<br>
|
|
|
|
|
format - see the informats variable for a list of available<br>
|
|
|
|
|
input formats<br>
|
|
|
|
|
string<br>
|
|
|
|
|
<br>
|
|
|
|
|
Example:<br>
|
|
|
|
|
>>> input = "C1=CC=CS1"<br>
|
|
|
|
|
>>> mymol = <a href="#-readstring">readstring</a>("smi",input)<br>
|
|
|
|
|
>>> len(mymol.atoms)<br>
|
|
|
|
|
@@ -444,9 +570,10 @@ Required parameters:<br>
|
|
|
|
|
|
|
|
|
|
<tr><td bgcolor="#55aa55"><tt> </tt></td><td> </td>
|
|
|
|
|
<td width="100%"><strong>descs</strong> = ['LogP', 'MR', 'TPSA']<br>
|
|
|
|
|
<strong>forcefields</strong> = ['UFF', 'MMFF94', 'Ghemical']<br>
|
|
|
|
|
<strong>forcefields</strong> = ['uff', 'mmff94', 'ghemical']<br>
|
|
|
|
|
<strong>fps</strong> = ['FP2', 'FP3', 'FP4']<br>
|
|
|
|
|
<strong>informats</strong> = {'acr': 'ACR format', 'alc': 'Alchemy format', 'arc': 'Accelrys/MSI Biosym/Insight II CAR format', 'bgf': 'MSI BGF format', 'box': 'Dock 3.5 Box format', 'bs': 'Ball and Stick format', 'c3d1': 'Chem3D Cartesian 1 format', 'c3d2': 'Chem3D Cartesian 2 format', 'caccrt': 'Cacao Cartesian format', 'car': 'Accelrys/MSI Biosym/Insight II CAR format', ...}<br>
|
|
|
|
|
<strong>informats</strong> = {'acr': 'ACR format', 'adfout': 'ADF output format', 'alc': 'Alchemy format', 'arc': 'Accelrys/MSI Biosym/Insight II CAR format', 'bgf': 'MSI BGF format', 'box': 'Dock 3.5 Box format', 'bs': 'Ball and Stick format', 'c3d1': 'Chem3D Cartesian 1 format', 'c3d2': 'Chem3D Cartesian 2 format', 'caccrt': 'Cacao Cartesian format', ...}<br>
|
|
|
|
|
<strong>oasa</strong> = None<br>
|
|
|
|
|
<strong>operations</strong> = ['Gen3D']<br>
|
|
|
|
|
<strong>outformats</strong> = {'alc': 'Alchemy format', 'bgf': 'MSI BGF format', 'box': 'Dock 3.5 Box format', 'bs': 'Ball and Stick format', 'c3d1': 'Chem3D Cartesian 1 format', 'c3d2': 'Chem3D Cartesian 2 format', 'cac': 'CAChe MolStruct format', 'caccrt': 'Cacao Cartesian format', 'cache': 'CAChe MolStruct format', 'cacint': 'Cacao Internal format', ...}</td></tr></table>
|
|
|
|
|
<strong>outformats</strong> = {'adf': 'ADF cartesian input format', 'alc': 'Alchemy format', 'bgf': 'MSI BGF format', 'box': 'Dock 3.5 Box format', 'bs': 'Ball and Stick format', 'c3d1': 'Chem3D Cartesian 1 format', 'c3d2': 'Chem3D Cartesian 2 format', 'cac': 'CAChe MolStruct format', 'caccrt': 'Cacao Cartesian format', 'cache': 'CAChe MolStruct format', ...}</td></tr></table>
|
|
|
|
|
</body></html>
|