2023-12-19 13:37:52 +08:00
|
|
|
task run_statistics {
|
|
|
|
|
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}
|
|
|
|
|
qc_stat.py ${output_dir}/qc/${name}.json ${output_dir}/qc/${name}_bamdst/ ${output_dir}/qc/${name}_qc.txt
|
|
|
|
|
#
|
|
|
|
|
# InsertAndDepthStat.R \
|
|
|
|
|
# ${output_dir}/qc/${name}_InsertAndDepthStat \
|
|
|
|
|
# ${output_dir}/qc/${name}_bamdst/insertsize.plot \
|
|
|
|
|
# ${output_dir}/qc/${name}_bamdst/depth_distribution.plot
|
|
|
|
|
>>>
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
workflow statistics {
|
|
|
|
|
Boolean run=true
|
|
|
|
|
|
|
|
|
|
String tumor
|
|
|
|
|
String tumor_rmdup_bam
|
|
|
|
|
|
|
|
|
|
String? normal
|
|
|
|
|
String? normal_rmdup_bam
|
|
|
|
|
|
|
|
|
|
String ref
|
|
|
|
|
String bed
|
|
|
|
|
String output_dir
|
|
|
|
|
|
|
|
|
|
if (run) {
|
|
|
|
|
call run_statistics as runstatistics_tumor {
|
|
|
|
|
input:
|
|
|
|
|
name=tumor,
|
|
|
|
|
output_dir=output_dir,
|
|
|
|
|
rmdupBam=tumor_rmdup_bam,
|
|
|
|
|
ref=ref,
|
|
|
|
|
bed=bed
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (defined(normal)) {
|
|
|
|
|
call run_statistics as runstatistics_normal {
|
|
|
|
|
input:
|
|
|
|
|
name=normal,
|
|
|
|
|
output_dir=output_dir,
|
|
|
|
|
rmdupBam=normal_rmdup_bam,
|
|
|
|
|
ref=ref,
|
|
|
|
|
bed=bed
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
output {
|
|
|
|
|
String tumor_bamdst_depth = "${output_dir}/qc/${tumor}_bamdst/depth.tsv.gz"
|
|
|
|
|
}
|
2023-08-29 10:31:06 +08:00
|
|
|
}
|