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: geo...@pitt.edu
web: http://hutchison.chem.pitt.edu/

> On May 19, 2016, at 11:03 AM, Jon Paul Janet <jpja...@mit.edu> 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
> OpenBabel-discuss@lists.sourceforge.net
> 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
OpenBabel-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openbabel-discuss

Reply via email to