Re: [Rdkit-discuss] Bond tags in SVGs

2018-12-04 Thread Lukas Pravda
Hi Greg, that’s what I have been thinking, unlucky. Essentially, I want to color the molecule in web-browser with various annotations and make it interactive. For that part I’m converting it internally to the d3.js internal representation (https://d3js.org/) and connecting it to its

Re: [Rdkit-discuss] Bond tags in SVGs

2018-12-04 Thread Greg Landrum
Hi Lukas, There's not currently a way to do this at the moment. The closest you can get is by calling AddMoleculeMetadata(): In [6]: d = Draw.MolDraw2DSVG(200,200) In [8]: d.DrawMolecule(nm) In [10]: d.AddMoleculeMetadata(nm) In [11]: d.FinishDrawing() In [12]: svg = d.GetDrawingText() In

Re: [Rdkit-discuss] Double Bond Stereochemistry in the RDKit

2018-12-04 Thread Dan Nealschneider
I've done some in-memory translation of molecules to ROMols, and have used #2 without major problems. I do remember needing to make sure that the stereoatoms are in the correct order - that is, that the first stereoatom is bonded to the beginAtom of the bond. In Python, this is something like:

Re: [Rdkit-discuss] Double Bond Stereochemistry in the RDKit

2018-12-04 Thread Brian Cole
Hi Kovas, For your use-case #2 should suffice, "set STEREOCIS/STEREOTRANS tags + manually set stereo atoms". This is what the EnumerateStereoisomers code does: https://github.com/rdkit/rdkit/blob/master/rdkit/Chem/EnumerateStereoisomers.py#L38 As to what is the 'ground truth', that is a more

Re: [Rdkit-discuss] Double Bond Stereochemistry in the RDKit

2018-12-04 Thread Kovas Palunas
Ok cool! I did actually just run into an issue while doing some tests: https://github.com/rdkit/rdkit/issues/2183. This issue brings up a question for me about where the smiles writer actually looks for stereochem info when it decides what to write. Also, I ran into the same snag earlier too