Matrix Science Mascot Parser toolkit
 
Loading...
Searching...
No Matches
ms_spectral_lib_peak.hpp
1/*
2##############################################################################
3# File: ms_spectral_lib_peak_list.hpp #
4# Mascot Parser toolkit #
5# Encapsulates a single peak plus annotations for spectral library files #
6# #
7##############################################################################
8# COPYRIGHT NOTICE #
9# Copyright 2015 Matrix Science Limited All Rights Reserved. #
10# #
11##############################################################################
12# $Source: parser/inc/ms_spectral_lib_peak.hpp $
13# $Author: dcreasy@matrixscience.com $
14# $Date: 2019-01-09 17:36:22 +0000 $
15# $Revision: 8cb0d9cae7732a8c4def8cb60456be4a3be7a559 | MSPARSER_REL_3_0_0-2024-09-24-0-g93ebaeb4f4 $
16##############################################################################
17*/
18
19#ifndef MS_SPECTRAL_LIB_PEAK
20#define MS_SPECTRAL_LIB_PEAK
21
22
23// Includes from the standard template library
24
25#include <map>
26#include <string>
27
28
29namespace matrix_science {
30
40 namespace ms_spectral_lib {
54 };
55 };
56
58 class MS_MASCOTRESFILE_API ms_spectral_lib_peak
59 {
60 public:
62 ms_spectral_lib_peak(const std::string & text,
65
67 ms_spectral_lib_peak(const double mz,
68 const double intensity,
69 const std::string & annotation,
71
74
76 void copyFrom(const ms_spectral_lib_peak* right);
77
78#ifndef SWIG
80 ms_spectral_lib_peak& operator=(const ms_spectral_lib_peak& right);
81#endif
82
84 double getMz() const;
85
87 double getIntensity() const;
88
90 std::string getAnnotation(ms_spectral_lib::FILE_FORMAT format = ms_spectral_lib::FORMAT_NIST_MSP) const;
91
93 void setAnnotation(const std::string & annotation, ms_spectral_lib::FILE_FORMAT format);
94
96 void clearAnnotation();
97
99 double getDelta() const;
100
102 bool isMatchedToCalculatedPeak() const;
103
105 bool isSuspectAssignment() const;
106
108 bool getConsensusData(int * numerator, int * denominator, double * medianDeviation) const;
109
111 std::string asText(ms_spectral_lib::FILE_FORMAT format) const;
112
114 bool isValid() const;
115
117 static std::string getUnmatchedAnnotationStr(ms_spectral_lib::FILE_FORMAT format);
118
119
120 private:
121 bool valid_;
122 double mz_;
123 double intensity_;
124 std::string mzText_;
125 std::string intensityText_;
126 std::string annotation_;
127 ms_spectral_lib::FILE_FORMAT currAnnotationFormat_;
128 double delta_;
129 bool consensusDataAvailable_;
130 int consensusNumerator_;
131 int consensusDenominator_;
132 double medianDeviationOfConsensusPeaks_;
133 };
134
135 // end of tools_group
137} // namespace matrix_science
138
139#endif // MS_SPECTRAL_LIB_PEAK
140
141/*------------------------------- End of File -------------------------------*/
All errors are collected in an instance of this class.
Definition: ms_errors.hpp:37
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
@ FORMAT_UNKNOWN
Unknown format.
Definition: ms_spectral_lib_peak.hpp:49
@ FORMAT_MGF
Mascot Generic Format. Only suitable for output.
Definition: ms_spectral_lib_peak.hpp:52
@ FORMAT_SPECTRAST
Institute for Systems Biology (ISB) SpectraST format.
Definition: ms_spectral_lib_peak.hpp:51
@ FORMAT_NIST_MSP
NIST MSP formt.
Definition: ms_spectral_lib_peak.hpp:50
@ FORMAT_XHUNTER
X!HUNTER ASL MGF file format (2007.06.01)
Definition: ms_spectral_lib_peak.hpp:53