Indigo icon indicating copy to clipboard operation
Indigo copied to clipboard

Unable to generate Rendering of InchiString using python API

Open rkrishnasanka opened this issue 3 years ago • 0 comments

Steps to Reproduce

  1. Use Indigo library (1.7.4). In python 3.9
  2. The following code was run
from indigo import Indigo
from indigo.renderer import IndigoRenderer
from indigo.inchi import IndigoInchi

indigo_object = Indigo()

mol1 = indigo_object.loadMolecule("ONc1cccc1")

print(mol1.smiles())

indigo_renderer_object = IndigoRenderer(indigo_object)

indigo_renderer_object.renderToFile(mol1, "mol1.png")

# From inchi string:


# mol2 = indigo_object.loadMolecule("InChI=1S/C6H12O6/c1-2-4-6-5-3-1/h1-6H")

# indigo_renderer_object.renderToFile(mol2, "mol2.png")

indigo_inchi_object = IndigoInchi(indigo_object)

inchi_string = r"InChI=1S/C38H60O18/c1-16-11-37-9-5-20-35(2,7-4-8-36(20,3)34(50)55-32-29(49)26(46)23(43)18(13-40)52-32)21(37)6-10-38(16,15-37)56-33-30(27(47)24(44)19(14-41)53-33)54-31-28(48)25(45)22(42)17(12-39)51-31/h17-33,39-49H,1,4-15H2,2-3H3/t17-,18-,19-,20?,21?,22-,23-,24-,25+,26+,27+,28-,29-,30-,31+,32+,33+,35-,36-,37-,38+/m1/s1_c0"

mol3 = indigo_inchi_object.loadMolecule(inchi_string)

print(indigo_inchi_object.version())
print(indigo_inchi_object.getLog())
print(indigo_inchi_object.getWarning())
print(indigo_inchi_object.getInchiKey(inchi_string))

indigo_renderer_object.renderToFile(mol3, "mol3.png")

imgstring = indigo_renderer_object.renderToString(mol3)

print(imgstring)


Expected behavior The expected behavior was that mol3.png would have the chemical structure of the design or throw an error indicating that it cannot be computed/rendered.

Actual behavior The program outputs a blank image. Empty PNG with now draings in it. (See first attachment)

Attachments If applicable, add attachment files to reproduce the issue. mol3

Indigo/Bingo version
Indigo library (1.7.4) installed from pip

Additional context Add any other context about the problem here.

rkrishnasanka avatar Aug 04 '22 14:08 rkrishnasanka