CRAM Compression Savings
Compare measured CRAM and BAM byte sizes as compression ratio and storage savings.
Description
Compression savings compares measured representations of the same data.
Compression savings compares measured representations of the same data. A smaller CRAM file gives a positive savings percentage relative to BAM.
Compare measured CRAM and BAM byte sizes as compression ratio and storage savings.
When to use CRAM Compression Savings
Use this for the following task: Compare measured CRAM and BAM byte sizes as compression ratio and storage savings.
Prepare the caller-filtered sequences, counts, coordinates or annotations requested below. Keep identifiers and paired lists aligned on the same reference.
How to use CRAM Compression Savings and understand its results
- Prepare the caller-filtered sequences, counts, coordinates or annotations requested below. Keep identifiers and paired lists aligned on the same reference.
- Enter bamBytes, cramBytes using the field table, then run the tool.
- Read compressionRatio, savingsPercent, savedBytes. Interpret flags, units, ordering and placeholder values using the rules below.
- Review any reported issue or failed check, correct the supplied values when appropriate, and verify the result in its intended context.
| Input field | Meaning | Value type and bounds | Requirement |
|---|---|---|---|
| bamBytes | Bam bytes | integer; minimum 1 | Required |
| cramBytes | Cram bytes | integer; minimum 1 | Required |
Require positive safe byte counts and return the quotient, signed saved bytes and signed percentage.1
ratio = bamBytes/cramBytes; savings% = 100(bamBytes−cramBytes)/bamBytes This summarizes the declared operation. Units, indexing, inclusivity and exceptional cases are explained in the surrounding text.
| Output field | Meaning | Value type |
|---|---|---|
| compressionRatio | Compression ratio | number |
| savingsPercent | Signed savings relative to BAM size; negative values represent an increase. | number |
| savedBytes | BAM bytes minus CRAM bytes; negative when CRAM is larger. | integer |
{
"input": {
"bamBytes": 1000,
"cramBytes": 400
},
"output": {
"compressionRatio": 2.5,
"savingsPercent": 60,
"savedBytes": 600
}
} Limitations and assumptions
Negative savings are valid when CRAM is larger. No compression is performed; comparable content and reference dependencies must be assessed separately.
The tool operates on supplied local data; alignment, filtering and annotation must already be appropriate for the stated calculation. Malformed requests produce input errors. A successfully evaluated request can still contain false flags, empty result lists or a result outside the supplied threshold; those outcomes have the meanings stated above.
Alternative or Complementary methods
Choose SAM Flag Decode for this operation: Decode SAM FLAG bits and preserve unsupported high bits explicitly. For a complementary task, use CIGAR Operation Summary for this operation: Summarize CIGAR operations and distinguish query-consuming and reference-consuming bases.
The implementation reference documents the exact calculation, supported input shapes and returned fields.
References
-
CRAM Compression Savings — tool.io
Similar or alternative tools
- SAM Flag Decode
Decode SAM FLAG bits and preserve unsupported high bits explicitly.
- CIGAR Operation Summary
Summarize CIGAR operations and distinguish query-consuming and reference-consuming bases.