Home  · Classes  · Annotated Classes  · Modules  · Members  · Namespaces  · Related Pages
OPXLDataStructs.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-2017.
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: Eugen Netz $
32 // $Authors: Eugen Netz $
33 // --------------------------------------------------------------------------
34 
35 #ifndef OPENMS_ANALYSIS_XLMS_OPXLDATASTRUCTS
36 #define OPENMS_ANALYSIS_XLMS_OPXLDATASTRUCTS
37 
44 //#include <numeric>
45 
46 namespace OpenMS
47 {
48  class OPENMS_DLLAPI OPXLDataStructs
49  {
50 
51  public:
52 
57  {
58  CROSS = 0,
59  MONO = 1,
60  LOOP = 2,
61  NUMBER_OF_CROSS_LINK_TYPES
62  };
63 
74  {
75  AASequence alpha; // longer peptide
76  AASequence beta; // shorter peptide (empty for mono-link), tie bracker: mass then lexicographical
77  std::pair<SignedSize, SignedSize> cross_link_position; // index in alpha, beta or between alpha, alpha in loop-links
82 
84  {
85  if (!beta.empty()) return CROSS;
86 
87  if (cross_link_position.second == -1) return MONO;
88 
89  return LOOP;
90  }
91 
92  bool operator==(const ProteinProteinCrossLink & other) const
93  {
94  return alpha == other.alpha &&
95  beta == other.beta &&
96  cross_link_position == other.cross_link_position &&
97  cross_linker_mass == other.cross_linker_mass &&
98  cross_linker_name == other.cross_linker_name &&
99  term_spec_alpha == other.term_spec_alpha &&
100  term_spec_beta == other.term_spec_beta;
101  }
102  };
103 
112  {
115 
119 
121  double score;
122 
125 
127  double pre_score;
128  double percTIC;
129  double wTIC;
130  double int_sum;
131  double match_odds;
132  std::vector< double > xcorrx;
133  double xcorrx_max;
134  std::vector< double > xcorrc;
135  double xcorrc_max;
140  double HyperCommon;
141  double HyperXlink;
142  double HyperAlpha;
143  double HyperBeta;
144  double HyperBoth;
145  double PScoreCommon;
146  double PScoreXlink;
147  double PScoreAlpha;
148  double PScoreBeta;
149  double PScoreBoth;
150 
151  std::vector<PeptideHit::PeakAnnotation> frag_annotations;
152 
154 
155  bool operator<(const CrossLinkSpectrumMatch& other) const
156  {
157  return score < other.score;
158  }
159 
160  bool operator==(const CrossLinkSpectrumMatch& other) const
161  {
162  return cross_link == other.cross_link &&
163  scan_index_light == other.scan_index_light &&
164  scan_index_heavy == other.scan_index_heavy &&
165  score == other.score &&
166  rank == other.rank &&
167  pre_score == other.pre_score &&
168  percTIC == other.percTIC &&
169  wTIC == other.wTIC &&
170  int_sum == other.int_sum &&
171  match_odds == other.match_odds &&
172  xcorrx == other.xcorrx &&
173  xcorrx_max == other.xcorrx_max &&
174  xcorrc == other.xcorrc &&
175  xcorrc_max == other.xcorrc_max &&
176  matched_common_alpha == other.matched_common_alpha &&
177  matched_common_beta == other.matched_common_beta &&
178  matched_xlink_alpha == other.matched_xlink_alpha &&
179  matched_xlink_beta == other.matched_xlink_beta &&
180  HyperCommon == other.HyperCommon &&
181  HyperXlink == other.HyperXlink &&
182  HyperAlpha == other.HyperAlpha &&
183  HyperBeta == other.HyperBeta &&
184  HyperBoth == other.HyperBoth &&
185  PScoreCommon == other.PScoreCommon &&
186  PScoreXlink == other.PScoreXlink &&
187  PScoreAlpha == other.PScoreAlpha &&
188  PScoreBeta == other.PScoreBeta &&
189  PScoreBoth == other.PScoreBoth;
190  }
191  };
192 
203  struct XLPrecursor
204  {
206  unsigned int alpha_index;
207  unsigned int beta_index;
208  };
209 
210  // comparator for sorting XLPrecursor vectors and using upper_bound and lower_bound using only a precursor mass
217  {
218  bool operator() (const XLPrecursor& a, const XLPrecursor& b) const
219  {
220  return a.precursor_mass < b.precursor_mass;
221  }
222  bool operator() (const XLPrecursor& a, const double& b) const
223  {
224  return a.precursor_mass < b;
225  }
226  bool operator() (const double& a, const XLPrecursor& b) const
227  {
228  return a < b.precursor_mass;
229  }
230  };
231 
238  {
239  INTERNAL = 0,
240  C_TERM = 1,
241  N_TERM = 2
242  };
243 
255  {
256  double peptide_mass;
259  };
260 
267  {
268  bool operator() (const AASeqWithMass a, const AASeqWithMass b) const
269  {
270  return a.peptide_mass < b.peptide_mass;
271  }
272  bool operator() (const AASeqWithMass a, const double b) const
273  {
274  return a.peptide_mass < b;
275  }
276  bool operator() (const double a, const AASeqWithMass b) const
277  {
278  return a < b.peptide_mass;
279  }
280  };
281 
289  {
290 
291  MSExperiment spectra_common_peaks; // merge spectrum of common peaks (present in both spectra)
292  MSExperiment spectra_xlink_peaks; // Xlink peaks in the light spectrum (common peaks between spectra_light_different and spectra heavy_to_light)
294 
295  // pre-initialize so we can simply std::swap the spectra (no synchronization in multi-threading context needed as we get no reallocation of the PeakMaps).
297  {
298  for (Size i = 0; i != size; ++i)
299  {
300  spectra_common_peaks.addSpectrum(PeakSpectrum());
301  spectra_xlink_peaks.addSpectrum(PeakSpectrum());
302  spectra_all_peaks.addSpectrum(PeakSpectrum());
303  }
304  }
305  };
306 
307  }; // class
308 } // namespace OpenMS
309 
310 
311 #endif
The AASeqWithMassComparator is a comparator for AASeqWithMass objects.
Definition: OPXLDataStructs.h:266
Size matched_xlink_alpha
Definition: OPXLDataStructs.h:138
std::vector< double > xcorrc
Definition: OPXLDataStructs.h:134
double percTIC
Definition: OPXLDataStructs.h:128
double wTIC
Definition: OPXLDataStructs.h:129
A more convenient string class.
Definition: String.h:57
ProteinProteinCrossLinkType
The ProteinProteinCrossLinkType enum enumerates possible types of Protein-Protein cross-linking react...
Definition: OPXLDataStructs.h:56
double HyperXlink
Definition: OPXLDataStructs.h:141
void addSpectrum(const MSSpectrum &spectrum)
adds a spectrum to the list
Definition: MSExperiment.h:831
unsigned int beta_index
Definition: OPXLDataStructs.h:207
MSExperiment spectra_xlink_peaks
Definition: OPXLDataStructs.h:292
The XLPrecursorComparator is a comparator for XLPrecursors, that allows direct comparison of the XLPr...
Definition: OPXLDataStructs.h:216
std::vector< PeptideHit::PeakAnnotation > frag_annotations
Definition: OPXLDataStructs.h:151
double HyperAlpha
Definition: OPXLDataStructs.h:142
Representation of a peptide/protein sequence.
Definition: AASequence.h:108
Main OpenMS namespace.
Definition: FeatureDeconvolution.h:47
double HyperCommon
Definition: OPXLDataStructs.h:140
std::vector< double > xcorrx
Definition: OPXLDataStructs.h:132
double PScoreBoth
Definition: OPXLDataStructs.h:149
double xcorrx_max
Definition: OPXLDataStructs.h:133
The CrossLinkSpectrumMatch struct represents a PSM between a ProteinProteinCrossLink and a spectrum i...
Definition: OPXLDataStructs.h:111
Size matched_common_alpha
Definition: OPXLDataStructs.h:136
double HyperBoth
Definition: OPXLDataStructs.h:144
double xcorrc_max
Definition: OPXLDataStructs.h:135
Size scan_index_heavy
Definition: OPXLDataStructs.h:118
PreprocessedPairSpectra(Size size)
Definition: OPXLDataStructs.h:296
AASequence peptide_seq
Definition: OPXLDataStructs.h:257
double pre_score
counts, scores and other data for xQuest-like output
Definition: OPXLDataStructs.h:127
Definition: OPXLDataStructs.h:48
The PreprocessedPairSpectra struct represents the result of comparing a light and a heavy labeled spe...
Definition: OPXLDataStructs.h:288
bool operator==(const CrossLinkSpectrumMatch &other) const
Definition: OPXLDataStructs.h:160
double score
final score
Definition: OPXLDataStructs.h:121
TermSpecificity
Position where the modification is allowed to occur.
Definition: ResidueModification.h:96
Size matched_xlink_beta
Definition: OPXLDataStructs.h:139
double PScoreBeta
Definition: OPXLDataStructs.h:148
bool operator<(const CrossLinkSpectrumMatch &other) const
Definition: OPXLDataStructs.h:155
In-Memory representation of a mass spectrometry experiment.
Definition: MSExperiment.h:82
double peptide_mass
Definition: OPXLDataStructs.h:256
double match_odds
Definition: OPXLDataStructs.h:131
bool empty() const
check if sequence is empty
MSExperiment spectra_common_peaks
Definition: OPXLDataStructs.h:291
double HyperBeta
Definition: OPXLDataStructs.h:143
MSSpectrum PeakSpectrum
Spectrum consisting of raw data points or peaks.
Definition: StandardTypes.h:53
double PScoreCommon
Definition: OPXLDataStructs.h:145
size_t Size
Size type e.g. used as variable which can hold result of size()
Definition: Types.h:128
unsigned int alpha_index
Definition: OPXLDataStructs.h:206
MSExperiment spectra_all_peaks
Definition: OPXLDataStructs.h:293
double PScoreAlpha
Definition: OPXLDataStructs.h:147
The XLPrecursor struct represents a cross-link candidate in the process of filtering candidates by pr...
Definition: OPXLDataStructs.h:203
double int_sum
Definition: OPXLDataStructs.h:130
Size peptide_id_index
Definition: OPXLDataStructs.h:153
Size matched_common_beta
Definition: OPXLDataStructs.h:137
The AASeqWithMass struct represents a normal peptide with its precomputed mass.
Definition: OPXLDataStructs.h:254
PeptidePosition position
Definition: OPXLDataStructs.h:258
ProteinProteinCrossLink cross_link
structure of the cross-link
Definition: OPXLDataStructs.h:114
float precursor_mass
Definition: OPXLDataStructs.h:205
PeptidePosition
The PeptidePosition enum.
Definition: OPXLDataStructs.h:237
Size scan_index_light
reference to pair of spectra
Definition: OPXLDataStructs.h:117
double PScoreXlink
Definition: OPXLDataStructs.h:146
Size rank
rank among the matches to the same spectrum
Definition: OPXLDataStructs.h:124

OpenMS / TOPP release 2.3.0 Documentation generated on Tue Jan 9 2018 18:22:02 using doxygen 1.8.13