indigo-depict highlighting

23 views
Skip to first unread message

site...@greenpharma.com

unread,
Oct 28, 2015, 7:01:33 AM10/28/15
to indigo-general
Hello

I wonder if it is possible to highlight a part of a structure (e.g. for substructure search rendering) using indigo-depict.
There are -hlthick or -hlcolor options but I do not understand how they work.

Ideally, I would like a command which looks something like:
indigo-depict input.mol input.svg -highlight "smiles"

Let me know if this possible ?
Thanks in advance for your kind help.

Best regards

Savelyev Alexander

unread,
Oct 29, 2015, 7:00:10 AM10/29/15
to indigo-general, site...@greenpharma.com
Hello


The -hlthick or -hlcolor options are used to highlight structures. You can use smiles (see example below) or molfile with highlighted atoms and bonds (please see the attached highlighting.mol).

To create highlighted structure e.g. with a matched query, you can use the Indigo toolkit

 http://lifescience.opensource.epam.com/indigo/api/index.html#example-2-getting-the-highlighted-target-molecule

example:

mol1 = indigo.loadQueryMolecule("CN")
mol2
= indigo.loadMolecule("P(=O)(O[H])(O[H])OC([H])([H])C1=C([H])N=C(C([H])([H])[H])N=C1N([H])[H]")
mol2
.foldHydrogens()
m
= indigo.substructureMatcher(mol2).match(mol1)
hi
= m.highlightedTarget()
print(hi.smiles())

Output:
P(OCC1C(N)=NC(C)=NC=1)(O)(O)=O |ha:4,5,hb:4|

Thanks
Alexander




highlighting.mol
Reply all
Reply to author
Forward
0 new messages