|
libpappsomspp
Library for mass spectrometry
|
#include <locationsaver.h>
Public Member Functions | |
| LocationSaver () | |
| ~LocationSaver () | |
| void | addLocation (std::size_t beginning, std::size_t length, int tree, int score, const SpOMSProtein *protein_ptr) |
| Adds a location to the locations heap. If a saved location has the same tree_id, it will replace it. Otherwise, it replaces the location with the lowest score. | |
| std::vector< Location > | getLocations () const |
| Returns a vector containing the saved locations. | |
| std::size_t | getNextTree () |
| Creates a new alignment tree and returns its id. | |
| int | getMinScore (int tree_id) const |
| Returns the minimum score for a location with the provided tree_id to be saved in the heap. | |
| void | resetLocationSaver () |
Static Private Member Functions | |
| static bool | locationCompare (const Location &loc1, const Location &loc2) |
Private Attributes | |
| std::vector< Location > | m_locations_heap |
| std::vector< int > | m_tree_scores |
| std::vector< bool > | m_tree_in_heap |
Definition at line 78 of file locationsaver.h.
| pappso::specpeptidoms::LocationSaver::LocationSaver | ( | ) |
Constructor
Definition at line 59 of file locationsaver.cpp.
References pappso::specpeptidoms::Location::beginning, pappso::specpeptidoms::Location::length, m_locations_heap, pappso::specpeptidoms::MAX_SAVED_ALIGNMENTS(), pappso::specpeptidoms::MIN_ALIGNMENT_SCORE(), pappso::specpeptidoms::Location::proteinPtr, pappso::specpeptidoms::Location::score, and pappso::specpeptidoms::Location::tree.
| pappso::specpeptidoms::LocationSaver::~LocationSaver | ( | ) |
| void pappso::specpeptidoms::LocationSaver::addLocation | ( | std::size_t | beginning, |
| std::size_t | length, | ||
| int | tree, | ||
| int | score, | ||
| const SpOMSProtein * | protein_ptr ) |
Adds a location to the locations heap. If a saved location has the same tree_id, it will replace it. Otherwise, it replaces the location with the lowest score.
Definition at line 82 of file locationsaver.cpp.
References locationCompare(), m_locations_heap, m_tree_in_heap, and m_tree_scores.
| std::vector< pappso::specpeptidoms::Location > pappso::specpeptidoms::LocationSaver::getLocations | ( | ) | const |
Returns a vector containing the saved locations.
Definition at line 126 of file locationsaver.cpp.
References m_locations_heap.
Referenced by pappso::cbor::psm::PsmSpecPeptidOmsScan::sequenceAlignment().
| int pappso::specpeptidoms::LocationSaver::getMinScore | ( | int | tree_id | ) | const |
Returns the minimum score for a location with the provided tree_id to be saved in the heap.
Definition at line 151 of file locationsaver.cpp.
References pappso::specpeptidoms::ALIGNMENT_FILTER(), m_locations_heap, and m_tree_scores.
| std::size_t pappso::specpeptidoms::LocationSaver::getNextTree | ( | ) |
Creates a new alignment tree and returns its id.
Definition at line 143 of file locationsaver.cpp.
References m_tree_in_heap, m_tree_scores, and pappso::specpeptidoms::MIN_ALIGNMENT_SCORE().
|
staticprivate |
Definition at line 75 of file locationsaver.cpp.
References pappso::specpeptidoms::Location::score.
Referenced by addLocation().
| void pappso::specpeptidoms::LocationSaver::resetLocationSaver | ( | ) |
Definition at line 186 of file locationsaver.cpp.
References pappso::specpeptidoms::Location::beginning, pappso::specpeptidoms::Location::length, m_locations_heap, m_tree_in_heap, m_tree_scores, pappso::specpeptidoms::MIN_ALIGNMENT_SCORE(), pappso::specpeptidoms::Location::proteinPtr, pappso::specpeptidoms::Location::score, and pappso::specpeptidoms::Location::tree.
|
private |
Definition at line 123 of file locationsaver.h.
Referenced by LocationSaver(), addLocation(), getLocations(), getMinScore(), and resetLocationSaver().
|
private |
Definition at line 125 of file locationsaver.h.
Referenced by addLocation(), getNextTree(), and resetLocationSaver().
|
private |
Definition at line 124 of file locationsaver.h.
Referenced by addLocation(), getMinScore(), getNextTree(), and resetLocationSaver().