From cfe43e3971327ff26ef9087e31b4294d4a98d99c Mon Sep 17 00:00:00 2001 From: Guillermo del Angel Date: Tue, 12 Jul 2011 13:43:46 -0400 Subject: [PATCH] Bug fix for Genotype given alleles: if we are in INDEL mode ignore SNPs and MNPs instead of emitting an empty site with alleles but no annotations --- .../genotyper/UnifiedGenotyperEngine.java | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/UnifiedGenotyperEngine.java b/public/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/UnifiedGenotyperEngine.java index 4c9080884..6fc972b5d 100755 --- a/public/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/UnifiedGenotyperEngine.java +++ b/public/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/UnifiedGenotyperEngine.java @@ -634,17 +634,27 @@ public class UnifiedGenotyperEngine { if (vcInput == null) return null; - if (vcInput.isSNP() && ( UAC.GLmodel == GenotypeLikelihoodsCalculationModel.Model.BOTH || UAC.GLmodel == GenotypeLikelihoodsCalculationModel.Model.SNP)) - return GenotypeLikelihoodsCalculationModel.Model.SNP; + // todo - no support to genotype MNP's yet + if (vcInput.isMNP()) + return null; + + if (vcInput.isSNP()) { + if (( UAC.GLmodel == GenotypeLikelihoodsCalculationModel.Model.BOTH || UAC.GLmodel == GenotypeLikelihoodsCalculationModel.Model.SNP)) + return GenotypeLikelihoodsCalculationModel.Model.SNP; + else + // ignore SNP's if user chose INDEL mode + return null; + } else if ((vcInput.isIndel() || vcInput.isMixed()) && (UAC.GLmodel == GenotypeLikelihoodsCalculationModel.Model.BOTH || UAC.GLmodel == GenotypeLikelihoodsCalculationModel.Model.INDEL)) return GenotypeLikelihoodsCalculationModel.Model.INDEL; - } else { + } + else { // todo - this assumes SNP's take priority when BOTH is selected, should do a smarter way once extended events are removed if( UAC.GLmodel == GenotypeLikelihoodsCalculationModel.Model.BOTH || UAC.GLmodel == GenotypeLikelihoodsCalculationModel.Model.SNP) return GenotypeLikelihoodsCalculationModel.Model.SNP; else if (UAC.GLmodel == GenotypeLikelihoodsCalculationModel.Model.INDEL) return GenotypeLikelihoodsCalculationModel.Model.INDEL; - } + } } return null; }