FASTQ, BAM, CRAM and MPEG-G: A Guide to Genomic Data Formats and Compression
Compare FASTQ, BAM, CRAM and MPEG-G genomic data formats. Explore lossless compression, reference genomes, NGS and WGS data storage costs, and long-term genomic archiving strategies.
Why Do Genomic Data Formats Matter?
Next-generation sequencing (NGS), whole-exome sequencing (WES), and whole-genome sequencing (WGS) technologies generate substantial amounts of digital data in genetic diagnostic laboratories.
Storing, transferring, reanalyzing, and retrieving these datasets for clinical or research purposes requires more than sufficient storage capacity.
The file format used to store genomic data, the information preserved within it, and the compression method applied are equally important.
Four commonly encountered genomic data formats and standards are:
- FASTQ: Stores sequencing reads and their associated base quality scores.
- BAM: Stores alignment records in a compressed binary representation.
- CRAM: Provides advanced compression for genomic alignment data, including optional reference-based encoding.
- MPEG-G: A family of international standards, ISO/IEC 23092, developed for genomic information coding, storage, transport, and access.
These formats are not completely interchangeable.
For example, FASTQ is commonly used to represent sequencing reads before alignment, while BAM and CRAM are typically used to store alignment results.
MPEG-G provides a broader standardized framework for representing aligned and unaligned sequencing data.
Choosing an appropriate format therefore depends on the laboratory's analytical requirements, data integrity policies, software environment, and long-term archiving strategy.
What Is FASTQ?
FASTQ is a text-based format that stores nucleotide sequences and corresponding base quality scores produced by sequencing instruments or subsequent base-calling processes.
A typical FASTQ record contains four lines:
- A read identifier.
- The nucleotide sequence.
- A separator line.
- Base quality characters.
Example FASTQ record:
@read_001
ACGTACGT
+
IIIIIIII
The quality characters represent confidence in the base calls according to the encoding scheme used.
Phred+33 encoding, commonly used in modern short-read datasets, represents quality scores using printable ASCII characters.
FASTQ files do not inherently contain alignment positions against a reference genome.
The chromosome or genomic region from which a read originates may be determined during subsequent alignment and analysis steps.
What Is FASTQ.GZ?
Because FASTQ is text-based, files are commonly compressed using gzip.
The resulting files usually have extensions such as .fastq.gz or .fq.gz.
Advantages of FASTQ.GZ include:
- Broad compatibility with bioinformatics tools.
- Reduced file size during storage and transfer.
- Lossless preservation of the original sequences and quality values.
- Easy integration into established sequencing workflows.
However, standard gzip compression does not necessarily exploit the biological structure of genomic data.
Traditional gzip files also do not inherently provide genomic region-based random access.
Consequently, relying exclusively on gzip may not always be the most efficient strategy for managing large FASTQ archives.
What Is BAM?
BAM (Binary Alignment/Map) is the binary representation of SAM (Sequence Alignment/Map) records.
BAM files can store information generated when sequencing reads are aligned to a reference genome.
Typical information includes:
- Read identifiers.
- Reference sequence names and alignment positions.
- Alignment flags.
- Mapping quality (MAPQ).
- CIGAR strings.
- Nucleotide sequences.
- Base quality scores.
- Optional SAM tags.
BAM uses BGZF block-based compression.
With appropriate indexes, this structure supports random access to specific genomic regions.
For example, an indexed, coordinate-sorted BAM file can provide records from a particular chromosome region without requiring the entire file to be read sequentially.
Advantages of BAM
BAM offers several important benefits:
- Extensive support across bioinformatics software.
- A standardized structure for alignment records.
- Compatibility with
samtoolsand numerous variant analysis workflows, including tools commonly used alongsidebcftools. - Indexed access to genomic regions.
- Established adoption in clinical and research laboratories.
However, BAM files can require substantial storage capacity, particularly in large WGS projects.
Although BAM is compressed, it does not necessarily provide the smallest possible representation of genomic alignment data.
This is where genomics-specific compression approaches, including CRAM and MPEG-G, may be considered.
What Is CRAM?
CRAM is a genomic data format developed to store SAM/BAM alignment information more efficiently.
The CRAM format, specified within the GA4GH ecosystem, can use different compression techniques for different data fields.
One of its important capabilities is the use of reference-based compression where appropriate.
When a sequencing read closely matches a reference genome, representing differences from that reference can reduce storage requirements compared with storing the complete sequence independently.
Does CRAM Always Require a Reference Genome?
No.
CRAM supports multiple encoding strategies, and not every CRAM workflow requires an external reference genome.
However, decoding a CRAM file created using reference-based encoding may require access to the appropriate reference sequence.
A reliable CRAM archiving strategy should therefore consider:
- The correct reference genome version.
- Reference sequence integrity.
- Tool and codec versions.
- The ability to decode and reconstruct the preserved data.
Storing only the .cram file may be insufficient in certain long-term archiving scenarios.
CRAM 3.0 vs CRAM 3.1
CRAM 3.1 introduces additional compression codecs compared with CRAM 3.0.
These codecs may improve compression efficiency for particular datasets.
However, the results depend on sequencing technology, quality score characteristics, compression settings, and software versions.
Support for CRAM 3.1 should not be assumed to be identical across all analysis tools.
Before adopting a newer CRAM version, laboratories should verify that their existing pipelines can read, write, and index the relevant files as required.
Is CRAM Lossless?
CRAM supports lossless preservation strategies as well as controlled lossy representations of certain information.
This distinction is particularly important for base quality scores.
Reducing selected quality information can decrease file size. However, if the original data must be fully recoverable, the compression workflow must be configured accordingly.
In clinical and scientific archiving, whether compression is lossless cannot be determined from the file extension alone.
Laboratories must document how data was encoded, which fields were preserved, and which options were used during conversion.
What Is MPEG-G?
MPEG-G (ISO/IEC 23092) is an international standards family developed for genomic information representation, compression, transport, and processing.
MPEG-G is not simply a single compression algorithm designed to reduce file size.
It defines different components for representing genomic data structures and supporting data access.
These include:
- Genomic information storage and transport.
- Sequencing read encoding.
- Quality value representation.
- Metadata and application programming interfaces.
- Conformance and reference software.
- Additional standardization work addressing genomic annotations.
The ISO/IEC 23092 Standards Family
Key components of MPEG-G include:
| Standard part | Primary scope |
|---|---|
| ISO/IEC 23092-1 | Genomic information transport and storage |
| ISO/IEC 23092-2 | Genomic information coding |
| ISO/IEC 23092-3 | Metadata and application interfaces |
| ISO/IEC 23092-4 | Reference software |
| ISO/IEC 23092-5 | Conformance |
| ISO/IEC 23092-6 | Genomic annotation coding |
A particular software product should not automatically be assumed to support every MPEG-G component or feature.
Compatibility must be verified against the relevant standard version, implementation profile, and product capabilities.
How Does MPEG-G Work?
MPEG-G aims to encode genomic information using approaches that take advantage of the structural characteristics of different genomic data fields.
Its goal is to support greater efficiency in genomic data storage, processing, and access.
The standard provides mechanisms for organizing data units and enabling selective access to appropriately encoded information.
However, the actual compressed file size, access speed, and computational performance depend on the implementation, dataset, and underlying infrastructure.
FASTQ vs BAM vs CRAM vs MPEG-G: Key Differences
The four approaches can be compared according to their general characteristics.
| Feature | FASTQ | BAM | CRAM | MPEG-G |
|---|---|---|---|---|
| Primary data | Reads and quality scores | Alignment records | Compressed alignment records | Aligned and unaligned genomic data |
| Typical extension | .fastq, .fastq.gz | .bam | .cram | Depends on the implementation and container type |
| Compression | Commonly external gzip | BGZF | Genomics-specific codecs | Genomic coding under ISO/IEC 23092 |
| Reference genome | Not required | Used in the alignment context | May be required depending on encoding | Depends on the coding approach |
| Regional access | Limited in traditional FASTQ | Supported with indexing | Supported with indexing | May be supported through suitable structures and implementations |
| Typical use | Sequencing read data | Alignment and analysis | Alignment storage and analysis | Genomic storage, transfer, and data access |
This table compares the general purposes of each approach.
Actual capabilities may vary according to the tools, versions, and file creation settings used.
Importantly, BAM and CRAM already support indexed regional access.
Selective access is therefore not exclusive to MPEG-G.
When evaluating a technology, laboratories should consider the combined effects of access performance, storage efficiency, and compatibility for their specific workloads.
Lossless vs Lossy Genomic Data Compression
Two different approaches must be distinguished when evaluating genomic compression technologies.
Lossless Compression
Lossless compression allows the defined scope of preserved data to be reconstructed completely after decompression.
This is particularly important when original sequencing reads and quality scores must be retained.
However, preserving the nucleotide sequences alone does not necessarily mean that every data field has survived a file format conversion.
Read identifiers, quality values, auxiliary fields, record order, and other metadata may also need to be checked.
Lossy Compression
Lossy compression reduces file size by removing, modifying, or simplifying selected information.
One of the most familiar examples in genomic data processing is the reduction or quantization of base quality scores.
This approach may be useful in certain research scenarios.
However, potential effects on variant calling, reanalysis, and clinical validity should be evaluated before adoption.
A higher compression ratio does not automatically mean a better genomic archiving strategy.
How Should Genomic Compression Ratios Be Compared?
Two measurements are commonly used when evaluating genomic data compression.
Compression ratio:
Original file size / Compressed file size
Size reduction percentage:
(1 - Compressed size / Original size) × 100
For example, if a 60 GB file is reduced to 15 GB:
- Compression ratio:
4:1 - Size reduction:
75% - Storage capacity saved:
45 GB
However, meaningful comparisons require a clear definition of the source and destination data.
Comparing a 60 GB FASTQ.GZ file with a 15 GB MPEG-G file is not equivalent to comparing a 60 GB BAM file with the same MPEG-G output.
It is also necessary to confirm that both files represent the same biological information and preserve comparable data fields.
Why Do WGS Datasets Produce Different Compression Results?
Factors influencing compression performance include:
- Sequencing technology.
- Read length.
- WGS or WES coverage.
- Average sequencing depth.
- Quality score distribution.
- Proportion of unmapped reads.
- Similarity to the reference genome.
- Auxiliary data fields.
- Compression profile and settings.
- CPU, memory, and storage performance.
Therefore, no single compression percentage can reliably represent results across all laboratories and datasets.
How Can Genomic Data Storage Costs Be Calculated?
As genomic datasets grow, storage costs involve more than purchasing disk capacity.
The total cost of ownership may include:
- Primary storage capacity.
- Backups and copies stored in separate failure domains.
- Cloud object storage charges.
- Data retrieval and transfer fees.
- Archive and access tier selection.
- CPU resources used for compression and decompression.
- Data accessibility during reanalysis.
- Operational management, monitoring, and integrity verification.
Example: A 100 TB Genomic Data Archive
The following example is hypothetical and does not represent a performance forecast for any particular product.
Consider a laboratory maintaining a 100 TB genomic data archive.
Suppose a pilot study demonstrates an average 60% reduction in size while preserving the required information.
| Metric | Value |
|---|---:|
| Original data volume | 100 TB |
| Hypothetical size reduction | 60% |
| New data volume | 40 TB |
| Storage capacity saved | 60 TB |
However, saving 60 TB of capacity does not necessarily translate into an equivalent percentage reduction in total costs.
Software licensing, computational resources, backup policies, and data access requirements must also be considered.
In clinical laboratories, reliable recovery and long-term accessibility may be more important than capacity savings alone.
How Should a Genomic Data Archiving Strategy Be Designed?
An effective genomic archiving policy goes beyond making files smaller.
It must also define why data is retained and how it will be used.
1. Separate Data Types
FASTQ, BAM, CRAM, VCF, analysis reports, and other records serve different purposes.
For example, VCF files describe genetic variants but do not contain all the original sequencing reads.
Therefore, storing only VCF files is not equivalent to archiving FASTQ or BAM/CRAM datasets.
2. Define Retention Requirements
The duration and accessibility of archived data should be determined according to applicable regulations, contracts, accreditation requirements, and laboratory policies.
A universal retention period should not be assumed.
3. Establish a Clear Lossless Preservation Policy
Requirements for preserving original nucleotide sequences, quality scores, and other relevant fields must be documented.
Post-conversion validation should verify not only that a file can be opened, but also that the information required to be preserved remains equivalent.
4. Preserve Reference Genomes and Software Versions
Where reference-based compression is used, relevant reference genome versions should be included in the archiving plan.
Decoder availability and long-term compatibility must also be considered.
5. Verify Data Integrity
Cryptographic checksums such as SHA-256 can be used to verify file integrity during storage and transfer.
However, compressed and decompressed files naturally have different byte-level checksums.
Conversion validation must therefore include comparisons of the relevant preserved data fields, independently of file representation.
6. Test Data Recovery
Archived files should be periodically tested to confirm that they can be opened, decoded, and returned to the appropriate analysis workflow when needed.
The existence of an archived file does not necessarily guarantee recoverability.
What Is GenomSys MPEG-G Suite?
GenomSys MPEG-G Suite is a collection of software tools and interfaces designed to integrate MPEG-G technology into genomic data workflows.
According to the manufacturer's published information, the solution focuses on conversion and processing workflows involving FASTQ, BAM, CRAM, and MPEG-G, together with compression and selected genomic data access capabilities.
What Requirements Does MPEG-G Suite Address?
Key application areas include:
Genomic data compression
Using genomics-specific coding methods to support more efficient storage of large genomic datasets.
Data format conversion
Evaluating existing FASTQ, BAM, and CRAM workflows in combination with MPEG-G-based processing.
Selective data access
Supporting access to required genomic data regions through suitable data structures and product capabilities.
Storage and transfer optimization
Assessing storage capacity requirements and data movement costs, particularly for large WGS archives.
Does MPEG-G Suite Deliver the Same Savings in Every Laboratory?
No.
Compression ratios and performance examples presented by the manufacturer must be evaluated within the context of the datasets and testing conditions used.
The actual benefit should be established through a pilot study using the laboratory's own data.
For example, FASTQ.GZ, BAM, and CRAM datasets can be evaluated separately by measuring:
- Original and converted file sizes.
- Data integrity.
- Compression time.
- Decompression and reverse conversion time.
- CPU and memory consumption.
- Regional data access performance.
- Compatibility with existing bioinformatics tools.
Adoption of GenomSys MPEG-G Suite should be based on validated performance and the laboratory's actual operational requirements.
CRAM vs MPEG-G: How Should Laboratories Decide?
Comparing CRAM and MPEG-G should not be limited to compression ratios.
CRAM is an established option for storing alignment data, supported by a mature ecosystem of widely used bioinformatics tools.
MPEG-G provides a broader standardization framework for genomic data representation, storage, and access.
Laboratories should consider the following questions:
- Which file types consume the most storage capacity?
- Which data fields must be preserved without loss?
- How frequently must archived data be retrieved?
- Which formats are supported by existing analysis software?
- How will reference genomes be managed?
- What computational resources are required for compression and decompression?
- How will data remain accessible five or ten years from now?
- How do licensing and support costs affect the overall financial benefit?
It is not technically appropriate to present one format as the best choice for every laboratory.
CRAM may be sufficient for some institutions.
For others, MPEG-G-based data management may offer additional advantages, depending on existing workflows and measured performance.
Genomic Data Compression Assessment with RelGenSys
RelGenSys aims to support organizations working with genomic data as they evaluate storage, archiving, and software integration requirements.
A technical assessment of GenomSys MPEG-G Suite may include a comparative pilot plan using the laboratory's own representative datasets.
Such an assessment can consider:
- Existing genomic data volume.
- Currently used data formats.
- Retention and retrieval requirements.
- Target reductions in file size.
- Format conversion needs.
- Data integrity verification.
- Infrastructure and operating costs.
For technical information about GenomSys MPEG-G Suite and an evaluation of its suitability for your institution, contact RelGenSys.
Conclusion: Is Reducing File Size Enough?
File size is an important consideration in long-term genomic data management, but it is not the only one.
FASTQ stores sequencing reads and quality values.
BAM represents alignment records in a widely supported and accessible format.
CRAM provides advanced compression options for genomic alignment data.
MPEG-G offers an internationally standardized approach to genomic information compression, representation, transport, and access.
The appropriate solution depends on the laboratory's data types and operational requirements.
Effective genomic data management means reducing storage costs while preserving data integrity, reanalysis capabilities, long-term accessibility, and interoperability.
Frequently Asked Questions
What is the difference between FASTQ and BAM?
FASTQ stores sequencing reads and their associated base quality scores. BAM is the binary representation of SAM alignment records and can include alignment positions against a reference genome and other analytical information.
What is the difference between BAM and CRAM?
BAM uses BGZF compression for alignment records. CRAM supports specialized compression methods for genomic data fields and may use reference-based encoding where appropriate.
Is CRAM always lossless?
No. CRAM supports lossless preservation but can also be used with controlled lossy data reduction. Losslessness must be verified according to the compression configuration and preserved data fields.
Is MPEG-G a file format or a compression standard?
MPEG-G is the ISO/IEC 23092 family of standards. In addition to genomic coding and compression, it includes components addressing storage, transport, metadata, and data access.
Does MPEG-G always compress better than CRAM?
No. Results depend on the dataset, software implementation, compression settings, data preservation requirements, and system resources. A representative comparative test is necessary.
Is FASTQ.GZ lossless?
Standard gzip compression is lossless. A correctly compressed FASTQ file can be decompressed to recover the original FASTQ contents. Additional data integrity checks are necessary when subsequent format conversions are involved.
Do CRAM files require a reference genome?
CRAM files created using reference-based encoding may require access to the appropriate reference genome for decoding. Reference versions, integrity, and availability should therefore be considered in the archiving plan.
How much can WGS data be compressed?
There is no universal compression ratio. Results depend on the original format, sequencing technology, quality scores, dataset characteristics, and compression algorithm. Reliable estimates should be obtained through pilot testing with representative WGS datasets.
Can MPEG-G Suite integrate with existing bioinformatics software?
GenomSys MPEG-G Suite provides genomic data processing and format conversion capabilities. Compatibility and integration with particular bioinformatics tools should be verified against the current product version and technical documentation.
Technical disclaimer: This content is intended for educational purposes and technology assessment. Before converting, compressing, or archiving clinical genomic data, organizations should evaluate data integrity, appropriate validation procedures, institutional policies, and applicable regulatory requirements.
References
Scientific publications
- Efficient Storage of High Throughput DNA Sequencing Data Using Reference-Based Compression — Fritz M.H.-Y., Leinonen R., Cochrane G., Birney E. · Genome Research · 2011
- Genie: The First Open-Source ISO/IEC Encoder for Genomic Data — Genie araştırma ekibi · Communications Biology · 2024
Technical documentation
- NCBI Sequence Read Archive – File Format Guide — National Center for Biotechnology Information (NCBI) · NCBI Sequence Read Archive Documentation
- SAM/BAM and Related High-Throughput Sequencing Format Specifications — Global Alliance for Genomics and Health (GA4GH) – Large Scale Genomics Work Stream · SAMtools HTS Specifications
- CRAM Format Specification (Version 3.1) — SAMtools Developers – GA4GH · CRAM Format Specification · 2025
- ISO/IEC 23092 – MPEG-G: Genomic Information Representation — ISO/IEC Moving Picture Experts Group (MPEG) · MPEG-G Standards Documentation
Manufacturer documents
- GenomSys MPEG-G Suite – Product Documentation — GenomSys · GenomSys Official Product Documentation