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 QString &protein) |
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 |
int | m_min_score |
int | m_max_score |
Definition at line 54 of file locationsaver.h.
pappso::specpeptidoms::LocationSaver::LocationSaver | ( | ) |
Constructor
Definition at line 36 of file locationsaver.cpp.
References m_locations_heap, pappso::specpeptidoms::MAX_SAVED_ALIGNMENTS(), and pappso::specpeptidoms::MIN_ALIGNMENT_SCORE().
pappso::specpeptidoms::LocationSaver::~LocationSaver | ( | ) |
void pappso::specpeptidoms::LocationSaver::addLocation | ( | std::size_t | beginning, |
std::size_t | length, | ||
int | tree, | ||
int | score, | ||
const QString & | protein ) |
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 56 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 92 of file locationsaver.cpp.
References m_locations_heap.
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 117 of file locationsaver.cpp.
References 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 109 of file locationsaver.cpp.
References m_tree_in_heap, m_tree_scores, and pappso::specpeptidoms::MIN_ALIGNMENT_SCORE().
|
staticprivate |
Definition at line 49 of file locationsaver.cpp.
References pappso::specpeptidoms::Location::score.
Referenced by addLocation().
void pappso::specpeptidoms::LocationSaver::resetLocationSaver | ( | ) |
Definition at line 134 of file locationsaver.cpp.
References m_locations_heap, m_tree_in_heap, m_tree_scores, and pappso::specpeptidoms::MIN_ALIGNMENT_SCORE().
|
private |
Definition at line 96 of file locationsaver.h.
Referenced by LocationSaver(), addLocation(), getLocations(), getMinScore(), and resetLocationSaver().
|
private |
Definition at line 99 of file locationsaver.h.
|
private |
Definition at line 99 of file locationsaver.h.
|
private |
Definition at line 98 of file locationsaver.h.
Referenced by addLocation(), getNextTree(), and resetLocationSaver().
|
private |
Definition at line 97 of file locationsaver.h.
Referenced by addLocation(), getMinScore(), getNextTree(), and resetLocationSaver().