samtools-cram-size - Man Page

list a break down of data types in a CRAM file

Synopsis

samtools cram-size [-ve] [-o file] in.bam

Description

Produces a summary of CRAM block Content ID numbers and their associated Data Series stored within them.  Optionally a more detailed breakdown of how each data series is encoded per container may also be listed using the -e or --encodings option.

CRAM permits mixing multiple Data Series into a single block.  In this case it is not possible to tell the relative proportion that the Data Series consume within that block.  CRAM also permits different encodings and block Content ID assignment per container, although this would be highly unusual.  Htslib will always assign the same Data Series to a block with a consistent Content ID, although the CRAM Encoding may change.

Each CRAM block has a compression method.  These may not be consistent between successive blocks with the same Content ID.  Htslib learns which compression methods work, so a single Content ID may have multiple compression methods associated with it.  The methods utilised are listed per line with a single character code, although the size breakdown per method and a more verbose description can be shown using the -v option.  The compression codecs used in CRAM may have a variety of parameters, such as compression levels, inbuilt transformations, and choices of entropy encoding.  An attempt is made to distinguish between these different method parameterisations.

The compression methods and their short and long (verbose) name are below:

ShortLongDescription
ggzipGzip
_gzip-minGzip -1
Ggzip-maxGzip -9
bbzip2Bzip2
bbzip2-1 to bzip2-8Explicit bzip2 compression levels
Bbzip2-9Bzip2 -9
llzmaLZMA
rr4x8-o0rANS 4x8 Order-0
Rr4x8-o1rANS 4x8 Order-1
0r4x16-o0rANS 4x16 Order-0
0r4x16-o0RrANS 4x16 Order-0 with RLE
0r4x16-o0PrANS 4x16 Order-0 with PACK
0r4x16-o0PRrANS 4x16 Order-0 with PACK and RLE
1r4x16-o1rANS 4x16 Order-1
1r4x16-o1RrANS 4x16 Order-1 with RLE
1r4x16-o1PrANS 4x16 Order-1 with PACK
1r4x16-o1PRrANS 4x16 Order-1 with PACK and RLE
4r32x16-o0rANS 32x16 Order-0
4r32x16-o0RrANS 32x16 Order-0 with RLE
4r32x16-o0PrANS 32x16 Order-0 with PACK
4r32x16-o0PRrANS 32x16 Order-0 with PACK and RLE
5r32x16-o1rANS 32x16 Order-1
5r32x16-o1RrANS 32x16 Order-1 with RLE
5r32x16-o1PrANS 32x16 Order-1 with PACK
5r32x16-o1PRrANS 32x16 Order-1 with PACK and RLE
8rNx16-xo0rANS Nx16 STRIPED mode
2rNx16-catrANS Nx16 CAT mode
aarith-o0Arithmetic coding Order-0
aarith-o0RArithmetic coding Order-0 with RLE
aarith-o0PArithmetic coding Order-0 with PACK
aarith-o0PRArithmetic coding Order-0 with PACK and RLE
Aarith-o1Arithmetic coding Order-1
Aarith-o1RArithmetic coding Order-1 with RLE
Aarith-o1PArithmetic coding Order-1 with PACK
Aarith-o1PRArithmetic coding Order-1 with PACK and RLE
aarith-xo0Arithmetic coding STRIPED mode
aarith-catArithmetic coding CAT mode
ffqzcompFQZComp quality codec
ntok3-ransName tokeniser with rANS encoding
ntok3-arithName tokeniser with Arithmetic encoding

Options

-o FILE

Output size information to FILE.

-v

Verbose mode.  This shows one line per combination of Content ID and compression method.

-e,  --encodings

CRAM uses an Encoding, which describes how the data is serialised into a data block.  This is distinct from the CRAM compression method, which is then applied to the block post-encoding.  The encoding methods are stored per CRAM Container.

This option list CRAM record encoding map and tag encoding map.  This shows the data series, the associated CRAM encoding method, such as HUFFMAN, BETA or EXTERNAL, and any parameters associated with that encoding.  The output may be large as this is information per container rather than a single set of summary statistics at the end of processing.

Examples

Author

Written by James Bonfield from the Sanger Institute.

See Also

samtools(1),

Samtools website: <http://www.htslib.org/>

Referenced By

samtools(1).

16 December 2025 samtools-1.23 Bioinformatics tools