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(SAMFileHeader header)
Write the header to disk.
|
protected void |
writeHeader(java.lang.String textHeader)
Write the header to disk.
|
addAlignment, close, getDefaultMaxRecordsInRam, getFileHeader, getMaxRecordsInRam, getSortOrder, getTempDirectory, setDefaultMaxRecordsInRam, setHeader, setMaxRecordsInRam, setProgressLogger, setSortOrder, setTempDirectorypublic 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 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 writeHeader(SAMFileHeader header)
SAMFileWriterImplIMPORTANT: this method will be abstract once SAMFileWriterImpl.writeHeader(String) is removed.
Note: default implementation uses SAMTextHeaderCodec.encode(java.io.Writer, htsjdk.samtools.SAMFileHeader) and calls
SAMFileWriterImpl.writeHeader(String).
writeHeader in class SAMFileWriterImplheader - object to write.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)