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 #pragma once
36 
43 //#include <numeric>
44 
45 namespace OpenMS
46 {
47  class OPENMS_DLLAPI OPXLDataStructs
48  {
49 
50  public:
51 
56  {
57  CROSS = 0,
58  MONO = 1,
59  LOOP = 2,
60  NUMBER_OF_CROSS_LINK_TYPES
61  };
62 
73  {
74  AASequence alpha; // longer peptide
75  AASequence beta; // shorter peptide (empty for mono-link), tie bracker: mass then lexicographical
76  std::pair<SignedSize, SignedSize> cross_link_position; // index in alpha, beta or between alpha, alpha in loop-links
81 
83  {
84  if (!beta.empty()) return CROSS;
85 
86  if (cross_link_position.second == -1) return MONO;
87 
88  return LOOP;
89  }
90 
91  bool operator==(const ProteinProteinCrossLink & other) const
92  {
93  return alpha == other.alpha &&
94  beta == other.beta &&
95  cross_link_position == other.cross_link_position &&
96  cross_linker_mass == other.cross_linker_mass &&
97  cross_linker_name == other.cross_linker_name &&
98  term_spec_alpha == other.term_spec_alpha &&
99  term_spec_beta == other.term_spec_beta;
100  }
101  };
102 
111  {
114 
118 
120  double score;
121 
124 
126  double pre_score;
127  double percTIC;
128  double wTIC;
129  double int_sum;
130  double match_odds;
135  std::vector< double > xcorrx;
136  double xcorrx_max;
137  std::vector< double > xcorrc;
138  double xcorrc_max;
143  double HyperCommon;
144  double HyperXlink;
145  double HyperAlpha;
146  double HyperBeta;
147  double HyperBoth;
148 
149  std::vector<PeptideHit::PeakAnnotation> frag_annotations;
150 
152 
153  bool operator<(const CrossLinkSpectrumMatch& other) const
154  {
155  return score < other.score;
156  }
157 
158  bool operator==(const CrossLinkSpectrumMatch& other) const
159  {
160  return cross_link == other.cross_link &&
161  scan_index_light == other.scan_index_light &&
162  scan_index_heavy == other.scan_index_heavy &&
163  score == other.score &&
164  rank == other.rank &&
165  pre_score == other.pre_score &&
166  percTIC == other.percTIC &&
167  wTIC == other.wTIC &&
168  int_sum == other.int_sum &&
169  match_odds == other.match_odds &&
170  xcorrx == other.xcorrx &&
171  xcorrx_max == other.xcorrx_max &&
172  xcorrc == other.xcorrc &&
173  xcorrc_max == other.xcorrc_max &&
174  matched_common_alpha == other.matched_common_alpha &&
175  matched_common_beta == other.matched_common_beta &&
176  matched_xlink_alpha == other.matched_xlink_alpha &&
177  matched_xlink_beta == other.matched_xlink_beta &&
178  HyperCommon == other.HyperCommon &&
179  HyperXlink == other.HyperXlink &&
180  HyperAlpha == other.HyperAlpha &&
181  HyperBeta == other.HyperBeta &&
182  HyperBoth == other.HyperBoth;
183  }
184  };
185 
196  struct XLPrecursor
197  {
199  unsigned int alpha_index;
200  unsigned int beta_index;
201  };
202 
203  // comparator for sorting XLPrecursor vectors and using upper_bound and lower_bound using only a precursor mass
210  {
211  bool operator() (const XLPrecursor& a, const XLPrecursor& b) const
212  {
213  return a.precursor_mass < b.precursor_mass;
214  }
215  bool operator() (const XLPrecursor& a, const double& b) const
216  {
217  return a.precursor_mass < b;
218  }
219  bool operator() (const double& a, const XLPrecursor& b) const
220  {
221  return a < b.precursor_mass;
222  }
223  };
224 
231  {
232  INTERNAL = 0,
233  C_TERM = 1,
234  N_TERM = 2
235  };
236 
248  {
249  double peptide_mass;
252  };
253 
260  {
261  bool operator() (const AASeqWithMass a, const AASeqWithMass b) const
262  {
263  return a.peptide_mass < b.peptide_mass;
264  }
265  bool operator() (const AASeqWithMass a, const double b) const
266  {
267  return a.peptide_mass < b;
268  }
269  bool operator() (const double a, const AASeqWithMass b) const
270  {
271  return a < b.peptide_mass;
272  }
273  };
274 
282  {
283 
284  MSExperiment spectra_common_peaks; // merge spectrum of common peaks (present in both spectra)
285  MSExperiment spectra_xlink_peaks; // Xlink peaks in the light spectrum (common peaks between spectra_light_different and spectra heavy_to_light)
287 
288  // 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).
290  {
291  for (Size i = 0; i != size; ++i)
292  {
293  spectra_common_peaks.addSpectrum(PeakSpectrum());
294  spectra_xlink_peaks.addSpectrum(PeakSpectrum());
295  spectra_all_peaks.addSpectrum(PeakSpectrum());
296  }
297  }
298  };
299 
300  }; // class
301 } // namespace OpenMS
302 
303 
The AASeqWithMassComparator is a comparator for AASeqWithMass objects.
Definition: OPXLDataStructs.h:259
Size matched_xlink_alpha
Definition: OPXLDataStructs.h:141
std::vector< double > xcorrc
Definition: OPXLDataStructs.h:137
double percTIC
Definition: OPXLDataStructs.h:127
double wTIC
Definition: OPXLDataStructs.h:128
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:55
double HyperXlink
Definition: OPXLDataStructs.h:144
void addSpectrum(const MSSpectrum &spectrum)
adds a spectrum to the list
unsigned int beta_index
Definition: OPXLDataStructs.h:200
MSExperiment spectra_xlink_peaks
Definition: OPXLDataStructs.h:285
The XLPrecursorComparator is a comparator for XLPrecursors, that allows direct comparison of the XLPr...
Definition: OPXLDataStructs.h:209
std::vector< PeptideHit::PeakAnnotation > frag_annotations
Definition: OPXLDataStructs.h:149
double HyperAlpha
Definition: OPXLDataStructs.h:145
Representation of a peptide/protein sequence.
Definition: AASequence.h:107
Main OpenMS namespace.
Definition: FeatureDeconvolution.h:46
double HyperCommon
Definition: OPXLDataStructs.h:143
std::vector< double > xcorrx
Definition: OPXLDataStructs.h:135
double xcorrx_max
Definition: OPXLDataStructs.h:136
The CrossLinkSpectrumMatch struct represents a PSM between a ProteinProteinCrossLink and a spectrum i...
Definition: OPXLDataStructs.h:110
Size matched_common_alpha
Definition: OPXLDataStructs.h:139
double HyperBoth
Definition: OPXLDataStructs.h:147
double xcorrc_max
Definition: OPXLDataStructs.h:138
Size scan_index_heavy
Definition: OPXLDataStructs.h:117
PreprocessedPairSpectra(Size size)
Definition: OPXLDataStructs.h:289
AASequence peptide_seq
Definition: OPXLDataStructs.h:250
double pre_score
counts, scores and other data for xQuest-like output
Definition: OPXLDataStructs.h:126
Definition: OPXLDataStructs.h:47
The PreprocessedPairSpectra struct represents the result of comparing a light and a heavy labeled spe...
Definition: OPXLDataStructs.h:281
bool operator==(const CrossLinkSpectrumMatch &other) const
Definition: OPXLDataStructs.h:158
double score
final score
Definition: OPXLDataStructs.h:120
TermSpecificity
Position where the modification is allowed to occur.
Definition: ResidueModification.h:95
Size matched_xlink_beta
Definition: OPXLDataStructs.h:142
bool operator<(const CrossLinkSpectrumMatch &other) const
Definition: OPXLDataStructs.h:153
In-Memory representation of a mass spectrometry experiment.
Definition: MSExperiment.h:77
double peptide_mass
Definition: OPXLDataStructs.h:249
double match_odds
Definition: OPXLDataStructs.h:130
double log_occupancy_full_spec
Definition: OPXLDataStructs.h:134
bool empty() const
check if sequence is empty
MSExperiment spectra_common_peaks
Definition: OPXLDataStructs.h:284
double HyperBeta
Definition: OPXLDataStructs.h:146
MSSpectrum PeakSpectrum
Spectrum consisting of raw data points or peaks.
Definition: StandardTypes.h:44
size_t Size
Size type e.g. used as variable which can hold result of size()
Definition: Types.h:127
unsigned int alpha_index
Definition: OPXLDataStructs.h:199
MSExperiment spectra_all_peaks
Definition: OPXLDataStructs.h:286
The XLPrecursor struct represents a cross-link candidate in the process of filtering candidates by pr...
Definition: OPXLDataStructs.h:196
double log_occupancy_alpha
Definition: OPXLDataStructs.h:132
double int_sum
Definition: OPXLDataStructs.h:129
Size peptide_id_index
Definition: OPXLDataStructs.h:151
Size matched_common_beta
Definition: OPXLDataStructs.h:140
The AASeqWithMass struct represents a normal peptide with its precomputed mass.
Definition: OPXLDataStructs.h:247
PeptidePosition position
Definition: OPXLDataStructs.h:251
ProteinProteinCrossLink cross_link
structure of the cross-link
Definition: OPXLDataStructs.h:113
float precursor_mass
Definition: OPXLDataStructs.h:198
double log_occupancy
Definition: OPXLDataStructs.h:131
PeptidePosition
The PeptidePosition enum.
Definition: OPXLDataStructs.h:230
Size scan_index_light
reference to pair of spectra
Definition: OPXLDataStructs.h:116
double log_occupancy_beta
Definition: OPXLDataStructs.h:133
Size rank
rank among the matches to the same spectrum
Definition: OPXLDataStructs.h:123

OpenMS / TOPP release 2.3.0 Documentation generated on Wed Apr 18 2018 19:29:07 using doxygen 1.8.14