All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
XQuestResultXMLFile.h
Go to the documentation of this file.
1 // Copyright (c) 2002-present, OpenMS Inc. -- EKU Tuebingen, ETH Zurich, and FU Berlin
2 // SPDX-License-Identifier: BSD-3-Clause
3 //
4 // --------------------------------------------------------------------------
5 // $Maintainer: Eugen Netz $
6 // $Authors: Lukas Zimmermann, Eugen Netz $
7 // --------------------------------------------------------------------------
8 #pragma once
9 
10 #include <OpenMS/FORMAT/XMLFile.h>
16 
17 namespace OpenMS
18 {
19 
30  class OPENMS_DLLAPI XQuestResultXMLFile :
31  public Internal::XMLFile,
32  public ProgressLogger
33  {
34 public:
37 
44  void load(const String & filename,
45  PeptideIdentificationList & pep_ids,
46  std::vector< ProteinIdentification > & prot_ids
47  );
48 
54  void store(const String& filename,
55  const std::vector<ProteinIdentification>& poid,
56  const PeptideIdentificationList& peid) const;
57 
62  int getNumberOfHits() const;
63 
68  double getMinScore() const;
69 
74  double getMaxScore() const;
75 
86  static void writeXQuestXMLSpec(const String& out_file, const String& base_name,
87  const OPXLDataStructs::PreprocessedPairSpectra& preprocessed_pair_spectra,
88  const std::vector< std::pair<Size, Size> >& spectrum_pairs,
89  const std::vector< std::vector< OPXLDataStructs::CrossLinkSpectrumMatch > >& all_top_csms,
90  const PeakMap& spectra, const bool& test_mode = false);
91 
100  static void writeXQuestXMLSpec(const String& out_file, const String& base_name,
101  const std::vector< std::vector< OPXLDataStructs::CrossLinkSpectrumMatch > >& all_top_csms,
102  const PeakMap& spectra, const bool& test_mode = false);
103 
104 
105 
106 private:
107 
114  static String getxQuestBase64EncodedSpectrum_(const PeakSpectrum& spec, const String& header, const bool& test_mode = false);
115 
122  static void wrap_(const String& input, Size width, String& output);
123 
124  int n_hits_;
125  double min_score_;
126  double max_score_;
127  };
128 } // namespace OpenMS
Base class for loading/storing XML files that have a handler derived from XMLHandler.
Definition: XMLFile.h:23
In-Memory representation of a mass spectrometry run.
Definition: MSExperiment.h:49
The representation of a 1D spectrum.
Definition: MSSpectrum.h:44
Container for peptide identifications from multiple spectra.
Definition: PeptideIdentificationList.h:66
Base class for all classes that want to report their progress.
Definition: ProgressLogger.h:27
A more convenient string class.
Definition: String.h:34
Used to load and store xQuest result files.
Definition: XQuestResultXMLFile.h:33
int n_hits_
Total number of hits within the result file.
Definition: XQuestResultXMLFile.h:124
double getMinScore() const
Returns minimum score among the hits in the file.
static void wrap_(const String &input, Size width, String &output)
A helper function, that takes one string containing one line and wraps it into several lines of a giv...
double max_score_
Maximum score encountered in file.
Definition: XQuestResultXMLFile.h:126
static String getxQuestBase64EncodedSpectrum_(const PeakSpectrum &spec, const String &header, const bool &test_mode=false)
Transforms a PeakSpectrum into a base64 encoded string, which is the format used in spec....
void store(const String &filename, const std::vector< ProteinIdentification > &poid, const PeptideIdentificationList &peid) const
Stores the identifications in a xQuest XML file.
static void writeXQuestXMLSpec(const String &out_file, const String &base_name, const OPXLDataStructs::PreprocessedPairSpectra &preprocessed_pair_spectra, const std::vector< std::pair< Size, Size > > &spectrum_pairs, const std::vector< std::vector< OPXLDataStructs::CrossLinkSpectrumMatch > > &all_top_csms, const PeakMap &spectra, const bool &test_mode=false)
Writes spec.xml output containing matching peaks between heavy and light spectra after comparing and ...
void load(const String &filename, PeptideIdentificationList &pep_ids, std::vector< ProteinIdentification > &prot_ids)
Load the content of the xquest.xml file into the provided data structures.
double min_score_
Minimum score encountered in file.
Definition: XQuestResultXMLFile.h:125
static void writeXQuestXMLSpec(const String &out_file, const String &base_name, const std::vector< std::vector< OPXLDataStructs::CrossLinkSpectrumMatch > > &all_top_csms, const PeakMap &spectra, const bool &test_mode=false)
Writes spec.xml output containing spectra for visualization. This version of the function is meant to...
int getNumberOfHits() const
Returns the total number of hits in the file.
double getMaxScore() const
Returns maximum score among the hits in the file.
size_t Size
Size type e.g. used as variable which can hold result of size()
Definition: Types.h:97
Main OpenMS namespace.
Definition: openswathalgo/include/OpenMS/OPENSWATHALGO/DATAACCESS/ISpectrumAccess.h:19
The PreprocessedPairSpectra struct represents the result of comparing a light and a heavy labeled spe...
Definition: OPXLDataStructs.h:278