Skip to content

Commit

Permalink
Require mapq>0; report NM and mapq in debug mapping file
Browse files Browse the repository at this point in the history
  • Loading branch information
martinghunt committed Aug 7, 2020
1 parent eb4b552 commit 04105de
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion varifier/probe_mapping.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,8 @@ def hit_debug_string(hit, map_probe):
f"qstart/end={hit.q_st}/{hit.q_en}",
f"rstart/end={hit.r_st}/{hit.r_en}",
f"cigar={hit.cigar}",
f"mapq={hit.mapq}",
f"NM={hit.NM}",
]
)

Expand Down Expand Up @@ -128,7 +130,7 @@ def evaluate_vcf_record(
file=map_outfile,
)

alt_hits = [x for x in alt_hits if alt_probe.map_hit_includes_allele(x)]
alt_hits = [x for x in alt_hits if alt_probe.map_hit_includes_allele(x) and x.mapq > 0]
alt_match, alt_allele_length, alt_best_hit = probe_hits_to_best_allele_counts(
alt_probe, alt_hits, debug_outfile=map_outfile
)
Expand Down Expand Up @@ -162,6 +164,7 @@ def evaluate_vcf_record(
if ref_probe.map_hit_includes_allele(x)
and alt_best_hit.ctg == x.ctg
and x.r_st == alt_best_hit.r_st
and x.mapq > 0
]

if len(ref_hits) == 0:
Expand Down

0 comments on commit 04105de

Please sign in to comment.