Matrix Science Mascot Parser toolkit
 
Loading...
Searching...
No Matches
ms_fragmentvector.hpp
1/*
2##############################################################################
3# File: ms_fragmentvector.hpp #
4# Mascot Parser toolkit #
5# Encapsulates a list (vector) of single fragment ions #
6##############################################################################
7# COPYRIGHT NOTICE #
8# Copyright 1998-2006 Matrix Science Limited All Rights Reserved. #
9# #
10##############################################################################
11# $Source: parser/inc/ms_fragmentvector.hpp $
12# $Author: villek@matrixscience.com $
13# $Date: 2023-10-31 16:08:54 +0000 $
14# $Revision: 925ec81070097410ba470a308ccae6c56aa345b2 | MSPARSER_REL_3_0_0-2024-09-24-0-g93ebaeb4f4 $
15##############################################################################
16*/
17
18#if !defined(ms_fragmentvector_INCLUDED_)
19#define ms_fragmentvector_INCLUDED_
20
21
22// Includes from the standard template library
23#include <string>
24#include <set>
25#include <vector>
26#include <map>
27
28
29namespace matrix_science {
30 class ms_mascotresfilebase;
31
38
46 class MS_MASCOTRESFILE_API ms_fragmentvector
47 {
48 public:
49
51
59 {
60
61 MATCH_MOST_INTENSE_PEAK = 0x0000,
62 MATCH_CLOSEST_PEAK = 0x0001
63 };
64
66
73 {
77 TOLERANCE_PPM
78 };
79
82
85
87 virtual ~ms_fragmentvector();
88
90 void copyFrom(const ms_fragmentvector* right);
91
92#ifndef SWIG
94 ms_fragmentvector& operator=(const ms_fragmentvector& right);
95#endif
97 int getNumberOfFragments() const;
98
100 void clearFragments();
101
103 void appendFragment(const ms_fragment * item);
104
106 const ms_fragment * getFragmentByNumber(const unsigned int numFrag) const;
107
108 typedef std::vector<ms_fragment> frag_vector;
109
110#if !defined(SWIGJAVA) && !defined(SWIGCSHARP)
112 frag_vector * getVector();
113#endif
115 const frag_vector * getVector() const;
116
118 bool addExperimentalData(const std::string & peakList,
119 const int numPeaks,
120 const double tolerance,
121 const std::string & toleranceUnits,
122 const bool updateMatchList = true);
123
125 bool addExperimentalData(const ms_mascotresfilebase * resfile,
126 const int query,
127 const int flags = MATCH_MOST_INTENSE_PEAK,
128 const int peaksUsedFromIons1 = -1,
129 const int peaksUsedFromIons2 = -1,
130 const int peaksUsedFromIons3 = -1);
131
132 typedef std::map<double, double> peaklist_t; // Mass, intensity
133
135 bool addExperimentalData(const peaklist_t & peakList,
136 const double tolerance,
137 const std::string & toleranceUnits,
138 const bool updateMatchList = true);
139
141#ifndef SWIG
142 static void getMassesWithinTolerance(const double mass,
143 const double toleranceValue,
144 const TOLERANCE_UNIT toleranceUnit,
145 double & minMass,
146 double & maxMass);
147#else // SWIG Multiple return values
148 static void getMassesWithinTolerance(const double mass,
149 const double toleranceValue,
150 const TOLERANCE_UNIT toleranceUnit,
151 double & OUTPUT,
152 double & OUTPUT);
153#endif
154
155 private:
156 frag_vector entries_;
157 peaklist_t experimentalData_;
158 void matchFragments();
159 double matchingTol_;
160 std::string matchingTolUnits_;
161 }; // class ms_fragmentvector // end of mass_calculation_group
163} // matrix_science
164
165#endif // !defined(ms_fragmentvector_INCLUDED_)
Class representing a single peptide fragment.
Definition: ms_fragment.hpp:38
Class for holding a list of ms_fragment objects.
Definition: ms_fragmentvector.hpp:47
MATCH_PEAKS
Flags for matching experimental peaks to calculated peaks.
Definition: ms_fragmentvector.hpp:59
TOLERANCE_UNIT
Flags for tolerance units used for matching peaks.
Definition: ms_fragmentvector.hpp:73
@ TOLERANCE_PERCENT
Percentage of the fragment or peptide mass.
Definition: ms_fragmentvector.hpp:76
@ TOLERANCE_DALTON
Simple Daltons.
Definition: ms_fragmentvector.hpp:74
@ TOLERANCE_MMU
milli mass units (1000th of a Dalton)
Definition: ms_fragmentvector.hpp:75
Abstract base class of ms_mascotresfile_dat and ms_mascotresfile_msr.
Definition: ms_mascotresfilebase.hpp:72