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

Fix SAM format output and HARD clipping #253

Merged
merged 2 commits into from
Jul 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/align/include/computeAlignments.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -482,7 +482,7 @@ typedef atomic_queue::AtomicQueue<std::string*, 1024, nullptr, true, true, false
}

// To distinguish split alignment in SAM output format (currentRecord.rankMapping == 0 to avoid the suffix there is just one alignment for the query)
const std::string query_name_suffix = param.split && param.sam_format ? "_" + std::to_string(rec->currentRecord.rankMapping) : "";
//const std::string query_name_suffix = param.split && param.sam_format ? "_" + std::to_string(rec->currentRecord.rankMapping) : "";

wflign::wavefront::WFlign* wflign = new wflign::wavefront::WFlign(
param.wflambda_segment_length,
Expand Down Expand Up @@ -523,7 +523,7 @@ typedef atomic_queue::AtomicQueue<std::string*, 1024, nullptr, true, true, false
!param.sam_format,
param.no_seq_in_sam);
wflign->wflign_affine_wavefront(
rec->currentRecord.qId + query_name_suffix,
rec->currentRecord.qId,// + query_name_suffix,
queryRegionStrand,
rec->queryTotalLength,
rec->queryStartPos,
Expand Down
20 changes: 4 additions & 16 deletions src/common/wflign/src/wflign_patch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1715,24 +1715,12 @@ query_start : query_end)
query_offset +
(query_is_rev ? query_length - query_start : query_end);

if (query_is_rev) {
if (query_length > query_end_pos) {
out << (query_length - query_end_pos) << "H";
}
} else {
if (query_start_pos > 0) {
out << query_start_pos << "H";
}
if (query_start_pos > 0) {
out << query_start_pos << "H";
}
out << cigarv;
if (query_is_rev) {
if (query_start_pos > 0) {
out << query_start_pos << "H";
}
} else {
if (query_length > query_end_pos) {
out << (query_length - query_end_pos) << "H";
}
if (query_total_length > query_end_pos) {
out << (query_total_length - query_end_pos) << "H";
}

out << "\t"
Expand Down
Loading