Class MolImport

java.lang.Object
chemaxon.marvin.io.MolImportModule
chemaxon.marvin.io.formats.mdl.MolImport
All Implemented Interfaces:
StereoConstants

@PublicAPI public class MolImport extends MolImportModule implements StereoConstants
Imports MDL Molfile, SDfile, RGfile, RDfile, Rxnfile and (Chemaxon) compressed molfile. In the Molfiles documentation, you can find details about import options.
Since:
Marvin 1.3
  • Field Details

    • fixSgroups

      protected boolean fixSgroups
    • sgroupList

      protected List<Sgroup> sgroupList
  • Constructor Details

    • MolImport

      public MolImport()
  • Method Details

    • setOptions

      public void setOptions(String opts)
      Sets the import options.
      Overrides:
      setOptions in class MolImportModule
      Parameters:
      opts - import options
    • initMolImport

      public void initMolImport(MolInputStream is) throws IOException
      Initializes the import module.
      Overrides:
      initMolImport in class MolImportModule
      Parameters:
      is - the molecule input stream
      Throws:
      MolFormatException - if the file cannot be read because of a molecule file format related error
      IOException - an I/O error occurred while reading the file
    • readMol

      public boolean readMol(Molecule mol) throws MolFormatException, IOException
      Reads a molecule from MDL mol/sdf/rxn file. All the nodes, edges, and properties are removed from mol before reading.
      Specified by:
      readMol in class MolImportModule
      Parameters:
      mol - the molecule object to read into
      Returns:
      true after successfully reading the molecule, false if no more molecule found
      Throws:
      MolFormatException - if the file is in bad format
      IOException - in case of I/O error
    • createMol

      public Molecule createMol()
      Creates a new target molecule object.
      Specified by:
      createMol in class MolImportModule
      Returns:
      new Molecule, RgMolecule or RxnMolecule
      Since:
      Marvin 3.4, 05/08/2004
    • getMolfileVersion

      protected int getMolfileVersion()
      Gets the molfile version.
      Returns:
      2 or 3
      Since:
      Marvin 3.4.1, 07/16/2004