From 6898463326f045b0b050a4fb953628060ae08ff6 Mon Sep 17 00:00:00 2001 From: Tom Kurowski Date: Tue, 25 Oct 2022 21:52:37 +0100 Subject: [PATCH] Correct the child sample depth calculation --- vcf2loc.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/vcf2loc.py b/vcf2loc.py index 26a7d0a..706b4ab 100755 --- a/vcf2loc.py +++ b/vcf2loc.py @@ -109,11 +109,14 @@ # Keeping only SNV sites. continue if args.min_dp is not None: + parent_b_dp = ( + 0 if args.parent_b is None + else site.genotype_calls[args.parent_a]['DP'] + ) child_dp = ( site.depth - site.genotype_calls[args.parent_a]['DP'] - - 0 if args.parent_b is None - else site.genotype_calls[args.parent_a]['DP'] + - parent_b_dp ) if child_dp < args.min_dp: # Skipping sites with low depth.