在 GIAB 数据集中,NA12878对应 HG001,为女性样本;NA12777对应 HG004,为男性样本。
1. AWS CLI安装
AWS安装教程:https://docs.aws.amazon.com/cli/latest/userguide/getting-started-install.html
# linux
curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"
unzip awscliv2.zip
sudo ./aws/install
2. 数据下载
HG001 和 HG004 的数据总量约为 100GB。
下载的文件列表:
- CRAM 文件:这是经过压缩的比对文件
- VCF 文件:包含变异检测结果
- BED 文件:用于排除低复杂度区域
- README 文件:其中包含变异调用的步骤说明
# 创建存放数据的目录
mkdir GIAB && cd GIAB
# 下载HG001(NA12878)和HG004(NA12777)的数据
# --recursive:此参数用于递归下载整个目录
# --no-sign-request: 无需进行身份验证下载
# --include: 参数筛选出仅包含 HG001 和 HG004 的文件
aws s3 cp s3://ultima-ashg-2023-reference-set/ . \
--recursive --no-sign-request \
--include "HG001*" --include "HG004*"
3. 参考基因组下载与CRAM解压
CRAM 文件需要参考基因组才能解压,下载hg38可将CRAM解压为BAM。
aws s3 cp s3://s3.amazonaws.com/ucsc - \
goldenPath/hg38/bigZips/hg38.fa.gz .
gunzip hg38.fa.gz
# 解压 CRAM 文件
samtools view -C -T hg38.fa HG001.cram -o HG001.bam
4. 变异评估
可使用hap.py工具(GitHub: https://github.com/illumina/hap.py ),将检测结果与 GIAB 的基准变异集合进行对比,以此评估变异检测的准确性。
git clone https://github.com/Illumina/hap.py.git
# 基本用法
# 将PG_NA12878检测结果与NA12878基准变异集合进行对比
/bin/hap.py \
example/happy/PG_NA12878_chr21.vcf.gz \
example/happy/NA12878_chr21.vcf.gz \
-f example/happy/PG_Conf_chr21.bed.gz \
-o test
ls test.*
# test.metrics.json test.summary.csv