54 lines
1.4 KiB
Plaintext
54 lines
1.4 KiB
Plaintext
task runstatistics {
|
|
String name
|
|
String output_dir
|
|
String rmdupBam
|
|
|
|
String ref
|
|
String bed
|
|
|
|
command <<<
|
|
|
|
if [ ! -d ${output_dir}/qc/${name}_bamdst ];then
|
|
mkdir -p ${output_dir}/qc/${name}_bamdst
|
|
fi
|
|
|
|
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
|
|
>>>
|
|
}
|
|
|
|
workflow statistics {
|
|
|
|
String tumor
|
|
String tumor_rmdup_bam
|
|
|
|
String? normal
|
|
String? normal_rmdup_bam
|
|
|
|
String ref
|
|
String bed
|
|
String output_dir
|
|
|
|
scatter(name in [tumor, normal]) {
|
|
if (defined(name)) {
|
|
call runstatistics {
|
|
input:
|
|
name=name,
|
|
output_dir=output_dir,
|
|
rmdupBam=if name==tumor then tumor_rmdup_bam else normal_rmdup_bam,
|
|
ref=ref,
|
|
bed=bed
|
|
}
|
|
}
|
|
}
|
|
|
|
output {
|
|
String tumor_bamdst_depth = "${output_dir}/qc/${tumor}_bamdst/depth.tsv.gz"
|
|
}
|
|
} |