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-2016.
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 
82  class OPENMS_DLLAPI TransitionTSVReader :
83  public ProgressLogger,
84  public DefaultParamHandler
85  {
86 
87 private:
91 
93  typedef std::vector<OpenMS::TargetedExperiment::Protein> ProteinVectorType;
94  typedef std::vector<OpenMS::TargetedExperiment::Peptide> PeptideVectorType;
95  typedef std::vector<OpenMS::ReactionMonitoringTransition> TransitionVectorType;
96 
104  {
105  double precursor;
106  double product;
109  double CE;
112  int decoy;
129  };
130 
131  static const char* strarray_[];
132 
133  static const std::vector<std::string> header_names_;
134 
143  void getTSVHeader_(const std::string& line, char& delimiter, std::vector<std::string> header, std::map<std::string, int>& header_dict);
144 
152  void readUnstructuredTSVInput_(const char* filename, FileTypes::Type filetype, std::vector<TSVTransition>& transition_list);
153 
156  void cleanupTransitions_(TSVTransition& mytransition);
157 
165  void TSVToTargetedExperiment_(std::vector<TSVTransition>& transition_list, OpenMS::TargetedExperiment& exp);
166 
174  void TSVToTargetedExperiment_(std::vector<TSVTransition>& transition_list, OpenSwath::LightTargetedExperiment& exp);
175 
185 
198  void resolveMixedSequenceGroups_(std::vector<TSVTransition>& transition_list);
199 
200  void createTransition_(std::vector<TSVTransition>::iterator& tr_it, OpenMS::ReactionMonitoringTransition& rm_trans);
201 
202  void createProtein_(std::vector<TSVTransition>::iterator& tr_it, OpenMS::TargetedExperiment::Protein& protein);
203 
204  void createPeptide_(std::vector<TSVTransition>::iterator& tr_it, OpenMS::TargetedExperiment::Peptide& peptide);
205 
206  void addModification_(std::vector<TargetedExperiment::Peptide::Modification>& mods,
207  int location, ResidueModification& rmod, const String& name);
209 
210 
216  void writeTSVOutput_(const char* filename, OpenMS::TargetedExperiment& targeted_exp);
217 
218 protected:
219 
221  void updateMembers_();
222 
223 public:
224 
228 
232 
239  void convertTargetedExperimentToTSV(const char* filename, OpenMS::TargetedExperiment& targeted_exp);
240 
248  void convertTSVToTargetedExperiment(const char* filename, FileTypes::Type filetype, OpenMS::TargetedExperiment& targeted_exp);
249 
257  void convertTSVToTargetedExperiment(const char* filename, FileTypes::Type filetype, OpenSwath::LightTargetedExperiment& targeted_exp);
258 
260  void validateTargetedExperiment(OpenMS::TargetedExperiment& targeted_exp);
261 
262  };
263 }
264 
265 #endif
double fragment_mzdelta
Definition: TransitionTSVReader.h:122
bool override_group_label_check_
Definition: TransitionTSVReader.h:90
double CE
Definition: TransitionTSVReader.h:109
int fragment_modification
Definition: TransitionTSVReader.h:123
A more convenient string class.
Definition: String.h:57
bool identifying_transition
Definition: TransitionTSVReader.h:127
String Annotation
Definition: TransitionTSVReader.h:115
String label_type
Definition: TransitionTSVReader.h:119
std::vector< OpenMS::TargetedExperiment::Protein > ProteinVectorType
Typedefs.
Definition: TransitionTSVReader.h:93
std::vector< OpenMS::TargetedExperiment::Peptide > PeptideVectorType
Definition: TransitionTSVReader.h:94
This class can convert TraML and TSV files into each other.
Definition: TransitionTSVReader.h:82
Representation of a modification.
Definition: ResidueModification.h:65
Main OpenMS namespace.
Definition: FeatureDeconvolution.h:47
double precursor
Definition: TransitionTSVReader.h:105
double library_intensity
Definition: TransitionTSVReader.h:110
String ProteinName
Definition: TransitionTSVReader.h:114
int decoy
Definition: TransitionTSVReader.h:112
std::vector< OpenMS::ReactionMonitoringTransition > TransitionVectorType
Definition: TransitionTSVReader.h:95
String group_id
Definition: TransitionTSVReader.h:111
String uniprot_id
Definition: TransitionTSVReader.h:125
int precursor_charge
Definition: TransitionTSVReader.h:117
String fragment_type
Definition: TransitionTSVReader.h:124
String peptide_group_label
Definition: TransitionTSVReader.h:118
bool quantifying_transition
Definition: TransitionTSVReader.h:128
int fragment_nr
Definition: TransitionTSVReader.h:121
double product
Definition: TransitionTSVReader.h:106
Base class for all classes that want to report their progress.
Definition: ProgressLogger.h:55
Internal structure to represent a transition.
Definition: TransitionTSVReader.h:103
This class stores an prediction of an SRM/MRM transition.
Definition: TargetedExperiment.h:53
String transition_name
Definition: TransitionTSVReader.h:108
String PeptideSequence
Definition: TransitionTSVReader.h:113
bool detecting_transition
Definition: TransitionTSVReader.h:126
String retentionTimeInterpretation_
Members.
Definition: TransitionTSVReader.h:89
Definition: TargetedExperimentHelper.h:102
double rt_calibrated
Definition: TransitionTSVReader.h:107
A base class for all classes handling default parameters.
Definition: DefaultParamHandler.h:92
static const std::vector< std::string > header_names_
Definition: TransitionTSVReader.h:133
int fragment_charge
Definition: TransitionTSVReader.h:120
Type
Actual file types enum.
Definition: FileTypes.h:59
Definition: TransitionExperiment.h:157
String FullPeptideName
Definition: TransitionTSVReader.h:116
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 Jan 31 2017 06:39:56 using doxygen 1.8.8