Package chemaxon.formats
Class MFileFormat
java.lang.Object
chemaxon.formats.MFileFormat
File format descriptor class.
- Since:
- Marvin 5.0, 05/23/2007
-
Field Summary
Modifier and TypeFieldDescriptionstatic final MFileFormat
Chemaxon SMILES Abbreviated Groups.static final MFileFormat
ACCORD file formatstatic final MFileFormat
Image object (java.awt.Image).static final MFileFormat
BASE64 encoded file.static final MFileFormat
ChemDraw CDX file.static final MFileFormat
ChemDraw CDXML file.static final MFileFormat
Chemical Markup Language.static final MFileFormat
Chemaxon Compressed Molfiles, RGfiles, Rgfiles, SDfiles or RDfiles.static final MFileFormat
Chemaxon Compressed Molfiles and Rgfiles.static final MFileFormat
Chemaxon Compressed RDfiles.static final MFileFormat
Chemaxon Compressed Rxnfiles.static final MFileFormat
Chemaxon Compressed SDfiles.static final MFileFormat
static final MFileFormat
Chemaxon Object Notation.static final MFileFormat
Chemaxon Extended SMARTS.static final MFileFormat
Chemaxon Extended SMILES.static final MFileFormat
Any document format recognized by Document to Structure (doc, odt, ...).static final MFileFormat
DNA sequence.static final MFileFormat
Windows Enhanced Metafiles.static final MFileFormat
Encapsulated PostScript vector image format.static final long
General archive format that stores a file in another format.static final long
Import/export module handles binary (byte array) data.static final long
The format can store atom coordinates if this flag is set.static final long
Export is possible if this flag is set.static final long
File format readable by a graphics program (image viewer, ray tracer etc.).static final long
2D image file format, readable by image viewers.static final long
Import is possible if this flag is set.static final long
Storage of records in different formats is possible if this flag is set.static final long
The format can store molecule(s) if this flag is set.static final long
The format is designed to store multiple records if this flag is set.static final long
The import/export modules can handle files with multiple records if this flag is set, but according to the format definition it is not legal.static final long
Import/export module creates or reads a java object.static final long
The format can store reaction(s) if this flag is set.static final long
Format recognizer exists if this flag is set.static final long
Format uses one line per structure.static final long
User defined format.static final long
The format is XML based if this flag is set.static final MFileFormat
FASTA file formatstatic final MFileFormat
FASTA file format with DNA sequencestatic final MFileFormat
FASTA file format with peptide sequencestatic final MFileFormat
FASTA file format with RNA sequencestatic final MFileFormat
Gaussian Cube files.static final MFileFormat
Gaussian Input Format.static final MFileFormat
Gaussian Input Format: Z-matrix.static final MFileFormat
Gaussian output format.static final MFileFormat
GZIP compressed file.static final MFileFormat
IUPAC InChI files.static final MFileFormat
IUPAC InChIKey.static final MFileFormat
JPEG format.static final MFileFormat
MDL Molfiles and Rgfiles.static final MFileFormat
static final MFileFormat
MDL Extended Molfiles and Rgfiles.static final MFileFormat
Tripos Mol2 files.static final MFileFormat
Chemaxon Marvin Document.static final MFileFormat
Windows Bitmap format.static final MFileFormat
IUPAC Name files.static final MFileFormat
static final MFileFormat
Protein Data Bank format.static final MFileFormat
Portable Document Format.static final MFileFormat
Peptide Sequence.static final MFileFormat
Peptide Sequence (1-letter).static final MFileFormat
Peptide Sequence (3-letter).static final MFileFormat
Portable Network Graphics.static final MFileFormat
POVRay file.static final MFileFormat
MDL RDfiles.static final MFileFormat
RNA sequence.static final MFileFormat
MDL Rxnfiles.static final MFileFormat
MDL Extended Rxnfiles.static final MFileFormat
MDL SDfiles.static final MFileFormat
SKC file formatstatic final MFileFormat
SMARTS.static final MFileFormat
SMILES.static final MFileFormat
Scalable Vector Graphics.static final MFileFormat
Tripos SYBYL molfiles.static final MFileFormat
Tagged Image File Format.static final MFileFormat
static final MFileFormat
XYZ files. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionCreates the export module.createExportModule
(String enc) Creates the export module.Creates the molecule import module.Creates a recognizer module.createRecognizer
(String fmt) Deprecated, for removal: This API element is subject to removal in a future version.as of Marvin 2014.07.21.0 usecreateRecognizer()
insteadcreateRecordReader
(MolInputStream mis, String opts) Creates the record reader.static MFileFormat
createUserDefined
(String description, String formats, String extensions, MRecordReaderFactory recordReaderFactory, MolImportModuleFactory importModuleFactory, MolExportModuleFactory exportModuleFactory, RecognizerFactory recognizerFactory, String subformatPriorities, long flags) Creates a user-defined format descriptor.static MFileFormat
createUserDefined
(String description, List<String> formats, List<String> extensions, MRecordReaderFactory recordReaderFactory, MolImportModuleFactory importModuleFactory, MolExportModuleFactory exportModuleFactory, RecognizerFactory recognizerFactory, Map<String, Integer> subformatPriorities, long flags) Creates a user-defined format descriptor.Gets the associated non-query format.Gets the associated query format.Gets the format description.Gets the extension list.String[]
Deprecated, for removal: This API element is subject to removal in a future version.long
getFlags()
Gets the format descriptor flags.Deprecated, for removal: This API element is subject to removal in a future version.as of Marvin 2014.07.21.0 not usedgetName()
Gets the codename of the format.Gets all the codenames of the format.String[]
getNames()
Deprecated, for removal: This API element is subject to removal in a future version.UsegetNameList()
instead.int
getPriority
(String subfmt) Deprecated, for removal: This API element is subject to removal in a future version.as of Marvin 2014.07.21.0 usegetSubFormatPriority(String)
insteadstatic int
getSubFormatPriority
(String subFormatName) Gets the priority of the specified subformat name.boolean
isFlagSet
(long flag) Checks whether the format has a given (set of) flag(s) set.boolean
Tests whether the format matches the specified pattern.toString()
Overrides Object.toString() to ease debugging.
-
Field Details
-
MRV
Chemaxon Marvin Document. -
CML
Chemical Markup Language. -
CXON
Chemaxon Object Notation. -
MOL
MDL Molfiles and Rgfiles. -
MOL_V2_OUT
-
MOL_V3_OUT
MDL Extended Molfiles and Rgfiles. -
RXN
MDL Rxnfiles. -
RXN_V3_OUT
MDL Extended Rxnfiles. -
SDF
MDL SDfiles. -
RDF
MDL RDfiles. -
CSMDL_IN
Chemaxon Compressed Molfiles, RGfiles, Rgfiles, SDfiles or RDfiles. Format object for import only. -
CSMOL_OUT
Chemaxon Compressed Molfiles and Rgfiles. -
CSRXN_OUT
Chemaxon Compressed Rxnfiles. -
CSSDF_OUT
Chemaxon Compressed SDfiles. -
CSRDF
Chemaxon Compressed RDfiles. -
SMILES
SMILES. -
SMARTS
SMARTS. -
CXSMILES
Chemaxon Extended SMILES. -
CXSMARTS
Chemaxon Extended SMARTS. -
ABBREVGROUP
Chemaxon SMILES Abbreviated Groups. -
INCHI
IUPAC InChI files. -
INCHIKEY
IUPAC InChIKey. -
NAME
IUPAC Name files. -
PEPTIDE_IN
Peptide Sequence. -
PEPTIDE1_OUT
Peptide Sequence (1-letter). -
PEPTIDE3_OUT
Peptide Sequence (3-letter). -
RNA
RNA sequence. -
DNA
DNA sequence. -
XYZ
XYZ files. -
GAUSSIAN_CUBE
Gaussian Cube files. -
GAUSSIAN_INPUT
Gaussian Input Format. -
GAUSSIAN_INPUTZ
Gaussian Input Format: Z-matrix. -
GAUSSIAN_OUTPUT
Gaussian output format. -
SYBYLMOL
Tripos SYBYL molfiles. -
MOL2
Tripos Mol2 files. -
PDB
Protein Data Bank format. -
GZIP
GZIP compressed file. -
BASE64
BASE64 encoded file. -
AWT_IMAGE
Image object (java.awt.Image). -
JPEG
JPEG format. -
PNG
Portable Network Graphics. -
MSBMP
Windows Bitmap format. -
PDF
Portable Document Format. -
SVG
Scalable Vector Graphics. -
EPS
Encapsulated PostScript vector image format. -
TIFF
Tagged Image File Format. -
EMF
Windows Enhanced Metafiles. -
POVRAY
POVRay file. -
OSRA
-
CDX
ChemDraw CDX file. -
CDXML
ChemDraw CDXML file. -
D2S
Any document format recognized by Document to Structure (doc, odt, ...). -
FASTA
FASTA file format -
FASTA_DNA
FASTA file format with DNA sequence -
FASTA_RNA
FASTA file format with RNA sequence -
FASTA_PEPTIDE
FASTA file format with peptide sequence -
SKC
SKC file format -
ACCORD
ACCORD file format -
CSV
-
VMN
-
F_EXPORT
public static final long F_EXPORTExport is possible if this flag is set.- See Also:
-
F_IMPORT
public static final long F_IMPORTImport is possible if this flag is set.- See Also:
-
F_RECOGNIZER
public static final long F_RECOGNIZERFormat recognizer exists if this flag is set. Automatically set by the constructor if the recognizer argument is notnull
.- See Also:
-
F_BINARY
public static final long F_BINARYImport/export module handles binary (byte array) data.- See Also:
-
F_OBJECT
public static final long F_OBJECTImport/export module creates or reads a java object.- See Also:
-
F_MOLECULE
public static final long F_MOLECULEThe format can store molecule(s) if this flag is set.- See Also:
-
F_REACTION
public static final long F_REACTIONThe format can store reaction(s) if this flag is set.- See Also:
-
F_ARCHIVE
public static final long F_ARCHIVEGeneral archive format that stores a file in another format.- See Also:
-
F_GRAPHICS
public static final long F_GRAPHICSFile format readable by a graphics program (image viewer, ray tracer etc.).- See Also:
-
F_IMAGE
public static final long F_IMAGE2D image file format, readable by image viewers.- See Also:
-
F_COORDS
public static final long F_COORDSThe format can store atom coordinates if this flag is set.- See Also:
-
F_MULTIPLE_RECORDS_LEGAL
public static final long F_MULTIPLE_RECORDS_LEGALThe format is designed to store multiple records if this flag is set.- See Also:
-
F_MULTIPLE_RECORDS_POSSIBLE
public static final long F_MULTIPLE_RECORDS_POSSIBLEThe import/export modules can handle files with multiple records if this flag is set, but according to the format definition it is not legal. Other programs may not import multiple records just the first one.- See Also:
-
F_MIXED
public static final long F_MIXEDStorage of records in different formats is possible if this flag is set.- See Also:
-
F_XML
public static final long F_XMLThe format is XML based if this flag is set.- See Also:
-
F_USER_DEFINED
public static final long F_USER_DEFINEDUser defined format.- See Also:
-
F_SINGLE_LINE
public static final long F_SINGLE_LINEFormat uses one line per structure.- Since:
- Marvin 5.1
- See Also:
-
-
Constructor Details
-
MFileFormat
@Deprecated(forRemoval=true) @SubjectToRemoval(date=JUL_01_2025) public MFileFormat(String desc, String format, String mime, String exts, String rrname, String impname, String expname, String recogn, long f) Deprecated, for removal: This API element is subject to removal in a future version.Use one of thecreateUserDefined(java.lang.String, java.lang.String, java.lang.String, chemaxon.formats.factory.MRecordReaderFactory, chemaxon.formats.factory.MolImportModuleFactory, chemaxon.formats.factory.MolExportModuleFactory, chemaxon.formats.factory.RecognizerFactory, java.lang.String, long)
factory methods.Creates a user-defined format descriptor. The recogn argument specifies the recognizer module name and the priority of the format, separated by a space. If the format has more than one subformats, then their priorities are specified here in the form"format1=priority1 format2=priority2 ..."
.The
F_USER_DEFINED
flag is automatically set.- Parameters:
desc
- the format descriptionformat
- the formatmime
- the MIME type ornull
if unknownexts
- the file extensions separated by spacesrrname
- name of the record reader moduleimpname
- name of the import moduleexpname
- name of the export modulerecogn
- the file format recognizer module name and the priority (nonnegative integer)f
- the flags
-
-
Method Details
-
createUserDefined
public static MFileFormat createUserDefined(String description, String formats, String extensions, MRecordReaderFactory recordReaderFactory, MolImportModuleFactory importModuleFactory, MolExportModuleFactory exportModuleFactory, RecognizerFactory recognizerFactory, String subformatPriorities, long flags) Creates a user-defined format descriptor. TheF_USER_DEFINED
flag is automatically set.- Parameters:
description
- the format descriptionformats
- the format or subformats separated by spacesextensions
- the file extensions separated by spacesrecordReaderFactory
- factory for the record reader module, or nullrecordReaderFactory
- factory for the import module, or nullexportModuleFactory
- factory for the export module, or nullrecognizerFactory
- factory for the recognizer module, or nullsubformatPriorities
- the priority of the format (nonnegative integer). If the format has more than one subformats, then their priorities are specified here in the form"format1=priority1 format2=priority2 ..."
.flags
- the flags
-
createUserDefined
public static MFileFormat createUserDefined(String description, List<String> formats, List<String> extensions, MRecordReaderFactory recordReaderFactory, MolImportModuleFactory importModuleFactory, MolExportModuleFactory exportModuleFactory, RecognizerFactory recognizerFactory, Map<String, Integer> subformatPriorities, long flags) Creates a user-defined format descriptor. TheF_USER_DEFINED
flag is automatically set.- Parameters:
description
- the format descriptionformats
- the list of formatsextensions
- the list of file extensionsrecordReaderFactory
- factory for the record reader and import modules, or nullexportModuleFactory
- factory for the export module, or nullrecognizerFactory
- factory for the recognizer module, or nullsubformatPriorities
- a map of each subformat to its priority, or nullflags
- the flags
-
getName
Gets the codename of the format.- Returns:
- the codename
-
getNameList
Gets all the codenames of the format.- Returns:
- the codenames
-
getNames
Deprecated, for removal: This API element is subject to removal in a future version.UsegetNameList()
instead.Gets all the codenames of the format.- Returns:
- the codenames
-
getDescription
Gets the format description.- Returns:
- the description
-
getExtensionList
Gets the extension list.- Returns:
- the extension list
-
getExtensions
Deprecated, for removal: This API element is subject to removal in a future version.Gets the extension list.- Returns:
- the extension list
-
getMIMEType
Deprecated, for removal: This API element is subject to removal in a future version.as of Marvin 2014.07.21.0 not usedGets the MIME type.- Returns:
- the MIME type or
null
if unknown
-
getFlags
public long getFlags()Gets the format descriptor flags.- Returns:
- the flags
-
getAssociatedQueryFormat
Gets the associated query format.- Returns:
- the associated format or
null
-
getAssociatedNonQueryFormat
Gets the associated non-query format.- Returns:
- the associated format or
null
-
getPriority
@Deprecated(forRemoval=true) @SubjectToRemoval(date=JUL_01_2025) public int getPriority(String subfmt) Deprecated, for removal: This API element is subject to removal in a future version.as of Marvin 2014.07.21.0 usegetSubFormatPriority(String)
insteadGets the priority determining format recognition order.- Parameters:
subfmt
- the name of the subformat ornull
- Returns:
- zero or a positive number
- Throws:
IllegalArgumentException
- if priority for the specified subformat is not defined- Since:
- Marvin 5.1, 07/29/2008
-
getSubFormatPriority
Gets the priority of the specified subformat name.- Parameters:
subFormatName
- the name of the subformat- Returns:
- zero or a positive number
- Throws:
IllegalArgumentException
- if priority for the specified subformat is not defined- Since:
- Marvin 5.1, 07/29/2008
-
matches
Tests whether the format matches the specified pattern.- Parameters:
fmt
- the format name ornull
if not importantf
- these flags must be setmask
- only bits specified here are taken into account- Returns:
true
if it matches,false
otherwise
-
isFlagSet
public boolean isFlagSet(long flag) Checks whether the format has a given (set of) flag(s) set.- Parameters:
flag
- the flag (or set of flags) to be test- Returns:
- true if (all of) the given flag(s) is set, false otherwise
- Since:
- Marvin 5.1
-
createRecordReader
Creates the record reader.- Parameters:
mis
- the molecule input streamopts
- the options ornull
- Returns:
- the record reader
or
null
if there is no record reader for this format - Throws:
IllegalCharsetNameException
- if illegal encoding is usedUnsupportedCharsetException
- if unsupported encoding is usedSecurityException
- if the module cannot be loaded because of a firewall problemMolFormatException
- See Also:
-
createImportModule
Creates the molecule import module.- Returns:
- the molecule import module
or
null
if there is no importer for this format - Throws:
SecurityException
- if the module cannot be loaded because of a firewall problemMolFormatException
-
createExportModule
Creates the export module.- Returns:
- the molecul export module
or
null
if there is no exporter for this format - Throws:
SecurityException
- if the module cannot be loaded because of a firewall problemMolExportException
- See Also:
-
createExportModule
Creates the export module.- Parameters:
enc
- the encoding- Returns:
- the molecul export module
or
null
if there is no exporter for this format - Throws:
SecurityException
- if the module cannot be loaded because of a firewall problemMolExportException
- See Also:
-
createRecognizer
Creates a recognizer module.- Returns:
- the recognizer module
or
null
if there is no recognizer for this format - Throws:
SecurityException
- if the module cannot be loaded because of a firewall problemMolFormatException
- if the recognizer module cannot be created
-
createRecognizer
@Deprecated(forRemoval=true) @SubjectToRemoval(date=JUL_01_2025) public Recognizer createRecognizer(String fmt) throws MolFormatException Deprecated, for removal: This API element is subject to removal in a future version.as of Marvin 2014.07.21.0 usecreateRecognizer()
insteadCreates a recognizer module.- Parameters:
fmt
- the (sub)format's codename- Returns:
- the recognizer module
or
null
if there is no recognizer for this format - Throws:
SecurityException
- if the module cannot be loaded because of a firewall problemMolFormatException
- if the recognizer module cannot be created
-
toString
Overrides Object.toString() to ease debugging. Returns a string consisting of the classname (without the package name!), the at-sign character `@
', the unsigned hexadecimal representation of the hash code of the object and the format name(s) in square brackets.
-
createUserDefined(java.lang.String, java.lang.String, java.lang.String, chemaxon.formats.factory.MRecordReaderFactory, chemaxon.formats.factory.MolImportModuleFactory, chemaxon.formats.factory.MolExportModuleFactory, chemaxon.formats.factory.RecognizerFactory, java.lang.String, long)
factory methods.