Skip to content

Commit

Permalink
Sorted terminal telomeres
Browse files Browse the repository at this point in the history
  • Loading branch information
AldhairMedico committed Jan 13, 2025
1 parent 9129d2e commit e652845
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/teloscope.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -192,11 +192,11 @@ std::vector<TelomereBlock> Teloscope::filterTerminalBlocks(const std::vector<Tel
}

// Assign best 'p' and 'q' blocks per path
if (has_p1 && has_q1) {
if (has_p1 && has_q1) {
filteredBlocks.push_back(best_p);
filteredBlocks.push_back(best_q);
}
else {
else {
if (has_p1) {
filteredBlocks.push_back(best_p);
if (has_p2) {
Expand All @@ -211,10 +211,15 @@ std::vector<TelomereBlock> Teloscope::filterTerminalBlocks(const std::vector<Tel
}
}

// Sort by coords
std::sort(filteredBlocks.begin(), filteredBlocks.end(),
[](const TelomereBlock &a, const TelomereBlock &b) {
return a.start < b.start;
});

return filteredBlocks;
}


std::vector<TelomereBlock> Teloscope::filterInterstitialBlocks(
const std::vector<TelomereBlock>& interstitialBlocks,
const std::vector<TelomereBlock>& terminalBlocks) {
Expand Down

0 comments on commit e652845

Please sign in to comment.