Skip to content

Commit fe6bdd2

Browse files
updated the b_offset value
1 parent e59c748 commit fe6bdd2

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/utils/format-reads.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -417,7 +417,7 @@ revcomp_seq_by_byte(bam1_t *aln) {
417417
if (l_qseq % 2 == 1) { // for odd-length sequences
418418
for (size_t i = 0; i < num_bytes - 1; i++) {
419419
// swap 4-bit chunks within consecutive bytes like this:
420-
// (aaaabbbb ccccdddd) => (....aaaa bbbbcccc dddd....)
420+
// (----aaaa bbbbcccc dddd....) => (aaaabbbb ccccdddd ....)
421421
seq[i] = (seq[i] << 4) | (seq[i + 1] >> 4);
422422
}
423423
seq[num_bytes - 1] <<= 4;
@@ -444,7 +444,7 @@ merge_by_byte(const bam1_t *a, const bam1_t *b, bam1_t *c) {
444444
const size_t a_num_bytes = ceil(a_used_len / 2.0);
445445
const size_t b_num_bytes = ceil(b_seq_len / 2.0);
446446

447-
const size_t b_offset = is_b_odd;
447+
const size_t b_offset = is_a_odd && is_b_odd;
448448

449449
const auto a_seq = bam_get_seq(a);
450450
const auto b_seq = bam_get_seq(b);

0 commit comments

Comments
 (0)