57 lines
1.5 KiB
Plaintext
57 lines
1.5 KiB
Plaintext
|
|
task runstatistics {
|
||
|
|
String name
|
||
|
|
String outputDir
|
||
|
|
String rmdupBam
|
||
|
|
|
||
|
|
String ref
|
||
|
|
String codesDir
|
||
|
|
String bed
|
||
|
|
|
||
|
|
command <<<
|
||
|
|
|
||
|
|
if [ ! -d ${outputDir}/qc/${name}_bamdst ];then
|
||
|
|
mkdir -p ${outputDir}/qc/${name}_bamdst
|
||
|
|
fi
|
||
|
|
|
||
|
|
samtools flagstat -@ 10 ${rmdupBam} >${outputDir}/qc/${name}.rmdup.flagstat
|
||
|
|
samtools stats --reference ${ref} -t ${bed} -@ 10 ${rmdupBam} > ${outputDir}/qc/${name}.rmdup.stat
|
||
|
|
bamdst -p ${bed} -o ${outputDir}/qc/${name}_bamdst ${rmdupBam}
|
||
|
|
|
||
|
|
Rscript ${codesDir}/InsertAndDepthStat.R \
|
||
|
|
${outputDir}/qc/${name}_InsertAndDepthStat \
|
||
|
|
${outputDir}/qc/${name}_bamdst/insertsize.plot \
|
||
|
|
${outputDir}/qc/${name}_bamdst/depth_distribution.plot
|
||
|
|
>>>
|
||
|
|
}
|
||
|
|
|
||
|
|
workflow statistics {
|
||
|
|
|
||
|
|
String tumor
|
||
|
|
String tumor_rmdupBam
|
||
|
|
|
||
|
|
String? normal
|
||
|
|
String? normal_rmdupBam
|
||
|
|
|
||
|
|
String ref
|
||
|
|
String bed
|
||
|
|
String outputDir
|
||
|
|
String codesDir
|
||
|
|
|
||
|
|
scatter(name in [tumor, normal]) {
|
||
|
|
if (defined(name)) {
|
||
|
|
call runstatistics {
|
||
|
|
input:
|
||
|
|
name=name,
|
||
|
|
outputDir=outputDir,
|
||
|
|
rmdupBam=if name==tumor then tumor_rmdupBam else normal_rmdupBam,
|
||
|
|
ref=ref,
|
||
|
|
codesDir=codesDir,
|
||
|
|
bed=bed
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
output {
|
||
|
|
String tumor_bamdst_depth = "${outputDir}/qc/${tumor}_bamdst/depth.tsv.gz"
|
||
|
|
}
|
||
|
|
}
|