Thanks again!
Jean-Marc
Le 08/06/2023 à 10:31, Paolo Tosco a écrit :
Dear Jean-Marc,
I wrote my email in an iPad, and probably attaching the image failed
somehow.
You may save the SVG image to a file as follows; it is a plain text
XML string:
svg_image = drawer.GetDrawingText()
with ope
Dear Jean-Marc,I wrote my email in an iPad, and probably attaching the image failed somehow.You may save the SVG image to a file as follows; it is a plain text XML string:svg_image = drawer.GetDrawingText()with open(“ h_atoms_at_ring_jn.svg”, “w”) as hnd: hnd.write(svg_image)Cheers,p.On 8 Jun 20
I guessed that for some reason the drawing did not show up in Paolo's reply
to my question but I did not try to investigate further to find an
explanation,
since I run his code without any problem and was then able to adapt it
for the
creation of PNG images.
How did you create file h_atoms_at_
Very nice! The picture in the thread above didn't come through for me. I
re-ran that code and got the following output, included as both an inline
PNG and an attached SVG so hopefully it shows up for folks in at least one:
[image: h_atoms_at_ring_jn.png]
On Mon, Jun 5, 2023 at 3:15 AM Jean-Marc Nu
Dear Paolo,
many thanks, your solution worked like a charm!
Best regards,
Jean-Marc
Le 01/06/2023 à 23:57, Paolo Tosco a écrit :
Dear Jean-Marc,
you may retain the original mol block wedging and avoid introducing H
atoms as follows:
from rdkit import Chem
from rdkit.Chem.Draw import rdMo
Dear Jean-Marc,
you may retain the original mol block wedging and avoid introducing H atoms
as follows:
from rdkit import Chem
from rdkit.Chem.Draw import rdMolDraw2D
from IPython.display import SVG
mol = Chem.MolFromMolBlock("""trans-decalin
RDKit 2D
10 11 0 0 0 0 0 0 0
Dear all,
starting from this mol block:
trans-decalin
RDKit 2D
10 11 0 0 0 0 0 0 0 0999 V2000
1.5000 0. 0. C 0 0 0 0 0 0 0 0 0 0 0 0
0.7500 -1.2990 0. C 0 0 0 0 0 0 0 0 0 0 0 0
-0.7500 -1.2990 0. C 0 0
7 matches
Mail list logo