Home  · Classes  · Annotated Classes  · Modules  · Members  · Namespaces  · Related Pages
TransitionTSVReader.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-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: Hannes Roest $
32 // $Authors: Hannes Roest $
33 // --------------------------------------------------------------------------
34 
35 #ifndef OPENMS_ANALYSIS_OPENSWATH_TRANSITIONTSVREADER_H
36 #define OPENMS_ANALYSIS_OPENSWATH_TRANSITIONTSVREADER_H
37 
43 #include <fstream>
44 
45 namespace OpenMS
46 {
47 
72  class OPENMS_DLLAPI TransitionTSVReader :
73  public ProgressLogger
74  {
75 
76 private:
77 
78  typedef std::vector<OpenMS::TargetedExperiment::Protein> ProteinVectorType;
79  typedef std::vector<OpenMS::TargetedExperiment::Peptide> PeptideVectorType;
80  typedef std::vector<OpenMS::ReactionMonitoringTransition> TransitionVectorType;
81 
83  {
84  double precursor;
85  double product;
86  double rt_calibrated;
88  double CE;
91  int decoy;
102  };
103 
104  static const char* strarray[];
105 
106  static const std::vector<std::string> header_names;
107 
109  void readTSVInput_(const char* filename, std::vector<TSVTransition>& transition_list);
110 
112  void getTSVHeader(std::string & line, char & delimiter, std::vector<std::string> header, std::map<std::string, int> & header_dict);
113 
115  void readUnstructuredTSVInput_(const char* filename, std::vector<TSVTransition>& transition_list);
116 
118  void cleanUpTransition(TSVTransition & mytransition);
119 
121  void TSVToTargetedExperiment_(std::vector<TSVTransition>& transition_list, OpenMS::TargetedExperiment& exp);
122 
123  void createTransition_(std::vector<TSVTransition>::iterator& tr_it, OpenMS::ReactionMonitoringTransition& rm_trans);
124 
125  void createProtein_(std::vector<TSVTransition>::iterator& tr_it, OpenMS::TargetedExperiment::Protein& protein);
126 
127  void createPeptide_(std::vector<TSVTransition>::iterator& tr_it, OpenMS::TargetedExperiment::Peptide& peptide);
128 
129  void add_modification_(std::vector<TargetedExperiment::Peptide::Modification> & mods,
130  int location, ResidueModification & rmod, const String & name);
131 
132 
134  void writeTSVOutput_(const char* filename, OpenMS::TargetedExperiment& targeted_exp);
135 
136 public:
138  void convertTargetedExperimentToTSV(const char* filename, OpenMS::TargetedExperiment& targeted_exp);
139 
141  void convertTSVToTargetedExperiment(const char* filename, OpenMS::TargetedExperiment& targeted_exp);
142 
144  void validateTargetedExperiment(OpenMS::TargetedExperiment& targeted_exp);
145 
146  };
147 }
148 
149 #endif
150 
double CE
Definition: TransitionTSVReader.h:88
A more convenient string class.
Definition: String.h:56
static const std::vector< std::string > header_names
Definition: TransitionTSVReader.h:106
String Annotation
Definition: TransitionTSVReader.h:94
std::vector< OpenMS::TargetedExperiment::Protein > ProteinVectorType
Definition: TransitionTSVReader.h:78
std::vector< OpenMS::TargetedExperiment::Peptide > PeptideVectorType
Definition: TransitionTSVReader.h:79
This class can convert TraML and TSV files into each other.
Definition: TransitionTSVReader.h:72
Representation of a modification.
Definition: ResidueModification.h:58
double precursor
Definition: TransitionTSVReader.h:84
double library_intensity
Definition: TransitionTSVReader.h:89
String ProteinName
Definition: TransitionTSVReader.h:93
int decoy
Definition: TransitionTSVReader.h:91
std::vector< OpenMS::ReactionMonitoringTransition > TransitionVectorType
Definition: TransitionTSVReader.h:80
String group_id
Definition: TransitionTSVReader.h:90
String group_label
Definition: TransitionTSVReader.h:97
String uniprot_id
Definition: TransitionTSVReader.h:101
int precursor_charge
Definition: TransitionTSVReader.h:96
String fragment_type
Definition: TransitionTSVReader.h:100
int fragment_nr
Definition: TransitionTSVReader.h:99
double product
Definition: TransitionTSVReader.h:85
Base class for all classes that want to report their progess.
Definition: ProgressLogger.h:56
Definition: TransitionTSVReader.h:82
This class stores an prediction of an SRM/MRM transition.
Definition: TargetedExperiment.h:53
String transition_name
Definition: TransitionTSVReader.h:87
String PeptideSequence
Definition: TransitionTSVReader.h:92
Definition: TargetedExperimentHelper.h:102
double rt_calibrated
Definition: TransitionTSVReader.h:86
int fragment_charge
Definition: TransitionTSVReader.h:98
String FullPeptideName
Definition: TransitionTSVReader.h:95
Definition: TargetedExperimentHelper.h:211
This class stores a SRM/MRM transition.
Definition: ReactionMonitoringTransition.h:53

OpenMS / TOPP release 1.11.1 Documentation generated on Thu Nov 14 2013 11:19:22 using doxygen 1.8.5