OpenMS  3.0.0
NuXLReport.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-2020.
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: Timo Sachsenberg $
32 // $Authors: Timo Sachsenberg $
33 // --------------------------------------------------------------------------
34 
35 #pragma once
36 
40 
45 #include <OpenMS/FORMAT/TextFile.h>
46 
47 #include <vector>
48 
49 namespace OpenMS
50 {
51 
53 struct OPENMS_DLLAPI NuXLReportRow
54 {
55  bool no_id;
56 
57  // columns
58  double rt;
59  double original_mz;
64  double score;
65  int rank;
70  double NA_weight;
71  double xl_weight;
72  StringList meta_values; // the actual values of exported metadata
76  double m_H;
77  double m_2H;
78  double m_3H;
79  double m_4H;
81  String getString(const String& separator) const;
82 };
83 
85 struct OPENMS_DLLAPI NuXLReportRowHeader
86 {
87  static String getString(const String& separator, const StringList& meta_values_to_export);
88 };
89 
91 struct OPENMS_DLLAPI NuXLReport
92 {
93  static std::vector<NuXLReportRow> annotate(
94  const PeakMap& spectra,
95  std::vector<PeptideIdentification>& peptide_ids,
96  const StringList& meta_values_to_export,
97  double marker_ions_tolerance);
98 };
99 
100 
102 struct OPENMS_DLLAPI NuXLProteinReport
103 {
104  static void annotateProteinModificationForTopHits(std::vector<ProteinIdentification>& prot_ids,
105  const std::vector<PeptideIdentification>& peps,
106  TextFile& tsv_file);
107 
108  // crosslink efficiency = frequency of the crosslinked amino acid / frequency of the amino acid in all crosslink spectrum matches
109  static std::map<char, double> getCrossLinkEfficiency(const std::vector<PeptideIdentification>& peps);
110 
111  // returns map of adduct to counts
112  static std::map<String, size_t> countAdducts(const std::vector<PeptideIdentification>& peps);
113 
114  static void mapAccessionToTDProteins(ProteinIdentification& prot_id, std::map<String, ProteinHit*>& acc2protein_targets, std::map<String, ProteinHit*>& acc2protein_decoys);
115 };
116 
117 }
Representation of a protein identification run.
Definition: ProteinIdentification.h:74
double m_3H
Definition: NuXLReport.h:78
A more convenient string class.
Definition: String.h:58
String fragment_annotation
Definition: NuXLReport.h:80
String peptide
Definition: NuXLReport.h:61
double score
Definition: NuXLReport.h:64
double m_2H
Definition: NuXLReport.h:77
struct to hold a single report line
Definition: NuXLReport.h:53
create header line
Definition: NuXLReport.h:85
Main OpenMS namespace.
Definition: FeatureDeconvolution.h:47
bool no_id
Definition: NuXLReport.h:55
double rel_prec_error
Definition: NuXLReport.h:75
int rank
Definition: NuXLReport.h:65
String localization_scores
Definition: NuXLReport.h:67
double best_localization_score
Definition: NuXLReport.h:66
double rt
Definition: NuXLReport.h:58
NuXLMarkerIonExtractor::MarkerIonsType marker_ions
Definition: NuXLReport.h:73
double peptide_weight
Definition: NuXLReport.h:69
StringList meta_values
Definition: NuXLReport.h:72
double m_H
Definition: NuXLReport.h:76
std::vector< String > StringList
Vector of String.
Definition: ListUtils.h:70
In-Memory representation of a mass spectrometry run.
Definition: MSExperiment.h:70
double original_mz
Definition: NuXLReport.h:59
String best_localization
Definition: NuXLReport.h:68
String NA
Definition: NuXLReport.h:62
protein report
Definition: NuXLReport.h:102
Int charge
Definition: NuXLReport.h:63
std::map< String, std::vector< std::pair< double, double > > > MarkerIonsType
name to mass-intensity pair
Definition: NuXLMarkerIonExtractor.h:49
double m_4H
Definition: NuXLReport.h:79
double abs_prec_error
Definition: NuXLReport.h:74
int Int
Signed integer type.
Definition: Types.h:102
double xl_weight
Definition: NuXLReport.h:71
create PSM report
Definition: NuXLReport.h:91
double NA_weight
Definition: NuXLReport.h:70
This class provides some basic file handling methods for text files.
Definition: TextFile.h:46
String accessions
Definition: NuXLReport.h:60