The isotope property is read and the mass of the atom is adjusted:
[3]>>> m = Chem.MolFromMolFile('iso.mol')

[4]>>> m.GetAtomWithIdx(0).GetMass()
Out[4] 13.0

There's not currently a way to find out directly if the isotope of an
atom has been set; I hope to have this fixed for the next release, but
I'm not yet sure that's going to happen.

As an FYI, when the RDKit generates mol blocks, it currently puts the
isotope information in the atom line, not in an M  ISO line:

[5]>>> print Chem.MolToMolBlock(m)
-----> print(Chem.MolToMolBlock(m))
Benzene-13C1
     RDKit          2D

  6  6  0  0  0  0  0  0  0  0999 V2000
    0.0000    0.8250    0.0000 C   1  0  0  0  0  0  0  0  0  0  0  0
   -0.7145    0.4125    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0
   -0.7145   -0.4125    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0
    0.0000   -0.8250    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0
    0.7145   -0.4125    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0
    0.7145    0.4125    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0
  1  2  2  0
  6  1  1  0
  2  3  1  0
  3  4  2  0
  4  5  1  0
  5  6  2  0
M  END

I will definitely get this updated for the next release.

-greg


On Wed, Jun 15, 2011 at 12:07 AM, Donald Keidel <[email protected]> wrote:
> Hi,
>
> I am reading an sd file that has an M ISO line (carbon 13 isotope).
> Here is the sd file:
>
> Benzene-13C1
>   OpenBabl03260920282D
>
>   6  6  0  0  0  0  0  0  0  0999 V2000
>     0.0000    0.8250    0.0000 C   0  0  0  0  0
>    -0.7145    0.4125    0.0000 C   0  0  0  0  0
>    -0.7145   -0.4125    0.0000 C   0  0  0  0  0
>     0.0000   -0.8250    0.0000 C   0  0  0  0  0
>     0.7145   -0.4125    0.0000 C   0  0  0  0  0
>     0.7145    0.4125    0.0000 C   0  0  0  0  0
>   1  2  2  0  0  0
>   6  1  1  0  0  0
>   2  3  1  0  0  0
>   3  4  2  0  0  0
>   4  5  1  0  0  0
>   5  6  2  0  0  0
> M  ISO  1   1  13
> M  END
>
> I then try to display the properties of atom 1 (0 in RDKit since zero
> based lists) and this is what I see:
>
> I read the mol
> .
> .
> .
> .
>  >>> mol
> <rdkit.Chem.rdchem.Mol object at 0x1d21a60>
>  >>> atom = mol.GetAtoms()[0]
>  >>> prop = atom.GetPropNames()[0]
> Traceback (most recent call last):
>   File "<stdin>", line 1, in <module>
> IndexError: Index out of range
>
>
> Isnt the ISO property supposed to be read as a property of the atom?  Am
> I doing something wrong or interpreting something incorrectly?
>
> Thank you in advance for any help.
>
> Don
>
>
> ------------------------------------------------------------------------------
> EditLive Enterprise is the world's most technically advanced content
> authoring tool. Experience the power of Track Changes, Inline Image
> Editing and ensure content is compliant with Accessibility Checking.
> http://p.sf.net/sfu/ephox-dev2dev
> _______________________________________________
> Rdkit-discuss mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/rdkit-discuss
>

------------------------------------------------------------------------------
EditLive Enterprise is the world's most technically advanced content
authoring tool. Experience the power of Track Changes, Inline Image
Editing and ensure content is compliant with Accessibility Checking.
http://p.sf.net/sfu/ephox-dev2dev
_______________________________________________
Rdkit-discuss mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss

Reply via email to