Package chemaxon.formats
Class MFileFormat
java.lang.Object
chemaxon.formats.MFileFormat
File format descriptor class.
- Since:
- Marvin 5.0, 05/23/2007
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final MFileFormatChemaxon SMILES Abbreviated Groups.static final MFileFormatACCORD file formatstatic final MFileFormatImage object (java.awt.Image).static final MFileFormatBASE64 encoded file.static final MFileFormatChemDraw CDX file.static final MFileFormatChemDraw CDXML file.static final MFileFormatChemical Markup Language.static final MFileFormatChemaxon Compressed Molfiles, RGfiles, Rgfiles, SDfiles or RDfiles.static final MFileFormatChemaxon Compressed Molfiles and Rgfiles.static final MFileFormatChemaxon Compressed RDfiles.static final MFileFormatChemaxon Compressed Rxnfiles.static final MFileFormatChemaxon Compressed SDfiles.static final MFileFormatstatic final MFileFormatChemaxon Object Notation.static final MFileFormatChemaxon Extended SMARTS.static final MFileFormatChemaxon Extended SMILES.static final MFileFormatAny document format recognized by Document to Structure (doc, odt, ...).static final MFileFormatDNA sequence.static final MFileFormatWindows Enhanced Metafiles.static final MFileFormatEncapsulated PostScript vector image format.static final longGeneral archive format that stores a file in another format.static final longImport/export module handles binary (byte array) data.static final longThe format can store atom coordinates if this flag is set.static final longExport is possible if this flag is set.static final longFile format readable by a graphics program (image viewer, ray tracer etc.).static final long2D image file format, readable by image viewers.static final longImport is possible if this flag is set.static final longStorage of records in different formats is possible if this flag is set.static final longThe format can store molecule(s) if this flag is set.static final longThe format is designed to store multiple records if this flag is set.static final longThe 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 longImport/export module creates or reads a java object.static final longThe format can store reaction(s) if this flag is set.static final longFormat recognizer exists if this flag is set.static final longFormat uses one line per structure.static final longUser defined format.static final longThe format is XML based if this flag is set.static final MFileFormatFASTA file formatstatic final MFileFormatFASTA file format with DNA sequencestatic final MFileFormatFASTA file format with peptide sequencestatic final MFileFormatFASTA file format with RNA sequencestatic final MFileFormatGaussian Cube files.static final MFileFormatGaussian Input Format.static final MFileFormatGaussian Input Format: Z-matrix.static final MFileFormatGaussian output format.static final MFileFormatGZIP compressed file.static final MFileFormatIUPAC InChI files.static final MFileFormatIUPAC InChIKey.static final MFileFormatJPEG format.static final MFileFormatMDL Molfiles and Rgfiles.static final MFileFormatstatic final MFileFormatMDL Extended Molfiles and Rgfiles.static final MFileFormatTripos Mol2 files.static final MFileFormatChemaxon Marvin Document.static final MFileFormatWindows Bitmap format.static final MFileFormatIUPAC Name files.static final MFileFormatstatic final MFileFormatProtein Data Bank format.static final MFileFormatPortable Document Format.static final MFileFormatPeptide Sequence.static final MFileFormatPeptide Sequence (1-letter).static final MFileFormatPeptide Sequence (3-letter).static final MFileFormatPortable Network Graphics.static final MFileFormatPOVRay file.static final MFileFormatMDL RDfiles.static final MFileFormatRNA sequence.static final MFileFormatMDL Rxnfiles.static final MFileFormatMDL Extended Rxnfiles.static final MFileFormatMDL SDfiles.static final MFileFormatSKC file formatstatic final MFileFormatSMARTS.static final MFileFormatSMILES.static final MFileFormatScalable Vector Graphics.static final MFileFormatTripos SYBYL molfiles.static final MFileFormatTagged Image File Format.static final MFileFormatstatic final MFileFormatXYZ files. -
Constructor Summary
Constructors -
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 MFileFormatcreateUserDefined(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 MFileFormatcreateUserDefined(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.longgetFlags()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.intgetPriority(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 intgetSubFormatPriority(String subFormatName) Gets the priority of the specified subformat name.booleanisFlagSet(long flag) Checks whether the format has a given (set of) flag(s) set.booleanTests 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_DEFINEDflag is automatically set.- Parameters:
desc- the format descriptionformat- the formatmime- the MIME type ornullif 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_DEFINEDflag 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 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 flagsrecordReaderFactory- factory for the import module, or null
-
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_DEFINEDflag 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
nullif 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 ornullif not importantf- these flags must be setmask- only bits specified here are taken into account- Returns:
trueif it matches,falseotherwise
-
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
nullif 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
nullif 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
nullif 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
nullif 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
nullif 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
nullif 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.