Genomic Data Storage and Compression: How to Manage FASTQ, BAM and CRAM Files
How should FASTQ, BAM, and CRAM files generated by next-generation sequencing be stored and managed? As genomic data volumes grow, storage, backup, and long-term archiving costs become increasingly important for laboratories. This technical guide examines genomic file formats, lossless and lossy compression, reference-based CRAM technology, data integrity, secure archiving, and the key considerations for choosing genomic storage infrastructure.
The widespread adoption of next-generation sequencing (NGS) technologies has enabled genetic laboratories and research institutions to generate increasingly large volumes of genomic data.
Completing a genetic test does not simply produce an analysis report. Depending on the sequencing and analytical methods used, laboratories may also generate raw sequencing reads, alignment files, variant call files, quality control reports, and various intermediate outputs.
Among these files, FASTQ, BAM, and CRAM are some of the most important formats in genomic data management.
Whole-genome sequencing (WGS), whole-exome sequencing (WES), and other high-throughput NGS applications can require substantial storage capacity.
As the number of tests performed by a laboratory increases, storing data is only one part of the challenge. Data must also be backed up, protected, retrieved when needed, and preserved in a form that supports future reanalysis.
Genomic data management is therefore about much more than purchasing larger storage devices.
An effective strategy must consider file formats, compression methods, data integrity, archival policies, access performance, and information security together.
In this technical guide, we examine the differences between FASTQ, BAM, and CRAM, explore genomic data compression technologies, and discuss practical storage strategies for laboratories.
What Is Genomic Data Management?
Genomic data management encompasses the processes used to organize, store, protect, access, and process genetic and genomic information throughout its lifecycle.
This lifecycle begins with data generation and continues through analysis, sharing, archiving, retrieval, and, when appropriate, secure deletion.
The main objectives of genomic data management include:
- Preserving data integrity and availability.
- Reducing unnecessary duplicate copies.
- Supporting reproducible analytical workflows.
- Managing storage and backup costs.
- Preventing unauthorized access.
- Establishing retention periods and data lifecycle policies.
- Enabling previous analyses to be repeated when necessary.
However, the appropriate retention period for each type of file depends on whether a laboratory operates in a clinical or research setting, the applicable regulations, accreditation requirements, and institutional policies.
There is no single universal retention period that applies to every genomic laboratory.
Which File Formats Are Used in NGS Analysis?
Different stages of an NGS workflow generate different types of data.
| Format | Primary function | Common application |
|---|---|---|
| FASTQ | Stores sequencing reads and quality scores | Raw or processed read data |
| SAM | Text representation of alignment records | Inspection and processing of alignments |
| BAM | Compressed binary representation of alignment records | Storage and analysis of aligned reads |
| CRAM | Advanced compressed representation of genomic alignment data | More efficient storage and archiving |
| VCF | Stores genetic variant records | Reporting SNVs, indels, and other supported variants |
| BCF | Binary representation of VCF information | Efficient variant data processing |
These formats do not necessarily preserve the same information.
For example, keeping only a VCF file does not mean that raw sequencing data or alignment information has been retained.
Similarly, a CRAM archive generated from BAM does not necessarily guarantee that the original FASTQ file can be reconstructed byte for byte.
These distinctions are important when making long-term archiving decisions.
What Is a FASTQ File?
FASTQ is a widely used file format for storing sequencing reads and their associated base quality scores.
FASTQ records generally consist of four lines:
- A read identifier.
- A nucleotide sequence.
- A separator line.
- Characters representing quality scores.
Base quality scores express estimates of the probability of errors in individual base calls.
FASTQ is therefore more than a plain-text file containing the nucleotide letters A, T, G, and C.
It also preserves information about sequencing quality.
Why Are FASTQ Files Important?
FASTQ files provide the starting point for alignment and variant calling in many NGS workflows.
When analysis software, reference genomes, or analytical methods are updated, appropriate raw sequencing data may enable a laboratory to perform a new analysis.
However, a file stored in FASTQ format is not necessarily an unchanged output from the sequencing instrument.
FASTQ files may also be generated after adapter removal, quality trimming, or read filtering.
The processing status of each file should therefore be clearly documented in the archive.
What Is a BAM File?
BAM (Binary Alignment/Map) is a compressed binary representation of alignment records in SAM format.
BAM files are commonly generated after sequencing reads have been aligned to a reference genome.
They can contain not only the read sequences but also their genomic positions and additional alignment information.
Examples include:
- Chromosome and genomic coordinates.
- Mapping quality.
- CIGAR alignment information.
- Paired-read information.
- Base quality values.
- Optional alignment tags.
BAM is supported by numerous bioinformatics tools and is widely used in genomic analysis infrastructure.
However, BAM files may require substantial storage capacity in high-throughput sequencing environments.
This makes more efficient formats such as CRAM worth considering.
What Is a CRAM File?
CRAM is a file format developed for the efficient storage of genomic alignment data.
It supports workflows within the SAM/BAM ecosystem and uses compression strategies adapted to different types of genomic information.
One of its most important features is the ability to use reference-based compression.
With reference-based compression, regions of sequencing reads that match a reference genome can be represented more efficiently instead of storing the same sequence information repeatedly.
This approach can reduce file size for suitable genomic datasets.
CRAM was designed to improve compression efficiency while preserving the ability to work with genomic alignment information and established analysis tools.
The Global Alliance for Genomics and Health (GA4GH) recognizes CRAM as a technical standard for genomic data storage.
However, one important distinction must be understood:
CRAM supports both lossless storage and strategies that intentionally discard or modify selected information.
The presence of a .cram extension therefore does not automatically guarantee that every original data element has been preserved without loss.
What Is the Difference Between BAM and CRAM?
BAM and CRAM both belong to the broader genomic alignment data ecosystem, but they use different compression approaches.
| Feature | BAM | CRAM |
|---|---|---|
| Primary data | Alignment records | Alignment records |
| Compression | General-purpose binary compression | Genomics-specific compression methods |
| Reference dependency | Generally not required for decoding | Required for decoding in certain reference-based configurations |
| File size | Depends on the dataset | Can be smaller than BAM under suitable conditions |
| Random access | Supported through indexing | Supported through indexing |
| Data preservation | Binary representation of stored records | Lossless or selected lossy strategies |
| Long-term archiving | Suitable with appropriate management | Suitable when reference and decoding dependencies are preserved |
CRAM's potential to reduce file sizes is an important advantage.
GA4GH describes storage reductions of approximately 30–50% for certain CRAM use cases.
However, this is not a guaranteed reduction for every dataset.
Actual results depend on the source file, CRAM version, reference genome, quality scores, and compression settings.
What Is Lossless and Lossy Genomic Compression?
Two fundamental concepts are important when evaluating genomic data compression.
Lossless Compression
Lossless compression aims to preserve the defined information content during compression and decompression.
This is particularly important when archived information must remain available for future analysis.
However, a claim of losslessness should always specify exactly what is preserved.
Possible levels of preservation include:
- Byte-for-byte identity of the original file.
- Preservation of FASTQ sequences and quality scores.
- Preservation of the semantic content of SAM/BAM alignment records.
These are not identical verification criteria.
For example, reserializing genomic records into a different representation may produce a different SHA-256 checksum even when the relevant biological records remain equivalent.
Therefore, byte-level file identity and biological record equivalence must be distinguished.
Lossy Compression
Lossy compression intentionally modifies or removes selected information to achieve greater data reduction.
In genomic datasets, this is especially relevant to base quality scores.
Representing quality scores using fewer categories may reduce storage requirements.
However, changing these scores can affect the information available to certain downstream analytical workflows.
Scientific studies have investigated the impact of controlled quality score loss on selected genomic analyses.
Nevertheless, results considered acceptable for one dataset or application cannot automatically be generalized to every clinical genetic test.
In clinical genomics, any lossy compression strategy must be evaluated in the context of the intended application and appropriate validation requirements.
How Does Reference-Based Genomic Compression Work?
A substantial proportion of human DNA sequence information is shared across individuals and resembles an appropriate reference genome.
Reference-based compression can take advantage of this similarity.
Instead of representing every nucleotide independently, the method can more efficiently encode information such as:
- The position of a read within the reference genome.
- Bases that differ from the reference.
- Insertions and deletions.
- Required alignment information.
- Other selected data elements that must be preserved.
A study published by Fritz and colleagues in Genome Research in 2011 demonstrated the potential of reference-based compression for high-throughput DNA sequencing data.
However, not all datasets achieve the same compression efficiency.
Unmapped reads, different sequencing technologies, and datasets with high sequence diversity may produce different compression results.
Compression methods should therefore be evaluated using representative laboratory datasets rather than relying exclusively on advertised performance figures.
Why Does the Reference Genome Matter for CRAM?
Certain CRAM compression methods rely on a reference sequence during decoding.
Consequently, preserving a CRAM archive for long-term use may require more than retaining the .cram file itself.
The reference genome used should be documented, including:
- Its identity.
- Its version.
- Sequence integrity information.
- Relevant checksum values.
- Where the reference can be retrieved when needed.
Different genome assemblies, such as GRCh37 and GRCh38, must not be treated as interchangeable.
If the appropriate reference genome becomes unavailable or incompatible, decoding archived CRAM files may become difficult.
For reliable long-term archiving, reference dependencies should therefore be preserved alongside the data management records.
Can FASTQ Files Be Converted Directly into CRAM?
FASTQ and CRAM represent different data models.
FASTQ primarily contains sequencing reads and base quality scores, while CRAM is designed for records in the SAM/BAM alignment ecosystem.
In a standard NGS workflow, FASTQ reads may be aligned to generate BAM or CRAM outputs.
However, creating CRAM from an alignment workflow does not automatically mean that the original FASTQ file can later be reconstructed exactly.
Reasons include:
- Changes in read ordering.
- Modifications to read identifiers.
- Alterations to quality scores.
- Adapter removal or base trimming.
- Filtering of selected reads.
- Additional fields generated during alignment.
Therefore, if retaining the original FASTQ files is a requirement, that decision should be explicitly documented in the archiving policy.
A compressed alignment file should not be treated as a complete replacement for raw sequencing data unless the required equivalence has been verified.
How Is the Genomic Data Compression Ratio Calculated?
Compression performance is commonly evaluated by comparing the size of the original file with that of the compressed output.
Consider a file that occupies 100 GB before compression and 35 GB afterward.
The storage reduction is:
Storage reduction = (100 − 35) / 100 × 100 = 65%
This means that storage requirements have decreased by 65%, leaving a file that occupies 35% of the original space.
Compression ratio is a different measurement:
Compression ratio = 100 / 35 ≈ 2.86:1
These two metrics should not be confused.
When comparing compression products, the measurement being reported must be clearly identified.
Is a Smaller File Always Better?
No.
Final file size is only one consideration when evaluating compression technology.
Other important measurements include:
- Compression time.
- Decompression time.
- CPU and memory requirements.
- Storage access performance.
- Data integrity.
- Reference genome dependencies.
- Compatibility with bioinformatics software.
For laboratories that regularly access archived datasets, a smaller file may offer limited operational value if restoring it takes too long.
How Are Genomic Data Storage Costs Calculated?
The total cost of ownership of genomic storage infrastructure is not determined by disk capacity alone.
A realistic cost assessment should include:
- Active storage capacity.
- Backup capacity.
- Archival storage.
- Processing and memory infrastructure.
- Data center or cloud service fees.
- Network data transfer.
- Retrieval and download charges.
- Security and monitoring systems.
- Software licensing and operational labor.
For example, consider a laboratory performing 100 new analyses each month, with every analysis generating 30 GB of data that must be retained.
The monthly data increase would be 3 TB.
Over one year, approximately 36 TB of additional data would accumulate, assuming that no data are deleted or further compressed.
This estimate does not include backup copies, temporary analytical outputs, or additional duplicates.
Those components should be evaluated separately during capacity planning.
How Should Laboratories Choose Between NAS, Local Servers, and Cloud Storage?
Genetic laboratories can use different infrastructure models for genomic data storage.
NAS and On-Premises Storage
Network Attached Storage (NAS) systems provide centralized file access across a laboratory network.
Potential advantages include local network access and direct control over data movement within an institution's infrastructure.
However, the organization remains responsible for managing hardware capacity, security, backups, maintenance, and disaster recovery.
Cloud Storage
Cloud platforms can provide flexible storage capacity and different storage access tiers.
However, total costs may include more than the price per gigabyte stored.
Retrieval charges, network egress fees, requests, and other service costs should also be considered.
Moving genomic data to the cloud does not automatically ensure regulatory compliance.
Appropriate contracts, access permissions, and security configurations remain essential.
Hybrid Storage
Hybrid architectures may keep frequently accessed analytical data on local infrastructure while placing less frequently used archives in another suitable environment.
This approach may help balance performance and cost for certain laboratories.
However, the appropriate model depends on testing volume, access frequency, security requirements, and existing infrastructure.
What Are Hot, Warm, and Cold Storage?
Genomic data archives can be organized into different tiers based on access requirements.
| Storage tier | Primary purpose | Example |
|---|---|---|
| Hot storage | Frequently accessed active data | Ongoing NGS analysis |
| Warm storage | Data accessed periodically | Reanalysis of previous tests |
| Cold storage | Long-term, infrequently accessed data | Archives of completed studies |
Lower-cost cold storage may involve longer retrieval times or different access conditions.
Therefore, datasets that may require urgent clinical reanalysis should not automatically be moved exclusively to slow-access archival tiers.
Storage policies should reflect a laboratory's operational requirements.
How Can Genomic Data Be Stored Securely?
Human genomic data may present privacy and re-identification risks even when direct identifiers have been removed.
Genetic information therefore requires careful security and governance practices.
Controls that should be considered include:
- Role-based access permissions.
- Encryption during transmission.
- Encryption at rest.
- Strong authentication and multifactor authentication.
- Access and activity logs.
- Backup and restoration testing.
- Retention and secure deletion policies.
- Assessment of service providers and data processors.
In Türkiye, the Personal Data Protection Law (KVKK) and applicable regulations must be considered when processing personal information.
International research may involve additional obligations depending on where data originate, the agreements governing their use, and the relevant national regulations.
For example, the U.S. National Institutes of Health (NIH) has genomic data sharing requirements addressing responsible access and security for data within its policy scope.
However, NIH policies should not be mistaken for a universal regulatory framework applying automatically to every laboratory.
Are RAID and Backup the Same Thing?
No.
RAID can help a properly configured storage system remain available during certain disk failures.
However, RAID is not a backup strategy.
It may not provide adequate protection against accidental deletion, ransomware, physical destruction of the storage system, or other incidents affecting the stored data.
Genomic laboratories should therefore plan separate backup copies, appropriate isolation measures, and regular restoration tests.
For very large datasets, successfully copying files is not sufficient proof that the archive can be restored.
Actual data restoration should also be tested.
Checksums and Data Integrity in Genomic Storage
Data integrity is one of the most important considerations in long-term genomic archiving.
Checksum methods can help detect corruption that may occur during file transfers or storage operations.
Cryptographic hashing algorithms such as SHA-256 can be used for file integrity verification.
A basic workflow includes:
- Calculating the source file's checksum before archiving.
- Transferring the file to the destination storage environment.
- Calculating the checksum of the destination file.
- Comparing the results.
- Recording the verification outcome.
However, a compressed file and its original uncompressed version are expected to have different checksum values.
In compression testing, the compressed file should therefore not be compared byte for byte directly with the original.
Instead, the appropriately decompressed output should be evaluated against the expected data.
Byte-level identity and biological data equivalence may require different verification methods.
What Should Laboratories Look for in Genomic Compression Software?
The suitability of a genomic compression solution cannot be determined solely by the percentage reduction advertised by its developer.
Several questions should be addressed.
Which File Formats Are Supported?
FASTQ, BAM, CRAM, and VCF have different technical structures.
A product should not automatically be assumed to provide equivalent capabilities for every format.
Is Any Information Lost?
Claims of losslessness must clearly identify which data elements are preserved.
Read sequences, quality scores, identifiers, and any additional fields required for downstream analysis should be evaluated.
Can the Data Be Decompressed and Reanalyzed?
Creating a compressed archive is not sufficient.
Files must be recoverable and usable in the required bioinformatics workflows.
Is Processing Performance Acceptable?
CPU, RAM, and disk resource consumption during compression and decompression should be measured.
Is the Software Compatible with Existing Infrastructure?
Compatibility with Linux servers, network storage, cloud environments, and existing analysis software should be evaluated.
How Is Data Security Managed?
When genomic information is transferred to third-party environments, access permissions, data processing arrangements, and security obligations must be assessed.
How Should Genomic Compression Tools Be Compared?
Different commercial and open-source genomic compression solutions may be available.
Laboratories should compare them using their own representative datasets.
A pilot evaluation could include the following metrics:
| Test metric | Evaluation |
|---|---|
| Original size | Size of the source dataset |
| Compressed size | Size after compression |
| Storage reduction | Percentage reduction |
| Compression time | Time required to compress the data |
| Decompression time | Time needed to restore usable data |
| Data integrity | Appropriate verification results |
| Analysis compatibility | Ability to use restored data with existing tools |
| Resource consumption | CPU, RAM, and storage utilization |
The same datasets, hardware, and reasonably comparable configurations should be used.
Importantly, lossless and lossy compression results should not be placed in a single performance ranking without clearly distinguishing their data preservation characteristics.
These approaches do not provide the same guarantees.
The Role of Automation in Genomic Data Management
As testing volumes increase, manually moving, naming, backing up, and archiving files becomes more complicated.
Automated data management systems can support:
- Identification of completed analysis outputs.
- Movement of files to appropriate archival tiers.
- Scheduling of compression jobs.
- Verification of file integrity.
- Recording of access and processing activities.
- Periodic archive restoration tests.
- Monitoring of storage capacity.
However, automation should follow clearly defined rules regarding which data must be retained and which may be deleted.
Deletion of clinical genomic data should not be automated solely for the purpose of freeing storage space.
An Example Genomic Archiving Strategy for Laboratories
A laboratory seeking to improve genomic data management can develop its strategy in stages.
Stage 1: Data Inventory
Identify existing FASTQ, BAM, CRAM, VCF, and other files, including their size, frequency of use, and retention requirements.
Stage 2: Compression Pilot
Evaluate suitable compression methods using representative datasets from different types of genetic tests.
Stage 3: Data Integrity Verification
Verify that required files and biological information are preserved after compression and decompression.
Stage 4: Storage Tier Design
Place active and less frequently accessed data in storage environments appropriate for their operational requirements.
Stage 5: Backup and Disaster Recovery
Establish separate backup copies and documented restoration procedures.
Stage 6: Capacity and Cost Monitoring
Regularly assess monthly data generation, storage growth, compression performance, and total costs.
This approach helps institutions make technical investment decisions based on real data and operational requirements.
The Future of Genomic Data Storage
As genomic technologies continue to advance, expectations for storage infrastructure are evolving.
Higher sequencing volumes, growing genomic archives, and the need for reanalysis make sustainable data storage increasingly important.
Areas of ongoing development include:
- Compression algorithms tailored to genomic data types.
- Reference-based data representations.
- Cloud and hybrid storage architectures.
- Automated data lifecycle management.
- Standardized data access methods.
- Secure and reproducible analytical systems.
However, a higher compression ratio or a lower cost per gigabyte does not independently make a solution better.
Its value should be assessed by whether it reduces storage costs while preserving scientific data integrity and required accessibility.
Conclusion
FASTQ, BAM, and CRAM are essential data formats in modern genomic analysis workflows.
FASTQ stores sequencing reads and quality information, while BAM and CRAM play important roles in processing and preserving alignment records.
Genomic formats such as CRAM can reduce storage requirements under suitable conditions.
However, the information preserved during compression, reference genome dependencies, and decompression procedures must be carefully evaluated.
A sustainable genomic data strategy should integrate compression, archiving, backup, information security, and reanalysis requirements.
True efficiency in genomic data management is not simply about using less disk space. It is about preserving scientifically valuable data in a reliable, accessible, and manageable form over the long term.
Scientific and technical disclaimer: This article is intended for general scientific and technical education. Decisions regarding clinical genomic data retention, compression, and deletion must follow applicable regulations, laboratory quality systems, contractual obligations, and appropriately validated technical procedures.
References
Scientific publications
- Efficient storage of high throughput DNA sequencing data using reference-based compression — Fritz MH-Y, Leinonen R, Cochrane G, Birney E · Genome Research · 2011
- Quality Scores Compression of Genomic Sequencing Data: A Comprehensive Review and Performance Evaluation — Liu Y, Tang T, Zhu Z, Zeng X, Zou Q, Li K · IEEE/ACM Transactions on Computational Biology and Bioinformatics · 2025
- Using Genomic Data Responsibly Under the NIH Genomic Data Sharing Policy — National Institutes of Health (NIH) · NIH Grants & Funding · 2025
Technical documentation
- CRAM: Efficient Storage of Genomic Sequencing Data — Global Alliance for Genomics and Health (GA4GH) · GA4GH — CRAM · 2026