Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

6 лет назад
6 лет назад
6 лет назад
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163
  1. ## README
  2. **Author:** Huang Yechao
  3. **E-mail:**17210700095@fudan.edu.cn
  4. **Git:** http://choppy.3steps.cn/huangyechao/target-germline.git
  5. **Last Updates:** 16/1/2019
  6. **Description**
  7. > 本 APP 所构建的是用于二代测序目标区域测序 Germline 分析流程。使用的软件是[Sentieon](http://goldenhelix.com/products/sentieon/index.html):*A fast and accurate solution to variant calling from next-generation sequence data* 。本流程构建所使用的方法是基于流程语言WDL 并将其封装为[Choppy](http://docs.3steps.cn)平台上的APP进行使用。流程图如下所示:
  8. ![wes](assets/wes.png)
  9. 1. input:通常为二代目标区域测序所获得的fastq文件,通常包含两个数据文件`R1`和`R2`;此外还应当包含有测序时使用的 `bed` 文件
  10. 2. Mapping:将测序所得的数据与参考基因组进行比对,找到每一条read在参考基因组上的位置,将结果信息储存在**bam**文件中,并对获得的 **bam** 文件进行质控
  11. 3. Dedup:在制备文库的过程中,由于PCR扩增过程中会存在一些偏差,有的序列会被过量扩增。在比对的时候,这些过量扩增出来的完全相同的序列就会比对到基因组的相同位置。而这些过量扩增的reads并不是基因组自身固有序列,不能作为变异检测的证据,因此,要尽量去除这些由PCR扩增所形成的duplicates,并对去除重复之后的**bam**文件进行质控
  12. 4. Realigner: 将比对到 indel 附近的 reads 进行局部重新比对,将比对的错误率降到最低
  13. 5. BQSR:对bam文件里reads的碱基质量值进行重新校正,使最后输出的bam文件中reads中碱基的质量值能够更加接近真实的与参考基因组之间错配的概率
  14. 6. Haplotyer:变异检测,主要包括 **SNP** 和 **INDEL**
  15. ### APP 内容简介
  16. 1. `tasks`目录中分析流程中每一个步骤的 **WDL** 文件,如 `mapping.wdl` 如下所示
  17. ```bash
  18. task mapping {
  19. String fasta
  20. File ref_dir
  21. File fastq_1
  22. File fastq_2
  23. String SENTIEON_INSTALL_DIR
  24. String group
  25. String sample
  26. String pl
  27. String docker
  28. String cluster_config
  29. String disk_size
  30. command <<<
  31. set -o pipefail
  32. set -e
  33. export SENTIEON_LICENSE=192.168.0.55:8990
  34. nt=$(nproc)
  35. ${SENTIEON_INSTALL_DIR}/bin/bwa mem -M -R "@RG\tID:${group}\tSM:${sample}\tPL:${pl}" -t $nt ${ref_dir}/${fasta} ${fastq_1} ${fastq_2} | ${SENTIEON_INSTALL_DIR}/bin/sentieon util sort -o ${sample}.sorted.bam -t $nt --sam2bam -i -
  36. >>>
  37. runtime {
  38. dockerTag:docker
  39. cluster: cluster_config
  40. systemDisk: "cloud_ssd 40"
  41. dataDisk: "cloud_ssd " + disk_size + " /cromwell_root/"
  42. }
  43. output {
  44. File sorted_bam = "${sample}.sorted.bam"
  45. File sorted_bam_index = "${sample}.sorted.bam.bai"
  46. }
  47. }
  48. ```
  49. 2. `workflow.wdl` 是定义了每一个步骤的输入文件以及各个步骤之间的以来关系的文件:
  50. ```bash
  51. import "./tasks/mapping.wdl" as mapping
  52. import "./tasks/Metrics.wdl" as Metrics
  53. import "./tasks/Dedup.wdl" as Dedup
  54. import "./tasks/deduped_Metrics.wdl" as deduped_Metrics
  55. import "./tasks/Realigner.wdl" as Realigner
  56. import "./tasks/BQSR.wdl" as BQSR
  57. import "./tasks/Haplotyper.wdl" as Haplotyper
  58. workflow {{ project_name }} {
  59. File fastq_1
  60. File fastq_2
  61. String SENTIEON_INSTALL_DIR
  62. String sample
  63. String docker
  64. String fasta
  65. File ref_dir
  66. File dbmills_dir
  67. String db_mills
  68. File dbsnp_dir
  69. File region
  70. String dbsnp
  71. String disk_size
  72. String cluster_config
  73. call mapping.mapping as mapping {
  74. input:
  75. SENTIEON_INSTALL_DIR=SENTIEON_INSTALL_DIR,
  76. group=sample,
  77. sample=sample,
  78. pl="ILLUMINAL",
  79. fasta=fasta,
  80. ref_dir=ref_dir,
  81. fastq_1=fastq_1,
  82. fastq_2=fastq_2,
  83. docker=docker,
  84. disk_size=disk_size,
  85. cluster_config=cluster_config
  86. }
  87. call Metrics.Metrics as Metrics {
  88. input:
  89. SENTIEON_INSTALL_DIR=SENTIEON_INSTALL_DIR,
  90. fasta=fasta,
  91. ref_dir=ref_dir,
  92. sorted_bam=mapping.sorted_bam,
  93. sorted_bam_index=mapping.sorted_bam_index,
  94. sample=sample,
  95. docker=docker,
  96. disk_size=disk_size,
  97. cluster_config=cluster_config
  98. }
  99. ......
  100. ......
  101. }
  102. ```
  103. 其中文件最上面的 `import` 代表了所要使用的task文件,中间部分`File/String xxx` 表明了任务所传递出需要定义变量及其类型,`call`部分声明了流程的各个步骤及其依赖关系。(文档的具体说明详见[WDL](https://software.broadinstitute.org/wdl/documentation/spec#alternative-heredoc-syntax))
  104. 3. `input` 文件为整个 **APP** 运行时所要输入的参数,对于可以固定的参数可以直接在`input`文件中给出,对于需要改变的参数用`{{}}`进行引用,将会使得参数在 `samples` 文件中出现;其中`project_name`为所运行的任务的名称,需要在提交任务是进行定义
  105. ```bash
  106. {
  107. "{{ project_name }}.fasta": "GRCh38.d1.vd1.fa",
  108. "{{ project_name }}.ref_dir": "oss://pgx-reference-data/GRCh38.d1.vd1/",
  109. "{{ project_name }}.dbsnp": "dbsnp_146.hg38.vcf",
  110. "{{ project_name }}.fastq_1": "{{ read1 }}",
  111. "{{ project_name }}.SENTIEON_INSTALL_DIR": "/opt/sentieon-genomics",
  112. "{{ project_name }}.dbmills_dir": "oss://pgx-reference-data/GRCh38.d1.vd1/",
  113. "{{ project_name }}.db_mills": "Mills_and_1000G_gold_standard.indels.hg38.vcf",
  114. "{{ project_name }}.cluster_config": "{{ cluster if cluster != '' else 'OnDemand ecs.sn2ne.2xlarge img-ubuntu-vpc' }}",
  115. "{{ project_name }}.docker": "localhost:5000/sentieon-genomics:v2018.08.01 oss://pgx-docker-images/dockers",
  116. "{{ project_name }}.dbsnp_dir": "oss://pgx-reference-data/GRCh38.d1.vd1/",
  117. "{{ project_name }}.sample": "{{ sample_name }}",
  118. "{{ project_name }}.disk_size": "{{ disk_size }}",
  119. "{{ project_name }}.regions": "{{ regions }}",
  120. "{{ project_name }}.fastq_2": "{{ read2 }}"
  121. }
  122. ```
  123. > `{{ cluster if cluster != '' else 'OnDemand ecs.sn2ne.2xlarge img-ubuntu-vpc' }}`表示当没有指定`cluster` 的配置信息时,则默认使用 **ecs.sn2ne.2xlarge**
  124. 4. `sample.csv` 文件为提交任务时使用的输入文件,其内容是根据`input`文件中定义的信息对应生成的,也可使用 `Choppy` 的 `samples` 功能生成:
  125. ```bash
  126. choppy samples target-germline --output samples.csv
  127. ```
  128. ```bash
  129. #### samples.csv
  130. read1,read2,regions,sample_name,cluster,disk_size,sample_id
  131. ```
  132. 其中`sample_id`对应于所分析样本的索引号,用于生成当前样本提交时的任务信息,应注意不要包含`_`,否则会出现报错。
  133. 5. 提交任务
  134. ```bash
  135. choppy batch target-germline samples.csv --project-name your_project
  136. ```
  137. (更多使用信息,详见[Choppy使用说明](http://docs.3steps.cn))