CycloBranch
cSummaryFormula.h
Go to the documentation of this file.
1
7#ifndef _CSUMMARYFORMULA_H
8#define _CSUMMARYFORMULA_H
9
10#include <string>
11#include <fstream>
12#include "core/cFragmentIons.h"
13
14
15using namespace std;
16using namespace boost;
17
18
19class cPeaksList;
20class cPeakListSeries;
21class cBricksDatabase;
22
23
29void reduceMapToStringFormula(map<string, int>& atoms, string& formula);
30
31
37void addStringFormulaToMap(string& formula, map<string, int>& atoms);
38
39
45void mergeMaps(map<string, int>& source, map<string, int>& target);
46
47
53void rechargeMap(int charge, map<string, int>& atoms);
54
55
60
61 bool partial;
62
63 string formula;
64
65 void combineAtoms(cPeakListSeries& peaklistseries, int peaklistseriessize, vector<int>& peaklistseriessizes, cPeaksList& isotopeprofile, vector<int>& depthvector, int depth, double mass, double intensity, double charge, double minimumabsoluteintensity, double& localmaximumintensity, double minimumrelativeintensity);
66
67 double getIntensity(cBricksDatabase& bricksprobabilities, vector<int>& combarray, int mostintenseid, int mostintenseatomscount, int isotopecount);
68
69 void getIsotopeSummary(string& description, cBricksDatabase& bricks, vector<int>& combarray, int mostintenseid, int mostintenseatomscount, int isotopecount, bool positive);
70
71 void reduceIsotopeProfile(cPeaksList& isotopeprofile, cPeaksList& reducedprofile, double fwhm);
72
73public:
74
75
80
81
87 cSummaryFormula(string& formula, bool partial = false);
88
89
93 void clear();
94
95
101 void setFormula(const string& formula, bool partial = false);
102
103
108 string getSummary();
109
110
116 string getFancySummary(int charge);
117
118
123 bool isPartial();
124
125
130 void setPartial(bool partial);
131
132
138 void addFormula(string& formula, bool remove = false);
139
140
146 void setFromMap(map<string, int>& atoms, bool partial);
147
148
154 bool isValid(string& errormessage);
155
156
161 bool isEmpty();
162
163
169
170
175 double getMass();
176
177
187 cPeaksList getIsotopePattern(double fwhm, int charge, bool positive, int maxchangedatoms, bool writedescription);
188
189
194 void store(ofstream& os);
195
196
201 void load(ifstream& is);
202
203
209 bool equals(cSummaryFormula& secondformula);
210
211};
212
213
214#endif
Basic definitions of fragment ions occurring in the mass spectra.
double charge(double neutralmass, int charge)
Get mzratio from neutral mass.
Definition: cFragmentIons.cpp:1435
void rechargeMap(int charge, map< string, int > &atoms)
Change the charge from 1+ to another charge in a map.
Definition: cSummaryFormula.cpp:117
void mergeMaps(map< string, int > &source, map< string, int > &target)
Merge two maps of atoms into a target map.
Definition: cSummaryFormula.cpp:103
void reduceMapToStringFormula(map< string, int > &atoms, string &formula)
Reduce a map of atoms to a string.
Definition: cSummaryFormula.cpp:7
void addStringFormulaToMap(string &formula, map< string, int > &atoms)
Explode and add a summary formula string to a map.
Definition: cSummaryFormula.cpp:20
The class representing a database of building blocks (bricks).
Definition: cBricksDatabase.h:66
The class representing a series of peaklists.
Definition: cPeakListSeries.h:21
The class representing a peak list.
Definition: cPeaksList.h:68
The representation of a summary formula.
Definition: cSummaryFormula.h:59
void load(ifstream &is)
Load the structure from an input stream.
Definition: cSummaryFormula.cpp:631
bool isValid(string &errormessage)
Check the syntax of a chemical formula.
Definition: cSummaryFormula.cpp:392
string getFancySummary(int charge)
Get the fancy summary formula as a string.
Definition: cSummaryFormula.cpp:327
void setFormula(const string &formula, bool partial=false)
Set the formula.
Definition: cSummaryFormula.cpp:316
cPeaksList getIsotopePattern(double fwhm, int charge, bool positive, int maxchangedatoms, bool writedescription)
Get a theoretical isotope pattern of the formula.
Definition: cSummaryFormula.cpp:523
bool hasAllElementsPositive()
Check if the formula has the numbers of all elements positive.
Definition: cSummaryFormula.cpp:448
double getMass()
Get mass of the formula.
Definition: cSummaryFormula.cpp:457
cSummaryFormula()
The constructor.
Definition: cSummaryFormula.cpp:300
bool isEmpty()
Check if the formula is empty.
Definition: cSummaryFormula.cpp:443
string getSummary()
Get the summary formula as a string.
Definition: cSummaryFormula.cpp:322
void setFromMap(map< string, int > &atoms, bool partial)
Set the string formula from a map of atoms.
Definition: cSummaryFormula.cpp:386
void clear()
Clear the structure.
Definition: cSummaryFormula.cpp:310
void store(ofstream &os)
Store the structure into an output stream.
Definition: cSummaryFormula.cpp:625
bool equals(cSummaryFormula &secondformula)
Check if the object equals to another object.
Definition: cSummaryFormula.cpp:637
bool isPartial()
Check if the formula is incomplete or not.
Definition: cSummaryFormula.cpp:354
void setPartial(bool partial)
Set the formula as partial.
Definition: cSummaryFormula.cpp:359
void addFormula(string &formula, bool remove=false)
Add a formula to the existing one.
Definition: cSummaryFormula.cpp:364