83 std::size_t beginning, std::size_t length,
int tree,
int score,
const SpOMSProtein *protein_ptr)
87 m_tree_scores.at(tree) = score;
88 if(m_tree_in_heap.at(tree))
90 for(std::vector<Location>::iterator iter = m_locations_heap.begin();
91 iter != m_locations_heap.end();
94 if(iter->tree == tree)
97 iter->length = length;
105 if(m_locations_heap.begin()->tree >= 0)
107 m_tree_in_heap.at(m_locations_heap.begin()->tree) =
false;
109 m_tree_in_heap.at(tree) =
true;
112 m_locations_heap.pop_back();
113 m_locations_heap.push_back({beginning, length, tree, score, protein_ptr});
118 catch(
const std::exception &error)
121 QObject::tr(
"addLocation failed std::exception :\n%1").arg(error.what()));
153 if(m_tree_scores.size() == 0)
155 return m_locations_heap.begin()->score;
159 if(tree_id > (
int)m_tree_scores.size())
163 QObject::tr(
"LocationSaver::getMinScore failed :\nout of "
164 "range access %1 with m_tree_scores.size() %2")
166 .arg(m_tree_scores.size()));
174 m_tree_scores.at(tree_id),
175 std::max(m_locations_heap.begin()->score,
177 *(std::max_element(m_tree_scores.begin(), m_tree_scores.end())))));
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....