|
From: Tim V. <tim...@gm...> - 2008-10-04 19:20:17
|
Hi Rajarshi,
Here is a small example:
import pybel
import openbabel
ff = openbabel.OBForceField.FindType("MMFF94") # <--------
if not ff:
print "Error: force field not found"
exit()
mol = pybel.readstring("smi", "CCC")
ff.SetLogToStdOut()
ff.SetLogLevel(2)
if not ff.Setup(mol.OBMol):
print "Error: could not setup force field"
exit()
The FindType function returns an instance of the force field.
Tim
On Mon, Sep 29, 2008 at 4:40 PM, Rajarshi Guha <rg...@in...> wrote:
> Hi, I'm using the openbabel Python module to get at the OBForceField
> stuff.
>
> However, if I do:
>
> ff = OBForceField()
>
> it says that there is no constructor defined. However looking at the
> Pybel sources I thought that something on the lines of
>
> ff = OBForceField( OBForceField.FindType('MMFF94')
>
> would work. But now it says the constructor will take exactly 1
> argument.
>
> I'm a little confused as to how one should use the force field
> methods from Python and any pointers would be appreciated.
>
> -------------------------------------------------------------------
> Rajarshi Guha <rg...@in...>
> GPG Fingerprint: D070 5427 CC5B 7938 929C DD13 66A1 922C 51E7 9E84
> -------------------------------------------------------------------
> Gods are fragile things; they may be killed by a whiff of
> science or a dose of common sense.
> -- Chapman Cohen
>
>
>
> -------------------------------------------------------------------------
> This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
> Build the coolest Linux based applications with Moblin SDK & win great prizes
> Grand prize is a trip for two to an Open Source event anywhere in the world
> http://moblin-contest.org/redirect.php?banner_id=100&url=/
> _______________________________________________
> OpenBabel-discuss mailing list
> Ope...@li...
> https://lists.sourceforge.net/lists/listinfo/openbabel-discuss
>
|