Skip to content

Commit dc38a4e

Browse files
Moving magic numbers to some less magic numbers.
1 parent f8cd73b commit dc38a4e

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

src/utils/format-reads.cpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,10 +131,16 @@ bam_set1_core(bam1_core_t &core,
131131
const hts_pos_t pos, const uint8_t mapq, const size_t n_cigar,
132132
const int32_t mtid, const hts_pos_t mpos, const hts_pos_t isize,
133133
const size_t l_seq, const size_t qname_nuls) {
134+
/* ADS: need to clarify what these mean. They are used in
135+
`hts_reg2bin` from `htslib/hts.h` and likely mean "region to bin"
136+
for indexing */
137+
static const int min_shift = 14;
138+
static const int n_lvls = 5;
134139

135140
core.pos = pos;
136141
core.tid = tid;
137-
core.bin = hts_reg2bin(pos, pos + isize, 14, 5);
142+
/* ADS: MN I recall we migth not have needed this core.bin below */
143+
core.bin = hts_reg2bin(pos, pos + isize, min_shift, n_lvls);
138144
// used to be: core.bin = bam_reg2bin(pos, pos + rlen);
139145
// Changed based on htslib/cram/cram_samtools.h
140146
core.qual = mapq;

0 commit comments

Comments
 (0)