[Open Babel] isotopes in graphic formats

2017-06-29 Thread chubukov
I don't see any option to display the presence of specific isotopes when creating graphics from openbabel (i.e. converting to PNG or SVG). For instance, glucose and 13C6-glucose give me the same PNG image. Is this capability not available or am I missing something simple? Thanks. -- View this

Re: [Open Babel] isotopes

2013-11-18 Thread Dimitri Maziuk
On 11/18/2013 03:20 PM, Dimitri Maziuk wrote: > On 11/18/2013 03:07 PM, Geoffrey Hutchison wrote: >>> In the meantime, here's the patch -- feel free to rename "Prevalent" if >> >> I think my big question is why you do the loop in the > GetPrevalentIsotope() method? Why not just round the mass to an

Re: [Open Babel] isotopes

2013-11-18 Thread Dimitri Maziuk
On 11/18/2013 03:07 PM, Geoffrey Hutchison wrote: >> In the meantime, here's the patch -- feel free to rename "Prevalent" if > > I think my big question is why you do the loop in the GetPrevalentIsotope() method? Why not just round the mass to an integer? There should be no perceptible difference

Re: [Open Babel] isotopes

2013-11-18 Thread Geoffrey Hutchison
> In the meantime, here's the patch -- feel free to rename "Prevalent" if I think my big question is why you do the loop in the GetPrevalentIsotope() method? Why not just round the mass to an integer? I mean, if it's Uranium 235, it's within 0.5 amu of 235.0. -Geoff --

Re: [Open Babel] isotopes

2013-11-18 Thread Dimitri Maziuk
On 11/18/2013 01:32 PM, Geoffrey Hutchison wrote: >> make an isotope/mass vector a member of OBElement instead of its "mass >> Atomic mass (in amu)", but that's just me.) > > The problem is that the full isotope table is fairly huge and rarely used. Checking memory use, I see that in my programs,

Re: [Open Babel] isotopes

2013-11-18 Thread Geoffrey Hutchison
> make an isotope/mass vector a member of OBElement instead of its "mass > Atomic mass (in amu)", but that's just me.) The problem is that the full isotope table is fairly huge and rarely used. Checking memory use, I see that in my programs, it's usually never even initialized, while the element

Re: [Open Babel] isotopes

2013-11-14 Thread Dimitri Maziuk
On 11/14/2013 09:54 AM, Dimitri Maziuk wrote: > Yeah well. I saw that OBIsotopeTable looks like there must be one per > element and I saw one "isotab" extern global and grep didn't show when > or where it's initialized. Those things put together didn't make sense. And now that I looked again w

Re: [Open Babel] isotopes

2013-11-14 Thread Dimitri Maziuk
On 2013-11-14 06:43, David Hall wrote: > I'm unsure why you make comments saying that you doubt isotope.txt is > not where information about isotopes lives for openbabel. I was confused by 31.9988 and the fact that setting carbon isotope to 7 didn't throw an (e.g.) ArrayOutOfBounds. I then reali

Re: [Open Babel] isotopes

2013-11-14 Thread David Hall
It seems you want a list of the isotopes for a particular element? Looking at the C++ code for openbabel, it seems like this might be easy to expose, but for now, if you have a guess about the range of the function you can get something in python fairly quickly: In [1]: import openbabel In [2]: f

Re: [Open Babel] isotopes

2013-11-13 Thread Dimitri Maziuk
PS. just to make sure I'm not reading some stale garbage from the heap: >>> for i in (9, 8, 7, 6, 5, 4) : ... mol = pybel.readstring("smi","C(=O)=O") ... mol.OBMol.BeginModify() ... for atom in mol.atoms : ... if atom.OBAtom.IsCarbon() : atom.OBAtom.SetIsotope( i ) ...

Re: [Open Babel] isotopes

2013-11-13 Thread Dimitri Maziuk
On 11/13/2013 05:08 PM, Geoffrey Hutchison wrote: ... I mean, do you want > something which says carbon-11 is basically nonexistent? If so, no you > can't use Open Babel for that since we don't store or tabulate the > abundance of isotopes, only the isotopic masses and the mass for the most > comm

Re: [Open Babel] isotopes

2013-11-13 Thread Geoffrey Hutchison
I'm really not sure I understand your use case. I interpreted your question as "I want to use the OBIsotopeTable to find the integer associated with the most common isotope". In code, that shows up something like: int atomicNum = 6; // carbon double exactMass = isotab.GetExactMass(atomicNum); int

Re: [Open Babel] isotopes

2013-11-13 Thread Dimitri Maziuk
On 11/13/2013 04:34 PM, Geoffrey Hutchison wrote: > I'm not sure what you want. You want to know that the most common isotope > (0) is, in fact, carbon 13 or something? I mean, you can round the exact > mass and this will give you the isotope. I can't think of a > counter-example. Can you? No, but

Re: [Open Babel] isotopes

2013-11-13 Thread Geoffrey Hutchison
I'm not sure what you want. You want to know that the most common isotope (0) is, in fact, carbon 13 or something? I mean, you can round the exact mass and this will give you the isotope. I can't think of a counter-example. Can you? -Geoff On Wed, Nov 13, 2013 at 4:42 PM, Dimitri Maziuk wrote:

[Open Babel] isotopes

2013-11-13 Thread Dimitri Maziuk
Hi all, is there a way to find the number of "isotope 0"? I'm not seeing anything suitable in isotope table. TIA -- Dimitri Maziuk Programmer/sysadmin BioMagResBank, UW-Madison -- http://www.bmrb.wisc.edu signature.asc Description: OpenPGP digital signature ---