GreenGroup/RMG-Java — Issue #241: mol2AdjList relies on unsupported field
Author: gmagoon
Created: 2012-01-04 20:54:04+00:00
State: open

mol2AdjList in Species relies on a three digit field at the top of the connection table indicating the number of lines at the end of the file that begin with "M"; this is read in by the code as numOfMLines.

However, according to CTFile specification this field is no longer supported (see below) and some third-party MOL file sources (including OpenBabel and ChemDraw) use 999 in place of this. Consequently, using the mol2AdjList function on such a file produces a null pointer exception at https://github.com/GreenGroup/RMG-Java/blob/master/source/RMG/jing/chem/Species.java#L1844

From the CTFile specification for the "counts" line:

aaabbblllfffcccsssxxxrrrpppiiimmmvvvvvv
...
mmm = number of lines of additional properties, including the "M END" line. No longer supported, the default is set to 999.