Indigo
Indigo copied to clipboard
A little problem with MOl file to image conversion
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