fillUC strict option in python bindings

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

fillUC strict option in python bindings

Jon Paul Janet
Hello,

I am trying to convert a .cif file to a xyz of the unit cell, using the openbabel python bindings. The working CLI that I am trying to implement is:

obabel source.cif  -O output.xyz --fillUC strict

I need to add the "--fillUC strict" option to the conversion in Python (2.7.6) . Something like:

import openbabel
obConversion = openbabel.OBConversion()
obConversion.SetInAndOutFormats("cif", "xyz")
obConversion.AddOption("fillUC",openbabel.OBConversion.GENOPTIONS,"strict")
mol = openbabel.OBMol()
obConversion.ReadFile(mol, "source.cif")
obConversion.WriteFile(mol, 'output.xyz')

This produces the same output I would get from the CLI call without the "--fillUC strict" option (it seems to be ignoring this). I don't really know if I am invoking the AddOption syntax correctly - I have tried various mutations of the above syntax without success. Any help would be greatly appreciated!

Best,
JP







------------------------------------------------------------------------------
Mobile security can be enabling, not merely restricting. Employees who
bring their own devices (BYOD) to work are irked by the imposition of MDM
restrictions. Mobile Device Manager Plus allows you to control only the
apps on BYO-devices by containerizing them, leaving personal data untouched!
https://ad.doubleclick.net/ddm/clk/304595813;131938128;j
_______________________________________________
OpenBabel-discuss mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/openbabel-discuss
Reply | Threaded
Open this post in threaded view
|

Re: fillUC strict option in python bindings

Noel O'Boyle
Administrator

filluc is an operation. See pybel.ops and usage of gen3d.

On 19 May 2016 4:04 p.m., "Jon Paul Janet" <[hidden email]> wrote:
Hello,

I am trying to convert a .cif file to a xyz of the unit cell, using the openbabel python bindings. The working CLI that I am trying to implement is:

obabel source.cif  -O output.xyz --fillUC strict

I need to add the "--fillUC strict" option to the conversion in Python (2.7.6) . Something like:

import openbabel
obConversion = openbabel.OBConversion()
obConversion.SetInAndOutFormats("cif", "xyz")
obConversion.AddOption("fillUC",openbabel.OBConversion.GENOPTIONS,"strict")
mol = openbabel.OBMol()
obConversion.ReadFile(mol, "source.cif")
obConversion.WriteFile(mol, 'output.xyz')

This produces the same output I would get from the CLI call without the "--fillUC strict" option (it seems to be ignoring this). I don't really know if I am invoking the AddOption syntax correctly - I have tried various mutations of the above syntax without success. Any help would be greatly appreciated!

Best,
JP







------------------------------------------------------------------------------
Mobile security can be enabling, not merely restricting. Employees who
bring their own devices (BYOD) to work are irked by the imposition of MDM
restrictions. Mobile Device Manager Plus allows you to control only the
apps on BYO-devices by containerizing them, leaving personal data untouched!
https://ad.doubleclick.net/ddm/clk/304595813;131938128;j
_______________________________________________
OpenBabel-discuss mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/openbabel-discuss


------------------------------------------------------------------------------
Mobile security can be enabling, not merely restricting. Employees who
bring their own devices (BYOD) to work are irked by the imposition of MDM
restrictions. Mobile Device Manager Plus allows you to control only the
apps on BYO-devices by containerizing them, leaving personal data untouched!
https://ad.doubleclick.net/ddm/clk/304595813;131938128;j
_______________________________________________
OpenBabel-discuss mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/openbabel-discuss
Reply | Threaded
Open this post in threaded view
|

Re: fillUC strict option in python bindings

Geoff Hutchison
In reply to this post by Jon Paul Janet
I believe you want something of this sort (untested):

fillUC = openbabel.OBOp.FindType("fillUC")
fillUC.Do(myOBMol, "strict")

---
Prof. Geoffrey Hutchison
Department of Chemistry
University of Pittsburgh
tel: (412) 648-0492
email: [hidden email]
web: http://hutchison.chem.pitt.edu/

