Skip to content

Commit 671a29e

Browse files
committed
fix ref/alt/other allele match reporting in find_intersecting_snps.py (broken during py2 to py3 conversion)
1 parent 33e241d commit 671a29e

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

mapping/find_intersecting_snps.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -415,10 +415,13 @@ def count_ref_alt_matches(read, read_stats, snp_tab, snp_idx, read_pos):
415415
alt_alleles = snp_tab.snp_allele2[snp_idx]
416416

417417
for i in range(len(snp_idx)):
418-
if ref_alleles[i] == read.query_sequence[read_pos[i]-1]:
418+
ref = ref_alleles[i].decode("utf-8")
419+
alt = alt_alleles[i].decode("utf-8")
420+
421+
if ref == read.query_sequence[read_pos[i]-1]:
419422
# read matches reference allele
420423
read_stats.ref_count += 1
421-
elif alt_alleles[i] == read.query_sequence[read_pos[i]-1]:
424+
elif alt == read.query_sequence[read_pos[i]-1]:
422425
# read matches non-reference allele
423426
read_stats.alt_count += 1
424427
else:

0 commit comments

Comments
 (0)