You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
Use Indigo library with .NET wrapper in a .NET C# console application project.
Load attached molfile into string "mol": string mol = File.ReadAllText(@"C:\Temp\mul_with_scn_no_space_before_eol.txt");
Load that string into an Indigo molecule and write it back as another molfile string: 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 line M 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
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:
smz-bayer
added a commit
to smz-bayer/Indigo
that referenced
this issue
Jan 23, 2025
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: