diff --git a/pathogenprofiler/variant_calling.py b/pathogenprofiler/variant_calling.py index 6fe65cc..1092078 100644 --- a/pathogenprofiler/variant_calling.py +++ b/pathogenprofiler/variant_calling.py @@ -103,7 +103,7 @@ class GatkCaller(VariantCaller): def call_variants(self) -> Vcf: # Call variants using GATK if self.platform=="illumina": - self.calling_cmd = "samtools view -T %(ref_file)s -h %(bam_file)s {region} %(samclip_cmd)s | samtools view -b > %(temp_file_prefix)s.{region_safe}.tmp.bam && samtools index %(temp_file_prefix)s.{region_safe}.tmp.bam && gatk HaplotypeCaller -R %(ref_file)s -I %(temp_file_prefix)s.{region_safe}.tmp.bam -O /dev/stdout -L {region} %(calling_params)s -OVI false | bcftools norm -f %(ref_file)s -Oz -o %(temp_file_prefix)s.{region_safe}.vcf.gz" % vars(self) + self.calling_cmd = "samtools view -T %(ref_file)s -h %(bam_file)s {region} %(samclip_cmd)s | samtools view -b > %(temp_file_prefix)s.{region_safe}.tmp.bam && samtools index %(temp_file_prefix)s.{region_safe}.tmp.bam && gatk HaplotypeCaller -A StrandBiasBySample -R %(ref_file)s -I %(temp_file_prefix)s.{region_safe}.tmp.bam -O /dev/stdout -L {region} %(calling_params)s -OVI false | bcftools norm -f %(ref_file)s -Oz -o %(temp_file_prefix)s.{region_safe}.vcf.gz" % vars(self) else: raise NotImplementedError("%s not implemented for %s platform" % (self.__software__,self.platform)) return self.run_calling(self.calling_cmd) diff --git a/pathogenprofiler/vcf.py b/pathogenprofiler/vcf.py index 4047081..6050b1d 100644 --- a/pathogenprofiler/vcf.py +++ b/pathogenprofiler/vcf.py @@ -20,6 +20,9 @@ def get_stand_support(var: pysam.VariantRecord,alt: str) -> Tuple[int,int]: elif 'ADF' in var.samples[0]: forward_support = var.samples[0]['ADF'][alt_index+1] reverse_support = var.samples[0]['ADR'][alt_index+1] + 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] else: forward_support = None reverse_support = None