Skip to content

Commit

Permalink
also backport PglMultiallelicSparseToDense() remap bugfix
Browse files Browse the repository at this point in the history
  • Loading branch information
chrchang committed Jul 4, 2024
1 parent bc6b5b6 commit adfee42
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions 2.0/include/pgenlib_write.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1923,6 +1923,9 @@ void PglMultiallelicSparseToDense(const uintptr_t* __restrict genoarr, const uin
const uintptr_t sample_idx = BitIter1(patch_01_set, &sample_idx_base, &cur_bits);
const AlleleCode ac = remap[patch_01_vals[uii]];
if (ac > remap0) {
// bugfix (4 Jul 2024): cannot assume wide_codes[2 * sample_idx] ==
// remap0. It's remap1 when remap1 < remap0.
wide_codes[2 * sample_idx] = remap0;
wide_codes[2 * sample_idx + 1] = ac;
} else {
wide_codes[2 * sample_idx] = ac;
Expand Down

0 comments on commit adfee42

Please sign in to comment.