Choose whether to keep program records based on Walker

* Add keepProgramRecords argument
* Make removeProgramRecords / keepProgramRecords override default
This commit is contained in:
Joel Thibault 2012-07-31 15:09:36 -04:00
parent e04989f76d
commit 524d7ea306
2 changed files with 14 additions and 2 deletions

View File

@ -797,6 +797,15 @@ public class GenomeAnalysisEngine {
if ( getWalkerBAQApplicationTime() == BAQ.ApplicationTime.FORBIDDEN && argCollection.BAQMode != BAQ.CalculationMode.OFF)
throw new UserException.BadArgumentValue("baq", "Walker cannot accept BAQ'd base qualities, and yet BAQ mode " + argCollection.BAQMode + " was requested.");
if (argCollection.removeProgramRecords && argCollection.keepProgramRecords)
throw new UserException.BadArgumentValue("rpr / kpr", "Cannot enable both options");
// LocusWalkers don't use program records, so remove them by default to save memory
boolean removeProgramRecords = (this.walker instanceof LocusWalker) || argCollection.removeProgramRecords;
if (argCollection.keepProgramRecords)
removeProgramRecords = false;
return new SAMDataSource(
samReaderIDs,
threadAllocation,
@ -814,7 +823,7 @@ public class GenomeAnalysisEngine {
refReader,
getBaseRecalibration(),
argCollection.defaultBaseQualities,
argCollection.removeProgramRecords);
removeProgramRecords);
}
/**

View File

@ -249,9 +249,12 @@ public class GATKArgumentCollection {
@Argument(fullName = "validation_strictness", shortName = "S", doc = "How strict should we be with validation", required = false)
public SAMFileReader.ValidationStringency strictnessLevel = SAMFileReader.ValidationStringency.SILENT;
@Argument(fullName = "remove_program_records", shortName = "rpr", doc = "Should we remove program records from the SAM header", required = false)
@Argument(fullName = "remove_program_records", shortName = "rpr", doc = "Should we override the Walker's default and remove program records from the SAM header", required = false)
public boolean removeProgramRecords = false;
@Argument(fullName = "keep_program_records", shortName = "kpr", doc = "Should we override the Walker's default and keep program records from the SAM header", required = false)
public boolean keepProgramRecords = false;
@Argument(fullName = "unsafe", shortName = "U", doc = "If set, enables unsafe operations: nothing will be checked at runtime. For expert users only who know what they are doing. We do not support usage of this argument.", required = false)
public ValidationExclusion.TYPE unsafe;