Separate out SD File non-structural data handling into methods - this is similar to the IteratingSDFReader and will be unified eventually.

Signed-off-by: Egon Willighagen <egonw@users.sourceforge.net>
Cleanup the creation of the IChemModel for each new container.

Signed-off-by: Egon Willighagen <egonw@users.sourceforge.net>
A test for a bug posted on the mailing list - this file reads okay with IteratingSDFReader but not with the IChemFile.

Signed-off-by: Egon Willighagen <egonw@users.sourceforge.net>
Simplified reading of ChemFile - this resolves the bugs posted on the mailing list. Also a regression indicates we should also trip data values if we already have data.

Signed-off-by: Egon Willighagen <egonw@users.sourceforge.net>
Read the non-structure data with the container - although the data makes it an SD file rather than a V2000 it is useful as if an SD file is completely V2000 successive calls to read(AtomContainer) will correctly load the contents. This is faster than the IteratingSDFReader which copies into a temporary buffer before parsing it to the V2000 reader.

Signed-off-by: Egon Willighagen <egonw@users.sourceforge.net>
Separate out reading of the atom block information from

Signed-off-by: Egon Willighagen <egonw@users.sourceforge.net>
The atom block was setting an RGroupCount - this seemed to be redundant and may have been due to R groups being stored separately. In particular the atom alias index was adjusted - this didn’t seem correct and a test confirms it.

Signed-off-by: Egon Willighagen <egonw@users.sourceforge.net>
The Rgroups with no number (R#) don’t need to be store separately - we can use the index in the container given the number of atom in the structure and the number given in the file (we could be adding to an existing container).

Signed-off-by: Egon Willighagen <egonw@users.sourceforge.net>
Fixing and including RGroupQuery IO tests in the module suite.

Signed-off-by: Egon Willighagen <egonw@users.sourceforge.net>
With a few tweaks we can depend on the MDL reader to provide the atoms as they appear in the atom block and should not use the atomsByLinePosition stored in the reader.

Signed-off-by: Egon Willighagen <egonw@users.sourceforge.net>
remove the method getAtomsByLinePosition, the returned container currently and should always guarantee this.

Signed-off-by: Egon Willighagen <egonw@users.sourceforge.net>
Utility methods for efficient parsing MDL input - including faster parsing of values and coordinates. Some parts (i.e. isElement) are slow but can easily be replaced in future with optimised routines.

Signed-off-by: Egon Willighagen <egonw@users.sourceforge.net>
A fast function of parsing MDL V2000 atom lines which strictly obey the format.

Signed-off-by: Egon Willighagen <egonw@users.sourceforge.net>
Rename atom and bond counts.

Signed-off-by: Egon Willighagen <egonw@users.sourceforge.net>
Rename atom and bond lists.

Signed-off-by: Egon Willighagen <egonw@users.sourceforge.net>
Use arrays instead of lists - we know how many atoms and bonds there will be.

Signed-off-by: Egon Willighagen <egonw@users.sourceforge.net>
Move query bond count out of the conditional - this will allow us to separate out the bond parsing. We also set the bond order to unset for the query bonds as it’s slightly more friendly then null.

Signed-off-by: Egon Willighagen <egonw@users.sourceforge.net>
Rename, relaxed to slow - we may still want to hop back to the old method but new faster parsing is still relaxed / strict.

Signed-off-by: Egon Willighagen <egonw@users.sourceforge.net>
Separate out parsing of the bond block.

Signed-off-by: Egon Willighagen <egonw@users.sourceforge.net>
Set valence when parsing the bond.

Signed-off-by: Egon Willighagen <egonw@users.sourceforge.net>