Hi all,

 

I was wondering if there is a way how you can tag <path> elements (bonds) in 
the svg created by rdkit.

 

i.e. transform something like this: 

<path d='M 265.658,263.25 342.74,218.746' style='...' />

<path d='M 342.74,218.746 419.822,174.241' style='...' />

 

Into:

<path bondId='1' d='M 265.658,263.25 342.74,218.746' style='...' />

<path bondId='2' d='M 342.74,218.746 419.822,174.241' style='...' />

 

Or similar. I’ve found possibility of tagging atoms in the SVG using 
Draw.rdMolDraw2D.MolDraw2DSVG.drawOptions() method that exposes property 
includeAtomTags. This then renders following additional elements into the SVG:

rdkit:atom idx="4" label="O<sup>-</sup>" x="153.479" y="82.8259" />

 

But I have not seen anything like this for bonds (latest release of RDKIT and 
python). Thanks, in advance for any hints. I was wondering about using 
highlightBondLists and then based on the svg infer the bond annotation, but 
that seems to be a bit of an overkill.

 

Cheers,

Lukas

 

 

_______________________________________________
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss

Reply via email to