Avoid calling getBasePileup when there's no pileup in NBaseCount annotation
This commit is contained in:
parent
729bb954e2
commit
5f7ccdcc01
|
|
@ -27,13 +27,15 @@ public class NBaseCount extends InfoFieldAnnotation {
|
||||||
int countNBaseSolid = 0;
|
int countNBaseSolid = 0;
|
||||||
int countRegularBaseSolid = 0;
|
int countRegularBaseSolid = 0;
|
||||||
|
|
||||||
for( final Map.Entry<String, AlignmentContext> sample : stratifiedContexts.entrySet() ) {
|
for( final AlignmentContext context : stratifiedContexts.values() ) {
|
||||||
for( final PileupElement p : sample.getValue().getBasePileup()) {
|
if ( context.hasBasePileup() ) { // must be called as getBasePileup may throw error when pileup has no bases
|
||||||
if( p.getRead().getReadGroup().getPlatform().toUpperCase().contains("SOLID") ) {
|
for( final PileupElement p : context.getBasePileup()) {
|
||||||
if( BaseUtils.isNBase( p.getBase() ) ) {
|
if( p.getRead().getReadGroup().getPlatform().toUpperCase().contains("SOLID") ) {
|
||||||
countNBaseSolid++;
|
if( BaseUtils.isNBase( p.getBase() ) ) {
|
||||||
} else if( BaseUtils.isRegularBase( p.getBase() ) ) {
|
countNBaseSolid++;
|
||||||
countRegularBaseSolid++;
|
} else if( BaseUtils.isRegularBase( p.getBase() ) ) {
|
||||||
|
countRegularBaseSolid++;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue