OpenMS  3.0.0
FileTypes.h
Go to the documentation of this file.
1 // --------------------------------------------------------------------------
2 // OpenMS -- Open-Source Mass Spectrometry
3 // --------------------------------------------------------------------------
4 // Copyright The OpenMS Team -- Eberhard Karls University Tuebingen,
5 // ETH Zurich, and Freie Universitaet Berlin 2002-2022.
6 //
7 // This software is released under a three-clause BSD license:
8 // * Redistributions of source code must retain the above copyright
9 // notice, this list of conditions and the following disclaimer.
10 // * Redistributions in binary form must reproduce the above copyright
11 // notice, this list of conditions and the following disclaimer in the
12 // documentation and/or other materials provided with the distribution.
13 // * Neither the name of any author or any participating institution
14 // may be used to endorse or promote products derived from this software
15 // without specific prior written permission.
16 // For a full list of authors, refer to the file AUTHORS.
17 // --------------------------------------------------------------------------
18 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19 // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20 // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21 // ARE DISCLAIMED. IN NO EVENT SHALL ANY OF THE AUTHORS OR THE CONTRIBUTING
22 // INSTITUTIONS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
23 // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
24 // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
25 // OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
26 // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
27 // OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
28 // ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 //
30 // --------------------------------------------------------------------------
31 // $Maintainer: Timo Sachsenberg $
32 // $Authors: Stephan Aiche, Andreas Bertsch, Marc Sturm, Chris Bielow $
33 // --------------------------------------------------------------------------
34 
35 #pragma once
36 
37 #include <OpenMS/config.h>
39 
40 #include <vector>
41 
42 namespace OpenMS
43 {
52  struct OPENMS_DLLAPI FileTypes
53  {
54 
56  enum Type
57  {
59  DTA,
66  MGF,
67  INI,
70  MZML,
72  MS2,
77  QCML,
78  MZQC,
81  MSP,
84  PNG,
86  TSV,
92  EDTA,
93  CSV,
94  TXT,
95  OBO,
96  HTML,
98  XSD,
99  PSQ,
100  MRM,
102  PQP,
103  MS,
104  OSW,
106  PIN,
113  RAW,
114  OMS,
115  EXE,
116  XML,
117  BZ2,
118  GZ,
119  SIZE_OF_TYPE
120  };
121 
123  static String typeToName(Type type);
124 
128  static String typeToDescription(Type type);
129 
132  static Type nameToType(const String& name);
133 
135  static String typeToMZML(Type type);
136  };
137 
138  enum class FilterLayout
139  {
140  COMPACT,
141  ONE_BY_ONE,
142  BOTH
143  };
149  class OPENMS_DLLAPI FileTypeList
150  {
151  public:
152  FileTypeList(const std::vector<FileTypes::Type>& types);
153 
155  bool contains(const FileTypes::Type& type) const;
156 
157  const std::vector<FileTypes::Type>& getTypes() const
158  {
159  return type_list_;
160  }
161 
166  String toFileDialogFilter(const FilterLayout style, bool add_all_filter) const;
167 
182  FileTypes::Type fromFileDialogFilter(const String& filter, const FileTypes::Type fallback = FileTypes::Type::UNKNOWN) const;
183 
184  private:
187  {
188  std::vector<String> items;
189  std::vector<FileTypes::Type> types;
190  };
194  FilterElements_ asFilterElements_(const FilterLayout style, bool add_all_filter) const;
195 
196  std::vector<FileTypes::Type> type_list_;
197  };
198 
199 } // namespace OpenMS
200 
OpenMS parameters file with workflow information (.toppas)
Definition: FileTypes.h:68
Type
Actual file types enum.
Definition: FileTypes.h:56
any TSV file, for example msInspect file or OpenSWATH transition file (see TransitionTSVFile) ...
Definition: FileTypes.h:86
NIST spectra library file format (.msp)
Definition: FileTypes.h:81
any BZ2 compressed file
Definition: FileTypes.h:117
A more convenient string class.
Definition: String.h:58
MS2 file (.ms2)
Definition: FileTypes.h:72
XSD schema format.
Definition: FileTypes.h:98
FASTA file (.fasta)
Definition: FileTypes.h:91
OpenMS identification format (.idXML)
Definition: FileTypes.h:64
CachedMzML file (.cachedmzML)
Definition: FileTypes.h:71
const std::vector< FileTypes::Type > & getTypes() const
Definition: FileTypes.h:157
MzData file (.mzData)
Definition: FileTypes.h:61
Novor custom parameter file.
Definition: FileTypes.h:109
NCBI binary blast db.
Definition: FileTypes.h:99
general comma separated files format (might also be tab or space separated!!!), data should be regula...
Definition: FileTypes.h:93
Portable Network Graphics (.png)
Definition: FileTypes.h:84
mzQC (HUPO PSI format) (.mzQC)
Definition: FileTypes.h:78
mzTab file (.mzTab)
Definition: FileTypes.h:87
Main OpenMS namespace.
Definition: FeatureDeconvolution.h:47
holds a vector of known file types, e.g. as a way to specify supported input formats ...
Definition: FileTypes.h:149
specArray file (.peplist)
Definition: FileTypes.h:88
internal format for writing and reading parameters (also used as part of CTD)
Definition: FileTypes.h:107
Centralizes the file types recognized by FileHandler.
Definition: FileTypes.h:52
mzQuantML (HUPO PSI AnalysisXML followup format) (.mzq)
Definition: FileTypes.h:76
OpenMS consensus map format (.consensusXML)
Definition: FileTypes.h:65
OMSSA XML file format for peptide identifications (.xml)
Definition: FileTypes.h:82
JavaScript Object Notation file (.json)
Definition: FileTypes.h:112
analysisXML format
Definition: FileTypes.h:97
Mascot XML file format for peptide identifications (.xml)
Definition: FileTypes.h:83
enhanced comma separated files (RT, m/z, Intensity, [meta])
Definition: FileTypes.h:92
TPP protXML file (.protXML)
Definition: FileTypes.h:74
combine COMPACT and ONE_BY_ONE
Unknown file extension.
Definition: FileTypes.h:58
Executable (.exe)
Definition: FileTypes.h:115
mzIdentML (HUPO PSI AnalysisXML followup format) (.mzid)
Definition: FileTypes.h:75
xQuest XML file format for matched spectra for spectra visualization in the xQuest results manager (...
Definition: FileTypes.h:111
DTA file (.dta)
Definition: FileTypes.h:59
OpenSWATH Peptide Query Parameter (PQP) SQLite DB, see TransitionPQPFile.
Definition: FileTypes.h:102
XMass Analysis file (fid)
Definition: FileTypes.h:85
list all types individually, e.g. &#39;mzML files (*.mzML);;mzXML files (*.mzXML);;&#39;
kroenik file (.kroenik)
Definition: FileTypes.h:90
SpectraST binary spectral library file (sptxt is the equivalent text-based format, similar to the MSP format)
Definition: FileTypes.h:108
TraML (HUPO PSI format) for transitions (.traML)
Definition: FileTypes.h:80
qcML (will undergo standardisation maybe) (.qcml)
Definition: FileTypes.h:77
any text format, which has only loose definition of what it actually contains – thus it is usually h...
Definition: FileTypes.h:94
std::vector< FileTypes::Type > types
Definition: FileTypes.h:189
any HTML format
Definition: FileTypes.h:96
OpenMS feature file (.featureXML)
Definition: FileTypes.h:63
Controlled Vocabulary format.
Definition: FileTypes.h:95
make a single item, e.g. &#39;all readable files (*.mzML *.mzXML);;&#39;
xQuest XML file format for protein-protein cross-link identifications (.xquest.xml) ...
Definition: FileTypes.h:110
Transformation description file (.trafoXML)
Definition: FileTypes.h:69
FilterLayout
Definition: FileTypes.h:138
Percolator tab-delimited output (PSM level)
Definition: FileTypes.h:105
OpenMS database file.
Definition: FileTypes.h:114
SIRIUS file format (.ms)
Definition: FileTypes.h:103
any XML format
Definition: FileTypes.h:116
hardkloer file (.hardkloer)
Definition: FileTypes.h:89
Percolator tab-delimited input (PSM level)
Definition: FileTypes.h:106
hold filter items (for Qt dialogs) along with their OpenMS type
Definition: FileTypes.h:186
OpenSWATH OpenSWATH report (OSW) SQLite DB.
Definition: FileTypes.h:104
GelML (HUPO PSI format) (.gelML)
Definition: FileTypes.h:79
SqLite format for mass and chromatograms, see SqMassFile.
Definition: FileTypes.h:101
DTA2D file (.dta2d)
Definition: FileTypes.h:60
bool contains(T value, T min, T max)
Is a value contained in [min, max] ?
Definition: MathFunctions.h:87
std::vector< String > items
Definition: FileTypes.h:188
Mascot Generic Format (.mgf)
Definition: FileTypes.h:66
Thermo Raw File (.raw)
Definition: FileTypes.h:113
MzML file (.mzML)
Definition: FileTypes.h:70
any Gzipped file
Definition: FileTypes.h:118
SpectraST MRM List.
Definition: FileTypes.h:100
std::vector< FileTypes::Type > type_list_
Definition: FileTypes.h:196
OpenMS parameters file (.ini)
Definition: FileTypes.h:67
MzXML file (.mzXML)
Definition: FileTypes.h:62
TPP pepXML file (.pepXML)
Definition: FileTypes.h:73