Throw a UserException in the BQSR when there is no data instead of creating an empty csv file

This commit is contained in:
Ryan Poplin 2011-10-26 15:56:41 -04:00
parent 585a45b7a3
commit 86871bd1e3
1 changed files with 3 additions and 0 deletions

View File

@ -526,6 +526,9 @@ public class CountCovariatesWalker extends LocusWalker<CountCovariatesWalker.Cou
*/
public void onTraversalDone( CountedData sum ) {
logger.info( "Writing raw recalibration data..." );
if( sum.countedBases == 0L ) {
throw new UserException.BadInput("Could not find any usable data in the input BAM file(s).");
}
outputToCSV( sum, RECAL_FILE );
logger.info( "...done!" );
}