Package chemaxon.marvin.io.formats.mdl
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 Summary
-
Fields inherited from class chemaxon.marvin.io.MolExportModule
addNumbering, aromatize, hydrogenize, stringBuffer
-
Fields inherited from interface chemaxon.struc.StereoConstants
ANTI, ATOMSTEREO_EITHER, ATOMSTEREO_MASK, ATOMSTEREO_NONE, ATOMSTEREO_SPECIFIC, CHIRALITY_M, CHIRALITY_MASK, CHIRALITY_P, CHIRALITY_r, CHIRALITY_R, CHIRALITY_s, CHIRALITY_S, CHIRALITYSUPPORT_ALL, CHIRALITYSUPPORT_ALL_POSSIBLE, CHIRALITYSUPPORT_NONE, CHIRALITYSUPPORT_SELECTED, CIS, CIS_TRANS, CTUMASK, CTUNKNOWN, CTUNSPEC, DBS_ALL, DBS_MARKED, DBS_NONE, ENDO, EXO, PARITY_ALLENE, PARITY_EITHER, PARITY_EVEN, PARITY_MASK, PARITY_NONE, PARITY_ODD, PARITY_TETRAHEDRAL, PARITY_UNSPEC, STGRP_ABS, STGRP_AND, STGRP_NONE, STGRP_OR, SYN, TRANS
-
-
Constructor Summary
Constructors Constructor Description MolExport()
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
appendMEnd(Molecule mol)
Appends the "M END" line to the string buffer.Object
convert(Molecule mol)
Creates an MDL mol or compressed mol representation of the molecule.protected void
convertCoordinateBondsToData(Molecule molecule)
Converts coordinate bonds to data sgroups (attached data) with field name MRV_COORDINATE_BOND.protected void
convertPageSettingsToData(Molecule mol)
Converts page setting of multipage molecular document to data sgroups (attached data) with field name MRV_PAGE_XXX.protected int
getMolfileVersion()
Gets the molfile version.protected void
getOptionDescriptors(String fmtname, String optnames, List<OptionDescriptor> l)
Gets the option descriptors.Object
open(String fmtopts, MPropertyContainer props)
Open the exporter stream.protected int
parseOption(String opts, int i)
Parses the bond length (b###) option.-
Methods inherited from class chemaxon.marvin.io.MolExportModule
addData, appendChars, appendLeft, appendRight, appendRight, close, getEncoding, getFormat, getOptionDescriptors, getOptionDescriptors, getOptions, getOptionSign, isCleanable, isDocumentExport, isImplicitHcountImportant, isImplicitHcountImportant, nextOpt, open, parseCharIfOptionSign, preconvert, preconvert, preconvert, preconvert, setEncoding, setGlobalGUIProperties
-
-
-
-
Method Detail
-
getOptionDescriptors
protected void getOptionDescriptors(String fmtname, String optnames, List<OptionDescriptor> l)
Gets the option descriptors.- Overrides:
getOptionDescriptors
in classMolExportModule
- Parameters:
fmtname
- the format name ornull
optnames
- option names ornull
for alll
- 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 classMolExportModule
- Parameters:
fmtopts
- output file format and optionsprops
- 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 classMolExportModule
- Parameters:
opts
- the options stringi
- 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 classMolExportModule
- 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(Molecule mol)
Appends the "M END" line to the string buffer.- Parameters:
mol
- the molecule
-
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
-
-