GATK 软件分析流程

本文涉及的产品
对象存储 OSS,20GB 3个月
对象存储 OSS,恶意文件检测 1000次 1年
对象存储OSS,敏感数据保护2.0 200GB 1年
简介: GATK 软件分析流程由阿里云和 Broad Institute 合作提供。Broad Institute 提供的 GATK 流程最佳实践用 工作流定义语言(WDL) 编写,通过批量计算集成的 Cromwell 工作流引擎解析执行。用户将为作业运行时实际消耗的计算和存储资源付费,不需要支付资源之外的附加费用。Broad Institute GATK 网站和论坛为 GATK 工具和 WDL 提供了更完整的背景信息,文档和支持。如果需要执行用 WDL 编写的通用工作流程,请参考 cromwell 工作流引擎和 WDL 支持的 APP 。

1. 准备

A) 使用 OSS 存储

要在批量计算上运行 GATK,输入、输出文件都需要保存在 OSS。所以,需要先开通 OSS 并创建好 Bucket。

注意:创建 Bucket 的区域,需要和运行批量计算的 GATK 区域一致。

B) 安装 batchcompute-cli 命令行工具

 pip install batchcompute-cli
AI 代码解读

安装完成后,还需要 配置 。

注意:当前最佳实践中使用的 GATK 相关软件版本信息如下:
  GATK: 4.0.0.0
  picard: 2.13.2
  genomes-in-the-cloud: 2.3.0-1501082129

2. 快速运行

本示例中,运行 Broad Institute 提供的 GATK4 版本全基因分析流程,该流程分为两步:

  第一步为 gatk4-data-processing 。

  第二步为 gatk4-germline-snps-indels 。

在配置好 bcs 工具后,执行如下命令:

bcs gen ./demo -t gatk

cd demo/gatk4-data-processing

sh main.sh # 运行gatk4-data-processing 流程

cd ../gatk4-germline-snps-indels

sh main.sh # 运行gatk4-germline-snps-indels 流程
AI 代码解读

这样您就在批量计算上运行了以上两个 GATK4 流程。

3. 命令详解

A) 生成示例

执行如下命令生成示例:

bcs gen ./demo -t gatk
AI 代码解读

它将生成以下目录结构:

demo

|-- Readme.md

|-- gatk4-data-processing

|   |-- main.sh

|   |-- src

|       |-- LICENSE

|       |-- README.md

|       |-- generic.batchcompute-papi.options.json

|       |-- processing-for-variant-discovery-gatk4.hg38.wgs.inputs.json

|       |-- processing-for-variant-discovery-gatk4.hg38.wgs.inputs.30x.json

|       |-- processing-for-variant-discovery-gatk4.wdl

|-- gatk4-germline-snps-indels

    |-- main.sh

    |-- src

        |-- LICENSE

        |-- README.md

        |-- generic.batchcompute-papi.options.json

        |-- haplotypecaller-gvcf-gatk4.hg38.wgs.inputs.json

        |-- haplotypecaller-gvcf-gatk4.hg38.wgs.inputs.30x.json

        |-- haplotypecaller-gvcf-gatk4.wdl
AI 代码解读

  gatk4-data-processing 目录中包括了运行 gatk4-data-processing 流程所需的所有配置和脚本。

  gatk4-germline-snps-indels 目录中包括了运行 gatk4-germline-snps-indels 流程所需的所有配置和脚本。

  每个目录下面的 main.sh 脚本封装了使用 bcs 工具提交作业的命令。

  src 目录下面包括了工作流实现代码。

B) 运行 gatk4-data-processing 流程

进入 demo/gatk4-data-processing 目录,运行 main.sh,该文件内容如下:

#!/bin/bash



# bcs asub cromwell -h for more



bcs asub cromwell gatk-job\

   --config ClassicNetwork=false\

   --input_from_file_WDL src/processing-for-variant-discovery-gatk4.wdl\

   --input_from_file_WORKFLOW_INPUTS src/processing-for-variant-discovery-gatk4.hg38.wgs.inputs.json\

   --input_from_file_WORKFLOW_OPTIONS src/generic.batchcompute-papi.options.json\

   --input_WORKING_DIR oss://demo-bucket/cli/gatk4_worker_dir/\

   --output_OUTPUTS_DIR oss://demo-bucket/cli/gatk4_outputs/\

   -t ecs.sn1.large -d cloud_efficiency
AI 代码解读

其中,部分参数描述为:

  input_from_file_WDL:WDL 流程描述文件路径。

  input_from_file_WORKFLOW_INPUTS:WDL 流程输入文件。

  input_from_file_WORKFLOW_OPTIONS:WDL 流程选项文件。

  input_WORKING_DIR:OSS上的目录,用来存储 WDL 流程中各个步骤生成的文件,bcs 会自动给您生成一个默认的路径。

  output_OUTPUTS_DIR:OSS 上的目录,用来存储 WDL 流程结束后生成的 metadata 文件,bcs 会自动给您生成一个默认的路径。

其他参数,请参考 bcs asub -h 命令。

如果希望使用此流程来运行自己的数据,需要修改 src/processing-for-variant-discovery-gatk4.hg38.wgs.inputs.json 文件中的 PreProcessingForVariantDiscovery_GATK4.flowcell_unmapped_bams_list 参数,指定存储在 OSS 上的 ubam 文件。

注意:该示例中的流程输入文件不是 FASTQ 格式,而是 unaligned BAM 文件。

