Dear Santiago,
Using D and T symbols for deuterium and tritium in MDL molfiles is outside the file format specification. Nonetheless, RDKit correctly parses those non-standard D and T symbols when reading an MDL molfile that contains them, as you can verify yourself through a simple test and also looking at the source code:
However, when writing the molfile, RDKit will write it according to specifications, i.e. using the H symbol and adding a “M ISO” entry. Any MDL molfile parser should be able to correctly parse such a file. ChemDraw will even automatically label the atoms as D and T, while MarvinJS will add the “2” and “3” superscript prefixes.
To me, it seems a bit overkill to add a flag to preserve non-standard features in MDL molfile writing. Why would you be interested in doing that?
Cheers, p. On 11 Apr 2023, at 11:50, Santiago Fraga <santi...@mestrelab.com> wrote:
Many thanks for your examples, Wim.
But I was checking the option to save the labels D and T in the molfile for the hydrogen isotopes,
as other tools can do.
Regards
Santiago
![]() |
SANTIAGO FRAGA
Software Developer
santi...@mestrelab.com
|
MESTRELAB RESEARCH S.L.
PHONE +34881976775
FAX +34981941079
Feliciano Barrera, 9B-Bajo 15706
Santiago de Compostela (SPAIN)
|
Follow us:
![MestreBlog]()
|
De: Wim Dehaen <wimdeh...@gmail.com>
Enviado: lunes, 10 de abril de 2023 18:07
Para: Santiago Fraga <santi...@mestrelab.com>
Cc: rdkit-discuss@lists.sourceforge.net <rdkit-discuss@lists.sourceforge.net>
Asunto: Re: [Rdkit-discuss] Deuterium/Tritium labels in Molfile
rdkit outputs a molfile with correct isotope labels for me using just:
mol=Chem.MolFromSmiles("[3H]c1ccccc1[2H]")
Chem.MolToMolFile(mol,"test.mol")
or labelling the atoms post hoc:
mol=Chem.MolFromSmiles("c1ccccc1")
mol=Chem.AddHs(mol)
mol.GetAtomWithIdx(6).SetIsotope(3)
mol.GetAtomWithIdx(7).SetIsotope(2)
mol=Chem.RemoveHs(mol)
Chem.MolToMolFile(mol,"test2.mol")
I hope this helps
Good afternoon!
I am a relatively new user of RDKit, and mainly the C++ API.
I am trying to save in a molfile the labels D and T for the hydrogen isotopes.
Like in the following molfile:
MJ230401
8 8 0 0 0 0 0 0 0 0999 V2000
-0.3572 0.4125 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
-1.0716 0.0000 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
-1.0716 -0.8250 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
-0.3572 -1.2375 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
0.3572 -0.8250 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
0.3572 0.0000 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
-0.3572 1.2375 0.0000 T 0 0 0 0 0 0 0 0 0 0 0 0
1.0717 0.4125 0.0000 D 0 0 0 0 0 0 0 0 0 0 0 0
3 4 2 0 0 0 0
4 5 1 0 0 0 0
5 6 2 0 0 0 0
6 1 1 0 0 0 0
1 2 2 0 0 0 0
2 3 1 0 0 0 0
6 8 1 0 0 0 0
1 7 1 0 0 0 0
M END
I am trying to set directly the labels in the hydrogen atoms:
atom->setProp<string>("atomLabel", "D");
or
atom->setProp<string>("_displayLabel", "D");
But when the molfile is generated the labels are not transferred.
It seems also that when reading a mofile including the labels, they are discarded.
Many thanks in advance
Santiago Fraga
_______________________________________________
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss
_______________________________________________Rdkit-discuss mailing listRdkit-discuss@lists.sourceforge.nethttps://lists.sourceforge.net/lists/listinfo/rdkit-discuss
|
_______________________________________________
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss