diff --git a/public/java/src/org/broadinstitute/sting/gatk/io/stubs/SAMFileWriterArgumentTypeDescriptor.java b/public/java/src/org/broadinstitute/sting/gatk/io/stubs/SAMFileWriterArgumentTypeDescriptor.java index 43ec934ed..8566f6c63 100644 --- a/public/java/src/org/broadinstitute/sting/gatk/io/stubs/SAMFileWriterArgumentTypeDescriptor.java +++ b/public/java/src/org/broadinstitute/sting/gatk/io/stubs/SAMFileWriterArgumentTypeDescriptor.java @@ -116,9 +116,9 @@ public class SAMFileWriterArgumentTypeDescriptor extends ArgumentTypeDescriptor String compressionLevelText = getArgumentValue( createBAMCompressionArgumentDefinition(source), matches ); Integer compressionLevel = compressionLevelText != null ? Integer.valueOf(compressionLevelText) : null; - Boolean indexOnTheFly = !argumentIsPresent(disableWriteIndexArgumentDefinition(source),matches) ? true : null; - Boolean generateMD5 = argumentIsPresent(this.enableMD5GenerationArgumentDefinition(source),matches) ? true : null; - Boolean simplifyBAM = argumentIsPresent(createSimplifyBAMArgumentDefinition(source),matches); + boolean indexOnTheFly = !argumentIsPresent(disableWriteIndexArgumentDefinition(source),matches); + boolean generateMD5 = argumentIsPresent(this.enableMD5GenerationArgumentDefinition(source),matches); + boolean simplifyBAM = argumentIsPresent(createSimplifyBAMArgumentDefinition(source),matches); // Validate the combination of parameters passed in. @@ -132,15 +132,19 @@ public class SAMFileWriterArgumentTypeDescriptor extends ArgumentTypeDescriptor } // Create the stub and set parameters. - SAMFileWriterStub stub = new SAMFileWriterStub(engine, new File(writerFileName)); + SAMFileWriterStub stub; + if ( writerFileName != null ) + stub = new SAMFileWriterStub(engine, new File(writerFileName)); + else + stub = new SAMFileWriterStub(engine, defaultOutputStream); - if( compressionLevel != null ) + if ( compressionLevel != null ) stub.setCompressionLevel(compressionLevel); - if(indexOnTheFly != null) + if ( indexOnTheFly ) stub.setIndexOnTheFly(indexOnTheFly); - if(generateMD5 != null) + if ( generateMD5 ) stub.setGenerateMD5(generateMD5); - if(simplifyBAM != null) + if ( simplifyBAM ) stub.setSimplifyBAM(simplifyBAM); // WARNING: Side effects required by engine! diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/PrintReadsWalker.java b/public/java/src/org/broadinstitute/sting/gatk/walkers/PrintReadsWalker.java index cb2944d31..4159a67b7 100755 --- a/public/java/src/org/broadinstitute/sting/gatk/walkers/PrintReadsWalker.java +++ b/public/java/src/org/broadinstitute/sting/gatk/walkers/PrintReadsWalker.java @@ -92,7 +92,7 @@ import java.util.TreeSet; @Requires({DataSource.READS, DataSource.REFERENCE}) public class PrintReadsWalker extends ReadWalker { - @Output(doc="Write output to this BAM filename instead of STDOUT") + @Output(doc="Write output to this BAM filename instead of STDOUT", required = true) SAMFileWriter out; @Argument(fullName = "readGroup", shortName = "readGroup", doc="Exclude all reads with this read group from the output", required = false)