public class CRAMFileWriter extends SAMFileWriterImpl
| Modifier and Type | Field and Description |
|---|---|
protected int |
containerSize |
protected int |
recordsPerSlice |
| Constructor and Description |
|---|
CRAMFileWriter(java.io.OutputStream outputStream,
java.io.OutputStream indexOS,
boolean presorted,
ReferenceSource source,
SAMFileHeader samFileHeader,
java.lang.String fileName)
Create a CRAMFileWriter and index on output streams.
|
CRAMFileWriter(java.io.OutputStream outputStream,
java.io.OutputStream indexOS,
ReferenceSource source,
SAMFileHeader samFileHeader,
java.lang.String fileName)
Create a CRAMFileWriter and index on output streams.
|
CRAMFileWriter(java.io.OutputStream outputStream,
ReferenceSource source,
SAMFileHeader samFileHeader,
java.lang.String fileName)
Create a CRAMFileWriter on an output stream.
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
finish()
Do any required flushing here.
|
protected void |
flushContainer()
Complete the current container and flush it to the output stream.
|
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 boolean |
shouldFlushContainer(SAMRecord nextRecord)
Decide if the current container should be completed and flushed.
|
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, setSortOrderprotected final int recordsPerSlice
protected final int containerSize
public CRAMFileWriter(java.io.OutputStream outputStream,
ReferenceSource source,
SAMFileHeader samFileHeader,
java.lang.String fileName)
samFileHeader.outputStream - where to write the output.source - reference sourcesamFileHeader - SAMFileHeader to be used. Sort order is determined by the sortOrder property of this arg.fileName - used for display in error messagespublic CRAMFileWriter(java.io.OutputStream outputStream,
java.io.OutputStream indexOS,
ReferenceSource source,
SAMFileHeader samFileHeader,
java.lang.String fileName)
samFileHeader.outputStream - where to write the output.indexOS - where to write the output index. Can be null if no index is required.source - reference sourcesamFileHeader - SAMFileHeader to be used. Sort order is determined by the sortOrder property of this arg.fileName - used for display in error messagespublic CRAMFileWriter(java.io.OutputStream outputStream,
java.io.OutputStream indexOS,
boolean presorted,
ReferenceSource source,
SAMFileHeader samFileHeader,
java.lang.String fileName)
outputStream - where to write the output.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 headersource - reference sourcesamFileHeader - SAMFileHeader to be used. Sort order is determined by the sortOrder property of this arg.fileName - used for display in error message displayprotected boolean shouldFlushContainer(SAMRecord nextRecord)
nextRecord - the record to be added into the current or next containerprotected void flushContainer()
throws java.lang.IllegalArgumentException,
java.lang.IllegalAccessException,
java.io.IOException
java.lang.IllegalArgumentExceptionjava.lang.IllegalAccessExceptionjava.io.IOExceptionprotected void writeAlignment(SAMRecord alignment)
writeAlignment in class SAMFileWriterImplalignment - must not be null and must have a valid SAMFileHeader.protected void writeHeader(java.lang.String textHeader)
SAMFileWriterImplwriteHeader in class SAMFileWriterImpltextHeader - for convenience if the implementation needs it.protected void finish()
SAMFileWriterImplfinish in class SAMFileWriterImplprotected java.lang.String getFilename()
SAMFileWriterImplgetFilename in class SAMFileWriterImplpublic 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)