57 std::size_t beginning, std::size_t length,
int tree,
int score,
const QString &protein)
59 m_tree_scores.at(tree) = score;
60 if(m_tree_in_heap.at(tree))
62 for(std::vector<Location>::iterator iter = m_locations_heap.begin();
63 iter != m_locations_heap.end();
66 if(iter->tree == tree)
69 iter->length = length;
77 if(m_locations_heap.begin()->tree >= 0)
79 m_tree_in_heap.at(m_locations_heap.begin()->tree) =
false;
81 m_tree_in_heap.at(tree) =
true;
84 m_locations_heap.pop_back();
85 m_locations_heap.push_back({beginning, length, tree, score, protein});
91std::vector<pappso::specpeptidoms::Location>
94 std::vector<Location> locations;
95 locations.reserve(m_locations_heap.size());
96 for(std::vector<Location>::const_iterator iter = m_locations_heap.begin();
97 iter != m_locations_heap.end();
102 locations.push_back(*iter);
112 m_tree_in_heap.push_back(
false);
113 return m_tree_scores.size() - 1;
119 if(m_tree_scores.size() == 0)
121 return m_locations_heap.begin()->score;
125 return std::max(m_tree_scores.at(tree_id), m_locations_heap.begin()->score);
136 for(
auto iter = m_locations_heap.begin(); iter != m_locations_heap.end(); iter++)
140 m_tree_scores.clear();
141 m_tree_in_heap.clear();
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 bool locationCompare(const Location &loc1, const Location &loc2)
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....
std::vector< Location > getLocations() const
Returns a vector containing the saved locations.
std::vector< Location > m_locations_heap
std::size_t getNextTree()
Creates a new alignment tree and returns its id.
save protein subsequences for alignment
const uint MAX_SAVED_ALIGNMENTS(5)
const int MIN_ALIGNMENT_SCORE(15)
This header contains all the type re-definitions and all the global variables definitions used in the...