From ca1c11d43ce7b9871f4c93521f40acaa31e08771 Mon Sep 17 00:00:00 2001 From: Jody Phelan Date: Mon, 21 Oct 2024 22:21:13 +0100 Subject: [PATCH] add dp4 support in var into --- pathogenprofiler/vcf.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pathogenprofiler/vcf.py b/pathogenprofiler/vcf.py index 6050b1d..d8a084b 100644 --- a/pathogenprofiler/vcf.py +++ b/pathogenprofiler/vcf.py @@ -23,6 +23,9 @@ def get_stand_support(var: pysam.VariantRecord,alt: str) -> Tuple[int,int]: elif 'SB' in var.samples[0]: forward_support = var.samples[0]['SB'][(alt_index+1)*2] reverse_support = var.samples[0]['SB'][(alt_index+1)*2+1] + elif 'DP4' in var.info: + forward_support = var.info['DP4'][alt_index*2] + reverse_support = var.info['DP4'][alt_index*2+1] else: forward_support = None reverse_support = None