From 04105de4bcf5c2deecd7197b0a3d92a8b927adcf Mon Sep 17 00:00:00 2001 From: Martin Hunt Date: Fri, 7 Aug 2020 12:52:28 +0000 Subject: [PATCH] Require mapq>0; report NM and mapq in debug mapping file --- varifier/probe_mapping.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/varifier/probe_mapping.py b/varifier/probe_mapping.py index b016427..06d4209 100644 --- a/varifier/probe_mapping.py +++ b/varifier/probe_mapping.py @@ -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}", ] ) @@ -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 ) @@ -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: