Skip to content

Commit

Permalink
Corrects OOR issue where no genes removed from colour
Browse files Browse the repository at this point in the history
  • Loading branch information
samhorsfield96 committed Oct 18, 2024
1 parent 644644f commit da08d32
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/graph.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -514,11 +514,15 @@ std::pair<std::map<size_t, std::string>, std::map<size_t, std::string>> Graph::f

std::unordered_set<std::string> ORFs_to_remove_private;

// remove all low scoring ORFs
for (const auto& ORF_ID : to_remove.at(colour_ID))
// remove all low scoring ORFs if present in colour
const auto& removal = to_remove.find(colour_ID);
if (removal != to_remove.end())
{
ORF_map.erase(ORF_ID);
continue;
for (const auto& ORF_ID : removal->second)
{
ORF_map.erase(ORF_ID);
continue;
}
}

// iterate over ORFToScoreMap for the given colour
Expand Down

0 comments on commit da08d32

Please sign in to comment.