2009-09-21 Noel O'Boyle <baoilleach@gmail.com>

* scripts/*: Copied + pasted the scripts directory from 22x as a number
	of commits were never merged.
This commit is contained in:
Noel O'Boyle
2009-09-21 11:12:00 +00:00
parent 36baf46d9e
commit afb12d1eb7
12 changed files with 737 additions and 599 deletions

View File

@@ -1,3 +1,8 @@
2009-09-21 Noel O'Boyle <baoilleach@gmail.com>
* scripts/*: Copied + pasted the scripts directory from 22x as a number
of commits were never merged.
2009-09-20 Noel O'Boyle <baoilleach@gmail.com>
* scripts/CMakeLists.txt: Support for pybel. Revert regression that

View File

@@ -1,15 +1,22 @@
import org.openbabel.*
import org.openbabel.*;
public class OBTest
{
public OBTest()
{
System.loadLibrary("openbabel");
System.loadLibrary("openbabel_java");
}
public void run()
{
OBConversion c = new OBConversion();
OBMol mol = new OBMol();
c.SetInFormat("smi");
c.ReadString(mol, "c1ccccc1");
System.out.println("Benzene has " + mol.NumAtoms()
+ " atoms.");
}
public static void main(String[] args)

View File

@@ -1,8 +1,9 @@
Open Babel for Java
-------------------
This directory contains a set of SWIG-generated interface classes for
using the Open Babel C++ library from Java.
This directory contains a compiled Java jar file with SWIG-generated
interface classes for using the Open Babel C++ library from Java or from any
other language that runs on the JVM such as Jython or JRuby.
The Open Babel wiki pages on Java give information on compiling and
running Java programs with Open Babel:
@@ -11,33 +12,29 @@ http://openbabel.sourceforge.net/wiki/Java
*** Linux Compilation
First of all, set some environment variables (remember to change the paths to correspond to your system):
$ export JAVAHOME=/home/noel/Tools/jdk1.5.0_15
$ export JAVA_HOME=/home/noel/Tools/jdk1.5.0_15
$ export OB_JAVADIR=/home/noel/Tools/openbabel-2.2.0/scripts/java
$ export OB_LIBDIR=/home/noel/tree/lib # The install location of libopenbabel.so
Next, compile the Java bindings:
$ cd $OB_JAVADIR
$ g++ -c -fpic openbabel_java.cpp -I../../include -I$JAVAHOME/include -I$JAVAHOME/include/linux
$ export LD_LIBRARY_PATH=$OB_LIBDIR
$ g++ -shared -L$OB_LIBDIR openbabel_java.o -lopenbabel -o libopenbabel.so
$ g++ -c -fpic openbabel_java.cpp -I../../include -I$JAVA_HOME/include -I$JAVA_HOME/include/linux
$ g++ -shared openbabel_java.o -L../../src/.libs -lopenbabel -o libopenbabel_java.so
Compile and run the test program:
$ export CLASSPATH=.:$OB_JAVADIR/openbabel.jar
$ $JAVAHOME/bin/javac OBTest.java
$ $JAVA_HOME/bin/javac OBTest.java
$ export LD_LIBRARY_PATH=$OB_JAVADIR:$OB_LIBDIR
$ $JAVAHOME/bin/java OBTest
$ $JAVA_HOME/bin/java OBTest
If you get the output "Benzene has 0 atoms", you need to preload the OpenBabel library as follows:
$ LD_PRELOAD=$OB_LIBDIR/libopenbabel.so $JAVAHOME/bin/java OBTest
$ LD_PRELOAD=$OB_LIBDIR/libopenbabel.so $JAVA_HOME/bin/java OBTest
*** Mac OS X Compilation
% javac *.java
As for Linux, but use the following instructions to compile the bindings. Also, replace LD_LIBRARY_PATH with DYLD_LIBRARY_PATH.
% g++ -c -I/System/Library/Frameworks/JavaVM.framework/Headers \
openbabel_java.cpp
% g++ -dynamiclib -o libopenbabel.jnilib openbabel_java.o \
-framework JavaVM -L/usr/local/lib -lopenbabel
To run the OBTest program:
% java OBTest

View File

@@ -1,4 +1,3 @@
%module openbabel
%csconst(1);
//Rename GetType methods. GetType() is a member of the base C# object
@@ -653,21 +652,18 @@ using System.Runtime.InteropServices;
//ignore some currently unsupported operators
%ignore *::operator=;
%ignore *::operator++;
%ignore *::operator-=;
%ignore *::operator+=;
%ignore *::operator bool;
%ignore *::operator*=;
%ignore *::operator/=;
%ignore *::operator <<;
%ignore *::operator==;
%ignore *::operator-;
%ignore *::operator*;
//%ignore *::operator*;
%ignore *::operator !=;
%include "std_string.i"
%include "std_vector.i"
%include "std_string.i"
%typemap(cscode) std::vector<T>
%{
@@ -705,20 +701,28 @@ SWIG_STD_VECTOR_SPECIALIZE_MINIMUM(VectorOBVector3,std::vector<OpenBabel::vector
SWIG_STD_VECTOR_SPECIALIZE_MINIMUM(OBExternalBond,OpenBabel::OBExternalBond);
%template (VectorOBExternalBond) std::vector<OpenBabel::OBExternalBond>;
SWIG_STD_VECTOR_SPECIALIZE_MINIMUM(OBMol, OpenBabel::OBMol);
%template (vectorMol) std::vector<OpenBabel::OBMol>;
%template (VectorMol) std::vector<OpenBabel::OBMol>;
SWIG_STD_VECTOR_SPECIALIZE_MINIMUM(OBBond, OpenBabel::OBBond);
%template (vectorBond) std::vector<OpenBabel::OBBond>;
%template (VectorBond) std::vector<OpenBabel::OBBond>;
SWIG_STD_VECTOR_SPECIALIZE_MINIMUM(OBResidue, OpenBabel::OBResidue);
%template (vectorResidue) std::vector<OpenBabel::OBResidue>;
%template (VectorResidue) std::vector<OpenBabel::OBResidue>;
SWIG_STD_VECTOR_SPECIALIZE_MINIMUM(OBRing, OpenBabel::OBRing);
%template (vectorRing) std::vector<OpenBabel::OBRing>;
%template (VectorRing) std::vector<OpenBabel::OBRing>;
SWIG_STD_VECTOR_SPECIALIZE_MINIMUM(OBTorsion, OpenBabel::OBTorsion);
%template (VectorTorsion) std::vector<OpenBabel::OBTorsion>;
// Note that vectors of pointers need slightly different syntax
SWIG_STD_VECTOR_SPECIALIZE_MINIMUM(OBRing, OpenBabel::OBRing*);
%template (vectorpRing) std::vector<OpenBabel::OBRing*>;
%template (VectorpRing) std::vector<OpenBabel::OBRing*>;
SWIG_STD_VECTOR_SPECIALIZE_MINIMUM(OBGenericData, OpenBabel::OBGenericData*);
%template (vectorData) std::vector<OpenBabel::OBGenericData*>;
%template (VectorpData) std::vector<OpenBabel::OBGenericData*>;
SWIG_STD_VECTOR_SPECIALIZE_MINIMUM(OBInternalCoord, OpenBabel::OBInternalCoord*);
%template (VectorpInternalCoord) std::vector<OpenBabel::OBInternalCoord*>;
SWIG_STD_VECTOR_SPECIALIZE_MINIMUM(OBAtom, OpenBabel::OBAtom*);
%template (VectorpAtom) std::vector<OpenBabel::OBAtom*>;
SWIG_STD_VECTOR_SPECIALIZE_MINIMUM(OBBond, OpenBabel::OBBond*);
%template (VectorpBond) std::vector<OpenBabel::OBBond*>;
SWIG_STD_VECTOR_SPECIALIZE_MINIMUM(OBRotor, OpenBabel::OBRotor*);
%template (VectorpRotor) std::vector<OpenBabel::OBRotor*>;
@@ -738,6 +742,7 @@ SWIG_STD_VECTOR_SPECIALIZE_MINIMUM(OBRotor, OpenBabel::OBRotor*);
%include <openbabel/math/spacegroup.h>
%include <openbabel/base.h>
//replacement for method return unsupported std::pair
%extend OpenBabel::OBTorsion
{
@@ -829,6 +834,7 @@ CAST_GENERICDATA_TO(VirtualBond);
%include <openbabel/internalcoord.h>
%include <openbabel/atom.h>
%include <openbabel/bond.h>
%ignore OpenBabel::OBMol::SetData;
%include <openbabel/mol.h>
%include <openbabel/ring.h>
%include <openbabel/parsmart.h>
@@ -868,6 +874,8 @@ CAST_GENERICDATA_TO(VirtualBond);
%ignore OBMolAtomIter(OBMol &);
%ignore OBMolAtomBFSIter(OBMol &);
%ignore OBMolAtomDFSIter(OBMol &);
%ignore OBMolAtomBFSIter(OBMol &, int);
%ignore OBMolAtomDFSIter(OBMol &, int);
%ignore OBMolBondIter(OBMol &);
%ignore OBMolPairIter(OBMol &);
%ignore OBMolRingIter(OBMol &);
@@ -875,6 +883,26 @@ CAST_GENERICDATA_TO(VirtualBond);
%ignore OBResidueIter(OBMol &);
%ignore OBResidueAtomIter(OBResidue &);
//macro for wrapping iterators
%define WRAPITERATOR(NAME,CTYPE,RETYPE)
%ignore CTYPE::NAME();
%csmethodmodifiers CTYPE::operator* "protected";
%csmethodmodifiers CTYPE::operator++ "protected";
%rename(obAdvance) CTYPE::operator++;
%csmethodmodifiers CTYPE::operator bool() const "protected";
%rename(obHasNext) CTYPE::operator bool;
//***redundant?
%typemap(cstype) CTYPE "$csclassname"
%typemap(csinterfaces) CTYPE "IEnumerator<RETYPE>"
%typemap(csimports) CTYPE "
using System;
using System.Collections.Generic;
using System.Runtime.InteropServices;
"
%typemap(cscode) CTYPE
%{
protected bool iterating;
public virtual RETYPE Current
{

View File

@@ -1,4 +1,4 @@
%module openbabel
%module openbabel_java
%{
// used to set import/export for Cygwin DLLs

View File

@@ -40,45 +40,18 @@
#include <openbabel/kinetics.h>
#include <openbabel/rotamer.h>
#include <openbabel/graphsym.h>
#include <openbabel/stereo/stereo.h>
#include <openbabel/stereo/cistrans.h>
#include <openbabel/stereo/tetrahedral.h>
%}
%include "std_list.i"
%include "std_map.i"
%include "std_vector.i"
%include "std_string.i"
%include "std_pair.i"
namespace std {
%define VECTORPAIRTEMPLATE_WRAP(name, TA, TB)
%feature("ignore") vector< pair<TA, TB> >::append;
%feature("ignore") vector< pair<TA, TB> >::assign;
%feature("ignore") vector< pair<TA, TB> >::back;
%feature("ignore") vector< pair<TA, TB> >::begin;
%feature("ignore") vector< pair<TA, TB> >::capacity;
%feature("ignore") vector< pair<TA, TB> >::clear;
%feature("ignore") vector< pair<TA, TB> >::empty;
%feature("ignore") vector< pair<TA, TB> >::end;
%feature("ignore") vector< pair<TA, TB> >::erase;
%feature("ignore") vector< pair<TA, TB> >::front;
%feature("ignore") vector< pair<TA, TB> >::get_allocator;
%feature("ignore") vector< pair<TA, TB> >::insert;
%feature("ignore") vector< pair<TA, TB> >::pop;
%feature("ignore") vector< pair<TA, TB> >::pop_back;
%feature("ignore") vector< pair<TA, TB> >::push_back;
%feature("ignore") vector< pair<TA, TB> >::rbegin;
%feature("ignore") vector< pair<TA, TB> >::rend;
%feature("ignore") vector< pair<TA, TB> >::reserve;
%feature("ignore") vector< pair<TA, TB> >::resize;
%feature("ignore") vector< pair<TA, TB> >::size;
%feature("ignore") vector< pair<TA, TB> >::swap;
%template(vectorpair ## name) vector< pair<TA, TB> >;
%enddef
%define VVTEMPLATE_WRAP(name, T)
%feature("ignore") vector< vector<T> >::append;
%feature("ignore") vector< vector<T> >::assign;
@@ -130,7 +103,7 @@ namespace std {
%enddef
VECTORTEMPLATE_WRAP(Int, int)
VECTORTEMPLATE_WRAP(UInt, unsigned int)
VECTORTEMPLATE_WRAP(UnsignedInt, unsigned int)
VVTEMPLATE_WRAP(Int, int)
VECTORTEMPLATE_WRAP(Double, double)
VECTORTEMPLATE_WRAP(String, std::string)
@@ -142,8 +115,6 @@ VECTORTEMPLATE_WRAP(OBRing, OpenBabel::OBRing)
VECTORTEMPLATE_WRAP(pOBRing, OpenBabel::OBRing*)
VECTORTEMPLATE_WRAP(pOBGenericData, OpenBabel::OBGenericData*)
%template(pairOBAtomUInt) pair<OpenBabel::OBAtom*, unsigned int>;
VECTORPAIRTEMPLATE_WRAP(OBAtomUInt, OpenBabel::OBAtom*, unsigned int)
}
%define CAST_GENERICDATA_TO(subclass)
@@ -169,7 +140,6 @@ CAST_GENERICDATA_TO(RotamerList)
CAST_GENERICDATA_TO(RotationData)
CAST_GENERICDATA_TO(SerialNums)
CAST_GENERICDATA_TO(SetData)
CAST_GENERICDATA_TO(StereoBase)
CAST_GENERICDATA_TO(SymmetryData)
CAST_GENERICDATA_TO(TorsionData)
CAST_GENERICDATA_TO(UnitCell)
@@ -177,16 +147,6 @@ CAST_GENERICDATA_TO(VectorData)
CAST_GENERICDATA_TO(VibrationData)
CAST_GENERICDATA_TO(VirtualBond)
%define CAST_STEREODATA_TO(subclass)
%inline %{
OpenBabel::OB ## subclass *to ## subclass(OpenBabel::OBStereoBase *data) {
return (OpenBabel::OB ## subclass *) data;
}
%}
%enddef
CAST_STEREODATA_TO(CisTransStereo)
CAST_STEREODATA_TO(TetrahedralStereo)
// This method is renamed to a valid Python method name, as otherwise
// it cannot be used from Python
%rename(inc) *::operator++;
@@ -240,11 +200,6 @@ CAST_STEREODATA_TO(TetrahedralStereo)
%include <openbabel/op.h>
%include <openbabel/bitvec.h>
%include <openbabel/graphsym.h>
%include <openbabel/stereo/stereo.h>
%include <openbabel/stereo/cistrans.h>
%include <openbabel/stereo/tetrahedral.h>
# The following %ignores avoid warning messages due to shadowed classes.
# This does not imply a loss of functionality as (in this case)

View File

@@ -2,6 +2,12 @@ import os
import sys
import unittest
## In Python 3.x, generators have a __next__() method
## instead of a next() method
nextmethod = "next"
if sys.version_info[0] >= 3:
nextmethod = "__next__"
try:
test = os.write
try:
@@ -28,10 +34,10 @@ class myTestCase(unittest.TestCase):
# Taken from unittest.py in Python 2.5 distribution
def assertFalse(self, expr, msg=None):
"Fail the test if the expression is true."
if expr: raise self.failureException, msg
if expr: raise self.failureException(msg)
def assertTrue(self, expr, msg=None):
"""Fail the test unless the expression is true."""
if not expr: raise self.failureException, msg
if not expr: raise self.failureException(msg)
def assertAlmostEqual(self, first, second, places=7, msg=None):
"""Fail if the two objects are unequal as determined by their
difference rounded to the given number of decimal places
@@ -41,8 +47,8 @@ class myTestCase(unittest.TestCase):
as significant digits (measured from the most signficant digit).
"""
if round(second-first, places) != 0:
raise self.failureException, \
(msg or '%r != %r within %r places' % (first, second, places))
raise self.failureException(
(msg or '%r != %r within %r places' % (first, second, places)))
class TestToolkit(myTestCase):
@@ -111,6 +117,10 @@ class TestToolkit(myTestCase):
self.head[0].localopt()
newcoords = self.head[0].atoms[0].coords
self.assertNotEqual(oldcoords, newcoords)
# Make sure that make3D() is called for molecules without coordinates
mol = self.mols[0]
mol.localopt()
self.assertNotEqual(mol.atoms[3].coords, (0., 0., 0.))
def testMake3D(self):
"""Test that 3D coordinate generation does something"""
@@ -167,14 +177,14 @@ M END
self.assertEqual(len(self.mols), 2)
def RFreaderror(self):
mol = self.toolkit.readfile("sdf", "nosuchfile.sdf").next()
mol = getattr(self.toolkit.readfile("sdf", "nosuchfile.sdf"), nextmethod)()
def testRFmissingfile(self):
"""Test that reading from a non-existent file raises an error."""
self.assertRaises(IOError, self.RFreaderror)
def RFformaterror(self):
mol = self.toolkit.readfile("noel", "head.sdf").next()
mol = getattr(self.toolkit.readfile("noel", "head.sdf"), nextmethod)()
def testRFformaterror(self):
"""Test that invalid formats raise an error"""
@@ -296,12 +306,19 @@ M END
test = "Atom: 8 (-0.07 5.24 0.03)"
self.assertEqual(str(self.atom), test)
def invalidSMARTStest(self):
# Should raise IOError
return self.toolkit.Smarts("[#NOEL][#NOEL]")
def testSMARTS(self):
"""Searching for ethyl groups in triethylamine"""
mol = self.toolkit.readstring("smi", "CCN(CC)CC")
smarts = self.toolkit.Smarts("[#6][#6]")
ans = smarts.findall(mol)
self.assertEqual(len(ans), 3)
self.toolkit.ob.obErrorLog.SetOutputLevel(self.toolkit.ob.obError)
self.assertRaises(IOError, self.invalidSMARTStest)
self.toolkit.ob.obErrorLog.SetOutputLevel(self.toolkit.ob.obWarning)
def testAddh(self):
"""Adding and removing hydrogens"""
@@ -328,7 +345,7 @@ class TestPybel(TestToolkit):
def testunitcell(self):
"""Testing unit cell access"""
mol = self.toolkit.readfile("cif", "hashizume.cif").next()
mol = getattr(self.toolkit.readfile("cif", "hashizume.cif"), nextmethod)()
cell = mol.unitcell
self.assertAlmostEqual(cell.GetAlpha(), 92.9, 1)
@@ -387,6 +404,11 @@ Energy = 0
self.assertEqual(len(self.mols[0].atoms), 4)
self.assertRaises(AttributeError, self.RSaccesstest)
def testIterators(self):
"""Check out the OB iterators"""
numatoms = len(list(self.toolkit.ob.OBMolAtomIter(self.mols[0].OBMol)))
self.assertEqual(numatoms, 4)
class TestOBPybel(TestPybel):
toolkit = obpybel
@@ -444,6 +466,6 @@ if __name__=="__main__":
# testcases = [TestRDKit]
testcases = [TestOBPybel]
for testcase in testcases:
print "\n\n\nTESTING %s\n%s\n\n" % (testcase.__name__, "== "*10)
sys.stdout.write("\n\n\nTESTING %s\n%s\n\n\n" % (testcase.__name__, "== "*10))
myunittest = unittest.defaultTestLoader.loadTestsFromTestCase(testcase)
unittest.TextTestRunner(verbosity=2).run(myunittest)

View File

@@ -33,6 +33,7 @@ def _formatstodict(list):
broken = [(x,y.strip()) for x,y in broken]
return dict(broken)
_obconv = ob.OBConversion()
_builder = ob.OBBuilder()
informats = _formatstodict(_obconv.GetSupportedInputFormat())
"""A dictionary of supported input formats"""
outformats = _formatstodict(_obconv.GetSupportedOutputFormat())
@@ -73,7 +74,7 @@ def readfile(format, filename):
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"):
>>> for mol in readfile("sdf", "head.sdf"):
... atomtotal += len(mol.atoms)
...
>>> print atomtotal
@@ -102,7 +103,7 @@ def readstring(format, string):
Example:
>>> input = "C1=CC=CS1"
>>> mymol = readstring("smi",input)
>>> mymol = readstring("smi", input)
>>> len(mymol.atoms)
5
"""
@@ -364,7 +365,7 @@ class Molecule(object):
to improve the coordinates further.
"""
forcefield = forcefield.lower()
_operations['Gen3D'].Do(self.OBMol)
_builder.Build(self.OBMol)
self.addh()
self.localopt(forcefield, steps)

View File

@@ -33,6 +33,7 @@ def _formatstodict(list):
broken = [(x,y.strip()) for x,y in broken]
return dict(broken)
_obconv = ob.OBConversion()
_builder = ob.OBBuilder()
informats = _formatstodict(_obconv.GetSupportedInputFormat())
"""A dictionary of supported input formats"""
outformats = _formatstodict(_obconv.GetSupportedOutputFormat())
@@ -73,7 +74,7 @@ def readfile(format, filename):
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"):
>>> for mol in readfile("sdf", "head.sdf"):
... atomtotal += len(mol.atoms)
...
>>> print atomtotal
@@ -102,7 +103,7 @@ def readstring(format, string):
Example:
>>> input = "C1=CC=CS1"
>>> mymol = readstring("smi",input)
>>> mymol = readstring("smi", input)
>>> len(mymol.atoms)
5
"""
@@ -364,7 +365,7 @@ class Molecule(object):
to improve the coordinates further.
"""
forcefield = forcefield.lower()
_operations['Gen3D'].Do(self.OBMol)
_builder.Build(self.OBMol)
self.addh()
self.localopt(forcefield, steps)

View File

@@ -8,8 +8,16 @@
<td valign=bottom>&nbsp;<br>
<font color="#ffffff" face="helvetica, arial">&nbsp;<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&nbsp;-&nbsp;A&nbsp;Python&nbsp;module&nbsp;for&nbsp;accessing&nbsp;OpenBabel<br>
&nbsp;<br>
Global&nbsp;variables:<br>
&nbsp;&nbsp;ob&nbsp;-&nbsp;the&nbsp;underlying&nbsp;SWIG&nbsp;bindings&nbsp;for&nbsp;OpenBabel<br>
&nbsp;&nbsp;informats&nbsp;-&nbsp;a&nbsp;dictionary&nbsp;of&nbsp;supported&nbsp;input&nbsp;formats<br>
&nbsp;&nbsp;outformats&nbsp;-&nbsp;a&nbsp;dictionary&nbsp;of&nbsp;supported&nbsp;output&nbsp;formats<br>
&nbsp;&nbsp;descs&nbsp;-&nbsp;a&nbsp;list&nbsp;of&nbsp;supported&nbsp;descriptors<br>
&nbsp;&nbsp;fps&nbsp;-&nbsp;a&nbsp;list&nbsp;of&nbsp;supported&nbsp;fingerprint&nbsp;types<br>
&nbsp;&nbsp;forcefields&nbsp;-&nbsp;a&nbsp;list&nbsp;of&nbsp;supported&nbsp;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>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</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&nbsp;parameter:<br>
Attributes:<br>
&nbsp;&nbsp;&nbsp;atomicmass,&nbsp;atomicnum,&nbsp;cidx,&nbsp;coords,&nbsp;coordidx,&nbsp;exactmass,<br>
&nbsp;&nbsp;&nbsp;formalcharge,&nbsp;heavyvalence,&nbsp;heterovalence,&nbsp;hyb,&nbsp;idx,<br>
&nbsp;&nbsp;&nbsp;implicitvalence,&nbsp;index,&nbsp;isotope,&nbsp;partialcharge,&nbsp;spin,&nbsp;type,<br>
&nbsp;&nbsp;&nbsp;implicitvalence,&nbsp;isotope,&nbsp;partialcharge,&nbsp;spin,&nbsp;type,<br>
&nbsp;&nbsp;&nbsp;valence,&nbsp;vector.<br>
&nbsp;<br>
(refer&nbsp;to&nbsp;the&nbsp;Open&nbsp;Babel&nbsp;library&nbsp;documentation&nbsp;for&nbsp;more&nbsp;info).<br>
@@ -69,24 +76,90 @@ The&nbsp;original&nbsp;Open&nbsp;Babel&nbsp;atom&nbsp;can&nbsp;be&nbsp;accessed&
&nbsp;&nbsp;&nbsp;OBAtom<br>&nbsp;</tt></td></tr>
<tr><td>&nbsp;</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&nbsp;a&nbsp;string&nbsp;representation&nbsp;of&nbsp;the&nbsp;atom.<br>
&nbsp;<br>
&gt;&gt;&gt;&nbsp;a&nbsp;=&nbsp;<a href="#Atom">Atom</a>()<br>
&gt;&gt;&gt;&nbsp;print&nbsp;a<br>
<a href="#Atom">Atom</a>:&nbsp;0&nbsp;(0.0,&nbsp;0.0,&nbsp;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&nbsp;for&nbsp;instance&nbsp;variables&nbsp;(if&nbsp;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&nbsp;of&nbsp;weak&nbsp;references&nbsp;to&nbsp;the&nbsp;object&nbsp;(if&nbsp;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> = &lt;dictproxy object&gt;<dd><tt>dictionary&nbsp;for&nbsp;instance&nbsp;variables&nbsp;(if&nbsp;defined)</tt></dl>
<dl><dt><strong>__weakref__</strong> = &lt;attribute '__weakref__' of 'Atom' objects&gt;<dd><tt>list&nbsp;of&nbsp;weak&nbsp;references&nbsp;to&nbsp;the&nbsp;<a href="__builtin__.html#object">object</a>&nbsp;(if&nbsp;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&nbsp;Molecular&nbsp;<a href="#Fingerprint">Fingerprint</a>.<br>
&nbsp;<br>
Required&nbsp;parameters:<br>
&nbsp;&nbsp;&nbsp;obFingerprint&nbsp;--&nbsp;a&nbsp;vector&nbsp;calculated&nbsp;by&nbsp;OBFingerprint.FindFingerprint()<br>
&nbsp;&nbsp;&nbsp;fingerprint&nbsp;--&nbsp;a&nbsp;vector&nbsp;calculated&nbsp;by&nbsp;OBFingerprint.FindFingerprint()<br>
&nbsp;<br>
Attributes:<br>
&nbsp;&nbsp;&nbsp;fp&nbsp;--&nbsp;the&nbsp;original&nbsp;obFingerprint<br>
&nbsp;&nbsp;&nbsp;fp&nbsp;--&nbsp;the&nbsp;underlying&nbsp;fingerprint&nbsp;<a href="__builtin__.html#object">object</a><br>
&nbsp;&nbsp;&nbsp;bits&nbsp;--&nbsp;a&nbsp;list&nbsp;of&nbsp;bits&nbsp;set&nbsp;in&nbsp;the&nbsp;<a href="#Fingerprint">Fingerprint</a><br>
&nbsp;<br>
Methods:<br>
@@ -109,22 +182,24 @@ Methods:<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;tanimoto&nbsp;=&nbsp;a&nbsp;|&nbsp;b<br>&nbsp;</tt></td></tr>
<tr><td>&nbsp;</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&nbsp;for&nbsp;instance&nbsp;variables&nbsp;(if&nbsp;defined)</tt></dd>
</dl>
<dl><dt><strong>__weakref__</strong></dt>
<dd><tt>list&nbsp;of&nbsp;weak&nbsp;references&nbsp;to&nbsp;the&nbsp;object&nbsp;(if&nbsp;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> = &lt;dictproxy object&gt;<dd><tt>dictionary&nbsp;for&nbsp;instance&nbsp;variables&nbsp;(if&nbsp;defined)</tt></dl>
<dl><dt><strong>__weakref__</strong> = &lt;attribute '__weakref__' of 'Fingerprint' objects&gt;<dd><tt>list&nbsp;of&nbsp;weak&nbsp;references&nbsp;to&nbsp;the&nbsp;<a href="__builtin__.html#object">object</a>&nbsp;(if&nbsp;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>&nbsp;&nbsp;&nbsp;</tt></td>
<td colspan=2><tt>Represent&nbsp;a&nbsp;Pybel&nbsp;molecule.<br>
<td colspan=2><tt>Represent&nbsp;a&nbsp;Pybel&nbsp;<a href="#Molecule">Molecule</a>.<br>
&nbsp;<br>
Required&nbsp;parameter:<br>
&nbsp;&nbsp;&nbsp;OBMol&nbsp;--&nbsp;an&nbsp;Open&nbsp;Babel&nbsp;OBMol<br>
&nbsp;&nbsp;&nbsp;or<br>
&nbsp;&nbsp;&nbsp;<a href="#Molecule">Molecule</a>&nbsp;--&nbsp;any&nbsp;type&nbsp;of&nbsp;cinfony&nbsp;<a href="#Molecule">Molecule</a>&nbsp;(e.g.&nbsp;one&nbsp;from&nbsp;cinfony.rdkit)<br>
&nbsp;<br>
If&nbsp;a&nbsp;cinfony&nbsp;<a href="#Molecule">Molecule</a>&nbsp;is&nbsp;provided&nbsp;it&nbsp;will&nbsp;be&nbsp;converted&nbsp;into&nbsp;a&nbsp;pybel&nbsp;<a href="#Molecule">Molecule</a>.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br>
&nbsp;&nbsp;&nbsp;OBMol&nbsp;--&nbsp;an&nbsp;Open&nbsp;Babel&nbsp;OBMol&nbsp;or&nbsp;any&nbsp;type&nbsp;of&nbsp;cinfony&nbsp;<a href="#Molecule">Molecule</a><br>
&nbsp;<br>
Attributes:<br>
&nbsp;&nbsp;&nbsp;atoms,&nbsp;charge,&nbsp;data,&nbsp;dim,&nbsp;energy,&nbsp;exactmass,&nbsp;flags,&nbsp;formula,&nbsp;<br>
&nbsp;&nbsp;&nbsp;mod,&nbsp;molwt,&nbsp;spin,&nbsp;sssr,&nbsp;title,&nbsp;unitcell.<br>
&nbsp;&nbsp;&nbsp;atoms,&nbsp;charge,&nbsp;conformers,&nbsp;data,&nbsp;dim,&nbsp;energy,&nbsp;exactmass,&nbsp;formula,&nbsp;<br>
&nbsp;&nbsp;&nbsp;molwt,&nbsp;spin,&nbsp;sssr,&nbsp;title,&nbsp;unitcell.<br>
(refer&nbsp;to&nbsp;the&nbsp;Open&nbsp;Babel&nbsp;library&nbsp;documentation&nbsp;for&nbsp;more&nbsp;info).<br>
&nbsp;<br>
Methods:<br>
&nbsp;&nbsp;&nbsp;<a href="#Molecule-addh">addh</a>(),&nbsp;<a href="#Molecule-calcfp">calcfp</a>(),&nbsp;<a href="#Molecule-calcdesc">calcdesc</a>(),&nbsp;<a href="#Molecule-draw">draw</a>(),&nbsp;<a href="#Molecule-localopt">localopt</a>(),&nbsp;<a href="#Molecule-make3D">make3D</a>(),&nbsp;<a href="#Molecule-removeh">removeh</a>(),&nbsp;<a href="#Molecule-write">write</a>()&nbsp;<br>
&nbsp;&nbsp;&nbsp;<a href="#Molecule-addh">addh</a>(),&nbsp;<a href="#Molecule-calcfp">calcfp</a>(),&nbsp;<a href="#Molecule-calcdesc">calcdesc</a>(),&nbsp;<a href="#Molecule-draw">draw</a>(),&nbsp;<a href="#Molecule-localopt">localopt</a>(),&nbsp;<a href="#Molecule-make3D">make3D</a>(),&nbsp;<a href="#Molecule-removeh">removeh</a>(),<br>
&nbsp;&nbsp;&nbsp;<a href="#Molecule-write">write</a>()&nbsp;<br>
&nbsp;&nbsp;<br>
The&nbsp;original&nbsp;Open&nbsp;Babel&nbsp;molecule&nbsp;can&nbsp;be&nbsp;accessed&nbsp;using&nbsp;the&nbsp;attribute:<br>
The&nbsp;underlying&nbsp;Open&nbsp;Babel&nbsp;molecule&nbsp;can&nbsp;be&nbsp;accessed&nbsp;using&nbsp;the&nbsp;attribute:<br>
&nbsp;&nbsp;&nbsp;OBMol<br>&nbsp;</tt></td></tr>
<tr><td>&nbsp;</td>
<td width="100%">Methods defined here:<br>
<dl><dt><a name="Molecule-__getattr__"><strong>__getattr__</strong></a>(self, attr)</dt><dd><tt>Return&nbsp;the&nbsp;value&nbsp;of&nbsp;an&nbsp;attribute<br>
&nbsp;<br>
Note:&nbsp;The&nbsp;values&nbsp;are&nbsp;calculated&nbsp;on-the-fly.&nbsp;You&nbsp;may&nbsp;want&nbsp;to&nbsp;store&nbsp;the&nbsp;value&nbsp;in<br>
a&nbsp;variable&nbsp;if&nbsp;you&nbsp;repeatedly&nbsp;access&nbsp;the&nbsp;same&nbsp;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&nbsp;over&nbsp;the&nbsp;Atoms&nbsp;of&nbsp;the&nbsp;<a href="#Molecule">Molecule</a>.<br>
@@ -175,17 +242,16 @@ This&nbsp;allows&nbsp;constructions&nbsp;such&nbsp;as&nbsp;the&nbsp;following:<b
Optional&nbsp;parameter:<br>
&nbsp;&nbsp;&nbsp;descnames&nbsp;--&nbsp;a&nbsp;list&nbsp;of&nbsp;names&nbsp;of&nbsp;descriptors<br>
&nbsp;<br>
If&nbsp;descnames&nbsp;is&nbsp;not&nbsp;specified,&nbsp;the&nbsp;full&nbsp;list&nbsp;of&nbsp;Open&nbsp;Babel<br>
descriptors&nbsp;is&nbsp;calculated:&nbsp;LogP,&nbsp;PSA&nbsp;and&nbsp;MR.</tt></dd></dl>
If&nbsp;descnames&nbsp;is&nbsp;not&nbsp;specified,&nbsp;all&nbsp;available&nbsp;descriptors&nbsp;are<br>
calculated.&nbsp;See&nbsp;the&nbsp;descs&nbsp;variable&nbsp;for&nbsp;a&nbsp;list&nbsp;of&nbsp;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&nbsp;a&nbsp;molecular&nbsp;fingerprint.<br>
&nbsp;<br>
Optional&nbsp;parameters:<br>
&nbsp;&nbsp;&nbsp;fptype&nbsp;--&nbsp;the&nbsp;name&nbsp;of&nbsp;the&nbsp;Open&nbsp;Babel&nbsp;fingerprint&nbsp;type.<br>
&nbsp;<br>
If&nbsp;fptype&nbsp;is&nbsp;not&nbsp;specified,&nbsp;the&nbsp;FP2&nbsp;fingerprint&nbsp;type<br>
is&nbsp;used.&nbsp;See&nbsp;the&nbsp;Open&nbsp;Babel&nbsp;library&nbsp;documentation&nbsp;for&nbsp;more<br>
details.</tt></dd></dl>
&nbsp;&nbsp;&nbsp;fptype&nbsp;--&nbsp;the&nbsp;fingerprint&nbsp;type&nbsp;(default&nbsp;is&nbsp;"FP2").&nbsp;See&nbsp;the<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;fps&nbsp;variable&nbsp;for&nbsp;a&nbsp;list&nbsp;of&nbsp;of&nbsp;available&nbsp;fingerprint<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;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&nbsp;a&nbsp;2D&nbsp;depiction&nbsp;of&nbsp;the&nbsp;molecule.<br>
&nbsp;<br>
@@ -201,20 +267,22 @@ Optional&nbsp;parameters:<br>
OASA&nbsp;is&nbsp;used&nbsp;for&nbsp;2D&nbsp;coordinate&nbsp;generation&nbsp;and&nbsp;depiction.&nbsp;Tkinter&nbsp;and<br>
Python&nbsp;Imaging&nbsp;Library&nbsp;are&nbsp;required&nbsp;for&nbsp;image&nbsp;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&nbsp;optimize&nbsp;the&nbsp;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&nbsp;optimize&nbsp;the&nbsp;coordinates.<br>
&nbsp;<br>
Optional&nbsp;parameters:<br>
&nbsp;&nbsp;&nbsp;forcefield&nbsp;--&nbsp;default&nbsp;is&nbsp;"MMFF94"<br>
&nbsp;&nbsp;&nbsp;forcefield&nbsp;--&nbsp;default&nbsp;is&nbsp;"mmff94".&nbsp;See&nbsp;the&nbsp;forcefields&nbsp;variable<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;for&nbsp;a&nbsp;list&nbsp;of&nbsp;available&nbsp;forcefields.<br>
&nbsp;&nbsp;&nbsp;steps&nbsp;--&nbsp;default&nbsp;is&nbsp;500<br>
&nbsp;<br>
If&nbsp;the&nbsp;molecule&nbsp;does&nbsp;not&nbsp;have&nbsp;2D&nbsp;or&nbsp;3D&nbsp;coordinates,&nbsp;<a href="#Molecule-make3D">make3D</a>()&nbsp;is<br>
If&nbsp;the&nbsp;molecule&nbsp;does&nbsp;not&nbsp;have&nbsp;any&nbsp;coordinates,&nbsp;<a href="#Molecule-make3D">make3D</a>()&nbsp;is<br>
called&nbsp;before&nbsp;the&nbsp;optimization.&nbsp;Note&nbsp;that&nbsp;the&nbsp;molecule&nbsp;needs<br>
to&nbsp;have&nbsp;explicit&nbsp;hydrogens.&nbsp;If&nbsp;not,&nbsp;call&nbsp;<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&nbsp;3D&nbsp;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&nbsp;3D&nbsp;coordinates.<br>
&nbsp;<br>
Optional&nbsp;parameters:<br>
&nbsp;&nbsp;&nbsp;forcefield&nbsp;--&nbsp;default&nbsp;is&nbsp;"MMFF94"<br>
&nbsp;&nbsp;&nbsp;forcefield&nbsp;--&nbsp;default&nbsp;is&nbsp;"mmff94".&nbsp;See&nbsp;the&nbsp;forcefields&nbsp;variable<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;for&nbsp;a&nbsp;list&nbsp;of&nbsp;available&nbsp;forcefields.<br>
&nbsp;&nbsp;&nbsp;steps&nbsp;--&nbsp;default&nbsp;is&nbsp;50<br>
&nbsp;<br>
Once&nbsp;coordinates&nbsp;are&nbsp;generated,&nbsp;hydrogens&nbsp;are&nbsp;added&nbsp;and&nbsp;a&nbsp;quick<br>
@@ -224,26 +292,83 @@ to&nbsp;improve&nbsp;the&nbsp;coordinates&nbsp;further.</tt></dd></dl>
<dl><dt><a name="Molecule-removeh"><strong>removeh</strong></a>(self)</dt><dd><tt>Remove&nbsp;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&nbsp;the&nbsp;molecule&nbsp;to&nbsp;a&nbsp;file&nbsp;or&nbsp;return&nbsp;a&nbsp;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&nbsp;the&nbsp;molecule&nbsp;to&nbsp;a&nbsp;file&nbsp;or&nbsp;return&nbsp;a&nbsp;string.<br>
&nbsp;<br>
Optional&nbsp;parameters:<br>
&nbsp;&nbsp;&nbsp;format&nbsp;--&nbsp;default&nbsp;is&nbsp;"SMI"<br>
&nbsp;&nbsp;&nbsp;format&nbsp;--&nbsp;see&nbsp;the&nbsp;informats&nbsp;variable&nbsp;for&nbsp;a&nbsp;list&nbsp;of&nbsp;available<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;output&nbsp;formats&nbsp;(default&nbsp;is&nbsp;"smi")<br>
&nbsp;&nbsp;&nbsp;filename&nbsp;--&nbsp;default&nbsp;is&nbsp;None<br>
&nbsp;&nbsp;&nbsp;overwite&nbsp;--&nbsp;default&nbsp;is&nbsp;False<br>
&nbsp;&nbsp;&nbsp;overwite&nbsp;--&nbsp;if&nbsp;the&nbsp;output&nbsp;file&nbsp;already&nbsp;exists,&nbsp;should&nbsp;it<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;be&nbsp;overwritten?&nbsp;(default&nbsp;is&nbsp;False)<br>
&nbsp;<br>
If&nbsp;a&nbsp;filename&nbsp;is&nbsp;specified,&nbsp;the&nbsp;result&nbsp;is&nbsp;written&nbsp;to&nbsp;a&nbsp;file.<br>
Otherwise,&nbsp;a&nbsp;string&nbsp;is&nbsp;returned&nbsp;containing&nbsp;the&nbsp;result.<br>
The&nbsp;overwrite&nbsp;flag&nbsp;is&nbsp;ignored&nbsp;if&nbsp;a&nbsp;filename&nbsp;is&nbsp;not&nbsp;specified.<br>
It&nbsp;controls&nbsp;whether&nbsp;to&nbsp;overwrite&nbsp;an&nbsp;existing&nbsp;file.</tt></dd></dl>
&nbsp;<br>
To&nbsp;write&nbsp;multiple&nbsp;molecules&nbsp;to&nbsp;the&nbsp;same&nbsp;file&nbsp;you&nbsp;should&nbsp;use<br>
the&nbsp;<a href="#Outputfile">Outputfile</a>&nbsp;class.</tt></dd></dl>
<hr>
Data descriptors defined here:<br>
<dl><dt><strong>__dict__</strong></dt>
<dd><tt>dictionary&nbsp;for&nbsp;instance&nbsp;variables&nbsp;(if&nbsp;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&nbsp;of&nbsp;weak&nbsp;references&nbsp;to&nbsp;the&nbsp;object&nbsp;(if&nbsp;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> = &lt;dictproxy object&gt;<dd><tt>dictionary&nbsp;for&nbsp;instance&nbsp;variables&nbsp;(if&nbsp;defined)</tt></dl>
<dl><dt><strong>__weakref__</strong> = &lt;attribute '__weakref__' of 'Molecule' objects&gt;<dd><tt>list&nbsp;of&nbsp;weak&nbsp;references&nbsp;to&nbsp;the&nbsp;<a href="__builtin__.html#object">object</a>&nbsp;(if&nbsp;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&nbsp;--&gt;&nbsp;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&nbsp;for&nbsp;instance&nbsp;variables&nbsp;(if&nbsp;defined)</tt></dd>
</dl>
<dl><dt><strong>__weakref__</strong></dt>
<dd><tt>list&nbsp;of&nbsp;weak&nbsp;references&nbsp;to&nbsp;the&nbsp;object&nbsp;(if&nbsp;defined)</tt></dd>
</dl>
Data and other attributes defined here:<br>
<dl><dt><strong>__dict__</strong> = &lt;dictproxy object&gt;<dd><tt>dictionary&nbsp;for&nbsp;instance&nbsp;variables&nbsp;(if&nbsp;defined)</tt></dl>
<dl><dt><strong>__weakref__</strong> = &lt;attribute '__weakref__' of 'MoleculeData' objects&gt;<dd><tt>list&nbsp;of&nbsp;weak&nbsp;references&nbsp;to&nbsp;the&nbsp;<a href="__builtin__.html#object">object</a>&nbsp;(if&nbsp;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&nbsp;to&nbsp;be&nbsp;written&nbsp;to&nbsp;the&nbsp;same&nbsp;file&nbsp;you&n
class.<br>
&nbsp;<br>
Required&nbsp;parameters:<br>
&nbsp;&nbsp;&nbsp;format<br>
&nbsp;&nbsp;&nbsp;format&nbsp;-&nbsp;see&nbsp;the&nbsp;outformats&nbsp;variable&nbsp;for&nbsp;a&nbsp;list&nbsp;of&nbsp;available<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;output&nbsp;formats<br>
&nbsp;&nbsp;&nbsp;filename<br>
&nbsp;<br>
Optional&nbsp;parameters:<br>
&nbsp;&nbsp;&nbsp;overwrite&nbsp;(default&nbsp;is&nbsp;False)&nbsp;--&nbsp;if&nbsp;the&nbsp;output&nbsp;file&nbsp;already&nbsp;exists,<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;should&nbsp;it&nbsp;be&nbsp;overwritten?<br>
&nbsp;&nbsp;&nbsp;overwrite&nbsp;--&nbsp;if&nbsp;the&nbsp;output&nbsp;file&nbsp;already&nbsp;exists,&nbsp;should&nbsp;it<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;be&nbsp;overwritten?&nbsp;(default&nbsp;is&nbsp;False)<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br>
Methods:<br>
&nbsp;&nbsp;&nbsp;<a href="#Outputfile-write">write</a>(molecule),&nbsp;<a href="#Outputfile-close">close</a>()<br>&nbsp;</tt></td></tr>
&nbsp;&nbsp;&nbsp;<a href="#Outputfile-write">write</a>(molecule)<br>
&nbsp;&nbsp;&nbsp;<a href="#Outputfile-close">close</a>()<br>&nbsp;</tt></td></tr>
<tr><td>&nbsp;</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&nbsp;parameters:<br>
&nbsp;&nbsp;&nbsp;molecule</tt></dd></dl>
<hr>
Data descriptors defined here:<br>
<dl><dt><strong>__dict__</strong></dt>
<dd><tt>dictionary&nbsp;for&nbsp;instance&nbsp;variables&nbsp;(if&nbsp;defined)</tt></dd>
</dl>
<dl><dt><strong>__weakref__</strong></dt>
<dd><tt>list&nbsp;of&nbsp;weak&nbsp;references&nbsp;to&nbsp;the&nbsp;object&nbsp;(if&nbsp;defined)</tt></dd>
</dl>
Data and other attributes defined here:<br>
<dl><dt><strong>__dict__</strong> = &lt;dictproxy object&gt;<dd><tt>dictionary&nbsp;for&nbsp;instance&nbsp;variables&nbsp;(if&nbsp;defined)</tt></dl>
<dl><dt><strong>__weakref__</strong> = &lt;attribute '__weakref__' of 'Outputfile' objects&gt;<dd><tt>list&nbsp;of&nbsp;weak&nbsp;references&nbsp;to&nbsp;the&nbsp;<a href="__builtin__.html#object">object</a>&nbsp;(if&nbsp;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&nbsp;parameters:<br>
&nbsp;&nbsp;&nbsp;molecule</tt></dd></dl>
<hr>
Data descriptors defined here:<br>
<dl><dt><strong>__dict__</strong></dt>
<dd><tt>dictionary&nbsp;for&nbsp;instance&nbsp;variables&nbsp;(if&nbsp;defined)</tt></dd>
</dl>
<dl><dt><strong>__weakref__</strong></dt>
<dd><tt>list&nbsp;of&nbsp;weak&nbsp;references&nbsp;to&nbsp;the&nbsp;object&nbsp;(if&nbsp;defined)</tt></dd>
</dl>
Data and other attributes defined here:<br>
<dl><dt><strong>__dict__</strong> = &lt;dictproxy object&gt;<dd><tt>dictionary&nbsp;for&nbsp;instance&nbsp;variables&nbsp;(if&nbsp;defined)</tt></dl>
<dl><dt><strong>__weakref__</strong> = &lt;attribute '__weakref__' of 'Smarts' objects&gt;<dd><tt>list&nbsp;of&nbsp;weak&nbsp;references&nbsp;to&nbsp;the&nbsp;<a href="__builtin__.html#object">object</a>&nbsp;(if&nbsp;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&nbsp;over&nbsp;the&nbsp;molecules&nbsp;in&nbsp;a&nbsp;file.<br>
&nbsp;<br>
Required&nbsp;parameters:<br>
&nbsp;&nbsp;&nbsp;format<br>
&nbsp;&nbsp;&nbsp;format&nbsp;-&nbsp;see&nbsp;the&nbsp;informats&nbsp;variable&nbsp;for&nbsp;a&nbsp;list&nbsp;of&nbsp;available<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;input&nbsp;formats<br>
&nbsp;&nbsp;&nbsp;filename<br>
&nbsp;<br>
You&nbsp;can&nbsp;access&nbsp;the&nbsp;first&nbsp;molecule&nbsp;in&nbsp;a&nbsp;file&nbsp;using:<br>
You&nbsp;can&nbsp;access&nbsp;the&nbsp;first&nbsp;molecule&nbsp;in&nbsp;a&nbsp;file&nbsp;using&nbsp;the&nbsp;next()&nbsp;method<br>
of&nbsp;the&nbsp;iterator:<br>
&nbsp;&nbsp;&nbsp;&nbsp;mol&nbsp;=&nbsp;<a href="#-readfile">readfile</a>("smi",&nbsp;"myfile.smi").next()<br>
&nbsp;&nbsp;&nbsp;&nbsp;<br>
You&nbsp;can&nbsp;make&nbsp;a&nbsp;list&nbsp;of&nbsp;the&nbsp;molecules&nbsp;in&nbsp;a&nbsp;file&nbsp;using:<br>
&nbsp;&nbsp;&nbsp;&nbsp;mols&nbsp;=&nbsp;[mol&nbsp;for&nbsp;mol&nbsp;in&nbsp;<a href="#-readfile">readfile</a>("smi",&nbsp;"myfile.smi")]<br>
&nbsp;&nbsp;&nbsp;&nbsp;mols&nbsp;=&nbsp;list(<a href="#-readfile">readfile</a>("smi",&nbsp;"myfile.smi"))<br>
&nbsp;&nbsp;&nbsp;&nbsp;<br>
You&nbsp;can&nbsp;iterate&nbsp;over&nbsp;the&nbsp;molecules&nbsp;in&nbsp;a&nbsp;file&nbsp;as&nbsp;shown&nbsp;in&nbsp;the<br>
following&nbsp;code&nbsp;snippet...<br>
&nbsp;<br>
following&nbsp;code&nbsp;snippet:<br>
&gt;&gt;&gt;&nbsp;atomtotal&nbsp;=&nbsp;0<br>
&gt;&gt;&gt;&nbsp;for&nbsp;mol&nbsp;in&nbsp;<a href="#-readfile">readfile</a>("sdf","head.sdf"):<br>
...&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;atomtotal&nbsp;+=&nbsp;len(mol.atoms)<br>
@@ -429,9 +553,11 @@ following&nbsp;code&nbsp;snippet...<br>
<dl><dt><a name="-readstring"><strong>readstring</strong></a>(format, string)</dt><dd><tt>Read&nbsp;in&nbsp;a&nbsp;molecule&nbsp;from&nbsp;a&nbsp;string.<br>
&nbsp;<br>
Required&nbsp;parameters:<br>
&nbsp;&nbsp;&nbsp;format<br>
&nbsp;&nbsp;&nbsp;format&nbsp;-&nbsp;see&nbsp;the&nbsp;informats&nbsp;variable&nbsp;for&nbsp;a&nbsp;list&nbsp;of&nbsp;available<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;input&nbsp;formats<br>
&nbsp;&nbsp;&nbsp;string<br>
&nbsp;<br>
Example:<br>
&gt;&gt;&gt;&nbsp;input&nbsp;=&nbsp;"C1=CC=CS1"<br>
&gt;&gt;&gt;&nbsp;mymol&nbsp;=&nbsp;<a href="#-readstring">readstring</a>("smi",input)<br>
&gt;&gt;&gt;&nbsp;len(mymol.atoms)<br>
@@ -444,9 +570,10 @@ Required&nbsp;parameters:<br>
<tr><td bgcolor="#55aa55"><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</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>

View File

@@ -1,6 +1,6 @@
#!/usr/bin/env python
from distutils.core import *
import os,sys
import os,sys,shutil
about = """The Open Babel package provides a Python wrapper
to the Open Babel C++ chemistry library. Open Babel is a chemical
@@ -66,6 +66,8 @@ obExtension = Extension('_openbabel',
libraries=['openbabel']
)
shutil.copyfile("pybel_py%d.x.py" % sys.version_info[0], "pybel.py")
setup(name='openbabel',
version='1.5',
author='Noel O\'Boyle',

View File

@@ -14,29 +14,22 @@ This code was automatically generated with SWIG and provides access to almost al
More details can also be found at the Open Babel website:
<http://openbabel.sourceforge.net/wiki/Ruby/>
INSTALLATION
=== INSTALLATION ===
To install this module globally, first install Open Babel. Then invoke the following commands:
$ ruby extconf.rb
To compile this module, run the following commands:
$ ruby extconf.rb --with-openbabel-include=../../include --with-openbabel-lib=../../src/.libs
$ make
# make install
To install this module locally in ~/tree, first install Open Babel. Then invoke the following commands:
If you wish to install the module locally, set the environment variable DESTDIR to an appropriate location. To install the module, use the following command (as root, if installing globally):
$ ruby extconf.rb
(use the option --with-openbabel-dir=~/tree
if OpenBabel was installed locally)
$ make
$ export DESTDIR=~/tree
$ make install
=== USE ===
If OpenBabel is installed locally, then set LD_LIBRARY_PATH to the directory containing libopenbabel.so. If the OpenBabel Ruby module is installed locally in $tree, then set RUBYLIB using a command similar to the following:
$ export RUBYLIB=~/tree/usr/local/lib/site_ruby/1.8/i486-linux/
USE
If OpenBabel is installed locally, then set LD_LIBRARY_PATH to the directory containing libopenbabel.so.
The module can be easily tested from irb (interactive ruby):
$ irb
@@ -61,7 +54,7 @@ OpenBabel::OBResidueIndex::_7MG -> OpenBabel::OBResidueIndex::U7MG
OpenBabel::OBResidueIndex::_5MU -> OpenBabel::OBResidueIndex::U5MU
OpenBabel::OBResidueIndex::_5MC -> OpenBabel::OBResidueIndex::U5MC
USING SWIG TO GENERATE THE WRAPPER C++ CODE
=== USING SWIG TO GENERATE THE WRAPPER C++ CODE ===
Given the "openbabel-ruby.i" interface file (contained in this directory's
parent directory), wrapper code can be generated with SWIG. From the directory
@@ -82,7 +75,7 @@ Open Babel makefiles. Make sure you run ./configure with the
--enable-maintainer-mode flag when building Open Babel to enable rebuilding
these scripting interfaces.
COPYRIGHT AND LICENSE
=== COPYRIGHT AND LICENSE ===
Copyright (C) 2007 Geoffrey R. Hutchison <babel@geoffhutchison.net>
and Richard L. Apodaca <rich_apodaca@yahoo.com>