Skip to content

Commit

Permalink
Merge pull request #5 from hxj5/master
Browse files Browse the repository at this point in the history
fix bug of m2 & k2 in infer_allele
  • Loading branch information
hxj5 authored Nov 17, 2020
2 parents f2b0850 + 06a8bf8 commit c08f1a1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion cellsnp_util.h
Original file line number Diff line number Diff line change
@@ -852,7 +852,7 @@ static inline void csp_infer_allele(size_t *bc, int8_t *ref_idx, int8_t *alt_idx
if (bc[0] < bc[1]) { m1 = bc[1]; m2 = bc[0]; k1 = 1; k2 = 0; }
else { m1 = bc[0]; m2 = bc[1]; k1 = 0; k2 = 1; }
for (i = 2; i < 5; i++) {
if (bc[i] > m1) { m1 = bc[i]; k1 = i; }
if (bc[i] > m1) { m2 = m1; k2 = k1; m1 = bc[i]; k1 = i; }
else if (bc[i] > m2) { m2 = bc[i]; k2 = i; }
}
*ref_idx = k1; *alt_idx = k2;

0 comments on commit c08f1a1

Please sign in to comment.