@@ -4,6 +4,6 @@ | |||
"{{ project_name }}.docker": "registry-vpc.cn-shanghai.aliyuncs.com/pgx-docker-registry/samtools:v1.3.1", | |||
"{{ project_name }}.cluster_config": "OnDemand bcs.a2.large img-ubuntu-vpc", | |||
"{{ project_name }}.bam": "{{ bam }}", | |||
"{{ project_name }}.region": "{{ region }}", | |||
"{{ project_name }}.pos": "{{ pos_list.split(";") | tojson }}", | |||
"{{ project_name }}.sample": "{{ sample }}" | |||
} | |||
} |
@@ -2,17 +2,14 @@ task getBam { | |||
File bam | |||
File bam_idx | |||
String sample | |||
File region | |||
File pos | |||
String docker | |||
String cluster_config | |||
String disk_size | |||
command <<< | |||
cat ${region} | while read a | |||
do | |||
/opt/conda/bin/samtools view -b ${bam} "$a" > $a.${sample}.bam | |||
/opt/conda/bin/samtools index $a.${sample}.bam | |||
done | |||
/opt/conda/bin/samtools view ${bam} -H ${sep=" " pos} | /opt/conda/bin/samtools view -bS - | /opt/conda/bin/samtools sort > ${sample}.bam | |||
/opt/conda/bin/samtools index ${sample}.bam | |||
>>> | |||
runtime { | |||
@@ -22,7 +19,8 @@ task getBam { | |||
dataDisk: "cloud_ssd " + disk_size + " /cromwell_root/" | |||
} | |||
output { | |||
Array[File] region_bam = glob("*.bam") | |||
Array[File] region_bai = glob("*.bam.bai") | |||
File sub_bam = "${sample}.bam" | |||
File sub_bai = "${sample}.bam.bai" | |||
} | |||
} | |||
@@ -2,9 +2,10 @@ import "./tasks/getBam.wdl" as getBam | |||
workflow {{ project_name }} { | |||
File region | |||
File bam | |||
File bam_idx | |||
Array[String] pos | |||
String sample | |||
String docker | |||
String cluster_config | |||
@@ -15,7 +16,7 @@ workflow {{ project_name }} { | |||
bam=bam, | |||
bam_idx=bam_idx, | |||
sample=sample, | |||
region=region, | |||
pos=pos, | |||
docker=docker, | |||
cluster_config=cluster_config, | |||
disk_size=disk_size |