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-2015.
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 
40 
46 
47 #include <fstream>
48 
49 namespace OpenMS
50 {
51 
84  class OPENMS_DLLAPI TransitionTSVReader :
85  public ProgressLogger,
86  public DefaultParamHandler
87  {
88 
89 private:
93 
95  typedef std::vector<OpenMS::TargetedExperiment::Protein> ProteinVectorType;
96  typedef std::vector<OpenMS::TargetedExperiment::Peptide> PeptideVectorType;
97  typedef std::vector<OpenMS::ReactionMonitoringTransition> TransitionVectorType;
98 
106  {
107  double precursor;
108  double product;
111  double CE;
114  int decoy;
133  };
134 
135  static const char* strarray_[];
136 
137  static const std::vector<std::string> header_names_;
138 
147  void getTSVHeader_(const std::string& line, char& delimiter, std::vector<std::string> header, std::map<std::string, int>& header_dict);
148 
156  void readUnstructuredTSVInput_(const char* filename, FileTypes::Type filetype, std::vector<TSVTransition>& transition_list);
157 
160  void cleanupTransitions_(TSVTransition& mytransition);
161 
169  void TSVToTargetedExperiment_(std::vector<TSVTransition>& transition_list, OpenMS::TargetedExperiment& exp);
170 
178  void TSVToTargetedExperiment_(std::vector<TSVTransition>& transition_list, OpenSwath::LightTargetedExperiment& exp);
179 
189 
202  void resolveMixedSequenceGroups_(std::vector<TSVTransition>& transition_list);
203 
204  void createTransition_(std::vector<TSVTransition>::iterator& tr_it, OpenMS::ReactionMonitoringTransition& rm_trans);
205 
206  void createProtein_(std::vector<TSVTransition>::iterator& tr_it, OpenMS::TargetedExperiment::Protein& protein);
207 
208  void createPeptide_(std::vector<TSVTransition>::iterator& tr_it, OpenMS::TargetedExperiment::Peptide& peptide);
209 
210  void addModification_(std::vector<TargetedExperiment::Peptide::Modification>& mods,
211  int location, ResidueModification& rmod, const String& name);
213 
214 
220  void writeTSVOutput_(const char* filename, OpenMS::TargetedExperiment& targeted_exp);
221 
222 protected:
223 
225  void updateMembers_();
226 
227 public:
228 
232 
236 
243  void convertTargetedExperimentToTSV(const char* filename, OpenMS::TargetedExperiment& targeted_exp);
244 
252  void convertTSVToTargetedExperiment(const char* filename, FileTypes::Type filetype, OpenMS::TargetedExperiment& targeted_exp);
253 
261  void convertTSVToTargetedExperiment(const char* filename, FileTypes::Type filetype, OpenSwath::LightTargetedExperiment& targeted_exp);
262 
264  void validateTargetedExperiment(OpenMS::TargetedExperiment& targeted_exp);
265 
266  };
267 }
268 
269 #endif
Type
Actual file types enum.
Definition: FileTypes.h:59
double fragment_mzdelta
Definition: TransitionTSVReader.h:124
bool override_group_label_check_
Definition: TransitionTSVReader.h:92
double CE
Definition: TransitionTSVReader.h:111
int fragment_modification
Definition: TransitionTSVReader.h:125
A more convenient string class.
Definition: String.h:57
bool identifying_transition
Definition: TransitionTSVReader.h:129
String Annotation
Definition: TransitionTSVReader.h:117
String site_identifying_transition
Definition: TransitionTSVReader.h:130
String label_type
Definition: TransitionTSVReader.h:121
std::vector< OpenMS::TargetedExperiment::Protein > ProteinVectorType
Typedefs.
Definition: TransitionTSVReader.h:95
std::vector< OpenMS::TargetedExperiment::Peptide > PeptideVectorType
Definition: TransitionTSVReader.h:96
This class can convert TraML and TSV files into each other.
Definition: TransitionTSVReader.h:84
String site_identifying_class
Definition: TransitionTSVReader.h:131
Representation of a modification.
Definition: ResidueModification.h:65
Main OpenMS namespace.
Definition: FeatureDeconvolution.h:47
double precursor
Definition: TransitionTSVReader.h:107
double library_intensity
Definition: TransitionTSVReader.h:112
String ProteinName
Definition: TransitionTSVReader.h:116
int decoy
Definition: TransitionTSVReader.h:114
std::vector< OpenMS::ReactionMonitoringTransition > TransitionVectorType
Definition: TransitionTSVReader.h:97
String group_id
Definition: TransitionTSVReader.h:113
String uniprot_id
Definition: TransitionTSVReader.h:127
int precursor_charge
Definition: TransitionTSVReader.h:119
String fragment_type
Definition: TransitionTSVReader.h:126
String peptide_group_label
Definition: TransitionTSVReader.h:120
bool quantifying_transition
Definition: TransitionTSVReader.h:132
int fragment_nr
Definition: TransitionTSVReader.h:123
double product
Definition: TransitionTSVReader.h:108
Base class for all classes that want to report their progress.
Definition: ProgressLogger.h:55
Internal structure to represent a transition.
Definition: TransitionTSVReader.h:105
This class stores an prediction of an SRM/MRM transition.
Definition: TargetedExperiment.h:53
String transition_name
Definition: TransitionTSVReader.h:110
String PeptideSequence
Definition: TransitionTSVReader.h:115
bool detecting_transition
Definition: TransitionTSVReader.h:128
String retentionTimeInterpretation_
Members.
Definition: TransitionTSVReader.h:91
Definition: TargetedExperimentHelper.h:102
double rt_calibrated
Definition: TransitionTSVReader.h:109
A base class for all classes handling default parameters.
Definition: DefaultParamHandler.h:92
static const std::vector< std::string > header_names_
Definition: TransitionTSVReader.h:137
int fragment_charge
Definition: TransitionTSVReader.h:122
Definition: TransitionExperiment.h:179
String FullPeptideName
Definition: TransitionTSVReader.h:118
Definition: TargetedExperimentHelper.h:211
This class stores a SRM/MRM transition.
Definition: ReactionMonitoringTransition.h:55

OpenMS / TOPP release 2.0.0 Documentation generated on Tue Nov 1 2016 16:34:46 using doxygen 1.8.11