Re: [Open Babel] python api question

2013-06-05 Thread Dimitri Maziuk
On 06/05/2013 03:01 PM, Noel O'Boyle wrote: > Sorry - I misunderstood. atom.isotope is already there; just the > ability to set it is not... I'm setting it to get the weight of C13 and/or N15-labelled molecule. I'm not sure why we record those in our DB -- they're easy to calculate if anyone needs

Re: [Open Babel] python api question

2013-06-05 Thread Noel O'Boyle
Sorry - I misunderstood. atom.isotope is already there; just the ability to set it is not... On 5 June 2013 20:48, Noel O'Boyle wrote: > 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

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

Re: [Open Babel] python api question

2013-06-05 Thread Geoffrey Hutchison
> While you're at it & if you feel like it, things like > atom.isotope = property( OBAtom.GetIsotope(), OBAtom.SetIsotope() ) > (not to be taken literally, obviously ;) would be more "pythonic", too. Well, if you or others have suggestions, I can try hacking those too. If you're willing to rebuil

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?)

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 Maciek Wójcikowski
Yes. etab = ob.OBElementTable() etab.GetSymbol(6) Pozdrawiam, | Best regards, Maciek Wójcikowski mac...@wojcikowski.pl 2013/6/5 Dimitri Maziuk > On 2013-06-05 02:54, Maciek Wójcikowski wrote: > > If you realy need symbol of an element in automated fassion, then there > > is OBElementTab

Re: [Open Babel] python api question

2013-06-05 Thread Dimitri Maziuk
On 2013-06-05 02:54, Maciek Wójcikowski wrote: > 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 So it's ex

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 mac...@woj

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 > Hi all, > > I'm after the atom (element) type letter. What I ge

[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