public class CRAMFileWriter extends SAMFileWriterImpl
Constructor and Description |
---|
CRAMFileWriter(java.io.OutputStream outputStream,
CRAMReferenceSource referenceSource,
SAMFileHeader samFileHeader,
java.lang.String fileName)
Create a CRAMFileWriter on an output stream.
|
CRAMFileWriter(java.io.OutputStream outputStream,
java.io.OutputStream indexOS,
boolean presorted,
CRAMReferenceSource referenceSource,
SAMFileHeader samFileHeader,
java.lang.String fileName)
Create a CRAMFileWriter and optional index on output streams.
|
CRAMFileWriter(java.io.OutputStream outputStream,
java.io.OutputStream indexOS,
CRAMReferenceSource referenceSource,
SAMFileHeader samFileHeader,
java.lang.String fileName)
Create a CRAMFileWriter and optional index on output streams.
|
Modifier and Type | Method and Description |
---|---|
protected void |
finish()
Do any required flushing here.
|
java.util.Set<java.lang.String> |
getCaptureTags() |
protected java.lang.String |
getFilename()
For producing error messages.
|
java.util.Set<java.lang.String> |
getIgnoreTags() |
java.util.List<PreservationPolicy> |
getPreservationPolicies() |
boolean |
isCaptureAllTags() |
boolean |
isPreserveReadNames() |
void |
setCaptureAllTags(boolean captureAllTags) |
void |
setCaptureTags(java.util.Set<java.lang.String> captureTags) |
void |
setIgnoreTags(java.util.Set<java.lang.String> ignoreTags) |
void |
setPreserveReadNames(boolean preserveReadNames) |
protected void |
writeAlignment(SAMRecord alignment)
Write an alignment record.
|
protected void |
writeHeader(java.lang.String textHeader)
Write the header to disk.
|
addAlignment, close, getDefaultMaxRecordsInRam, getFileHeader, getSortOrder, setDefaultMaxRecordsInRam, setHeader, setProgressLogger, setSortOrder
public CRAMFileWriter(java.io.OutputStream outputStream, CRAMReferenceSource referenceSource, SAMFileHeader samFileHeader, java.lang.String fileName)
samFileHeader
.outputStream
- where to write the output. Can not be null.referenceSource
- reference source. Can not be null.samFileHeader
- SAMFileHeader
to be used. Can not be null. Sort order is determined by the sortOrder property of this arg.fileName
- used for display in error messagesjava.lang.IllegalArgumentException
- if the outputStream
, referenceSource
or samFileHeader
are nullpublic CRAMFileWriter(java.io.OutputStream outputStream, java.io.OutputStream indexOS, CRAMReferenceSource referenceSource, SAMFileHeader samFileHeader, java.lang.String fileName)
samFileHeader
.outputStream
- where to write the output. Can not be null.indexOS
- where to write the output index. Can be null if no index is required.referenceSource
- reference sourcesamFileHeader
- SAMFileHeader
to be used. Can not be null. Sort order is determined by the sortOrder property of this arg.fileName
- used for display in error messagesjava.lang.IllegalArgumentException
- if the outputStream
, referenceSource
or samFileHeader
are nullpublic CRAMFileWriter(java.io.OutputStream outputStream, java.io.OutputStream indexOS, boolean presorted, CRAMReferenceSource referenceSource, SAMFileHeader samFileHeader, java.lang.String fileName)
outputStream
- where to write the output. Can not be null.indexOS
- where to write the output index. Can be null if no index is required.presorted
- if true records written to this writer must already be sorted in the order specified by the headerreferenceSource
- reference sourcesamFileHeader
- SAMFileHeader
to be used. Can not be null. Sort order is determined by the sortOrder property of this arg.fileName
- used for display in error message displayjava.lang.IllegalArgumentException
- if the outputStream
, referenceSource
or samFileHeader
are nullprotected void writeAlignment(SAMRecord alignment)
writeAlignment
in class SAMFileWriterImpl
alignment
- must not be null and must have a valid SAMFileHeader.protected void writeHeader(java.lang.String textHeader)
SAMFileWriterImpl
writeHeader
in class SAMFileWriterImpl
textHeader
- for convenience if the implementation needs it.protected void finish()
SAMFileWriterImpl
finish
in class SAMFileWriterImpl
protected java.lang.String getFilename()
SAMFileWriterImpl
getFilename
in class SAMFileWriterImpl
public boolean isPreserveReadNames()
public void setPreserveReadNames(boolean preserveReadNames)
public java.util.List<PreservationPolicy> getPreservationPolicies()
public boolean isCaptureAllTags()
public void setCaptureAllTags(boolean captureAllTags)
public java.util.Set<java.lang.String> getCaptureTags()
public void setCaptureTags(java.util.Set<java.lang.String> captureTags)
public java.util.Set<java.lang.String> getIgnoreTags()
public void setIgnoreTags(java.util.Set<java.lang.String> ignoreTags)