Bug fix: check to see whether there's a BasePileup before asking for one.

This commit is contained in:
Eric Banks 2012-03-21 12:44:09 -04:00
parent 07c3bd32b3
commit 58245bfa2f
1 changed files with 4 additions and 2 deletions

View File

@ -31,8 +31,10 @@ public class LowMQ extends InfoFieldAnnotation {
double total = 0;
for ( Map.Entry<String, AlignmentContext> sample : stratifiedContexts.entrySet() )
{
ReadBackedPileup pileup = sample.getValue().getBasePileup();
for (PileupElement p : pileup )
if ( !sample.getValue().hasBasePileup() )
continue;
for ( PileupElement p : sample.getValue().getBasePileup() )
{
if ( p.getMappingQual() == 0 ) { mq0 += 1; }
if ( p.getMappingQual() <= 10 ) { mq10 += 1; }