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 Details

    • DEFAULT_MINIMUM_SINGLE_REFERENCE_SLICE_THRESHOLD

      public static final int DEFAULT_MINIMUM_SINGLE_REFERENCE_SLICE_THRESHOLD
      See Also:
    • DEFAULT_READS_PER_SLICE

      public static final int DEFAULT_READS_PER_SLICE
      See Also:
  • Constructor Details

    • CRAMEncodingStrategy

      public CRAMEncodingStrategy()
      Create an encoding strategy that uses all default values.
  • Method Details

    • 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 same ReferenceContextType. 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 for getReadsPerSlice()
      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)
      Parameters:
      encodingMap - the encoding map to use
    • getCustomCompressionHeaderEncodingMap

      public CompressionHeaderEncodingMap getCustomCompressionHeaderEncodingMap()
    • getGZIPCompressionLevel

      public int getGZIPCompressionLevel()
    • getReadsPerSlice

      public int getReadsPerSlice()
    • getSlicesPerContainer

      public int getSlicesPerContainer()
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object