Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use ksw2 to align soft-clipped ends from ungapped alignment #382

Open
wants to merge 13 commits into
base: main
Choose a base branch
from
Prev Previous commit
Next Next commit
Add operator<< for AlignmentInfo
  • Loading branch information
marcelm committed Feb 22, 2024
commit 36513bc8a53a43be6b8075fb7c4bed205f77c34c
10 changes: 10 additions & 0 deletions src/aligner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -311,3 +311,13 @@ AlignmentInfo Aligner::ksw_extend(const std::string& query, const std::string& r
kfree(km, ez.cigar);
return info;
}

std::ostream& operator<<(std::ostream& os, const AlignmentInfo& info) {
os << "AlignmentInfo(cigar='" << info.cigar
<< "', ref=" << info.ref_start << ".." << info.ref_end
<< ", query=" << info.query_start << ".." << info.query_end
<< ", NM=" << info.edit_distance
<< ", AS=" << info.sw_score
<< ")";
return os;
}
2 changes: 2 additions & 0 deletions src/aligner.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ struct AlignmentInfo {
int ref_span() const { return ref_end - ref_start; }
};

std::ostream& operator<<(std::ostream& os, const AlignmentInfo& info);

void ksw_gen_simple_mat(int m, int8_t *mat, int8_t a, int8_t b);

struct Aligner {
Expand Down