Storing and analyzing a genome on a blockchain

Gamze Gürsoy, Charlotte M. Brannon, Sarah Wagner, Mark GersteinbioRxiv 2020

TL;DR

This paper introduces SAMchain, a novel system that stores raw genomic data directly on a private blockchain, addressing the security and integrity concerns of traditional cloud storage. By employing reference-based compression and genomic location binning, SAMchain enables efficient storage and querying of large genomic datasets, paving the way for more secure and decentralized genomic data management.

What Problem Does This Paper Address?

The increasing availability of personal genome sequencing presents a massive opportunity for biomedical research and healthcare. However, storing and managing this vast amount of sensitive data securely and with high integrity is a significant challenge. Cloud storage, while convenient, is vulnerable to single points of failure, data corruption, and security breaches. Blockchain technology offers a decentralized and immutable alternative, but storing large genomic files directly on-chain is hindered by slow transaction speeds and the potential for massive chain growth. Existing blockchain solutions for genomics often only log access transactions, leaving the actual genomic data stored off-chain, thus not fully leveraging blockchain's security benefits. This paper tackles the problem of storing and analyzing raw genomic data directly on a blockchain, ensuring its integrity and security while addressing the scalability and querying challenges.

Methods

The core contribution is SAMchain, a system built on the MultiChain blockchain platform. Key innovations include:

  • Reference-Based Data Compression: Instead of storing the entire sequence of each read, SAMchain stores the differences between the read and a reference genome, inspired by the CRAM format. This "modcigar" approach significantly reduces data size, achieving approximately a 2-fold reduction.
  • Genomic Location Binning: To overcome the inefficiency of querying large, single streams, SAMchain divides the genome into bins (e.g., 1 million base pairs per bin) and creates separate streams for each bin. This allows query algorithms to efficiently target only the relevant streams, drastically reducing retrieval times.
  • Data Structure Design: SAMchain utilizes MultiChain's "data streams" feature. A metaData stream stores chain configuration and SAM file headers. Unmapped reads and contigs are stored in an unmappedANDcontigs stream. Mapped reads are stored in binned streams (chr_i-bin_j), with a FLANK key indicating if a read spans two bins.
  • SCtools: A suite of tools (queryReads, queryDepth, pileup, buildBAM) was developed to query and analyze the on-chain genomic data, enabling tasks like variant calling and depth analysis.
  • VCFChain and VCFquery: The framework was extended to handle variant data (VCF files) with similar binning and querying mechanisms.

Datasets

The performance evaluations were conducted using an alignment file curated from the high-coverage whole genome sequencing data of individual NA12878 from the 1000 Genomes Project. For testing purposes, a SAM file was constructed with approximately 1-5 disease-causing loci per chromosome. A VCF file from a consented individual in the ENCODE data portal was used for testing the VCFchain and VCFquery modules.

Key Insights and Ideas

  • On-Chain Storage is Achievable and Beneficial: The paper demonstrates that storing raw genomic data directly on a blockchain is feasible and offers significant advantages in terms of data integrity and security compared to off-chain storage solutions.
  • Compression and Binning are Crucial for Scalability: The combination of reference-based compression and genomic location binning is essential for overcoming the inherent limitations of blockchain for large-scale data storage and enabling efficient querying.
  • Genomic Location is the Primary Query Key: The design prioritizes binning by genomic location because it's the most frequently queried attribute for tasks like depth analysis and variant calling.
  • Blockchain for Genomics is More Than Just Logging: SAMchain moves beyond simply logging access transactions to providing a secure, immutable repository for the raw data itself.

Key Results

  • Storage Reduction: The "modcigar" approach achieved approximately a 2-fold reduction in storage size compared to storing raw sequences.
  • Query Time Improvement: The binned stream approach in SAMchain demonstrated up to a 25-fold advantage in query time compared to a naive single-stream implementation.
  • Storage Overhead: SAMchain required approximately 5-fold more storage per node than a standard SAM file (e.g., ~25 GB for ~10 million reads in a single-node network vs. 5.5 GB for the SAM file). Each additional node in the network required about 7.4 GB of redundant storage.
  • Build Time: Building and inserting 10 million reads into a SAMchain took approximately 55 hours, but this is a one-time operation.
  • VCFchain Storage: A VCFchain storing ~6.5 million variants required approximately 40 GB per node in a single-node network, with each additional node requiring 14 GB.

Limitations and Future Work

  • Storage Overhead: The paper acknowledges that storing data on-chain inherently incurs higher storage costs due to redundancy compared to traditional file systems.
  • On-Chain Computation: While MultiChain is used for storage, it doesn't natively support complex on-chain computation like Ethereum. The authors provide an example of an Ethereum Smart Contract for potential future expansion.
  • Building Time: The initial build time for a SAMchain can be substantial.
  • Future Work:
    • Exploring Ethereum for on-chain computation.
  • Creating dictionaries from SAM files for further compression.
  • Generalizing the solution to other large-scale data types like electronic health records and somatic mutation datasets.
  • Extending the framework to store encrypted data, potentially enabling homomorphic encryption for computations on encrypted data.

Summary updated

BibTeX
@misc{gursoy2020storing,
  author = {Gamze Gürsoy and Charlotte M. Brannon and Sarah Wagner and Mark Gerstein},
  title = {{Storing and analyzing a genome on a blockchain}},
  year = {2020},
  doi = {10.1101/2020.03.03.975334},
  howpublished = {bioRxiv},
}
Figure