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

  1. Prepare the caller-filtered sequences, counts, coordinates or annotations requested below. Keep identifiers and paired lists aligned on the same reference.
  2. Enter bamBytes, cramBytes using the field table, then run the tool.
  3. Read compressionRatio, savingsPercent, savedBytes. Interpret flags, units, ordering and placeholder values using the rules below.
  4. Review any reported issue or failed check, correct the supplied values when appropriate, and verify the result in its intended context.
Input fieldMeaningValue type and boundsRequirement
bamBytesBam bytesinteger; minimum 1Required
cramBytesCram bytesinteger; minimum 1Required

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 fieldMeaningValue type
compressionRatioCompression rationumber
savingsPercentSigned savings relative to BAM size; negative values represent an increase.number
savedBytesBAM bytes minus CRAM bytes; negative when CRAM is larger.integer
json
{
  "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

  1. 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.

Don't forget to set a bookmark for tool.io!
Privacy | Imprint | Cookies