Class MolExport

java.lang.Object
chemaxon.marvin.io.MolExportModule
chemaxon.marvin.io.formats.mdl.MolExport
All Implemented Interfaces:
StereoConstants

@PublicApi public class MolExport extends MolExportModule implements StereoConstants
Exports MDL Molfile, SDfile, RGfile, RDfile, Rxnfile and (Chemaxon) compressed molfile. In the Molfiles documentation, you can find details about export options.
Since:
Marvin 1.2.3
  • Field Details

    • REGNO_MAX_LENGTH_IN_HEADER

      public static final int REGNO_MAX_LENGTH_IN_HEADER
      See Also:
  • Constructor Details

    • MolExport

      public MolExport()
      Constructor. Sets the current date.
  • Method Details

    • getOptionDescriptors

      protected void getOptionDescriptors(String fmtname, String optnames, List<OptionDescriptor> l)
      Gets the option descriptors.
      Overrides:
      getOptionDescriptors in class MolExportModule
      Parameters:
      fmtname - the format name or null
      optnames - option names or null for all
      l - the output list
      Since:
      Marvin 5.0, 06/06/2007
    • open

      public Object open(String fmtopts, MPropertyContainer props) throws MolExportException
      Open the exporter stream.
      Overrides:
      open in class MolExportModule
      Parameters:
      fmtopts - output file format and options
      props - the gui options or null (ignored parameter)
      Returns:
      the head of the file for RDF, null otherwise
      Throws:
      MolExportException - Invalid format string.
    • parseOption

      protected int parseOption(String opts, int i) throws IllegalArgumentException
      Parses the bond length (b###) option.
      Overrides:
      parseOption in class MolExportModule
      Parameters:
      opts - the options string
      i - the current index
      Returns:
      index of the next option, or i if the current option is unknown
      Throws:
      IllegalArgumentException - in case of parsing error
    • convert

      public Object convert(Molecule mol) throws MolExportException
      Creates an MDL mol or compressed mol representation of the molecule. If the molecule source is in 0D, then cleans the moelcule in 2D before exporting it, since 0D olfiles cannot contains stereo information. This cleaning was introduced in Marvin 5.4, and can be omit by adding "omitClean0D" to the format options.
      Specified by:
      convert in class MolExportModule
      Parameters:
      mol - the molecule
      Returns:
      a string containing the molfile
      Throws:
      MolExportException - cannot be converted to MDL molfile
    • getMolfileVersion

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

      protected void appendMEnd()
      Appends the "M END" line to the string buffer.
    • convertPageSettingsToData

      protected void convertPageSettingsToData(Molecule mol)
      Converts page setting of multipage molecular document to data sgroups (attached data) with field name MRV_PAGE_XXX. The data is attached to the first atom.
      Parameters:
      mol - molecule to convert
      Since:
      Marvin 4.1 02/14/2006
    • convertCoordinateBondsToData

      protected void convertCoordinateBondsToData(Molecule molecule)
      Converts coordinate bonds to data sgroups (attached data) with field name MRV_COORDINATE_BOND. The data is attached to the first atom.
      Parameters:
      molecule - molecule to convert
      Since:
      Marvin 5.0 15/07/2007