Adding checks for hasBasePileup() before calling getBasePileup() as per GS thread

This commit is contained in:
Eric Banks 2011-11-09 22:37:26 -05:00
parent 82bf09edf3
commit 6313aae2c4
3 changed files with 5 additions and 2 deletions

View File

@ -69,7 +69,7 @@ public class AlleleBalance extends InfoFieldAnnotation {
if ( context == null )
continue;
if ( vc.isSNP() ) {
if ( vc.isSNP() && context.hasBasePileup() ) {
final String bases = new String(context.getBasePileup().getBases());
if ( bases.length() == 0 )
return null;

View File

@ -51,6 +51,9 @@ public class AlleleBalanceBySample extends GenotypeAnnotation implements Experim
if ( altAlleles.size() == 0 )
return null;
if ( !stratifiedContext.hasBasePileup() )
return null;
final String bases = new String(stratifiedContext.getBasePileup().getBases());
if ( bases.length() == 0 )
return null;

View File

@ -365,7 +365,7 @@ public class GenotypeAndValidateWalker extends RodWalker<GenotypeAndValidateWalk
return counter;
// Do not operate on variants that are not covered to the optional minimum depth
if (!context.hasReads() || (minDepth > 0 && context.getBasePileup().getBases().length < minDepth)) {
if (!context.hasReads() || !context.hasBasePileup() || (minDepth > 0 && context.getBasePileup().getBases().length < minDepth)) {
counter.nUncovered = 1L;
if (vcComp.getAttribute("GV").equals("T"))
counter.nAltNotCalled = 1L;