18#ifndef MS_AAHELPER_HPP
19#define MS_AAHELPER_HPP
26namespace matrix_science {
48 FRAG_NL_PRIMARY = 0x0001,
49 FRAG_NL_SECONDARY = 0x0010
57 const char * enzymeFileName,
58 const char * quantSchemaFilePath =
"http://www.matrixscience.com/xmlns/schema/quantitation_2 ../html/xmlns/schema/quantitation_2/quantitation_2.xsd http://www.matrixscience.com/xmlns/schema/quantitation_1 ../html/xmlns/schema/quantitation_1/quantitation_1.xsd",
59 const char * unimodSchemaFilePath =
"http://www.unimod.org/xmlns/schema/unimod_2 ../html/xmlns/schema/unimod_2/unimod_2.xsd");
63 const char * enzymeFileName,
64 const char * quantSchemaFilePath =
"http://www.matrixscience.com/xmlns/schema/quantitation_2 ../html/xmlns/schema/quantitation_2/quantitation_2.xsd http://www.matrixscience.com/xmlns/schema/quantitation_1 ../html/xmlns/schema/quantitation_1/quantitation_1.xsd",
65 const char * unimodSchemaFilePath =
"http://www.unimod.org/xmlns/schema/unimod_2 ../html/xmlns/schema/unimod_2/unimod_2.xsd");
96 void setAvailableModifications(
const ms_modvector *fixedModVector,
106 void startIteratePeptides(
const char* sequenceProtein,
107 const int sizeProtein,
111 bool getNextPeptide();
114 int getPepStart()
const;
117 int getPepEnd()
const;
120 int getMissed()
const;
123 void stopIteratePeptides();
126 double calcPeptideMZ(
const char* proteinStr,
127 const int proteinLen,
130 const std::vector< int > numThatMustBeModded,
136 ms_peptide createPeptide(
const char* proteinStr,
137 const int proteinLen,
140 const std::vector< int > varMods,
141 const std::vector< int > varModsWhichNl,
147 ms_peptide createPeptide(
const char* proteinStr,
148 const int proteinLen,
151 const std::vector< int > varMods,
152 const std::vector< int > varModsWhichNl,
153 const std::vector< int > summedMods,
154 const std::vector< int > summedModsWhichNl,
166 std::vector< double > calcFragments(
const ms_peptide* peptide,
168 const bool doubleCharged,
169 const double minMass,
170 const double maxMass,
174 const FRAG_NL fragNlType = FRAG_NL_PRIMARY)
const;
177 bool calcFragmentsEx(
const ms_peptide* peptide,
179 const int fragCharge,
180 const double minMass,
181 const double maxMass,
185 const FRAG_NL fragNlType = FRAG_NL_PRIMARY)
const;
189 std::vector< double > calcFragments(
const ms_peptide* peptide,
191 const bool doubleCharged,
192 const double minMass,
193 const double maxMass,
195 std::vector< ms_fragment > *fragments,
197 const FRAG_NL fragNlType = FRAG_NL_PRIMARY)
const;
200 bool calcFragmentsEx(
const ms_peptide* peptide,
202 const int fragCharge,
203 const double minMass,
204 const double maxMass,
206 std::vector< ms_fragment > *fragments,
208 const FRAG_NL fragNlType = FRAG_NL_PRIMARY)
const;
214 ms_errs* getLog()
const {
return const_cast<ms_errs*
>(getErrorHandler()); }
216 std::string convertPrimaryNlVectorToString(
const std::vector< int > modded,
217 const std::vector< int > whichNl,
218 const ms_modvector &varMods,
219 const ms_modvector &varMods_used,
222 std::vector< int > convertPrimaryNlStringToVector(
const std::string varModStr,
223 const std::string primaryNlStr,
224 const ms_modvector &varMods_used,
227 void initialiseFromResfile(
const ms_mascotresfilebase& resfile,
228 const char * enzymeFileName,
229 const char * quantSchemaFilePath,
230 const char * unimodSchemaFilePath);
231 bool checkVarModConflicts(
const ms_modvector *varModVector, ms_modvector &varMods, std::vector<int> &varModsSrc, ms_modvector &varMods_used, ms_errs &err)
const;
232 bool iscleavagepoint(
const char left,
const char right)
const;
233 bool switchIndependent();
234 void updatemissed(
const int leftPos);
237 bool calcUnionFragmentList(
const ms_peptide* peptide,
239 const int fragCharge,
240 const double minMass,
241 const double maxMass,
242 const MASS_TYPE massType,
243 const FRAG_NL fragNlType,
244 std::vector< ms_fragment > *fragments,
246 std::vector< double > *vi)
const;
247 bool calcCrosslinkedFragments(
const ms_peptide *peptide,
249 const int fragCharge,
250 const double minMass,
251 const double maxMass,
252 const MASS_TYPE massType,
253 const FRAG_NL fragNlType,
254 std::vector< ms_fragment > *fragments,
256 std::vector< double > *vi)
const;
257 bool cfr(
const ms_peptide* peptide,
258 const ms_peptide::PSM psmComponent,
260 const int fragCharge,
261 const double minMass,
262 const double maxMass,
263 const MASS_TYPE massType,
264 const FRAG_NL fragNlType,
265 const int linkerColumn,
266 const double linkerMassOffset,
267 std::vector< ms_fragment > *fragments,
269 std::vector< double > *vi)
const;
271 void getSeriesParams(
const char* pepStr,
273 const ms_masses & masses,
274 const MASS_TYPE massType,
278 bool& forward)
const;
280 void prepareCumulativeMassAndNL(
const std::string &pepStr,
281 const ms_masses *pMasses,
282 const MASS_TYPE massType,
283 const std::vector<bool> &residue_has_varmod,
284 const std::vector<double> &fixedModNlVals,
285 const std::vector<double> &totalModDelta,
286 const std::vector<double> &totalNlVals,
287 const bool isMasterNL,
288 std::vector<double> &m,
289 std::vector<double> &cumulativeNlVals)
const;
292 void calculateSeriesMasses(
const int seriesID,
293 const int fragCharge,
294 const MASS_TYPE massType,
295 const ms_peptide::PSM psmComponent,
296 const int linkerColumn,
297 const double linkerMassOffset,
298 const ms_masses *pMasses,
299 const std::string &pepStr,
300 const std::vector<double> &m,
301 const std::vector<double> &cumulativeNlVals,
302 const std::vector<bool> &loopLinkingAllows,
303 IonSet &ionSet)
const;
305 void setupFromPre2_2ResultsFile(
const std::string & peptide,
const std::string & varMods);
307 class ModLookupHelper;
308 bool initialiseModsAtResidues(
const ModLookupHelper &lookupHelper,
309 const std::string &pepStr,
310 const std::string &modStr,
311 const std::vector<int> &primaryNl,
312 const std::string &monoLinkStr,
313 const ms_modvector *varmods,
314 const std::vector<int> *varmods_src,
315 const ms_modvector *varmods_used,
316 const ms_peptide::PSM psmComponent,
317 std::vector< const ms_modification* > &mod_at_residue,
320 bool lookupLocalModVectors(
int q,
const ms_modvector* &local_mods,
const std::vector<int>* &local_mods_src,
const ms_modvector* &local_mods_used);
321 void clearLocalModVectors();
323 ms_masses massesUnmod_;
325 ms_umod_configfile umodFile_;
326 ms_quant_configfile quantFile_;
327 const ms_mascotresfilebase* pResfile_;
328 const ms_mascotresults * pSummary_;
330 ms_modvector fixedMods_;
331 ms_modvector varMods_;
332 std::vector< int > varModsSrc_;
333 ms_modvector varMods_used_;
335 typedef std::map<int, ms_modvector > queryParsedLocalMods_t;
336 typedef std::map<int, std::vector<int> > queryParsedLocalModsSrc_t;
337 queryParsedLocalMods_t queryParsedLocalMods_;
338 queryParsedLocalModsSrc_t queryParsedLocalModsSrc_;
339 queryParsedLocalMods_t queryParsedLocalModsUsed_;
343 std::string protStr_;
357 enum DERIVED_MOD_SPECIFICITY_STATUS
359 DMSS_NOT_INITIALISED,
362 DMSS_FROM_V2_2_OR_LATER_RESFILE,
363 DMSS_NOT_FROM_RESFILE
365 DERIVED_MOD_SPECIFICITY_STATUS derivedModSpecificityStatus_;
366 std::vector<MOD_TYPES> derivedModSpecificities_;
367 typedef std::vector< std::vector<bool> > modifiedResidues_t;
368 modifiedResidues_t derivedModifiedResidues_;
This class facilitates creation of peptides and calculation of MS-fragment masses.
Definition: ms_aahelper.hpp:35
FRAG_NL
Flag for controlling iteration over multiple neutral losses.
Definition: ms_aahelper.hpp:47
Represent a single entry in the enzymes file.
Definition: ms_enzyme.hpp:67
This class is used as a base class for several Mascot Parser classes.
Definition: ms_errors.hpp:696
All errors are collected in an instance of this class.
Definition: ms_errors.hpp:37
Class for holding a list of ms_fragment objects.
Definition: ms_fragmentvector.hpp:47
A vector of linker sites.
Definition: ms_linker_site_vector.hpp:46
Abstract base class of ms_mascotresfile_dat and ms_mascotresfile_msr.
Definition: ms_mascotresfilebase.hpp:72
Abstract class for either ms_peptidesummary or ms_proteinsummary.
Definition: ms_mascotresults.hpp:83
Reads and parses the masses file with residue and atom masses.
Definition: ms_masses.hpp:48
General usage class for creating lists of modifications to be passed as parameters.
Definition: ms_modfile.hpp:339
This class encapsulates a peptide from the mascot results file.
Definition: ms_peptide.hpp:57
MASS_TYPE
All possible mass types.
Definition: ms_modfile.hpp:65