libpappsomspp
Library for mass spectrometry
Loading...
Searching...
No Matches
spectralalignment.cpp
Go to the documentation of this file.
1/**
2 * \file pappsomspp/processing/specglob/spectraalignment.cpp
3 * \date 08/11/2023
4 * \author Olivier Langella
5 * \brief petide to spectrum alignment
6 *
7 * C++ implementation of the SpecGlob algorithm described in :
8 * 1. Prunier, G. et al. Fast alignment of mass spectra in large proteomics
9 * datasets, capturing dissimilarities arising from multiple complex
10 * modifications of peptides. BMC Bioinformatics 24, 421 (2023).
11 *
12 * HAL Id : hal-04296170 , version 1
13 * Mot de passe : hxo20cl
14 * DOI : 10.1186/s12859-023-05555-y
15 */
16
17
18/*
19 * SpecGlobTool, Spectra to peptide alignment tool
20 * Copyright (C) 2023 Olivier Langella
21 * <olivier.langella@universite-paris-saclay.fr>
22 *
23 * This program is free software: you can redistribute it and/or modify
24 * it under the terms of the GNU General Public License as published by
25 * the Free Software Foundation, either version 3 of the License, or
26 * (at your option) any later version.
27 *
28 * This program is distributed in the hope that it will be useful,
29 * but WITHOUT ANY WARRANTY; without even the implied warranty of
30 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
31 * GNU General Public License for more details.
32 *
33 * You should have received a copy of the GNU General Public License
34 * along with this program. If not, see <http://www.gnu.org/licenses/>.
35 *
36 */
37
38#include "spectralalignment.h"
39#include "../../pappsoexception.h"
40#include "../../utils.h"
41
42
43namespace pappso
44{
45namespace specglob
46{
48 pappso::PrecisionPtr precision_ptr)
49{
50 m_precisionPtr = precision_ptr;
51 m_scoreValues = score_values;
52}
53
57
58
64
70void
72 ExperimentalSpectrumCsp experimental_spectrum)
73{
74 mcsp_experimentalSpectrum = experimental_spectrum;
75 mcsp_peptideSpectrum = peptide_spectrum;
76 m_maxScore = 0;
77 m_matrix.resize(mcsp_peptideSpectrum.get()->size(),
78 mcsp_experimentalSpectrum.get()->size());
79
80 // set the value of difference between Precursor mass and theoretical mass of
81 // the proposed peptide
83 mcsp_experimentalSpectrum.get()->getPrecursorMass() -
84 mcsp_peptideSpectrum.get()->getPeptideSp().get()->getMass();
85
87
88 m_itPosMax = m_matrix.end2();
89 // Make the alignment in filling the matrices
90
91 auto last_theoretical_peptide = std::prev(m_matrix.end1());
92 for(auto itmi = ++m_matrix.begin1(); itmi != m_matrix.end1(); ++itmi)
93 {
94 for(auto itmj = ++itmi.begin(); itmj != itmi.end(); itmj++)
95 {
96 // qDebug() << "i=" << itmj.index1() << " j=" << itmj.index2();
100 // keep the Max Score during matrixes filling
101 // the condition is to keep the max score in the last line (last
102 // theoretical amino acid) This is for try to keep all amino acids of
103 // the initial Theoretical sequence (but can modify alignment choice)
104 if(itmi == last_theoretical_peptide && (*itmj).score > m_maxScore)
105 {
106 m_maxScore = (*itmj).score;
107 m_itPosMax = itmj;
108 }
109 }
110 }
111}
112
115{
118
119 double precursor_mass = mcsp_experimentalSpectrum.get()->getPrecursorMass();
120 std::size_t start = 1;
121 int max_score = m_maxScore;
122 pappso::specglob::PeptideSpectraCsp ref_best_peptide = ref_peptide;
123
124 while(start < ref_peptide.get()->getPeptideSp().get()->size() - 5)
125 {
126 pappso::PeptideSp peptide_sp = std::make_shared<pappso::Peptide>(
127 ref_peptide.get()->getPeptideSp().get()->getSequence().mid(start));
128 std::size_t length = peptide_sp.get()->size();
129 while(peptide_sp.get()->getMass() > (precursor_mass * 1.1))
130 {
131 peptide_sp = std::make_shared<pappso::Peptide>(
132 peptide_sp.get()->getSequence().mid(0, length - 1));
133 if(length > 1)
134 length--;
135 }
137 std::make_shared<pappso::specglob::PeptideSpectrum>(peptide_sp);
138 align(peptide_spectra, mcsp_experimentalSpectrum);
139
140 if(max_score < m_maxScore)
141 {
142 if(m_maxScore > 0)
143 {
144 model = buildPeptideModel();
145 model.eliminateComplementaryDelta(precision_ptr);
146 model.ltrimOnRemoval();
147 max_score = m_maxScore;
148 ref_best_peptide = mcsp_peptideSpectrum;
149 }
150 }
151 start++;
152 }
153 align(ref_best_peptide, mcsp_experimentalSpectrum);
154 return model;
155}
156
157void
159 const boost::numeric::ublas::matrix<SpectralAlignmentDataPoint>::iterator2
160 &it_pos,
161 const PeptideSpectrum &peptide_spectrum,
162 const ExperimentalSpectrum &experimental_spectrum)
163{
164 // long theoIndiceI = it_pos.index1();
165 // long expeIndiceJ = it_pos.index2();
166 // in first time, we set score corresponding to type of peak (initial/mirror
167 // or both) we set initial score to peak mirror or initial
170 // experimental_spectrum.at(expeIndiceJ).type;
171
174 int reAlignScoreNOToAdd =
176
177 switch(expePeakType)
178 {
180 // this is a symmetric peak
183 reAlignScoreNOToAdd =
185 if(m_BETTER_END_RA &&
186 it_pos.index1() == peptide_spectrum.getPeptideSp().get()->size())
187 {
188 reAlignScoreToAdd =
191 }
192 break;
194 // this is a native peak with a symmetric corresponding
197 reAlignScoreNOToAdd =
199 if(m_BETTER_END_RA &&
200 it_pos.index1() == peptide_spectrum.getPeptideSp().get()->size())
201 {
202 reAlignScoreToAdd =
205 }
206 break;
207 default:
208 // this is a native or synthetic peak
210 reAlignScoreToAdd =
212 reAlignScoreNOToAdd =
214 if(m_BETTER_END_RA &&
215 it_pos.index1() == peptide_spectrum.getPeptideSp().get()->size())
216 {
217 reAlignScoreToAdd =
220 }
221 break;
222 }
223 SpectralAlignmentDataPoint &matrix_data_point_i_j = *it_pos;
224
225 /*
226 long k = getkValue(it_pos,
227 peptide_spectrum.at(it_pos.index1()).diff_mz,
228 experimental_spectrum);
229
230 if(it_pos.index1() == 15)
231 qDebug() << "position1" << it_pos.index1() << "position2" << it_pos.index1()
232 << " k=" << k << " " << peptide_spectrum.at(it_pos.index1()).diff_mz;
233 */
234 pappso::MzRange aaMassRange(peptide_spectrum.at(it_pos.index1()).diff_mz,
236 qDebug();
237 // long k = -1;
238 auto itKpeak =
239 experimental_spectrum.reverseFindDiffMz(it_pos.index2(), aaMassRange);
240 // if(itKpeak != experimental_spectrum.rend())
241 // k = itKpeak->indice;
242
243 if(itKpeak == experimental_spectrum.rend())
244 {
245 matrix_data_point_i_j.score =
246 m_matrix(it_pos.index1() - 1, it_pos.index2()).score +
248 matrix_data_point_i_j.origin_column_indices = it_pos.index2();
249 matrix_data_point_i_j.alignment_type = SpectralAlignmentType::nonAlign;
250 }
251 else
252 {
253 SpectralAlignmentDataPoint &matrix_data_point_previ_k =
254 m_matrix(it_pos.index1() - 1, itKpeak->indice);
255 int scoreAlignK = matrix_data_point_previ_k.score + alignScoreToAdd;
256 // if it come from non align, we must verify that there is no offset from
257 // previous align
258 if(matrix_data_point_previ_k.alignment_type ==
260 {
261 int l;
262 for(l = it_pos.index1() - 1; l > 0; l--)
263 {
264 if(m_matrix(l, itKpeak->indice).origin_column_indices !=
265 itKpeak->indice)
266 break;
267 }
268 if(std::abs(m_matrix(l, itKpeak->indice).mass_difference -
269 (*it_pos).mass_difference) > m_precisionPtr->getNominal())
270 scoreAlignK = matrix_data_point_previ_k.score + reAlignScoreToAdd;
271 }
272
273 // int[0] = the j value m and int[1] = the score value
275 it_pos, itKpeak->indice, reAlignScoreToAdd, reAlignScoreNOToAdd);
276
277 // For debug to see value for any match
278 // System.out.println("score k = " + scoreAlignK + " - score m = " +
279 // reAlignBestScore[1] + " - origin m = "
280 // + reAlignBestScore[0]);
281
282 if(scoreAlignK >= reAlignBestScore.score)
283 {
284 // setMatricesData(theoIndiceI, expeIndiceJ, scoreAlignK, k, 2);
285 matrix_data_point_i_j.score = scoreAlignK;
286 matrix_data_point_i_j.origin_column_indices = itKpeak->indice;
287 matrix_data_point_i_j.alignment_type = SpectralAlignmentType::align;
288 }
289 else
290 {
291 /*setMatricesData(theoIndiceI,
292 expeIndiceJ,
293 reAlignBestScore[1],
294 reAlignBestScore[0],
295 reAlignBestScore[2]);*/
296
297 matrix_data_point_i_j = reAlignBestScore;
298 }
299 }
300}
301
302
305 const boost::numeric::ublas::matrix<SpectralAlignmentDataPoint>::iterator2
306 &it_pos,
307 std::size_t expeIndicesK,
308 int reAlignScore,
309 int alignScoreToAdd)
310{
311
312 std::size_t previous_peptide_row = it_pos.index1() - 1;
313 SpectralAlignmentDataPoint return_data_point = *it_pos;
314 int bestScore = -10000;
315 int origin = -1;
316
317 // find the best score column indice on previous row, walking back from
318 // expeIndicesK m is a j value between 0 and k where a realign can be do if we
319 // accept mass offset
320 for(long m = expeIndicesK; m > -1; m--)
321 {
322 // the >= here is for keep the highest S value if there is multiple S with
323 // the same best score
324 if(m_matrix(previous_peptide_row, m).score > bestScore)
325 {
326 bestScore = m_matrix(previous_peptide_row, m).score;
327 origin = m;
328 }
329 }
330
331 return_data_point.origin_column_indices = origin;
332 return_data_point.score = bestScore + reAlignScore;
333 return_data_point.alignment_type = SpectralAlignmentType::reAlign; // [2] = 1;
334
335 if(origin == -1)
336 return return_data_point;
337
338 // We check for the last alignment if we have chain of Non Alignment to
339 // compare the last mass offset found
340 std::size_t lastAlignIndiceI = previous_peptide_row;
341 for(long l = previous_peptide_row; l > 0; l--)
342 {
343 if(m_matrix(l, origin).origin_column_indices != 0)
344 {
345 lastAlignIndiceI = l;
346 break;
347 }
348 }
349
350 // if the difference of mass offset between actual state and last align (or
351 // realign) is null, we consider that to an alignment
352 if((lastAlignIndiceI != (previous_peptide_row)) && (it_pos.index1() > 1) &&
353 (std::abs(m_matrix(previous_peptide_row, expeIndicesK).mass_difference -
354 m_matrix(lastAlignIndiceI, origin).mass_difference) <
356 {
357 return_data_point.score = bestScore + alignScoreToAdd;
358 return_data_point.alignment_type =
360 }
361
362 // we return the origin (value of m) and the associate calculated score and
363 // the type of Alignment
364 return return_data_point;
365}
366
367
368void
370 const PeptideSpectrum &peptide_spectrum,
371 const ExperimentalSpectrum &experimental_spectrum)
372{
373
374 auto it_peptide = peptide_spectrum.begin();
375 auto it_spectrum = experimental_spectrum.begin();
376 for(auto itr1 = m_matrix.begin1(); itr1 != m_matrix.end1();
377 ++itr1, it_peptide++)
378 {
379 it_spectrum = experimental_spectrum.begin();
380 for(auto itr2 = itr1.begin(); itr2 != itr1.end(); itr2++, it_spectrum++)
381 {
382 (*itr2).alignment_type = SpectralAlignmentType::nonAlign;
383 if(it_peptide == peptide_spectrum.begin())
384 (*itr2).alignment_type = SpectralAlignmentType::nonAlign;
385 (*itr2).origin_column_indices = 0;
386 (*itr2).score = 0;
387 (*itr2).mass_difference = it_spectrum->symmetric_mz - it_peptide->mz;
388 // qDebug() << " i=" << itr2.index1() << " j=" << itr2.index2()
389 // << " mass_difference=" << (*itr2).mass_difference;
390 }
391 }
392}
393
394const matrix<SpectralAlignmentDataPoint> &
396{
397 return m_matrix;
398}
399
400std::vector<int>
401SpectralAlignment::getScoreRow(std::size_t row_indice) const
402{
403 std::vector<int> score;
404
405 auto itr1 = m_matrix.begin1() + row_indice;
406 for(auto itr2 = itr1.begin(); itr2 != itr1.end(); itr2++)
407 {
408 score.push_back((*itr2).score);
409 }
410
411 return score;
412}
413
414int
416{
417 return m_maxScore;
418}
419
420boost::numeric::ublas::matrix<SpectralAlignmentDataPoint>::iterator2
425
428 const boost::numeric::ublas::matrix<SpectralAlignmentDataPoint>::iterator2
429 &itpos) const
430{
431 return mcsp_experimentalSpectrum.get()->at(itpos.index2());
432}
433
434double
439
440
441QString
443{
444 if(m_maxScore < 1)
445 {
446 throw pappso::PappsoException("no backtrack");
447 }
448 QString pepModified = "";
449 QString theoSequence =
450 mcsp_peptideSpectrum.get()->getPeptideSp().get()->getSequence();
451 int actualI = m_itPosMax.index1();
452 int prevI;
453 int actualJ = m_itPosMax.index2();
454 int prevJ;
455 double actualDelMass;
456 double prevDelMass;
457 int modifCount = 0;
458 double totExplainMass = 0.0;
459
460 // System.out.println(theoSequence);
461 // System.out.println("actualI is : " + actualI + " and actualJ is : " +
462 // actualJ);
463
464 while(actualI > 0)
465 {
466 // System.out.println(actualI);
467 // define the actual mass delta to the actual i and j
468 QString tempPepSeq = "";
469 QString tempAA = "";
470 QString aminoAcid = "";
471 actualDelMass = m_matrix(actualI, actualJ).mass_difference;
472 prevI = actualI - 1;
473 prevJ = m_matrix(actualI, actualJ).origin_column_indices;
474 prevDelMass = m_matrix(prevI, prevJ).mass_difference;
475
476 // We checking first if last Amino acid are not aligned
477
478 if(m_matrix(actualI, actualJ).alignment_type ==
480 {
481 // System.out.println("I'm NON ALIGN");
482 tempPepSeq = QString("[%1]").arg(theoSequence.at(actualI - 1));
483
484 while(m_matrix(prevI, prevJ).alignment_type ==
486 prevI > 0)
487 {
488 tempPepSeq =
489 QString("[%1]").arg(theoSequence.at(prevI - 1)) + tempPepSeq;
490 prevI--;
491 }
492 // modifCount++;
493 actualI = prevI;
494 actualJ = prevJ;
495
496 pepModified = tempPepSeq + pepModified;
497
498 qDebug() << "a1 pepModified=" << pepModified;
499 // if not, we are in the case where there is an alignment or a
500 // realignment if there is Align or a re-align, put the letter of
501 // Amino Acid and check what we get before to see if we have a mass
502 // change
503 }
504 else
505 {
506 // we put the actual amino acid because he is found, and in function
507 // of alignment type, we can have a mass offset
508 tempPepSeq = QString("%1").arg(theoSequence.at(actualI - 1));
509 aminoAcid = tempPepSeq;
510
511 // we check if there is a deletion before the founded aminoAcid
512 if(prevI > 0 && m_matrix(prevI, prevJ).alignment_type ==
514 {
515
516 // modifCount++;
517
518 // we continue to check if this is a deletion bloc to keep the
519 // mass difference due to the deletion of the block
520 while(prevI > 0 && m_matrix(prevI, prevJ).alignment_type ==
522 {
523
524 tempPepSeq = QString("[%1]").arg(theoSequence.at(prevI - 1)) +
525 tempPepSeq;
526 tempAA =
527 QString("%1").arg(theoSequence.at(prevI - 1)) + tempAA;
528
529 prevI--;
530 prevDelMass = m_matrix(prevI, prevJ).mass_difference;
531 if(prevI == 0)
532 {
533 prevDelMass = 0.0;
534 }
535 }
536
537 // check the mass delta to avoid showing a null mass delta
538 if(std::abs(actualDelMass - prevDelMass) >
540 {
541
542 tempPepSeq = tempPepSeq.mid(0, tempPepSeq.length() - 1);
543
544 tempPepSeq +=
545 QString("[%1]").arg(actualDelMass - prevDelMass) +
546 aminoAcid;
547 totExplainMass += (actualDelMass - prevDelMass);
548 modifCount++;
549 qDebug() << "a2a1 tempPepSeq=" << tempPepSeq;
550 }
551
552 // if there this is just a re-align, we need to indicate the mass
553 // offset
554 }
555 else if(m_matrix(actualI, actualJ).alignment_type ==
557 {
558
559 tempPepSeq =
560 QString("[%1]").arg(actualDelMass - prevDelMass) + tempPepSeq;
561 modifCount++;
562 totExplainMass += (actualDelMass - prevDelMass);
563
564 // the fact when you align the first amino acid, but there is a
565 // leak of Amino acid in OMS solution before
566 }
567 else if(actualI == 1 &&
568 m_matrix(actualI, actualJ).alignment_type ==
570 (std::abs(actualDelMass) > m_precisionPtr->getNominal()))
571 {
572 tempPepSeq = QString("[%1]").arg(actualDelMass) + tempPepSeq;
573 totExplainMass += actualDelMass;
574 modifCount++;
575 }
576
577 pepModified = tempPepSeq + pepModified;
578 qDebug() << "a2 pepModified=" << pepModified;
579 // System.out.println(pepModified);
580
581 actualI = prevI;
582 actualJ = prevJ;
583 }
584 }
585
586 // setModificationNumber(modifCount);
587
588 return QString("%1_[%2]")
589 .arg(pepModified)
590 .arg(m_precursorMassDelta - totExplainMass);
591}
592
593
596{
597 if(m_maxScore < 1)
598 {
600 QObject::tr("building peptide model failed m_maxScore == %1")
601 .arg(m_maxScore));
602 }
603 PeptideModel sg_peptide_model(
604 mcsp_experimentalSpectrum.get()->getQualifiedMassSpectrum(),
605 *(mcsp_peptideSpectrum.get()->getPeptideSp().get()));
606 int actualI = m_itPosMax.index1();
607 int prevI;
608 int actualJ = m_itPosMax.index2();
609 int prevJ;
610 double actualDelMass;
611 double prevDelMass;
612
613 // System.out.println(theoSequence);
614 // System.out.println("actualI is : " + actualI + " and actualJ is : " +
615 // actualJ);
616
617 while(actualI > 0)
618 {
619 // System.out.println(actualI);
620 // define the actual mass delta to the actual i and j
621 QString aminoAcid = "";
622 actualDelMass = m_matrix(actualI, actualJ).mass_difference;
623 prevI = actualI - 1;
624 prevJ = m_matrix(actualI, actualJ).origin_column_indices;
625 prevDelMass = m_matrix(prevI, prevJ).mass_difference;
626
627 // We checking first if last Amino acid are not aligned
628
629 if(m_matrix(actualI, actualJ).alignment_type ==
631 {
632 // System.out.println("I'm NON ALIGN");
633
634 while(m_matrix(prevI, prevJ).alignment_type ==
636 prevI > 0)
637 {
638 if(prevI > 0)
639 sg_peptide_model[prevI - 1].bracket = true;
640 prevI--;
641 }
642 // modifCount++;
643 actualI = prevI;
644 actualJ = prevJ;
645
646 // if not, we are in the case where there is an alignment or a
647 // realignment if there is Align or a re-align, put the letter of
648 // Amino Acid and check what we get before to see if we have a mass
649 // change
650 }
651 else
652 {
653 // we put the actual amino acid because he is found, and in function
654 // of alignment type, we can have a mass offset
655
656 // we check if there is a deletion before the founded aminoAcid
657 if(prevI > 0 && m_matrix(prevI, prevJ).alignment_type ==
659 {
660
661 // modifCount++;
662
663 // we continue to check if this is a deletion bloc to keep the
664 // mass difference due to the deletion of the block
665 while(prevI > 0 && m_matrix(prevI, prevJ).alignment_type ==
667 {
668
669
670 if(prevI > 0)
671 sg_peptide_model[prevI - 1].bracket = true;
672 prevI--;
673 prevDelMass = m_matrix(prevI, prevJ).mass_difference;
674 if(prevI == 0)
675 {
676 prevDelMass = 0.0;
677 }
678 }
679
680 // check the mass delta to avoid showing a null mass delta
681 if(std::abs(actualDelMass - prevDelMass) >
683 {
684
685 int mass_i = actualI - 1;
686 if(mass_i == 0)
687 {
688 sg_peptide_model.setBeginMassDelta(actualDelMass -
689 prevDelMass);
690 }
691 else
692 {
693 sg_peptide_model[mass_i - 1].mass_difference =
694 actualDelMass - prevDelMass;
695 }
696 }
697
698 // if there this is just a re-align, we need to indicate the mass
699 // offset
700 }
701 else if(m_matrix(actualI, actualJ).alignment_type ==
703 {
704
705 int mass_i = actualI - 1;
706 if(mass_i == 0)
707 {
708 sg_peptide_model.setBeginMassDelta(actualDelMass -
709 prevDelMass);
710 }
711 else
712 {
713 sg_peptide_model[mass_i - 1].mass_difference =
714 actualDelMass - prevDelMass;
715 }
716 // the fact when you align the first amino acid, but there is a
717 // leak of Amino acid in OMS solution before
718 }
719 else if(actualI == 1 &&
720 m_matrix(actualI, actualJ).alignment_type ==
722 (std::abs(actualDelMass) > m_precisionPtr->getNominal()))
723 {
724 sg_peptide_model.setBeginMassDelta(actualDelMass);
725 }
726
727 actualI = prevI;
728 actualJ = prevJ;
729 }
730 }
731
732 // setModificationNumber(modifCount);
733
734 // return QString("%1_[%2]")
735 // .arg(pepModified)
736 // .arg(m_precursorMassDelta - totExplainMass);
737 return sg_peptide_model;
738}
739} // namespace specglob
740} // namespace pappso
virtual pappso_double getNominal() const final
Definition precision.cpp:65
std::vector< ExperimentalSpectrumDataPoint >::const_reverse_iterator reverseFindDiffMz(std::size_t start_position, const pappso::MzRange &targeted_mass_range) const
find the peak for wich mass difference from rbegin corresponds to aaTheoMass Find if a peak back in t...
bool ltrimOnRemoval()
try to remove left amino acid if there is a removal
bool eliminateComplementaryDelta(pappso::PrecisionPtr precision)
pappso::PeptideSp getPeptideSp() const
int get(ScoreValueType type)
SpectralAlignment(ScoreValues score_values, pappso::PrecisionPtr precision_ptr)
SpectralAlignmentDataPoint getBestRealignScore(const boost::numeric::ublas::matrix< SpectralAlignmentDataPoint >::iterator2 &it_pos, std::size_t expeIndicesK, int reAlignScore, int alignScoreToAdd)
boost::numeric::ublas::matrix< SpectralAlignmentDataPoint >::iterator2 getMaxPosIterator() const
std::vector< int > getScoreRow(std::size_t row_indice) const
void fillMassDelta(const PeptideSpectrum &peptide_spectrum, const ExperimentalSpectrum &experimental_spectrum)
const ExperimentalSpectrumDataPoint & getExperimentalSpectrumDataPoint(const boost::numeric::ublas::matrix< SpectralAlignmentDataPoint >::iterator2 &itpos) const
ExperimentalSpectrumCsp mcsp_experimentalSpectrum
PeptideSpectraCsp getPeptideSpectraCsp() const
PeptideModel rtrim(PrecisionPtr precision_ptr)
trim the current peptide to get a minimal alignment score
ExperimentalSpectrumCsp getExperimentalSpectrumCsp() const
const matrix< SpectralAlignmentDataPoint > & getMatrix() const
boost::numeric::ublas::matrix< SpectralAlignmentDataPoint >::iterator2 m_itPosMax
matrix< SpectralAlignmentDataPoint > m_matrix
void fillMatricesWithScores(const boost::numeric::ublas::matrix< SpectralAlignmentDataPoint >::iterator2 &it_pos, const PeptideSpectrum &peptide_spectrum, const ExperimentalSpectrum &experimental_spectrum)
void align(PeptideSpectraCsp peptide_spectrum, ExperimentalSpectrumCsp experimental_spectrum)
build the alignment matrix between a peptide sequence and an experimental spectrum
std::shared_ptr< const PeptideSpectrum > PeptideSpectraCsp
@ scoreAlignNative
Score for good alignment native (int)
@ scoreReAlignSymNO
Score for re-alignment without offset symmetric (int)
@ scoreNonAlign
Score for non alignment (int)
@ scoreAlignBoth
Score for good alignment both (int)
@ scoreReAlignBoth
Score for re-alignment both (int)
@ scoreReAlignBothNO
Score for re-alignment without offset both (int)
@ scoreReAlignSym
Score for re-alignment symmetric (int)
@ scoreAlignSym
Score for good alignment symmetric (int)
@ scoreReAlignNativeNO
Score for re-alignment without offset native (int)
std::shared_ptr< const ExperimentalSpectrum > ExperimentalSpectrumCsp
@ nonAlign
the type of alignment to put in origin matrix NON Alignment (0 - NA)
ExperimentalSpectrumDataPointType
Definition types.h:78
@ both
both, the ion and the complement exists in the original spectrum
@ symmetric
new peak : computed symmetric mass from a corresponding native peak
tries to keep as much as possible monoisotopes, removing any possible C13 peaks and changes multichar...
Definition aa.cpp:39
std::shared_ptr< const Peptide > PeptideSp