epam / epam/Indigo

Unable to generate Rendering of InchiString using python API

Open
#817 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
406
Forks
134
Avg merge
2d 11h
Merged PRs (30d)
24

Description

**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](https://user-images.githubusercontent.com/855696/182874294-5988ed09-284e-4fe9-98bc-b98b859fcd73.png)

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

**Additional context**
Add any other context about the problem here.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.