![]() |
OpenMS
|
Centralizes the file types recognized by FileHandler. More...
#include <OpenMS/FORMAT/FileTypes.h>
Static Public Member Functions | |
| static std::string | typeToName (Type type) |
| Returns the name/preferred extension of the type. | |
| static std::vector< std::string > | typeToExtensions (Type type) |
Returns every extension accepted for type, preferred one first. | |
| static std::string | typeToDescription (Type type) |
| static Type | nameToType (const std::string &name) |
| static std::string | typeToMZML (Type type) |
| Returns the mzML name (TODO: switch to accession since they are more stable!) | |
| static bool | isDirectoryType (Type type) |
Returns true if type represents a directory-shaped format (e.g. BRUKER_TDF, IDPARQUET, FEATUREPARQUET, CONSENSUSPARQUET). | |
| static bool | supportsCompressedReading (Type type, Type compression) |
Can a reader for type read a file compressed with compression directly? | |
| static bool | supportsCompressedWriting (Type type, Type compression) |
Does the writer for type produce the compression that compression names? | |
| static bool | sameFormat (const std::string &lhs, const std::string &rhs) |
| Do two declared format strings denote the same format? | |
Centralizes the file types recognized by FileHandler.
FileType separate from FileHandler to avoid circular inclusions by DocumentIdentifier, ExperimentalSettings and FileHandler and respective fileclasses (e.g. DTA2DFile).
|
strong |
| enum Type |
Actual file types enum.
| Enumerator | |
|---|---|
| UNKNOWN | Unknown file extension. |
| DTA | DTA file (.dta) |
| DTA2D | DTA2D file (.dta2d) |
| MZDATA | MzData file (.mzData) |
| MZXML | MzXML file (.mzXML) |
| FEATUREXML | OpenMS feature file (.featureXML) |
| IDXML | OpenMS identification format (.idXML) |
| CONSENSUSXML | OpenMS consensus map format (.consensusXML) |
| MGF | Mascot Generic Format (.mgf) |
| INI | OpenMS parameters file (.ini) |
| TOPPAS | OpenMS parameters file with workflow information (.toppas) |
| TRANSFORMATIONXML | Transformation description file (.trafoXML) |
| MZML | MzML file (.mzML) |
| CACHEDMZML | CachedMzML file (.cachedmzML) |
| MS2 | MS2 file (.ms2) |
| PEPXML | TPP pepXML file (.pepXML) |
| PROTXML | TPP protXML file (.protXML) |
| MZIDENTML | mzIdentML (HUPO PSI AnalysisXML followup format) (.mzid) |
| QCML | qcML (will undergo standardisation maybe) (.qcml) |
| MZQC | mzQC (HUPO PSI format) (.mzQC) |
| GELML | GelML (HUPO PSI format) (.gelML) |
| TRAML | TraML (HUPO PSI format) for transitions (.traML) |
| MSP | NIST spectra library file format (.msp) |
| OMSSAXML | OMSSA XML file format for peptide identifications (.xml) |
| MASCOTXML | Mascot XML file format for peptide identifications (.xml) |
| PNG | Portable Network Graphics (.png) |
| XMASS | XMass Analysis file (fid) |
| TSV | any TSV file, for example msInspect file or OpenSWATH transition file (see TransitionTSVFile) |
| MZTAB | mzTab file (.mzTab) |
| PEPLIST | specArray file (.peplist) |
| HARDKLOER | hardkloer file (.hardkloer) |
| KROENIK | kroenik file (.kroenik) |
| FASTA | FASTA file (.fasta) |
| PEFF | PEFF file (.peff) |
| EDTA | enhanced comma separated files (RT, m/z, Intensity, [meta]) |
| CSV | general comma separated files format (might also be tab or space separated!!!), data should be regular, i.e. matrix form |
| TXT | any text format, which has only loose definition of what it actually contains – thus it is usually hard to say where the file actually came from (e.g. PepNovo). |
| OBO | Controlled Vocabulary format. |
| HTML | any HTML format |
| ANALYSISXML | analysisXML format |
| XSD | XSD schema format. |
| PSQ | NCBI binary blast db. |
| MRM | SpectraST MRM List. |
| SQMASS | SqLite format for mass and chromatograms, see SqMassFile. |
| PQP | OpenSWATH Peptide Query Parameter (PQP) SQLite DB, see TransitionPQPFile. |
| CHROMPARQUET | OpenSWATH Parquet chromatogram output (.xic) |
| MOBILPARQUET | OpenSWATH Parquet mobilogram output (.xim) |
| PEAKMAPPARQUET | OpenSWATH Parquet peak-map output (.xipm) |
| OSWPQ | OpenSWATH Parquet bundle (.oswpq) for library and/or feature output. |
| MS | SIRIUS file format (.ms) |
| OSW | OpenSWATH OpenSWATH report (OSW) SQLite DB. |
| PSMS | Percolator tab-delimited output (PSM level) |
| PIN | Percolator tab-delimited input (PSM level) |
| PARAMXML | internal format for writing and reading parameters (also used as part of CTD) |
| SPLIB | SpectraST binary spectral library file (sptxt is the equivalent text-based format, similar to the MSP format) |
| NOVOR | Novor custom parameter file. |
| XQUESTXML | xQuest XML file format for protein-protein cross-link identifications (.xquest.xml) |
| SPECXML | xQuest XML file format for matched spectra for spectra visualization in the xQuest results manager (.spec.xml) |
| JSON | JavaScript Object Notation file (.json) |
| RAW | Thermo Raw File (.raw) |
| OMS | OpenMS database file. |
| EXE | Executable (.exe) |
| XML | any XML format |
| BZ2 | any BZ2 compressed file |
| GZ | any Gzipped file |
| ZIP | any ZIP compressed file |
| PARQUET | Apache Parquet file format (.parquet, .pqt) |
| IDPARQUET | OpenMS internal identification parquet bundle (directory: psms.parquet + proteins.parquet + protein_groups.parquet + search_params.parquet) |
| FEATUREPARQUET | OpenMS internal feature map parquet bundle (directory: features.parquet + psms.parquet + proteins.parquet + protein_groups.parquet + search_params.parquet) |
| CONSENSUSPARQUET | OpenMS internal consensus map parquet bundle (directory: consensus_features.parquet + psms.parquet + proteins.parquet + protein_groups.parquet + search_params.parquet) |
| BRUKER_TDF | Bruker TimsTOF .d directory (TDF format) |
| IMZML | imzML mass spectrometry imaging file (.imzML + .ibd) |
| YAML | YAML Ain't Markup Language file (.yaml) |
| SIZE_OF_TYPE | No file type. Simply stores the number of types. |
|
static |
Returns true if type represents a directory-shaped format (e.g. BRUKER_TDF, IDPARQUET, FEATUREPARQUET, CONSENSUSPARQUET).
|
static |
Converts a file type name into a Type Accepts the preferred extension as well as any registered alias (e.g. 'fa' and 'faa' both give FASTA).
| [in] | name | A case-insensitive name (e.g. FASTA or Fasta, etc.) |
|
static |
Do two declared format strings denote the same format?
Recognized names are compared by type, so a preferred extension and any of its aliases match ('fasta' == 'fa'). If either side is unrecognized the comparison falls back to a case-insensitive string compare, so two different custom extensions never become equal just because both map to UNKNOWN.
| [in] | lhs | A format name, without a leading dot (e.g. 'fasta' or a tool's custom extension) |
| [in] | rhs | The format name to compare against |
Can a reader for type read a file compressed with compression directly?
Transparent decompression is provided by XMLFile through CompressedInputSource, which handles all three suffixes, so it covers the XML-based formats. BRUKER_TDF is the exception: FileHandler unpacks a '.d.zip' archive via ZipArchiveFile but has no gzip or bzip2 path, so it supports ZIP only. A compressed filename of any other type still resolves to that type by name, but no reader will accept it, so callers must not treat the compression suffix as proof that the file can be read.
| [in] | type | The format inside the compressed container |
| [in] | compression | GZ, BZ2 or ZIP; anything else returns false |
Does the writer for type produce the compression that compression names?
The counterpart of supportsCompressedReading(). XMLFile compresses what it stores with gzip or bzip2 when the file name ends in '.gz' or '.bz2' (any letter case), which covers the formats marked COMPRESSED_WRITEABLE; it never writes a ZIP archive. OSWPQ is the exception: its writers always produce a ZIP archive, so a '.oswpq.zip' name matches what is written. Every other writer stores plain data whatever the file name says, so a TOPP tool refuses such an output name.
| [in] | type | The format to write |
| [in] | compression | GZ, BZ2 or ZIP; anything else returns false |
|
static |
Returns the human-readable explanation of the type. This may or may not add information, e.g. MZML becomes "mzML raw data file", but FEATUREXML becomes "OpenMS feature map"
|
static |
Returns every extension accepted for type, preferred one first.
The first element always equals typeToName(type) and is what OpenMS writes; the remaining ones are aliases that are merely recognized on input (e.g. FASTA yields {"fasta", "fa", "faa"}). Use this for file dialog filters and format listings; use typeToName() when a single canonical extension is required.
| [in] | type | The type to look up |
| Exception::InvalidValue | if type is not a known type |
|
static |
Returns the mzML name (TODO: switch to accession since they are more stable!)
|
static |
Returns the name/preferred extension of the type.
Referenced by TOPPViewBase::addDataFile(), TOPPViewBase::showTOPPDialog_(), and OpenMS::Internal::ClassTest::validateTmpFiles().