"fasta": "oss://pgx-reference-data/GRCh38.d1.vd1/GRCh38.d1.vd1.fa", | "fasta": "oss://pgx-reference-data/GRCh38.d1.vd1/GRCh38.d1.vd1.fa", | ||||
"faidx": "oss://pgx-reference-data/GRCh38.d1.vd1/GRCh38.d1.vd1.fa.fai", | "faidx": "oss://pgx-reference-data/GRCh38.d1.vd1/GRCh38.d1.vd1.fa.fai", | ||||
"docker": "registry.cn-shanghai.aliyuncs.com/pgx-docker-registry/cnvkit:0.9.7", | "docker": "registry.cn-shanghai.aliyuncs.com/pgx-docker-registry/cnvkit:0.9.7", | ||||
"samtools_docker": "registry.cn-shanghai.aliyuncs.com/pgx-docker-registry/samtools:v1.3.1", | |||||
"samtools_cluster": "OnDemand bcs.a2.large img-ubuntu-vpc", | |||||
"disk_size": "400", | "disk_size": "400", | ||||
"cluster_config": "OnDemand bcs.a2.7xlarge img-ubuntu-vpc", | "cluster_config": "OnDemand bcs.a2.7xlarge img-ubuntu-vpc", | ||||
"bed": "oss://pgx-reference-data/bed/hg38/Exome-Agilent_V6_chr.bed", | "bed": "oss://pgx-reference-data/bed/hg38/Exome-Agilent_V6_chr.bed", |
{ | { | ||||
"{{ project_name }}.sample_id": "{{ sample_id }}", | "{{ project_name }}.sample_id": "{{ sample_id }}", | ||||
"{{ project_name }}.normal_bam": {{ normal_bam | tojson }}, | "{{ project_name }}.normal_bam": {{ normal_bam | tojson }}, | ||||
"{{ project_name }}.normal_bai": {{ normal_bai | tojson }}, | |||||
"{{ project_name }}.tumor_bam": {{ tumor_bam | tojson }}, | "{{ project_name }}.tumor_bam": {{ tumor_bam | tojson }}, | ||||
"{{ project_name }}.tumor_bai": {{ tumor_bai | tojson }}, | |||||
"{{ project_name }}.fasta": "{{ fasta }}", | "{{ project_name }}.fasta": "{{ fasta }}", | ||||
"{{ project_name }}.faidx": "{{ faidx }}", | "{{ project_name }}.faidx": "{{ faidx }}", | ||||
"{{ project_name }}.ref_flat": "{{ ref_flat }}", | "{{ project_name }}.ref_flat": "{{ ref_flat }}", | ||||
"{{ project_name }}.method": "{{ method }}", | "{{ project_name }}.method": "{{ method }}", | ||||
"{{ project_name }}.segment_method": "{{ segment_method }}", | "{{ project_name }}.segment_method": "{{ segment_method }}", | ||||
"{{ project_name }}.reference": "{{ reference }}", | "{{ project_name }}.reference": "{{ reference }}", | ||||
"{{ project_name }}.samtools_docker": "{{ samtools_docker }}", | |||||
"{{ project_name }}.samtools_cluster": "{{ samtools_cluster }}", | |||||
"{{ project_name }}.docker": "{{ docker }}", | "{{ project_name }}.docker": "{{ docker }}", | ||||
"{{ project_name }}.bed": "{{ bed }}", | "{{ project_name }}.bed": "{{ bed }}", | ||||
"{{ project_name }}.disk_size": "{{ disk_size }}", | "{{ project_name }}.disk_size": "{{ disk_size }}", |
task batch { | task batch { | ||||
String sample_id | String sample_id | ||||
Array[File] tumor_bam | Array[File] tumor_bam | ||||
Array[File] tumor_bai | |||||
Array[File] normal_bam | Array[File] normal_bam | ||||
Array[File] normal_bai | |||||
Array[File] bam_index | |||||
File bed | File bed | ||||
File faidx | File faidx | ||||
File fasta | File fasta | ||||
command <<< | command <<< | ||||
set -o pipefail | set -o pipefail | ||||
set -e | set -e | ||||
nt=$(nproc) | |||||
mkdir -p /cromwell_root/tmp/cnvkit | mkdir -p /cromwell_root/tmp/cnvkit | ||||
cp ${sep=' ' normal_bai} /cromwell_root/tmp/cnvkit | |||||
cp ${sep=' ' tumor_bai} /cromwell_root/tmp/cnvkit | |||||
cp -r ${sep=" " bam_index} /cromwell_root/tmp/cnvkit | |||||
# must exist parameters | # must exist parameters | ||||
cp ${fasta} /cromwell_root/tmp/cnvkit/hg38.fa | cp ${fasta} /cromwell_root/tmp/cnvkit/hg38.fa | ||||
cp ${faidx} /cromwell_root/tmp/cnvkit/hg38.fai | cp ${faidx} /cromwell_root/tmp/cnvkit/hg38.fai | ||||
cp ${bed} /cromwell_root/tmp/cnvkit/target.bed | cp ${bed} /cromwell_root/tmp/cnvkit/target.bed | ||||
cp ${access_bed} /cromwell_root/tmp/cnvkit/access-mappable.bed | cp ${access_bed} /cromwell_root/tmp/cnvkit/access-mappable.bed | ||||
# optional parameters | # optional parameters | ||||
if [ ${ref_flat} != "" ]; then cp ${ref_flat} /cromwell_root/tmp/cnvkit/ref_flat.txt; fi | if [ ${ref_flat} != "" ]; then cp ${ref_flat} /cromwell_root/tmp/cnvkit/ref_flat.txt; fi | ||||
if [ ${reference} != "" ]; then cp ${reference} /cromwell_root/tmp/cnvkit/my_reference.cnn; fi | if [ ${reference} != "" ]; then cp ${reference} /cromwell_root/tmp/cnvkit/my_reference.cnn; fi | ||||
cd /cromwell_root/tmp/cnvkit | cd /cromwell_root/tmp/cnvkit | ||||
mkdir results | mkdir results | ||||
cnvkit.py batch ${sep=' ' tumor_bam} --normal ${sep=' ' normal_bam} \ | |||||
cnvkit.py batch -p $nt ${sep=' ' tumor_bam} --normal ${sep=' ' normal_bam} \ | |||||
--method ${method} --segment-method ${segment_method} \ | --method ${method} --segment-method ${segment_method} \ | ||||
--targets target.bed ${access_opt} ${annotate_opt} \ | --targets target.bed ${access_opt} ${annotate_opt} \ | ||||
--fasta hg38.fa ${reference_opt} \ | --fasta hg38.fa ${reference_opt} \ |
task samtools { | |||||
Array[File] tumor_bam | |||||
Array[File] normal_bam | |||||
String docker | |||||
String cluster | |||||
String disk_size | |||||
command <<< | |||||
set -o pipefail | |||||
set -e | |||||
nt=$(nproc) | |||||
mkdir -p /cromwell_root/tmp/samtools | |||||
cd /cromwell_root/tmp/samtools | |||||
/opt/conda/bin/samtools -@ $nt index ${sep=' ' tumor_bam} | |||||
/opt/conda/bin/samtools -@ $nt index ${sep=' ' normal_bam} | |||||
>>> | |||||
runtime { | |||||
docker: docker | |||||
cluster: cluster | |||||
systemDisk: "cloud_ssd 40" | |||||
dataDisk: "cloud_ssd " + disk_size + " /cromwell_root/" | |||||
} | |||||
output { | |||||
Array[File] bam_index = glob("/cromwell_root/tmp/samtools/*bai") | |||||
} | |||||
} |
import "./tasks/access.wdl" as access | import "./tasks/access.wdl" as access | ||||
import "./tasks/samtools.wdl" as samtools | |||||
import "./tasks/batch.wdl" as batch | import "./tasks/batch.wdl" as batch | ||||
import "./tasks/export.wdl" as export | import "./tasks/export.wdl" as export | ||||
workflow {{ project_name }} { | workflow {{ project_name }} { | ||||
String sample_id | String sample_id | ||||
Array[File] tumor_bam | Array[File] tumor_bam | ||||
Array[File] tumor_bai | |||||
Array[File] normal_bam | Array[File] normal_bam | ||||
Array[File] normal_bai | |||||
File bed | File bed | ||||
File faidx | File faidx | ||||
File fasta | File fasta | ||||
disk_size = disk_size | disk_size = disk_size | ||||
} | } | ||||
call samtools.samtools as samtools { | |||||
input: | |||||
tumor_bam = tumor_bam, | |||||
normal_bam = normal_bam, | |||||
docker=samtools_docker, | |||||
cluster=samtools_cluster, | |||||
disk_size=disk_size | |||||
} | |||||
call batch.batch as batch { | call batch.batch as batch { | ||||
input: | input: | ||||
sample_id = sample_id, | sample_id = sample_id, | ||||
segment_method = segment_method, | segment_method = segment_method, | ||||
reference = reference, | reference = reference, | ||||
tumor_bam = tumor_bam, | tumor_bam = tumor_bam, | ||||
tumor_bai = tumor_bai, | |||||
normal_bam = normal_bam, | normal_bam = normal_bam, | ||||
normal_bai = normal_bai, | |||||
bam_index = samtools.bam_index, | |||||
bed = bed, | bed = bed, | ||||
access_bed = access.access_bed, | access_bed = access.access_bed, | ||||
docker = docker, | docker = docker, |