Package htsjdk.beta.codecs.reads.bam
Class BAMEncoderOptions
java.lang.Object
htsjdk.beta.codecs.reads.bam.BAMEncoderOptions
Encoder options specific to BAM encoders.
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionint
Get the async output buffer size used for these options.int
Set the compression level for these options.Get theDeflaterFactory
for these options.int
Set the maximum records kept in RAM before spilling to disk for these options.int
Get the output buffer size for these options.Get the temporary directory path used for these options.boolean
Determine if async IO is enabled for these options.setAsyncIO
(boolean asyncIO) Set whether to enable async IO for these options.setAsyncOutputBufferSize
(int asyncOutputBufferSize) Get the async output buffer size used for these options.setCompressionLevel
(int compressionLevel) Set the compression level for these options.setDeflaterFactory
(DeflaterFactory deflaterFactory) Set theDeflaterFactory
for these options for these options.setMaxRecordsInRAM
(int maxRecordsInRAM) Get the maximum records kept in RAM before spilling to disk for these options.setOutputBufferSize
(int outputBufferSize) Set the buffer size for these options.setTemporaryDirectory
(IOPath tempDirPath) Get the temporary directory path for these options.
-
Field Details
-
DEAFULT_MAX_RECORDS_IN_RAM
public static final int DEAFULT_MAX_RECORDS_IN_RAM- See Also:
-
-
Constructor Details
-
BAMEncoderOptions
public BAMEncoderOptions()
-
-
Method Details
-
getOutputBufferSize
public int getOutputBufferSize()Get the output buffer size for these options. This determines the size of the output stream buffer used when writing outputs. Default value isDefaults.BUFFER_SIZE
.- Returns:
- the buffer size for these options
-
setOutputBufferSize
Set the buffer size for these options. This determines the size of the output stream buffer used when writing outputs. Defaults value isDefaults.BUFFER_SIZE
.- Parameters:
outputBufferSize
- the buffer size for these options- Returns:
- updated options
-
isAsyncIO
public boolean isAsyncIO()Determine if async IO is enabled for these options. Defaults toDefaults.USE_ASYNC_IO_WRITE_FOR_SAMTOOLS
.- Returns:
- true if async IO is enabled, otherwise false
-
setAsyncIO
Set whether to enable async IO for these options.- Parameters:
asyncIO
- true to enable async IO, false to disable.- Returns:
- updated options
-
getAsyncOutputBufferSize
public int getAsyncOutputBufferSize()Get the async output buffer size used for these options. If and only if using asynchronous IO sets the maximum number of records that can be buffered per writer before producers will block when trying to write another record. Defaults toAbstractAsyncWriter.DEFAULT_QUEUE_SIZE
.- Returns:
- async output buffer size used for these options
-
setAsyncOutputBufferSize
Get the async output buffer size used for these options. If and only if using asynchronous IO, sets the maximum number of records that can be buffered per writer before producers will block when trying to write another record.- Parameters:
asyncOutputBufferSize
- async output buffer size used for these options- Returns:
- updated options
-
getTemporaryDirectory
Get the temporary directory path used for these options. The temporary directory path is used for temporary files created during output sorting operations. Defaults value isIOUtil.getDefaultTmpDirPath()
.- Returns:
- the temp directory path to use for these options
-
setTemporaryDirectory
Get the temporary directory path for these options. The temporary directory path is used for temporary files created during output sorting operations. Defaults value isIOUtil.getDefaultTmpDirPath()
.- Parameters:
tempDirPath
- temporary directory path to use- Returns:
- updated options
-
getCompressionLevel
public int getCompressionLevel()Set the compression level for these options. Defaults value isBlockCompressedStreamConstants.DEFAULT_COMPRESSION_LEVEL
. SeeBlockCompressedStreamConstants.DEFAULT_COMPRESSION_LEVEL
- Returns:
- the compression level for these options, 1 <= compressionLevel <= 9
-
setCompressionLevel
Set the compression level for these options. Defaults value isBlockCompressedStreamConstants.DEFAULT_COMPRESSION_LEVEL
.- Parameters:
compressionLevel
- the compression level for these options, 1 <= compressionLevel <= 9- Returns:
- updated options
-
getMaxRecordsInRAM
public int getMaxRecordsInRAM()Set the maximum records kept in RAM before spilling to disk for these options. May be null. Default value is Maximum records in RAM determines the amount of memory used by the writer when sorting output during writing. When writing very large sorted SAM files, you may need use this option in order to avoid running out of file handles. The RAM available to the JVM may need to be increased in order to hold the specified number of records in RAM. Defaults value isDEAFULT_MAX_RECORDS_IN_RAM
.- Returns:
- the maximum records kept in ram before spilling to disk for these options
-
setMaxRecordsInRAM
Get the maximum records kept in RAM before spilling to disk for these options. Maximum records in RAM determines the amount of memory used by the writer when sorting output during writing. When writing very large sorted SAM files, you may need use this option in order to avoid running out of file handles. The RAM available to the JVM may need to be increased in order to hold the specified number of records in RAM. Defaults value isDEAFULT_MAX_RECORDS_IN_RAM
.- Parameters:
maxRecordsInRAM
- the maximum records kept in ram before spilling to disk. may be null.- Returns:
- updated options
-
getDeflaterFactory
Get theDeflaterFactory
for these options. Default value isBlockCompressedOutputStream.getDefaultDeflaterFactory()
.- Returns:
- the
DeflaterFactory
for these options
-
setDeflaterFactory
Set theDeflaterFactory
for these options for these options. Default value isBlockCompressedOutputStream.getDefaultDeflaterFactory()
.- Parameters:
deflaterFactory
- theDeflaterFactory
for these options- Returns:
- updated options
-