From 0e4068562db730c0edfed029a871303c3c0b4d7f Mon Sep 17 00:00:00 2001 From: Chris Miller Date: Mon, 17 Jun 2019 16:49:48 -0500 Subject: [PATCH] handle missing or zero depth field in tumor --- somatic_llr_filter.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/somatic_llr_filter.py b/somatic_llr_filter.py index a897f64..95d23dd 100644 --- a/somatic_llr_filter.py +++ b/somatic_llr_filter.py @@ -319,7 +319,12 @@ def missingVals(arr): if error_expect == 1: error_expect = 1 - args.sequence_error_rate - tumor_freq = tumor_var/tumor_depth + #handle case where depth is zero or missing + if tumor_depth == 0: + tumor_freq = 0 + else: + tumor_freq = tumor_var/tumor_depth + if tumor_freq == 0: tumor_freq = args.sequence_error_rate elif tumor_freq == 1: