epam / Indigo

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

Failed to convert from cml file in case of only rgroup is present without rgroup reference #291

Open ensemenova opened 3 years ago

ensemenova commented 3 years ago

Steps to reproduce:

Send POST request to https://lifescience.opensource.epam.com/v2/indigo/convert with following payload {"struct":"<?xml version=\"1.0\" ?>\n<cml>\n <molecule title=\"\" />\n <Rgroup rgroupID=\"5\">\n <molecule>\n <atomArray>\n <atom id=\"a0\" elementType=\"C\" x2=\"3.8\" y2=\"-1.325\" />\n <atom id=\"a1\" elementType=\"C\" x2=\"3.8\" y2=\"-2.325\" />\n </atomArray>\n <bondArray>\n <bond atomRefs2=\"a0 a1\" order=\"1\" />\n </bondArray>\n </molecule>\n </Rgroup>\n</cml>\n","output_format":"chemical/x-mdl-molfile","options":{"smart-layout":true,"ignore-stereochemistry-errors":true,"mass-skip-error-on-pseudoatoms":false,"gross-formula-add-rsites":true}} Actual result: 502 Bad Gateway Response status is returned

Expected result: Correct rgroup molecule description, i.e. `$MDL REV 1 $MOL $HDR

$END HDR $CTAB 0 0 0 0 0 999 V2000 M END $END CTAB $RGP 5 $CTAB 2 1 0 0 0 999 V2000 7.7000 -2.0750 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 6.9929 -1.3679 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0 1 2 1 0 0 0 M END $END CTAB $END RGP $END MOL`

ensemenova commented 3 years ago

Please notify Ketcher project when fixed