~ubuntu-branches/ubuntu/wily/openms/wily

« back to all changes in this revision

Viewing changes to include/OpenMS/FORMAT/FileTypes.h

  • Committer: Package Import Robot
  • Author(s): Filippo Rusconi
  • Date: 2013-12-20 11:30:16 UTC
  • mfrom: (5.1.2 sid)
  • Revision ID: package-import@ubuntu.com-20131220113016-wre5g9bteeheq6he
Tags: 1.11.1-3
* remove version number from libbost development package names;
* ensure that AUTHORS is correctly shipped in all packages.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
// -*- mode: C++; tab-width: 2; -*-
2
 
// vi: set ts=2:
3
 
//
4
 
// --------------------------------------------------------------------------
5
 
//                   OpenMS Mass Spectrometry Framework
6
 
// --------------------------------------------------------------------------
7
 
//  Copyright (C) 2003-2011 -- Oliver Kohlbacher, Knut Reinert
8
 
//
9
 
//  This library is free software; you can redistribute it and/or
10
 
//  modify it under the terms of the GNU Lesser General Public
11
 
//  License as published by the Free Software Foundation; either
12
 
//  version 2.1 of the License, or (at your option) any later version.
13
 
//
14
 
//  This library is distributed in the hope that it will be useful,
15
 
//  but WITHOUT ANY WARRANTY; without even the implied warranty of
16
 
//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
17
 
//  Lesser General Public License for more details.
18
 
//
19
 
//  You should have received a copy of the GNU Lesser General Public
20
 
//  License along with this library; if not, write to the Free Software
21
 
//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
22
 
//
23
 
// --------------------------------------------------------------------------
24
 
// $Maintainer: Andreas Bertsch $
25
 
// $Authors: Marc Sturm $
 
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-2013.
 
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: Stephan Aiche $
 
32
// $Authors: Andreas Bertsch, Marc Sturm, Stephan Aiche $
26
33
// --------------------------------------------------------------------------
27
34
 
28
35
#ifndef OPENMS_FORMAT_FILETYPES_H
29
36
#define OPENMS_FORMAT_FILETYPES_H
30
37
 
31
38
#include <OpenMS/config.h>
 
39
#include <OpenMS/DATASTRUCTURES/String.h>
 
40
 
 
41
#include <string>
 
42
#include <map>
32
43
 
