Created
August 27, 2012 10:50
-
-
Save chapmanb/3487411 to your computer and use it in GitHub Desktop.
Fix GATK null allele error when calculating DepthPerAlleleBySample for indels
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/annotator/DepthPerAlleleBySample.java b/public/java/src/org/broadinstitute/sting/gatk/walkers/annotator/DepthPerAlleleBySample.java | |
index 5d83ddd..928d836 100755 | |
--- a/public/java/src/org/broadinstitute/sting/gatk/walkers/annotator/DepthPerAlleleBySample.java | |
+++ b/public/java/src/org/broadinstitute/sting/gatk/walkers/annotator/DepthPerAlleleBySample.java | |
@@ -87,12 +87,12 @@ public class DepthPerAlleleBySample extends GenotypeAnnotation implements Standa | |
for ( PileupElement p : pileup ) { | |
if ( p.isBeforeInsertion() ) { | |
- | |
- final Allele insertion = Allele.create((char)refBase + p.getEventBases(), false); | |
- if ( alleleCounts.containsKey(insertion) ) { | |
- alleleCounts.put(insertion, alleleCounts.get(insertion)+1); | |
+ if ( p.getEventBases() != null ) { | |
+ final Allele insertion = Allele.create((char)refBase + p.getEventBases(), false); | |
+ if ( alleleCounts.containsKey(insertion) ) { | |
+ alleleCounts.put(insertion, alleleCounts.get(insertion)+1); | |
+ } | |
} | |
- | |
} else if ( p.isBeforeDeletionStart() ) { | |
if ( p.getEventLength() == refAllele.length() - 1 ) { | |
// this is indeed the deletion allele recorded in VC | |
@@ -120,4 +120,4 @@ public class DepthPerAlleleBySample extends GenotypeAnnotation implements Standa | |
public List<VCFFormatHeaderLine> getDescriptions() { | |
return Arrays.asList(VCFStandardHeaderLines.getFormatLine(getKeyNames().get(0))); | |
} | |
-} | |
\ No newline at end of file | |
+} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment