Matrix Science Mascot Parser toolkit
 
Loading...
Searching...
No Matches
ms_spectral_lib_peak_list.hpp
1/*
2##############################################################################
3# File: ms_spectral_lib_peak_list.hpp #
4# Mascot Parser toolkit #
5# Encapsulates peak lists for spectral library files (e.g. msp, sptext) #
6# #
7##############################################################################
8# COPYRIGHT NOTICE #
9# Copyright 2015 Matrix Science Limited All Rights Reserved. #
10# #
11##############################################################################
12# $Source: parser/inc/ms_spectral_lib_peak_list.hpp $
13# $Author: villek@matrixscience.com $
14# $Date: 2018-07-30 16:23:53 +0100 $
15# $Revision: 1b450440f9c97e1e41d0fc6016a27d68951d4532 | MSPARSER_REL_3_0_0-2024-09-24-0-g93ebaeb4f4 $
16##############################################################################
17*/
18
19#ifndef MS_SPECTRAL_LIB_PEAK_LIST
20#define MS_SPECTRAL_LIB_PEAK_LIST
21
22
23// Includes from the standard template library
24
25#include <vector>
26#include <map>
27#include <string>
28
29
30namespace matrix_science {
31
38 class MS_MASCOTRESFILE_API ms_spectral_lib_peak_list : public ms_errors
39 {
40 public:
42
54 };
57
60
62 ms_spectral_lib_peak_list(std::vector<std::string> input, ms_spectral_lib::FILE_FORMAT format);
63
66
68 void copyFrom(const ms_spectral_lib_peak_list* right);
69
70#ifndef SWIG
73#endif
75 int getNumPeaks() const;
76
78 const ms_spectral_lib_peak * getPeak(const int pkNum) const;
79
81 void addPeaks(const std::vector<double> &vecMz, const std::vector<double> &vecIntensity);
82
84 void annotatePeaks(const ms_fragmentvector *fragments, const double fragmentToleranceValue, const std::string fragmentToleranceUnit, double precursorMz);
85
86#ifndef SWIG
88 void annotatePeaks(const std::vector<ms_fragment> *fragments, const double fragmentToleranceValue, const std::string fragmentToleranceUnit, double precursorMz);
89#endif
90
92 void clearAnnotation();
93
95 PEAK_ANNOTATION_LEVEL getPeakAnnotationLevel() const;
96
98 std::vector<std::string> asText(ms_spectral_lib::FILE_FORMAT format) const;
99
101 std::string getChecksum() const;
102
104 void setAnnotationLevel(PEAK_ANNOTATION_LEVEL level);
105
106 private:
107 void setAnnotationLevel(const ms_spectral_lib_peak & pk);
108
109 std::vector<ms_spectral_lib_peak> peakList_;
110 bool isConsensusSpectrum_;
111 PEAK_ANNOTATION_LEVEL annotationLevel_;
112 std::string checksum_;
113 };
114
115 // end of tools_group
117} // namespace matrix_science
118
119#endif // MS_SPECTRAL_LIB_PEAK_LIST
120
121/*------------------------------- End of File -------------------------------*/
This class is used as a base class for several Mascot Parser classes.
Definition: ms_errors.hpp:696
Class for holding a list of ms_fragment objects.
Definition: ms_fragmentvector.hpp:47
This class is used to encapsulate a peak list from a single spectrum in a NIST .msp or a SpectraST ....
Definition: ms_spectral_lib_peak_list.hpp:39
PEAK_ANNOTATION_LEVEL
Amount of annotation as returned by getAnnotationLevel()
Definition: ms_spectral_lib_peak_list.hpp:49
@ ANNOT_LVL_QUESTION_MARKS
In Parser 2.6.0, when calling ms_spectral_lib_file::saveAs(), the resulting file adds "?...
Definition: ms_spectral_lib_peak_list.hpp:51
@ ANNOT_LVL_SOME_PEAKS
One or more peaks have annotation that is not just a "?".
Definition: ms_spectral_lib_peak_list.hpp:52
@ ANNOT_LVL_CANNOT_ANNOTATE
A call to ms_spectral_lib_entry::annotatePeaks() or ms_spectral_lib_peak_list::annotatePeaks() failed...
Definition: ms_spectral_lib_peak_list.hpp:53
@ ANNOT_LVL_NONE
None of the peaks have any annotation.
Definition: ms_spectral_lib_peak_list.hpp:50
This class is used to encapsulate a single fragment ion in a NIST .msp or a SpectraST ....
Definition: ms_spectral_lib_peak.hpp:59
FILE_FORMAT
Definition: ms_spectral_lib_peak.hpp:48