epam / epam/Indigo

A little problem with MOl file to image conversion

Open
#1,811 1 comment 0 reactions 0 assignees View on GitHub
Priority: Medium Severity: Medium User`s Feedback
Dominant language
C++
Stars
406
Forks
134
Avg merge
2d 11h
Merged PRs (30d)
24

Description

I have a mol file, the coordinates of the lines in it are very large, several thousand, which causes the structured image I uplifted to be very large, is there any way to proportionally reduce the generated image or make the coordinates in the mol file proportionally smaller? The ultimate goal is to produce a structured image that is more reasonable and aesthetically pleasing.
I am using Indigo version 1.16.0.0-gcd2c4f91c-x86_64-win-msvc-1937.
Here is the mol file along with my generation code and the image I generated (extra large).

`from indigo import *
from indigo.renderer import IndigoRenderer
from indigo.inchi import IndigoInchi
indigo = Indigo()
indigoRenderer = IndigoRenderer(indigo)

indigo.setOption("ignore-stereochemistry-errors", True)
indigo.setOption("ignore-noncritical-query-features", True)
indigo.setOption("standardize-stereo-from-coordinates", True)
indigo.setOption("standardize-clear-coordinates", True)
indigo.setOption("serialize-preserve-ordering", True)
print ("Indigo version " + indigo.version())
mol = indigo.loadMoleculeFromFile("136-27-6.mol")
indigo.setOption("render-label-mode", 'hetero')
indigo.setOption("render-bond-line-width", 1)
indigo.setOption("render-stereo-style", 'none')
indigo.setOption("render-relative-thickness", '0.8')
indigo.setOption("ignore-stereochemistry-errors", True)
indigo.setOption("render-output-format", "png")
indigo.setOption("stereochemistry-detect-haworth-projection", "True")
indigoRenderer.renderToFile(mol, 'result_20240313.png')

print('success')
`
Written by jPsi
18 19 0 0 0 0 0 0 0 0999 V2000
10000.000010020.0000 0.0000 S 0 0 0 0 0 0 0 0 0 0 0 0
10000.0000 9980.0000 0.0000 S 0 0 0 0 0 0 0 0 0 0 0 0
10000.000010100.0000 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
9861.430010020.0000 0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0
10000.0000 9900.0000 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
10138.6000 9980.0000 0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0
9965.360010040.0000 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
9965.360010080.0000 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
9930.710010020.0000 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
9930.710010100.0000 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
9896.070010040.0000 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
9896.070010080.0000 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
10034.6000 9960.0000 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
10034.6000 9920.0000 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
10069.3000 9980.0000 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
10069.3000 9900.0000 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
10103.9000 9960.0000 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
10103.9000 9920.0000 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
1 2 1 0 0 0 0
1 7 1 0 0 0 0
2 13 1 0 0 0 0
3 8 1 0 0 0 0
4 11 1 0 0 0 0
5 14 1 0 0 0 0
6 17 1 0 0 0 0
7 8 2 0 0 1 0
7 9 1 0 0 1 0
8 10 1 0 0 1 0
9 11 2 0 0 1 0
10 12 2 0 0 1 0
11 12 1 0 0 1 0
13 14 2 0 0 1 0
13 15 1 0 0 1 0
14 16 1 0 0 1 0
15 17 2 0 0 1 0
16 18 2 0 0 1 0
17 18 1 0 0 1 0
M END
![Uploading result_20240313.png…]()

Contributor guide

No contributing guide indexed for this repository

Research direction

Reproduce the oversized output using the supplied 136-27-6.mol input and Python IndigoRenderer snippet; begin by examining how the renderer handles the molecule coordinates and the listed render options. Done means the same molecule produces a reasonably sized, aesthetically pleasing image without requiring manual coordinate edits.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
computer-graphics
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.