Re: [Open Babel] python api question

2013-06-05 Thread Maciek Wójcikowski
Hello, Sure - try atom.atomicnum (pybel) or OBAtom.GetAtomicNum() (openbabel). It returns atomic number of element (fe. C - 6). Pozdrawiam, | Best regards, Maciek Wójcikowski mac...@wojcikowski.pl 2013/6/5 Dimitri Maziuk dmaz...@bmrb.wisc.edu Hi all, I'm after the atom (element)

Re: [Open Babel] python api question

2013-06-05 Thread Maciek Wójcikowski
If you realy need symbol of an element in automated fassion, then there is OBElementTable.GetSymbol( atomicnum ) that you can use. http://openbabel.org/dev-api/classOpenBabel_1_1OBElementTable.shtml#a18907ad1590deb926b43c4f08cac9405 Pozdrawiam, | Best regards, Maciek Wójcikowski

Re: [Open Babel] python api question

2013-06-05 Thread Maciek Wójcikowski
Yes. etab = ob.OBElementTable() etab.GetSymbol(6) Pozdrawiam, | Best regards, Maciek Wójcikowski mac...@wojcikowski.pl 2013/6/5 Dimitri Maziuk dmaz...@bmrb.wisc.edu On 2013-06-05 02:54, Maciek Wójcikowski wrote: If you realy need symbol of an element in automated fassion, then there

Re: [Open Babel] python api question

2013-06-05 Thread Geoffrey Hutchison
etab = ob.OBElementTable() etab.GetSymbol(6) Although I can see some benefit for Pybel to have a wrapper to handle something like atom.element and hide all this in something more Pythonic. (Noel, would you let me try doing this?) -Geoff

Re: [Open Babel] python api question

2013-06-05 Thread Dimitri Maziuk
On 06/05/2013 10:48 AM, Geoffrey Hutchison wrote: etab = ob.OBElementTable() etab.GetSymbol(6) Although I can see some benefit for Pybel to have a wrapper to handle something like atom.element and hide all this in something more Pythonic. (Noel, would you let me try doing this?) While

Re: [Open Babel] python api question

2013-06-05 Thread Noel O'Boyle
Sounds good Geoff. Regarding atom.isotope and others, just to note that Pybel is not intended to wrap all of Open Babel's functionality but just the most common (although it also wraps stuff that is awkward to use otherwise, e.g. unitcell). A small API makes it easy to use. Where to draw the line

[Open Babel] python api question

2013-06-04 Thread Dimitri Maziuk
Hi all, I'm after the atom (element) type letter. What I get from pybel's atom.type or atom.OBAtom.GetType() are O3, O2, C3, C2, etc. Is there a function or property that returns just O's and C's? TIA, -- Dimitri Maziuk Programmer/sysadmin BioMagResBank, UW-Madison -- http://www.bmrb.wisc.edu