From 01265f78e66b1f30069b5afe999e07e8d8cc3753 Mon Sep 17 00:00:00 2001 From: Guillermo del Angel Date: Wed, 1 Aug 2012 10:50:00 -0400 Subject: [PATCH] Add sanity check and possible bug fix for forum user: if haplotypes cannot be created from given alleles when genotyping indels (e.g. too close to contig boundary, etc.) in pool mode, empty allele list, signifying site can't be genotyped --- .../PoolIndelGenotypeLikelihoodsCalculationModel.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/protected/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/PoolIndelGenotypeLikelihoodsCalculationModel.java b/protected/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/PoolIndelGenotypeLikelihoodsCalculationModel.java index c2bac4455..c87ed04a0 100644 --- a/protected/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/PoolIndelGenotypeLikelihoodsCalculationModel.java +++ b/protected/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/PoolIndelGenotypeLikelihoodsCalculationModel.java @@ -105,6 +105,10 @@ public class PoolIndelGenotypeLikelihoodsCalculationModel extends PoolGenotypeLi haplotypeMap.clear(); } IndelGenotypeLikelihoodsCalculationModel.getHaplotypeMapFromAlleles(alleles, ref, ref.getLocus(), haplotypeMap); + + // sanity check: if haplotype map couldn't be created, clear allele list + if (haplotypeMap.isEmpty()) + alleles.clear(); return alleles; }