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 
79  class OPENMS_DLLAPI TransitionTSVReader :
80  public ProgressLogger,
81  public DefaultParamHandler
82  {
83 
84 private:
88 
90  typedef std::vector<OpenMS::TargetedExperiment::Protein> ProteinVectorType;
91  typedef std::vector<OpenMS::TargetedExperiment::Peptide> PeptideVectorType;
92  typedef std::vector<OpenMS::ReactionMonitoringTransition> TransitionVectorType;
93 
101  {
102  double precursor;
103  double product;
106  double CE;
109  int decoy;
123  };
124 
125  static const char* strarray_[];
126 
127  static const std::vector<std::string> header_names_;
128 
137  void getTSVHeader_(const std::string& line, char& delimiter, std::vector<std::string> header, std::map<std::string, int>& header_dict);
138 
146  void readUnstructuredTSVInput_(const char* filename, FileTypes::Type filetype, std::vector<TSVTransition>& transition_list);
147 
150  void cleanupTransitions_(TSVTransition& mytransition);
151 
159  void TSVToTargetedExperiment_(std::vector<TSVTransition>& transition_list, OpenMS::TargetedExperiment& exp);
160 
168  void TSVToTargetedExperiment_(std::vector<TSVTransition>& transition_list, OpenSwath::LightTargetedExperiment& exp);
169 
179 
192  void resolveMixedSequenceGroups_(std::vector<TSVTransition>& transition_list);
193 
194  void createTransition_(std::vector<TSVTransition>::iterator& tr_it, OpenMS::ReactionMonitoringTransition& rm_trans);
195 
196  void createProtein_(std::vector<TSVTransition>::iterator& tr_it, OpenMS::TargetedExperiment::Protein& protein);
197 
198  void createPeptide_(std::vector<TSVTransition>::iterator& tr_it, OpenMS::TargetedExperiment::Peptide& peptide);
199 
200  void addModification_(std::vector<TargetedExperiment::Peptide::Modification>& mods,
201  int location, ResidueModification& rmod, const String& name);
203 
204 
210  void writeTSVOutput_(const char* filename, OpenMS::TargetedExperiment& targeted_exp);
211 
212 protected:
213 
215  void updateMembers_();
216 
217 public:
218 
222 
226 
233  void convertTargetedExperimentToTSV(const char* filename, OpenMS::TargetedExperiment& targeted_exp);
234 
242  void convertTSVToTargetedExperiment(const char* filename, FileTypes::Type filetype, OpenMS::TargetedExperiment& targeted_exp);
243 
251  void convertTSVToTargetedExperiment(const char* filename, FileTypes::Type filetype, OpenSwath::LightTargetedExperiment& targeted_exp);
252 
254  void validateTargetedExperiment(OpenMS::TargetedExperiment& targeted_exp);
255 
256  };
257 }
258 
259 #endif
Type
Actual file types enum.
Definition: FileTypes.h:59
double fragment_mzdelta
Definition: TransitionTSVReader.h:119
bool override_group_label_check_
Definition: TransitionTSVReader.h:87
double CE
Definition: TransitionTSVReader.h:106
int fragment_modification
Definition: TransitionTSVReader.h:120
A more convenient string class.
Definition: String.h:57
String Annotation
Definition: TransitionTSVReader.h:112
String label_type
Definition: TransitionTSVReader.h:116
std::vector< OpenMS::TargetedExperiment::Protein > ProteinVectorType
Typedefs.
Definition: TransitionTSVReader.h:90
std::vector< OpenMS::TargetedExperiment::Peptide > PeptideVectorType
Definition: TransitionTSVReader.h:91
This class can convert TraML and TSV files into each other.
Definition: TransitionTSVReader.h:79
Representation of a modification.
Definition: ResidueModification.h:65
double precursor
Definition: TransitionTSVReader.h:102
double library_intensity
Definition: TransitionTSVReader.h:107
String ProteinName
Definition: TransitionTSVReader.h:111
int decoy
Definition: TransitionTSVReader.h:109
std::vector< OpenMS::ReactionMonitoringTransition > TransitionVectorType
Definition: TransitionTSVReader.h:92
String group_id
Definition: TransitionTSVReader.h:108
String uniprot_id
Definition: TransitionTSVReader.h:122
int precursor_charge
Definition: TransitionTSVReader.h:114
String fragment_type
Definition: TransitionTSVReader.h:121
String peptide_group_label
Definition: TransitionTSVReader.h:115
int fragment_nr
Definition: TransitionTSVReader.h:118
double product
Definition: TransitionTSVReader.h:103
Base class for all classes that want to report their progress.
Definition: ProgressLogger.h:55
Internal structure to represent a transition.
Definition: TransitionTSVReader.h:100
This class stores an prediction of an SRM/MRM transition.
Definition: TargetedExperiment.h:53
String transition_name
Definition: TransitionTSVReader.h:105
String PeptideSequence
Definition: TransitionTSVReader.h:110
String retentionTimeInterpretation_
Members.
Definition: TransitionTSVReader.h:86
Definition: TargetedExperimentHelper.h:102
double rt_calibrated
Definition: TransitionTSVReader.h:104
A base class for all classes handling default parameters.
Definition: DefaultParamHandler.h:92
static const std::vector< std::string > header_names_
Definition: TransitionTSVReader.h:127
int fragment_charge
Definition: TransitionTSVReader.h:117
Definition: TransitionExperiment.h:125
String FullPeptideName
Definition: TransitionTSVReader.h:113
Definition: TargetedExperimentHelper.h:211
This class stores a SRM/MRM transition.
Definition: ReactionMonitoringTransition.h:55

OpenMS / TOPP release 2.0.0 Documentation generated on Wed Mar 30 2016 16:18:42 using doxygen 1.8.5