> On May 19, 2016, at 11:03 AM, Jon Paul Janet <[hidden email]> wrote:
>
> Hello,
>
> I am trying to convert a .cif file to a xyz of the unit cell, using the openbabel python bindings. The working CLI that I am trying to implement is:
>
> obabel source.cif  -O output.xyz --fillUC strict
>
> I need to add the "--fillUC strict" option to the conversion in Python (2.7.6) . Something like:
>
> import openbabel
> obConversion = openbabel.OBConversion()
> obConversion.SetInAndOutFormats("cif", "xyz")
> obConversion.AddOption("fillUC",openbabel.OBConversion.GENOPTIONS,"strict")
> mol = openbabel.OBMol()
> obConversion.ReadFile(mol, "source.cif")
> obConversion.WriteFile(mol, 'output.xyz')
>
> This produces the same output I would get from the CLI call without the "--fillUC strict" option (it seems to be ignoring this). I don't really know if I am invoking the AddOption syntax correctly - I have tried various mutations of the above syntax without success. Any help would be greatly appreciated!
>
> Best,
> JP
>
>
>
>
>
>
> ------------------------------------------------------------------------------
> Mobile security can be enabling, not merely restricting. Employees who
> bring their own devices (BYOD) to work are irked by the imposition of MDM
> restrictions. Mobile Device Manager Plus allows you to control only the
> apps on BYO-devices by containerizing them, leaving personal data untouched!
> https://ad.doubleclick.net/ddm/clk/304595813;131938128;j_______________________________________________
> OpenBabel-discuss mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/openbabel-discuss


------------------------------------------------------------------------------
Mobile security can be enabling, not merely restricting. Employees who
bring their own devices (BYOD) to work are irked by the imposition of MDM
restrictions. Mobile Device Manager Plus allows you to control only the
apps on BYO-devices by containerizing them, leaving personal data untouched!
https://ad.doubleclick.net/ddm/clk/304595813;131938128;j
_______________________________________________
OpenBabel-discuss mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/openbabel-discuss
Reply | Threaded
Open this post in threaded view
|

Re: fillUC strict option in python bindings

Jon Paul Janet
Thank you so much - that worked like a charm.

Best regards,
JP
________________________________________
From: Geoffrey Hutchison [[hidden email]]
Sent: Thursday, May 19, 2016 3:26 PM
To: Jon Paul Janet
Cc: [hidden email]
Subject: Re: [Open Babel] fillUC strict option in python bindings

I believe you want something of this sort (untested):

fillUC = openbabel.OBOp.FindType("fillUC")
fillUC.Do(myOBMol, "strict")

---
Prof. Geoffrey Hutchison
Department of Chemistry
University of Pittsburgh
tel: (412) 648-0492
email: [hidden email]
web: http://hutchison.chem.pitt.edu/

> On May 19, 2016, at 11:03 AM, Jon Paul Janet <[hidden email]> wrote:
>
> Hello,
>
> I am trying to convert a .cif file to a xyz of the unit cell, using the openbabel python bindings. The working CLI that I am trying to implement is:
>
> obabel source.cif  -O output.xyz --fillUC strict
>
> I need to add the "--fillUC strict" option to the conversion in Python (2.7.6) . Something like:
>
> import openbabel
> obConversion = openbabel.OBConversion()
> obConversion.SetInAndOutFormats("cif", "xyz")
> obConversion.AddOption("fillUC",openbabel.OBConversion.GENOPTIONS,"strict")
> mol = openbabel.OBMol()
> obConversion.ReadFile(mol, "source.cif")
> obConversion.WriteFile(mol, 'output.xyz')
>
> This produces the same output I would get from the CLI call without the "--fillUC strict" option (it seems to be ignoring this). I don't really know if I am invoking the AddOption syntax correctly - I have tried various mutations of the above syntax without success. Any help would be greatly appreciated!
>
> Best,
> JP
>
>
>
>
>
>
> ------------------------------------------------------------------------------
> Mobile security can be enabling, not merely restricting. Employees who
> bring their own devices (BYOD) to work are irked by the imposition of MDM
> restrictions. Mobile Device Manager Plus allows you to control only the
> apps on BYO-devices by containerizing them, leaving personal data untouched!
> https://ad.doubleclick.net/ddm/clk/304595813;131938128;j_______________________________________________
> OpenBabel-discuss mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/openbabel-discuss


------------------------------------------------------------------------------
Mobile security can be enabling, not merely restricting. Employees who
bring their own devices (BYOD) to work are irked by the imposition of MDM
restrictions. Mobile Device Manager Plus allows you to control only the
apps on BYO-devices by containerizing them, leaving personal data untouched!
https://ad.doubleclick.net/ddm/clk/304595813;131938128;j
_______________________________________________
OpenBabel-discuss mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/openbabel-discuss