C) 运行 gatk4-germline-snps-indels 流程

该流程的运行与 gatk4-data-processing 流程类似,参考上述章节。

  如果希望使用此流程来运行自己的数据,需要修改 src/haplotypecaller-gvcf-gatk4.hg38.wgs.inputs.json 文件中的 HaplotypeCallerGvcf_GATK4.input_bam 参数,修改为 gatk4-data-processing 流程输出的 bam 文件路径。

  将 HaplotypeCallerGvcf_GATK4.input_bam_index 参数修改为相应的索引文件路径。

4. 作业状态查询与日志

在提交作业后,如果看到以下信息,说明提交成功

Job created: job-0000000059DC658400006822000001E3
AI 代码解读

job-0000000059DC658400006822000001E3 即是当次提交作业的 ID。

查看作业状态:

bcs j   # 获取作业列表

bcs j job-0000000059DC658400006822000001E3 # 查看作业详情
AI 代码解读

查看作业日志:

bcs log job-0000000059DC658400006822000001E3
AI 代码解读

5. 验证结果

查看 OSS 空间中的输出数据:

bcs o ls oss://demo-bucket/cli/gatk4_worker_dir/
AI 代码解读

查看 metadata 文件:

bcs o ls oss://demo-bucket/cli/gatk4_outputs/
AI 代码解读

6. 如何分析 30X 的全基因组数据

A) 生成配置文件

执行上述步骤生成本示例时,会同时生成一个适用 30X 全基因组数据分析的配置:
  processing-for-variant-discovery-gatk4.hg38.wgs.inputs.30x.json
  haplotypecaller-gvcf-gatk4.hg38.wgs.inputs.30x.json

B) 修改 processing-for-variant-discovery-gatk4 配置文件

为分析 30X 样本,需要将 processing-for-variant-discovery-gatk4.hg38.wgs.inputs.30x.json 文件中的PreProcessingForVariantDiscovery_GATK4.flowcell_unmapped_bams_list 参数改为OSS 文件路径,该文件包括了需要分析的 30X 样本在 OSS 上的路径列表。

注意,30X 数据样本,格式为 unaligned BAM 文件。

C)修改 gatk4-data-processing 流程文件

找到 gatk4-data-processing 流程的 main.sh 文件,将其中的 --input_from_file_WORKFLOW_INPUTS 参数,修改为 src/processing-for-variant-discovery-gatk4.hg38.wgs.inputs.30x.json,加上 --timeout 172800 参数,并提交作业。

D) 修改 haplotypecaller-gvcf-gatk4 配置文件

将 haplotypecaller-gvcf-gatk4.hg38.wgs.inputs.30x.json 中的 HaplotypeCallerGvcf_GATK4.input_bam 参数修改为gatk4-data-processing 流程输出的 bam 文件路径。

将 HaplotypeCallerGvcf_GATK4.input_bam_index 参数修改为相应的索引文件路径。

E) 修改 gatk4-germline-snps-indels 流程文件

找到 gatk4-germline-snps-indels 流程的 main.sh,将其中的 --input_from_file_WORKFLOW_INPUTS 参数修改为 src/haplotypecaller-gvcf-gatk4.hg38.wgs.inputs.30x.json,加上 --timeout 172800 参数,并最后提交作业。

本文作者:阿里云批量计算团队
文章转自阿里云基因行业公众号,欢迎大家扫码关注

目录
相关文章
标准流程描述语言 WDL 阿里云最佳实践
WDL 作为全球基因组与健康联盟 (Global Alliance for Genomics and Health)支持的工作流描述语言,已经被越来越多的客户所采用。通过阿里云的 Cromwell 方案,用户可以本地开发测试WDL流程,再使用云计算强大的计算能力,来完成基因组学数据分析工作。
11081 3
|
4月前
数据知识产权登记服务上线了!
数据知识产权登记服务上线了!
103 1
|
8月前
|
Sentieon软件快速入门指南
Sentieon为纯CPU计算加速软件,完全适配主流CPU计算架构:Intel、AMD、海光等X86架构CPU,华为鲲鹏、阿里倚天等ARM架构CPU。可灵活部署在实验室单机工作站、HPC集群、超算中心和云计算中心,保持同一套流程下不同规模数据计算结果的一致性。Sentieon软件团队拥有丰富的软件开发及算法优化工程经验,致力于解决生物数据分析中的速度与准确度瓶颈,为来自于分子诊断、药物研发、临床医疗、人群队列、动植物等多个领域的合作伙伴提供高效精准的软件解决方案,共同推动基因技术的发展。
324 4
Sentieon软件快速入门指南
【Docker项目实战】使用Docker部署FileGator文件管理器
【4月更文挑战第17天】使用Docker部署FileGator文件管理器
361 2
AttributeError: module ‘numpy‘ has no attribute ‘int‘.
AttributeError: module ‘numpy‘ has no attribute ‘int‘.
505 0
深入Linux进程内核:揭开进程工作原理的神秘面纱
深入Linux进程内核:揭开进程工作原理的神秘面纱
480 0
Rust机器学习之Linfa
本文将带领大家用Linfa实现一个完整的Logistics回归,过程中带大家学习Linfa的基本用法。
1296 0
Rust机器学习之Linfa

热门文章

最新文章

AI助理

你好,我是AI助理

可以解答问题、推荐解决方案等

登录插画

登录以查看您的控制台资源

管理云资源
状态一览
快捷访问