.setOutputFile(file) .setOutputFileType(fileOutputType) .setReferenceDictionary(stub.getMasterSequenceDictionary()) .setIndexCreator(stub.getIndexCreator()) .setOptions(options) .setOutputFile(bcfFile) .setOutputFileType(VariantContextWriterBuilder.OutputType.BCF) .setReferenceDictionary(stub.getMasterSequenceDictionary()) .setOptions(options) .build();
/** * Constructs an object which will write directly into the output file provided by the stub. * Intentionally delaying the writing of the header -- this should be filled in by the walker. * * Respecs the isCompressed() request in stub, so if isCompressed() is true then this * will create a storage output that dumps output to a BlockCompressedOutputStream. * * @param stub Stub to use when constructing the output file. */ public VariantContextWriterStorage(VariantContextWriterStub stub) { if ( stub.getOutputFile() != null ) { this.file = stub.getOutputFile(); writer = vcfWriterToFile(stub,stub.getOutputFile(),true,true); } else if ( stub.getOutputStream() != null ) { this.file = null; this.stream = stub.getOutputStream(); writer = new VariantContextWriterBuilder() .setOutputVCFStream(stream) .setReferenceDictionary(stub.getMasterSequenceDictionary()) .setOptions(stub.getWriterOptions(false)) .build(); } else throw new ReviewedGATKException("Unable to create target to which to write; storage was provided with neither a file nor a stream."); }