-
Notifications
You must be signed in to change notification settings - Fork 111
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
V2000 Mol file loader skips essential SGroup line in certain cases #2732
Labels
Milestone
Comments
smz-bayer
added a commit
to smz-bayer/Indigo
that referenced
this issue
Jan 23, 2025
9 tasks
smz-bayer
added a commit
to smz-bayer/Indigo
that referenced
this issue
Feb 3, 2025
AlexanderSavelyev
pushed a commit
that referenced
this issue
Feb 4, 2025
9 tasks
AliaksandrDziarkach
added a commit
that referenced
this issue
Feb 12, 2025
… cases Merge fix from master to 1.29
8 tasks
AlexanderSavelyev
pushed a commit
that referenced
this issue
Feb 13, 2025
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Summary
Reading a V2000 molfile that contains a line
M SCN .... HT
without the trailing space will skip the following molfile line if the M SCN line is not in an SGroup of type "SRU"Steps to Reproduce
string mol = File.ReadAllText(@"C:\Temp\mul_with_scn_no_space_before_eol.txt");
using (var indigo = new com.epam.indigo.Indigo()) { string loadAndBack = indigo.loadMolecule(mol).molfile(); }
Actual behavior
The new molfile string now contains a molfile where an essential line is missing from the SGroup information:
That missing line is
M SAL 1 3 2 4 5
, and it was immediately following the lineM SCN 1 1 HT
Expected behavior
The new molfile string should contain a complete molfile with correctly written SGroup information.
It might be slightly rearranged and have unneccessary information removed, but it must still contain the line
M SAL 1 3 2 4 5
Environment details:
Attachments
mul_with_scn_no_space_before_eol.txt
Additional context
According to V2000 MOL file spec, a line
M SCN ....
ends with a left justified 3-digit string.However, all of the alternatives for that string only have 2 digits ("HH", "HT", or "EU").
Thus, the trailing space may be present or absent, still yielding a valid mol file.
The Indigo code has an extra check to deal with that, but the check only works if the
M SCN ...
line belongs to an SGroup of type "SRU".In older molfiles you often find
M SCN ...
lines in other SGroup types, like "MUL". They may be removed without harm in such cases, but the rest of the SGroup information needs to stay consistent.The text was updated successfully, but these errors were encountered: