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

This commit is contained in:
Guillermo del Angel 2012-08-01 10:50:00 -04:00
parent 79195b97a3
commit 01265f78e6
1 changed files with 4 additions and 0 deletions

View File

@ -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;
}