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: 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 <santi...@mestrelab.com>
wrote:

> Thanks for your answer, Ling Chan.
> But I am already using that option with the C++ API.
>
> Regards
> Santiago
>
> <http://www.mestrelab.com>
>
> SANTIAGO FRAGA
> *Software Developer*
> santi...@mestrelab.com <+santi...@mestrelab.com>
>
> *MESTRELAB RESEARCH S.L.*
> PHONE *+34881976775*
> FAX *+34981941079*
> Feliciano Barrera, 9B-Bajo 15706
> Santiago de Compostela (SPAIN)
>
> Follow us:
> [image: Mestrelab Twitter] <https://twitter.com/mestrelab>  [image:
> Mestrelab Linkedin] <https://www.linkedin.com/company/mestrelab-research>
>  [image: Canal de YouTube Mestrelab]
> <https://www.youtube.com/channel/UCf3MVnd3XZflv0acvTv14ww>  [image:
> MestreBlog] <http://mestrelab.com/blog/>
>
>
>
> ------------------------------
> *De:* Ling Chan <lingtrek...@gmail.com>
> *Enviado:* martes, 2 de mayo de 2023 4:15
> *Para:* Santiago Fraga <santi...@mestrelab.com>
> *Cc:* RDKit Discuss <rdkit-discuss@lists.sourceforge.net>
> *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 <santi...@mestrelab.com> 於 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
> Rdkit-discuss@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/rdkit-discuss
>
> _______________________________________________
> Rdkit-discuss mailing list
> Rdkit-discuss@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/rdkit-discuss
>
_______________________________________________
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss

Reply via email to