Getting back null values from the tables is perfectly reasonable if those covariates don't appear in your table. Need to handle them gracefully.

This commit is contained in:
Ryan Poplin 2013-01-30 10:06:14 -05:00
parent e7d7d70247
commit 59311aeea2
1 changed files with 26 additions and 23 deletions

View File

@ -150,6 +150,8 @@ public class BaseRecalibration {
// the rg key is constant over the whole read, the global deltaQ is too // the rg key is constant over the whole read, the global deltaQ is too
final int rgKey = fullReadKeySet[0][0]; final int rgKey = fullReadKeySet[0][0];
final RecalDatum empiricalQualRG = recalibrationTables.getReadGroupTable().get(rgKey, errorModel.ordinal()); final RecalDatum empiricalQualRG = recalibrationTables.getReadGroupTable().get(rgKey, errorModel.ordinal());
if( empiricalQualRG != null ) {
final double epsilon = ( globalQScorePrior > 0.0 && errorModel.equals(EventType.BASE_SUBSTITUTION) ? globalQScorePrior : empiricalQualRG.getEstimatedQReported() ); final double epsilon = ( globalQScorePrior > 0.0 && errorModel.equals(EventType.BASE_SUBSTITUTION) ? globalQScorePrior : empiricalQualRG.getEstimatedQReported() );
for (int offset = 0; offset < readLength; offset++) { // recalibrate all bases in the read for (int offset = 0; offset < readLength; offset++) { // recalibrate all bases in the read
@ -179,6 +181,7 @@ public class BaseRecalibration {
quals[offset] = recalibratedQualityScore; quals[offset] = recalibratedQualityScore;
} }
} }
}
// finally update the base qualities in the read // finally update the base qualities in the read
read.setBaseQualities(quals, errorModel); read.setBaseQualities(quals, errorModel);