libpappsomspp
Library for mass spectrometry
Loading...
Searching...
No Matches
pappso::specpeptidoms::CorrectionTree Class Reference

#include <correctiontree.h>

Public Member Functions

 CorrectionTree ()
 
 ~CorrectionTree ()
 
void addPeaks (std::size_t peak1, std::size_t peak2)
 
std::vector< std::vector< std::size_t > > getPeaks () const
 

Private Member Functions

 CorrectionTree (std::size_t peak)
 

Private Attributes

std::size_t peak
 
CorrectionTreeSp msp_left
 
CorrectionTreeSp msp_right
 

Detailed Description

Definition at line 44 of file correctiontree.h.

Constructor & Destructor Documentation

◆ CorrectionTree() [1/2]

pappso::specpeptidoms::CorrectionTree::CorrectionTree ( )

Definition at line 36 of file correctiontree.cpp.

36 : peak(0)
37{
38}

References peak.

Referenced by addPeaks().

◆ ~CorrectionTree()

pappso::specpeptidoms::CorrectionTree::~CorrectionTree ( )

Definition at line 44 of file correctiontree.cpp.

45{
46}

◆ CorrectionTree() [2/2]

pappso::specpeptidoms::CorrectionTree::CorrectionTree ( std::size_t peak)
private

Definition at line 40 of file correctiontree.cpp.

40 : peak(peak)
41{
42}

References peak.

Member Function Documentation

◆ addPeaks()

void pappso::specpeptidoms::CorrectionTree::addPeaks ( std::size_t peak1,
std::size_t peak2 )

Definition at line 49 of file correctiontree.cpp.

50{
51 if(msp_left != nullptr)
52 {
53 msp_left->addPeaks(peak1, peak2);
54 msp_right->addPeaks(peak1, peak2);
55 }
56 else
57 {
58 msp_left = std::make_shared<CorrectionTree>(CorrectionTree(peak1));
59 msp_right = std::make_shared<CorrectionTree>(CorrectionTree(peak2));
60 }
61}

References CorrectionTree(), msp_left, and msp_right.

Referenced by pappso::specpeptidoms::SemiGlobalAlignment::correctAlign(), and pappso::specpeptidoms::SemiGlobalAlignment::preciseAlign().

◆ getPeaks()

std::vector< std::vector< std::size_t > > pappso::specpeptidoms::CorrectionTree::getPeaks ( ) const

Definition at line 64 of file correctiontree.cpp.

65{
66 std::vector<std::vector<std::size_t>> v_left, v_right;
67 if(peak == 0 && msp_left != nullptr)
68 {
69 v_left = msp_left->getPeaks();
70 v_right = msp_right->getPeaks();
71 v_left.insert(v_left.end(), v_right.begin(), v_right.end());
72 }
73 else if(peak > 0 && msp_left != nullptr)
74 {
75 v_left = msp_left->getPeaks();
76 v_right = msp_right->getPeaks();
77 v_left.insert(v_left.end(), v_right.begin(), v_right.end());
78 for(auto vec = v_left.begin(); vec != v_left.end(); vec++)
79 {
80 vec->push_back(peak);
81 }
82 }
83 else if(peak > 0)
84 {
85 v_left.push_back({peak});
86 }
87 return v_left;
88}

References msp_left, msp_right, and peak.

Referenced by pappso::specpeptidoms::SemiGlobalAlignment::correctAlign(), and pappso::specpeptidoms::SemiGlobalAlignment::preciseAlign().

Member Data Documentation

◆ msp_left

CorrectionTreeSp pappso::specpeptidoms::CorrectionTree::msp_left
private

Definition at line 56 of file correctiontree.h.

Referenced by addPeaks(), and getPeaks().

◆ msp_right

CorrectionTreeSp pappso::specpeptidoms::CorrectionTree::msp_right
private

Definition at line 56 of file correctiontree.h.

Referenced by addPeaks(), and getPeaks().

◆ peak

std::size_t pappso::specpeptidoms::CorrectionTree::peak
private

Definition at line 55 of file correctiontree.h.

Referenced by CorrectionTree(), CorrectionTree(), and getPeaks().


The documentation for this class was generated from the following files: