pipeline/wdl/statistics.wdl

54 lines
1.4 KiB
Plaintext
Raw Normal View History

2023-08-29 10:31:06 +08:00
task runstatistics {
String name
2023-10-18 15:59:11 +08:00
String output_dir
2023-08-29 10:31:06 +08:00
String rmdupBam
String ref
String bed
command <<<
2023-10-18 15:59:11 +08:00
if [ ! -d ${output_dir}/qc/${name}_bamdst ];then
mkdir -p ${output_dir}/qc/${name}_bamdst
2023-08-29 10:31:06 +08:00
fi
2023-10-18 15:59:11 +08:00
samtools flagstat -@ 10 ${rmdupBam} >${output_dir}/qc/${name}.rmdup.flagstat
samtools stats --reference ${ref} -t ${bed} -@ 10 ${rmdupBam} > ${output_dir}/qc/${name}.rmdup.stat
bamdst -p ${bed} -o ${output_dir}/qc/${name}_bamdst ${rmdupBam}
#
# InsertAndDepthStat.R \
# ${output_dir}/qc/${name}_InsertAndDepthStat \
# ${output_dir}/qc/${name}_bamdst/insertsize.plot \
# ${output_dir}/qc/${name}_bamdst/depth_distribution.plot
2023-08-29 10:31:06 +08:00
>>>
}
workflow statistics {
String tumor
2023-10-18 15:59:11 +08:00
String tumor_rmdup_bam
2023-08-29 10:31:06 +08:00
String? normal
2023-10-18 15:59:11 +08:00
String? normal_rmdup_bam
2023-08-29 10:31:06 +08:00
String ref
String bed
2023-10-18 15:59:11 +08:00
String output_dir
2023-08-29 10:31:06 +08:00
scatter(name in [tumor, normal]) {
if (defined(name)) {
call runstatistics {
input:
name=name,
2023-10-18 15:59:11 +08:00
output_dir=output_dir,
rmdupBam=if name==tumor then tumor_rmdup_bam else normal_rmdup_bam,
2023-08-29 10:31:06 +08:00
ref=ref,
bed=bed
}
}
}
output {
2023-10-18 15:59:11 +08:00
String tumor_bamdst_depth = "${output_dir}/qc/${tumor}_bamdst/depth.tsv.gz"
2023-08-29 10:31:06 +08:00
}
}