Good morning Wim
Yes, I know that the original smiles has problems with the dative bonds.
I am trying to load the molecule and then fix those bonds using this
solution:
https://gist.github.com/greglandrum/6cd7aadcdedb1ebcafa9537e8a47e3a4
And then generate a new molfile. I will try to apply your code to see if
I can improve the molecule
depiction.
Regards
Santiago
[http://www.mestrelab.com/mestrelab/wp-content/uploads/signs/line3.jpg]
[http://www.mestrelab.com/mestrelab/wp-content/uploads/signs/M-red-200pxb.jpg]<http://www.mestrelab.com>
SANTIAGO FRAGA
Software Developer
[email protected]<mailto:%[email protected]>
MESTRELAB RESEARCH S.L.
PHONE +34881976775
FAX +34981941079
Feliciano Barrera, 9B-Bajo 15706
Santiago de Compostela (SPAIN)
Follow us:
[Mestrelab Twitter]<https://twitter.com/mestrelab> [Mestrelab Linkedin]
<https://www.linkedin.com/company/mestrelab-research> [Canal de YouTube
Mestrelab] <https://www.youtube.com/channel/UCf3MVnd3XZflv0acvTv14ww>
[MestreBlog] <http://mestrelab.com/blog/>
________________________________
De: Wim Dehaen <[email protected]>
Enviado: martes, 2 de mayo de 2023 21:37
Para: Santiago Fraga <[email protected]>
Cc: Ling Chan <[email protected]>; RDKit Discuss
<[email protected]>
Asunto: Re: [Rdkit-discuss] Molfile from smiles
Hi all,
unfortunately I can't offer a "fix" but I can offer these minor comments:
-it seems like the SMILES has some parsing error. You can make uses of RDKits
extension for dative bonds in SMILES ("->") and replace the SMILES with the
below, which will parse, and give (what i assume is) the intended structure:
"C1=CC2=[N](C=C1)->[Ir]134(C5=CC=CC=C25)C2=CC=CC=C2C2=[N]->1C=CC=C2.C1=CC(C2=CC=CC=C32)=[N]->4C=C1"
-more fundamentally, i think the reason this molecule is hard to render is
because, as a hexavalent iridium complex it is more fundamentally 3-dimensional
and therefore tougher to sketch. you can see here on wikipedia Ir(ppy)3 even
when manually sketched looks a bit funny:
https://upload.wikimedia.org/wikipedia/commons/c/c8/Ir%28ppy%29_Schematic.png
-in general, organometallic species have various limitations when it comes to
their handling by cheminformatics packages. for this reason, some care is
needed when dealing with species like this to make sure you won't have issues
down the line. an overview of some rdkit related ones see this presentation by
prof jan jensen:
https://raw.githubusercontent.com/rdkit/UGM_2020/master/Presentations/JanJensen.pdf
Finally, if i embed the molecule and then display its 2D projection, it
actually looks pretty good (despite a warning UFF doesnt recognize iridium).
See below:
[image.png]
This was generated using the following codeblock (in Python, not C++, sorry for
that):
mol =
Chem.MolFromSmiles("C1=CC2=[N](C=C1)->[Ir]134(C5=CC=CC=C25)C2=CC=CC=C2C2=[N]->1C=CC=C2.C1=CC(C2=CC=CC=C32)=[N]->4C=C1",sanitize=True)
mol = Chem.AddHs(mol)
AllChem.EmbedMolecule(mol,randomSeed=0xf00d)
mol = Chem.RemoveHs(mol)
display(mol)
best wishes
wim
On Tue, May 2, 2023 at 5:06 PM Santiago Fraga
<[email protected]<mailto:[email protected]>> wrote:
Thanks for your answer, Ling Chan.
But I am already using that option with the C++ API.
Regards
Santiago
[http://www.mestrelab.com/mestrelab/wp-content/uploads/signs/line3.jpg]
[http://www.mestrelab.com/mestrelab/wp-content/uploads/signs/M-red-200pxb.jpg]<http://www.mestrelab.com>
SANTIAGO FRAGA
Software Developer
[email protected]<mailto:[email protected]>
MESTRELAB RESEARCH S.L.
PHONE +34881976775
FAX +34981941079
Feliciano Barrera, 9B-Bajo 15706
Santiago de Compostela (SPAIN)
Follow us:
[Mestrelab Twitter]<https://twitter.com/mestrelab> [Mestrelab Linkedin]
<https://www.linkedin.com/company/mestrelab-research> [Canal de YouTube
Mestrelab] <https://www.youtube.com/channel/UCf3MVnd3XZflv0acvTv14ww>
[MestreBlog] <http://mestrelab.com/blog/>
________________________________
De: Ling Chan <[email protected]<mailto:[email protected]>>
Enviado: martes, 2 de mayo de 2023 4:15
Para: Santiago Fraga <[email protected]<mailto:[email protected]>>
Cc: RDKit Discuss
<[email protected]<mailto:[email protected]>>
Asunto: Re: [Rdkit-discuss] Molfile from smiles
Hello Santiago,
In case you are still looking for an answer, somewhere in my notes I wrote the
following.
to get a better depiction of complicated topology, do this before rendering.
from rdkit.Chem import rdDepictor
rdDepictor.SetPreferCoordGen(True)
Sometimes it helps. Good luck.
Ling
Santiago Fraga <[email protected]<mailto:[email protected]>> 於
2023年4月21日週五 上午2:17寫道:
Good morning
I am trying to generate a molfile from smiles, using the RDKit C++
implementation.
But in some cases the result molfile is like the one in the attached
image.
My code is something like this:
string molecule =
"C1=CC2=[N](C=C1)[Ir]134(C5=CC=CC=C25)C2=CC=CC=C2C2=[N]1C=CC=C2.C1=CC(C2=CC=CC=C32)=[N]4C=C1";
RDKit::ROMol* mol = RDKit::SmilesToMol(molecule, 0, false, nullptr);
mol->updatePropertyCache(false);
RDDepict::preferCoordGen = true;
RDDepict::compute2DCoords(*mol);
string molfile = RDKit::MolToMolBlock(*mol, true, -1, false, true)
How could I fix the molfile?
Regards
Santiago
_______________________________________________
Rdkit-discuss mailing list
[email protected]<mailto:[email protected]>
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss
_______________________________________________
Rdkit-discuss mailing list
[email protected]<mailto:[email protected]>
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss
_______________________________________________
Rdkit-discuss mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss