#234 Support for multi molecule mol2 files

Rajarshi Guha
master (162)
Rajarshi Guha

Patch adds support for mulkti molecule mol2 files, so that all molecules can be read into a List of molecules. Added unit testa and test file


  • Rajarshi, some comments:

    • please do not change whitespace, or as little as possible
    • can you please add info on which OB version this is for,
      and preferably where to find the upstream bug report?

    • // fix OpenBabel atom type codes to SYBYL specification

    • if ("S.o2".equals(atomTypeStr)) atomTypeStr = "S.O2";
    • if ("S.o".equals(atomTypeStr)) atomTypeStr = "S.O";

    • we really need that IBond.Order.SINGLE_OR_DOUBLE, not? :)

    • } else if ("am".equals(orderStr) || "ar".equals(orderStr)) {

    • bond.setOrder(CDKConstants.BONDORDER_SINGLE);
    • bond.setFlag(CDKConstants.ISAROMATIC, true);
    • bond.getAtom(0).setFlag(CDKConstants.ISAROMATIC, true);
    • bond.getAtom(1).setFlag(CDKConstants.ISAROMATIC, true);

    • why is this test not tested anymore? ->

    • @Test public void testNCIfeb03_2D() throws Exception {

    • public void testNCIfeb03_2D() throws Exception {

    • I suggest to test that the first IAtomContainer has the correct number of atoms and bonds too, to test that we do not loose the last or first atom or so, or do not reset properly

  • Rajarshi Guha
    Rajarshi Guha

    Sorry about the whitespace, but it was getting difficult to debug with the current formatting and I had rearranged a lot of the old code anyway

    Updated note on OB type fixes

    Regarding, SINGLE_OR_DOUBLE - yes, it would be nice to have that, but its not in the API at this point right?

    Added missing @Test annotation and updated unit tests to check atom counts.

    Replaced patches with the 2 new patches

  • Applied to master.