@@ -1,12 +1,15 @@ | |||
{ | |||
"{{ project_name }}.Dedup_bam": "{{ Dedup_bam }}", | |||
"{{ project_name }}.fasta": "GRCh38.d1.vd1.fa", | |||
"{{ project_name }}.dedup_bam_index": "{{ dedup_bam_index }}", | |||
"{{ project_name }}.disk_size": "500", | |||
"{{ project_name }}.ref_fa_fai": "GRCh38.d1.vd1.fa.fai", | |||
"{{ project_name }}.FBdocker": "registry-vpc.cn-shanghai.aliyuncs.com/pgx-docker-registry/freebayes:1.3.1", | |||
"{{ project_name }}.mapper": "{{ mapper }}", | |||
"{{ project_name }}.sample_name": "{{ sample_name }}", | |||
"{{ project_name }}.half_read_length": "{{ half_read_length }}", | |||
"{{ project_name }}.breakChromo.docker": "registry-vpc.cn-shanghai.aliyuncs.com/pgx-docker-registry/samtools:v1.3.1", | |||
"{{ project_name }}.dedup_bam": "{{ dedup_bam }}", | |||
"{{ project_name }}.chromosomes": "Array[String] (optional, default = [\"chr1\", \"chr2\", \"chr3\", \"chr4\", \"chr5\", \"chr6\", \"chr7\", \"chr8\", \"chr9\", \"chr10\", \"chr11\", \"chr12\", \"chr13\", \"chr14\", \"chr15\", \"chr16\", \"chr17\", \"chr18\", \"chr19\", \"chr20\", \"chr21\", \"chr22\", \"chrX\"])", | |||
"{{ project_name }}.cluster_config": "OnDemand bcs.es.c.8xlarge img-ubuntu-vpc", | |||
"{{ project_name }}.Dedup_bam_index": "{{ Dedup_bam_index }}", | |||
"{{ project_name }}.sample": "{{ sample }}", | |||
"{{ project_name }}.concatVCF.docker": "registry-vpc.cn-shanghai.aliyuncs.com/pgx-docker-registry/bcftools:v1.9", | |||
"{{ project_name }}.freebayes.docker": "registry-vpc.cn-shanghai.aliyuncs.com/pgx-docker-registry/freebayes:1.3.1", | |||
"{{ project_name }}.ref_dir": "oss://chinese-quartet/quartet-storage-data/reference_data/" | |||
} | |||
} |
@@ -1,13 +1,13 @@ | |||
task Freebayes { | |||
task freebayes { | |||
File ref_dir | |||
File ref_fa_fai | |||
File fasta | |||
File Dedup_bam | |||
File Dedup_bam_index | |||
File chr_bam | |||
File chr_bam_bai | |||
String chromosome | |||
String half_read_length | |||
String sample | |||
String FBdocker | |||
String sample_name | |||
String docker | |||
String cluster_config | |||
String disk_size | |||
@@ -15,18 +15,16 @@ task Freebayes { | |||
set -o pipefail | |||
set -e | |||
nt=$(nproc) | |||
/opt/freebayes/scripts/freebayes-parallel <(/opt/freebayes/scripts/fasta_generate_regions.py ${ref_dir}/${ref_fa_fai} 100000) $nt -f ${ref_dir}/${fasta} --genotype-qualities -F 0.05 --max-complex-gap ${half_read_length} ${Dedup_bam} > ${sample}_fb.vcf | |||
cat ${sample}_fb.vcf | grep '#' > header | |||
cat ${sample}_fb.vcf | grep -v '#' | grep -v '0/0' | cat header - > ${sample}_fb.filtered.vcf | |||
freebayes -f ${ref_dir}/${fasta} --genotype-qualities --max-complex-gap ${half_read_length} ${chr_bam} > ${sample_name}_${chromosome}_fb.vcf | |||
>>> | |||
runtime { | |||
docker:FBdocker | |||
docker: docker | |||
cluster: cluster_config | |||
systemDisk: "cloud_ssd 40" | |||
dataDisk: "cloud_ssd " + disk_size + " /cromwell_root/" | |||
} | |||
output { | |||
File filtered = "${sample}_fb.filtered.vcf" | |||
File vcf = "${sample_name}_${chromosome}_fb.vcf" | |||
} | |||
} |
@@ -0,0 +1,33 @@ | |||
task Freebayes { | |||
File ref_dir | |||
File ref_fa_fai | |||
File fasta | |||
File Dedup_bam | |||
File Dedup_bam_index | |||
String half_read_length | |||
String sample | |||
String FBdocker | |||
String cluster_config | |||
String disk_size | |||
command <<< | |||
set -o pipefail | |||
set -e | |||
nt=$(nproc) | |||
/opt/freebayes/scripts/freebayes-parallel <(/opt/freebayes/scripts/fasta_generate_regions.py ${ref_dir}/${ref_fa_fai} 100000) $nt -f ${ref_dir}/${fasta} --genotype-qualities -F 0.05 --max-complex-gap ${half_read_length} ${Dedup_bam} > ${sample}_fb.vcf | |||
cat ${sample}_fb.vcf | grep '#' > header | |||
cat ${sample}_fb.vcf | grep -v '#' | grep -v '0/0' | cat header - > ${sample}_fb.filtered.vcf | |||
>>> | |||
runtime { | |||
docker:FBdocker | |||
cluster: cluster_config | |||
systemDisk: "cloud_ssd 40" | |||
dataDisk: "cloud_ssd " + disk_size + " /cromwell_root/" | |||
} | |||
output { | |||
File filtered = "${sample}_fb.filtered.vcf" | |||
} | |||
} |
@@ -0,0 +1,28 @@ | |||
task breakChromo { | |||
File dedup_bam | |||
File dedup_bam_index | |||
String chromosome | |||
String sample_name | |||
String docker | |||
String cluster_config | |||
String disk_size | |||
command <<< | |||
set -o pipefail | |||
set -e | |||
nt=$(nproc) | |||
/opt/conda/bin/samtools view -@ $nt -hb ${dedup_bam} ${chromosome} > ${sample_name}_${chromosome}.bam | |||
/opt/conda/bin/samtools index ${sample_name}_${chromosome}.bam | |||
>>> | |||
runtime { | |||
docker: docker | |||
cluster: cluster_config | |||
systemDisk: "cloud_ssd 40" | |||
dataDisk: "cloud_ssd " + disk_size + " /cromwell_root/" | |||
} | |||
output { | |||
File chr_bam = "${sample_name}_${chromosome}.bam" | |||
File chr_bam_bai = "samtools index ${sample_name}_${chromosome}.bam.bai" | |||
} | |||
} |
@@ -0,0 +1,25 @@ | |||
task concatVCF { | |||
Array[File] vcf | |||
String mapper | |||
String sample_name | |||
String docker | |||
String cluster_config | |||
String disk_size | |||
command <<< | |||
set -o pipefail | |||
set -e | |||
/opt/hall-lab/bcftools-1.9/bin/bcftools concat -a ${sep=" " vcf} > ${sample_name}.${mapper}.fb.vcf | |||
>>> | |||
runtime { | |||
docker: docker | |||
cluster: cluster_config | |||
systemDisk: "cloud_ssd 40" | |||
dataDisk: "cloud_ssd " + disk_size + " /cromwell_root/" | |||
} | |||
output { | |||
File filtered = "${sample_name}.${mapper}.fb.vcf" | |||
} | |||
} |
@@ -1,31 +1,49 @@ | |||
import "./tasks/Freebayes.wdl" as Freebayes | |||
import "./tasks/breakChromo.wdl" as breakChromo | |||
import "./tasks/freebayes.wdl" as freebayes | |||
import "./tasks/concatVCF.wdl" as concatVCF | |||
workflow {{ project_name }} { | |||
String sample | |||
String FBdocker | |||
File ref_fa_fai | |||
File fasta | |||
File Dedup_bam | |||
File Dedup_bam_index | |||
File dedup_bam | |||
File dedup_bam_index | |||
Array[String] chromosomes = ["chr1" , "chr2" , "chr3" , "chr4" , "chr5" , "chr6" , "chr7" , "chr8" , "chr9" , "chr10" , "chr11" , "chr12" , "chr13" , "chr14" , "chr15" , "chr16" , "chr17" , "chr18" , "chr19" , "chr20" , "chr21" , "chr22" , "chrX"] | |||
File ref_dir | |||
String mapper | |||
String fasta | |||
String half_read_length | |||
String sample_name | |||
String disk_size | |||
String cluster_config | |||
call Freebayes.Freebayes as Freebayes { | |||
scatter (chromosome in chromosomes){ | |||
call breakChromo.breakChromo as breakChromo { | |||
input: | |||
dedup_bam=dedup_bam, | |||
dedup_bam_index=dedup_bam_index, | |||
chromosome=chromosome, | |||
sample_name=sample_name, | |||
cluster_config=cluster_config, | |||
disk_size=disk_size | |||
} | |||
call freebayes.freebayes as freebayes { | |||
input: | |||
ref_dir=ref_dir, | |||
fasta=fasta, | |||
chr_bam=breakChromo.chr_bam, | |||
chr_bam_bai=breakChromo.chr_bam_bai, | |||
chromosome=chromosome, | |||
half_read_length=half_read_length, | |||
sample_name=sample_name, | |||
cluster_config=cluster_config, | |||
disk_size=disk_size | |||
} | |||
} | |||
call concatVCF.concatVCF as concatVCF{ | |||
input: | |||
fasta=fasta, | |||
ref_dir=ref_dir, | |||
Dedup_bam=Dedup_bam, | |||
Dedup_bam_index=Dedup_bam_index, | |||
sample=sample, | |||
half_read_length=half_read_length, | |||
FBdocker=FBdocker, | |||
vcf=freebayes.vcf, | |||
mapper=mapper, | |||
sample_name=sample_name, | |||
cluster_config=cluster_config, | |||
disk_size=disk_size, | |||
ref_fa_fai=ref_fa_fai | |||
} | |||
disk_size=disk_size | |||
} | |||
} | |||