使用 htsget 读取数据

本页介绍了如何使用 htsget 协议的 Google 实现来执行以下任务:

  • 读取存储在 Cloud Storage 中的数据。
  • 从公共来源(例如 Google 的千人基因组计划 (1000 Genomes Project) 镜像)读取数据。

htsget 协议由全球基因组学与健康联盟 (GA4GH) 定义。

Google 的 htsget 实现使您可以轻松访问和共享存储在您自己的云项目中的数据,而无需在 Compute Engine 虚拟机之间复制大型文件。

读取公开数据

如需启动 htsget 服务器,请运行以下命令:

docker network create test
docker run -d --network=test --name=htsget gcr.io/cloud-lifesciences/htsget

运行该命令会将服务器连接到名为“test”的本地 Docker 容器网络。服务器启动后,您可以使用任何使用 GA4GH htsget 协议进行通信的软件对其进行访问。

运行以下命令以查看公共基因组上 11 号染色体上的小范围的统计数据:

docker run \
    --network=test gcr.io/cloud-lifesciences/samtools \
    flagstat "http://htsget/reads/genomics-public-data/platinum-genomes/bam/NA12892_S1.bam?referenceName=chr11&end=1000"

几秒钟后,该命令会处理从 Cloud Storage 中存储的 BAM 文件流式传输的大约 1500 个测序片段:

1532 + 0 in total (QC-passed reads + QC-failed reads)
0 + 0 secondary
0 + 0 supplementary
5 + 0 duplicates
1526 + 0 mapped (99.61% : N/A)
1532 + 0 paired in sequencing
784 + 0 read1
748 + 0 read2
1510 + 0 properly paired (98.56% : N/A)
1520 + 0 with itself and mate mapped
6 + 0 singletons (0.39% : N/A)
10 + 0 with mate mapped to a different chr
1 + 0 with mate mapped to a different chr (mapQ>=5)

如需了解 htsget 服务器的详情,包括有关访问私有数据和数据访问限制的信息,请参阅 htsget README