public class CRAMContainerStreamWriter
extends java.lang.Object
Constructor and Description |
---|
CRAMContainerStreamWriter(CRAMEncodingStrategy encodingStrategy,
CRAMReferenceSource referenceSource,
SAMFileHeader samFileHeader,
java.io.OutputStream outputStream,
CRAMIndexer indexer,
java.lang.String outputIdentifier)
Create a CRAMContainerStreamWriter for writing SAM records into a series of CRAM
containers on output stream, with an optional index.
|
CRAMContainerStreamWriter(java.io.OutputStream outputStream,
CRAMReferenceSource source,
SAMFileHeader samFileHeader,
java.lang.String outputIdentifier,
CRAMIndexer indexer)
Create a CRAMContainerStreamWriter for writing SAM records into a series of CRAM
containers on output stream, with an optional index.
|
CRAMContainerStreamWriter(java.io.OutputStream recordOutputStream,
java.io.OutputStream indexOutputStream,
CRAMReferenceSource source,
SAMFileHeader samFileHeader,
java.lang.String outputIdentifier)
Create a CRAMContainerStreamWriter for writing SAM records into a series of CRAM
containers on output stream, with an optional index.
|
Modifier and Type | Method and Description |
---|---|
void |
finish(boolean writeEOFContainer)
Finish writing to the stream.
|
void |
writeAlignment(SAMRecord alignment)
Accumulate alignment records until we meet the threshold to flush a container.
|
protected void |
writeContainer(Container container) |
void |
writeHeader()
Write a CRAM file header and the previously provided SAM header to the stream.
|
void |
writeHeader(SAMFileHeader requestedSAMFileHeader)
Write a CRAM file header and the previously provided SAM header to the stream.
|
public CRAMContainerStreamWriter(java.io.OutputStream recordOutputStream, java.io.OutputStream indexOutputStream, CRAMReferenceSource source, SAMFileHeader samFileHeader, java.lang.String outputIdentifier)
recordOutputStream
- where to write the CRAM stream.indexOutputStream
- where to write the output index. Can be null if no index is required.source
- reference cramReferenceSourcesamFileHeader
- SAMFileHeader
to be used. Sort order is determined by the sortOrder property of this arg.outputIdentifier
- used for display in error message displaypublic CRAMContainerStreamWriter(java.io.OutputStream outputStream, CRAMReferenceSource source, SAMFileHeader samFileHeader, java.lang.String outputIdentifier, CRAMIndexer indexer)
outputStream
- where to write the CRAM stream.source
- reference cramReferenceSourcesamFileHeader
- SAMFileHeader
to be used. Sort order is determined by the sortOrder property of this arg.outputIdentifier
- used for display in error message displayindexer
- CRAM indexer. Can be null if no index is required.public CRAMContainerStreamWriter(CRAMEncodingStrategy encodingStrategy, CRAMReferenceSource referenceSource, SAMFileHeader samFileHeader, java.io.OutputStream outputStream, CRAMIndexer indexer, java.lang.String outputIdentifier)
encodingStrategy
- encoding strategy valuesreferenceSource
- reference cramReferenceSourcesamFileHeader
- SAMFileHeader
to be used. Sort order is determined by the sortOrder property of this arg.outputStream
- where to write the CRAM stream.indexer
- CRAM indexer. Can be null if no index is required.outputIdentifier
- informational string included in error reportingpublic void writeAlignment(SAMRecord alignment)
alignment
- must not be nullpublic void writeHeader(SAMFileHeader requestedSAMFileHeader)
public void writeHeader()
public void finish(boolean writeEOFContainer)
writeEOFContainer
- true if an EOF container should be written. Only use false if writing a CRAM file
fragment which will later be aggregated into a complete CRAM file.protected void writeContainer(Container container)