33
44
namespace OpenMS
34
45
{
35
 
        /**
36
 
                @brief Centralizes the file types recognized by FileHandler.
37
 
 
38
 
                FileType separate from FileHandler to avoid circular inclusions by DocumentIdentifier, ExperimentalSettings and FileHandler and respective fileclasses (e.g. DTA2DFile). See also: FileHandler::nameToType, FileHandler::typeToName and FileHandler::NameOfTypes .
39
 
 
40
 
                @ingroup FileIO
41
 
        */
42
 
        struct FileTypes
43
 
        {
44
 
                //NOTE: if you change/add something here, do not forget to change FileHandler::NameOfTypes[]
45
 
 
46
 
                ///Actual file types enum.
47
 
                enum Type
48
 
                {
49
 
                        UNKNOWN,                        ///< Unknown file extension
50
 
                        DTA,                            ///< DTA file (.dta)
51
 
                        DTA2D,                          ///< DTA2D file (.dta2d)
52
 
                        MZDATA,                         ///< MzData file (.MzData)
53
 
                        MZXML,                          ///< MzXML file (.MzXML)
54
 
                        FEATUREXML,                     ///< %OpenMS feature file (.featureXML)
55
 
                        IDXML,                                                  ///< %OpenMS identification format (.idXML)
56
 
                        CONSENSUSXML,                   ///< %OpenMS consensus map format (.consensusXML)
57
 
                        MGF,                                                            ///< Mascot Generic Format (.mgf)
58
 
                        INI,                            ///< %OpenMS parameters file (.ini)
59
 
      TOPPAS,                   ///< %OpenMS parameters file with workflow information (.toppas)
60
 
                        TRANSFORMATIONXML,  ///< Tranformation description file (.trafoXML)
61
 
                        MZML,                                                           ///< MzML file (.mzML)
62
 
                        MS2,                                                            ///< MS2 file (.ms2)
63
 
                        PEPXML,                                                 ///< TPP pepXML file (.pepXML)
64
 
                        PROTXML,                                                ///< TPP protXML file (.protXML)
65
 
                        MZIDENTML,                                      ///< mzIdentML (HUPO PSI AnalysisXML followup format) (.mzid)
66
 
                        GELML,                                                  ///< GelML (HUPO PSI format) (.GelML)
67
 
                        TRAML,                                                  ///< TraML (HUPO PSI format) for transitions (.TraML)
68
 
                        MSP,                                                            ///< NIST spectra library file format (.msp)
69
 
                        OMSSAXML,                                               ///< OMSSA XML file format for peptide identifications (.xml)
70
 
                        MASCOTXML,                                              ///< Mascot XML file format for peptide identifications (.xml)
71
 
                        PNG,                ///< Portable Network Graphics (.png)
72
 
                        XMASS,              ///< XMass Analysis file (fid)
 
46
  /**
 
47
    @brief Centralizes the file types recognized by FileHandler.
 
48
 
 
49
    FileType separate from FileHandler to avoid circular inclusions by DocumentIdentifier, ExperimentalSettings
 
50
    and FileHandler and respective fileclasses (e.g. DTA2DFile).
 
51
 
 
52
    @ingroup FileIO
 
53
  */
 
54
  struct OPENMS_DLLAPI FileTypes
 
55
  {
 
56
    //NOTE: if you change/add something here, do not forget to change FileTyoes::initializeMap_
 
57
 
 
58
    ///Actual file types enum.
 
59
    enum Type
 
60
    {
 
61
      UNKNOWN,            ///< Unknown file extension
 
62
      DTA,                ///< DTA file (.dta)
 
63
      DTA2D,              ///< DTA2D file (.dta2d)
 
64
      MZDATA,             ///< MzData file (.mzData)
 
65
      MZXML,              ///< MzXML file (.mzXML)
 
66
      FEATUREXML,         ///< %OpenMS feature file (.featureXML)
 
67
      IDXML,              ///< %OpenMS identification format (.idXML)
 
68
      CONSENSUSXML,       ///< %OpenMS consensus map format (.consensusXML)
 
69
      MGF,                ///< Mascot Generic Format (.mgf)
 
70
      INI,                ///< %OpenMS parameters file (.ini)
 
71
      TOPPAS,             ///< %OpenMS parameters file with workflow information (.toppas)
 
72
      TRANSFORMATIONXML,  ///< Tranformation description file (.trafoXML)
 
73
      MZML,               ///< MzML file (.mzML)
 
74
      MS2,                ///< MS2 file (.ms2)
 
75
      PEPXML,             ///< TPP pepXML file (.pepXML)
 
76
      PROTXML,            ///< TPP protXML file (.protXML)
 
77
      MZIDENTML,          ///< mzIdentML (HUPO PSI AnalysisXML followup format) (.mzid)
 
78
      MZQUANTML,          ///< mzQuantML (HUPO PSI AnalysisXML followup format) (.mzq)
 
79
      QCML,               ///< mzQualityML (will undergo standardisation maybe) (.qcml)
 
80
      GELML,              ///< GelML (HUPO PSI format) (.gelML)
 
81
      TRAML,              ///< TraML (HUPO PSI format) for transitions (.traML)
 
82
      MSP,                ///< NIST spectra library file format (.msp)
 
83
      OMSSAXML,           ///< OMSSA XML file format for peptide identifications (.xml)
 
84
      MASCOTXML,          ///< Mascot XML file format for peptide identifications (.xml)
 
85
      PNG,                ///< Portable Network Graphics (.png)
 
86
      XMASS,              ///< XMass Analysis file (fid)
73
87
      TSV,                ///< msInspect file (.tsv)
74
 
      PEPLIST,            ///< specArray file (.pepList)
 
88
      PEPLIST,            ///< specArray file (.peplist)
75
89
      HARDKLOER,          ///< hardkloer file (.hardkloer)
76
90
      KROENIK,            ///< kroenik file (.kroenik)
77
91
      FASTA,              ///< FASTA file (.fasta)
78
92
      EDTA,               ///< enhanced comma separated files (RT, m/z, Intensity, [meta])
79
 
                        SIZE_OF_TYPE                    ///< No file type. Simply stores the number of types
80
 
                };
81
 
        };
 
93
      CSV,                ///< general comma separated files format (might also be tab or space separated!!!), data should be regular, i.e. matrix form
 
94
      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).
 
95
      OBO,                ///< Controlled Vocabulary format
 
96
      HTML,               ///< any HTML format
 
97
      XML,                ///< any XML format
 
98
      ANALYSISXML,        ///< analysisXML format
 
99
      XSD,                ///< XSD schema format
 
100
      PSQ,                ///< NCBI binary blast db
 
101
      SIZE_OF_TYPE        ///< No file type. Simply stores the number of types
 
102
    };
 
103
 
 
104
    /// Returns the name/extension of the type.
 
105
    static String typeToName(Type type);
 
106
 
 
107
    /// Returns the mzML name (TODO: switch to accession since they are more stable!)
 
108
    static String typeToMZML(Type type);
 
109
 
 
110
    /// Converts a file type name into a Type
 
111
    static Type nameToType(const String& name);
 
112
 
 
113
private:
 
114
    /// Maps the FileType::Type to the preferred extension.
 
115
    static const std::map<Type, String> name_of_types_;
 
116
    
 
117
    /// Maps the FileType::Type to the preferred mzML CV name.
 
118
    static const std::map<Type, String> name_of_MZMLtypes_;
 
119
 
 
120
    /// Initializer for the file extension map.
 
121
    static std::map<Type, String> initializeMap_();
 
122
 
 
123
    /// Initializer for the file extension map.
 
124
    static std::map<Type, String> initializeMZMLMap_();
 
125
 
 
126
  };
82
127
 
83
128
} //namespace OpenMS
84
129