epam / Indigo

Universal cheminformatics toolkit, utilities and database search tools
http://lifescience.opensource.epam.com
Apache License 2.0
313 stars 105 forks source link

Add new settings for ACS style for convert and layout functions #2176

Open AnnaKosol opened 1 month ago

AnnaKosol commented 1 month ago

Background Related issue: https://github.com/epam/ketcher/issues/5152 need to add new settings.

Solution When calling indigo's functions such as layout, convert on the Canvas, new settings parameters should be processed. List of the new settings in the JSON of the Settings: bond-length-unit: "px" bond-length: 2.2

If possible, the size of an arrow should be the same as the size of a bond. Exceptions are when catalysts/reaction conditions/other additional context placed bellow or above the arrow. The logic is described in Ketcher issue: #5155 Default arrow size is equal to 2 default sizes of bonds (in angstrom) (images for better understanding) image image

Reaction margin size should be applied both for distance between plus and component and between arrow and component structure bounding box (should be equal distance)

image

Structure bounding box should be calculated as atoms bounding box + default atom label margin=0.5 Default bond length

image

For simple atoms atoms bounding box is a dot in center of the atom Image

Default size of the plus element by default equals 0.5 bond-length

image

reaction-component-margin-size-unit: "px" reaction-component-margin-size: default value = 2.3 pt image-resolution

bond-length-unit values can be in cm/pt/px/in bond-length number with 1 decimal places reaction-component-margin-size-unit values can be in cm/pt/px/in reaction-component-margin-size number with 1 decimal places image-resolution should be a number; Regardless of the resolution, the size of the image should be such that one bond is ~0,5cm (0,2in/14,4pt) long when printed/100% zoom.

Additional information 1 inch = 72 pt 1 inch = 2.54 cm 1 angstrom = 1e-8 cm PPI = pixels per inch = sqrt(w^2 + h^2) /d where w - width in px, h - height in px, d - diagonal in inches if PPI = 100 then 1px = 0.01 in reactionComponentMarginSize - horizontal & vertical margins

SMILES for testing OC(=O)C.OCCC>>CC(=O)OCCCC.O

AlexeyGirin commented 2 weeks ago

ACS-StyleGuide.pdf