Package htsjdk.samtools.cram.structure
Class CRAMEncodingStrategy
- java.lang.Object
-
- htsjdk.samtools.cram.structure.CRAMEncodingStrategy
-
public class CRAMEncodingStrategy extends Object
Parameters that can be set to control the encoding strategy used when writing CRAM.
-
-
Field Summary
Fields Modifier and Type Field Description static intDEFAULT_MINIMUM_SINGLE_REFERENCE_SLICE_THRESHOLDstatic intDEFAULT_READS_PER_SLICE
-
Constructor Summary
Constructors Constructor Description CRAMEncodingStrategy()Create an encoding strategy that uses all default values.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object o)CompressionHeaderEncodingMapgetCustomCompressionHeaderEncodingMap()intgetGZIPCompressionLevel()intgetMinimumSingleReferenceSliceSize()intgetReadsPerSlice()intgetSlicesPerContainer()inthashCode()voidsetCustomCompressionHeaderEncodingMap(CompressionHeaderEncodingMap encodingMap)Set theCompressionHeaderEncodingMapto use.CRAMEncodingStrategysetGZIPCompressionLevel(int compressionLevel)CRAMEncodingStrategysetMinimumSingleReferenceSliceSize(int minimumSingleReferenceSliceSize)The minimum number of reads we need to have seen to emit a single-reference slice.CRAMEncodingStrategysetReadsPerSlice(int readsPerSlice)Set number of slices per container.CRAMEncodingStrategysetSlicesPerContainer(int slicesPerContainer)Set the number of slices per container.StringtoString()
-
-
-
Field Detail
-
DEFAULT_MINIMUM_SINGLE_REFERENCE_SLICE_THRESHOLD
public static final int DEFAULT_MINIMUM_SINGLE_REFERENCE_SLICE_THRESHOLD
- See Also:
- Constant Field Values
-
DEFAULT_READS_PER_SLICE
public static final int DEFAULT_READS_PER_SLICE
- See Also:
- Constant Field Values
-
-
Method Detail
-
setReadsPerSlice
public CRAMEncodingStrategy setReadsPerSlice(int readsPerSlice)
Set number of slices per container. In some cases, a container containing fewer slices than the requested value will be produced in order to honor the specification rule that all slices in a container must have the sameReferenceContextType. Note: this value must be >=getMinimumSingleReferenceSliceSize().- Parameters:
readsPerSlice- number of slices written per container- Returns:
- updated CRAMEncodingStrategy
-
setMinimumSingleReferenceSliceSize
public CRAMEncodingStrategy setMinimumSingleReferenceSliceSize(int minimumSingleReferenceSliceSize)
The minimum number of reads we need to have seen to emit a single-reference slice. If we've seen fewer than this number, and we have more reads from a different reference context, we prefer to switch to, and subsequently emit, a multiple reference slice, rather than a small single-reference that contains fewer than this number of records. This number must be < the value forgetReadsPerSlice()- Parameters:
minimumSingleReferenceSliceSize-
-
getMinimumSingleReferenceSliceSize
public int getMinimumSingleReferenceSliceSize()
-
setGZIPCompressionLevel
public CRAMEncodingStrategy setGZIPCompressionLevel(int compressionLevel)
-
setSlicesPerContainer
public CRAMEncodingStrategy setSlicesPerContainer(int slicesPerContainer)
Set the number of slices per container. If > 1, multiple slices will be placed in the same container if the slices share the same reference context (container records mapped to the same contig). MULTI-REF slices are always emitted as a single contain to avoid conferring MULTI-REF on the next slice, which might otherwise be single-ref; the spec requires a MULTI_REF container to only contain multi-ref slices).- Parameters:
slicesPerContainer- - requested number of slices per container- Returns:
- CRAMEncodingStrategy
-
setCustomCompressionHeaderEncodingMap
public void setCustomCompressionHeaderEncodingMap(CompressionHeaderEncodingMap encodingMap)
Set theCompressionHeaderEncodingMapto use.- Parameters:
encodingMap- the encoding map to use
-
getCustomCompressionHeaderEncodingMap
public CompressionHeaderEncodingMap getCustomCompressionHeaderEncodingMap()
-
getGZIPCompressionLevel
public int getGZIPCompressionLevel()
-
getReadsPerSlice
public int getReadsPerSlice()
-
getSlicesPerContainer
public int getSlicesPerContainer()
-
-