Fix for PBT to stop NPE when there are no likelihoods present

This commit is contained in:
Eric Banks 2012-09-06 13:14:18 -04:00
parent a7396d29c9
commit 6df6c1abd5
1 changed files with 1 additions and 1 deletions

View File

@ -541,7 +541,7 @@ public class PhaseByTransmission extends RodWalker<HashMap<Byte,Integer>, HashMa
//Get a Map of genotype likelihoods.
//In case of null, unavailable or no call, all likelihoods are 1/3.
private EnumMap<GenotypeType,Double> getLikelihoodsAsMapSafeNull(Genotype genotype){
if(genotype == null || !genotype.isCalled()){
if(genotype == null || !genotype.isCalled() || genotype.getLikelihoods() == null){
EnumMap<GenotypeType,Double> likelihoods = new EnumMap<GenotypeType, Double>(GenotypeType.class);
likelihoods.put(GenotypeType.HOM_REF,1.0/3.0);
likelihoods.put(GenotypeType.HET,1.0/3.0);