瀏覽代碼

上传文件至 'tasks'

master
meng 2 年之前
父節點
當前提交
2aff741731
共有 1 個檔案被更改,包括 66 行新增0 行删除
  1. +66
    -0
      tasks/CNVkit.wdl

+ 66
- 0
tasks/CNVkit.wdl 查看文件

@@ -0,0 +1,66 @@

task cnvkit{
String sample
File ref_dir
String fasta
File ref_flat
File tumor_bam
File tumor_bam_index
File? normal_bam
File? normal_bam_index
String docker
String cluster_config
String disk_size

command <<
set -o pipefail
set -e
nt=$(nproc)

cnvkit.py batch ${tumor_bam} \
-n ${normal_bam} \
-m wgs \
-f ${fasta} \
--annotate ${ref_flat}

cnvkit.py scatter ${sample}.cnr \
-s ${sample}.cns \
-o ${sample}_scatter.pdf

cnvkit.py diagram ${sample}.cnr \
-s ${sample}.call.cns \
-o ${sample}.diagram.pdf

cnvkit.py heatmap ${sample}.cnr ${sample}.call.cns \
-o ${sample}.heatmap.pdf

cnvkit.py genemetrics ${sample}.cnr -t 0.2 -m 3 -o ${sample}.ratio_cnv.txt

cnvkit.py genemetrics ${sample}.cnr -s ${sample}.call.cns -t 0.2 -m 3 -o ${sample}.segment_cnv.txt

cat WGS_IL_T_1.ratio_cnv.txt | tail -n+2 | cut -f1 | sort | uniq > ratio_cnv.txt
cat ${sample}.segment_cnv.txt | tail -n+2 | cut -f1 | sort | uniq > segment_cnv.txt
comm -12 ratio_cnv.txt segment_cnv.txt > ${sample}.trusted_genes.txt

awk 'NR==FNR {a[$1]=$2;next} NR!=FNR {if(FNR == 1 || (FNR != 1 && $1 in a)) print $0}' ${sample}.trusted_genes.txt WGS_IL_T_1.ratio_cnv.txt > ${sample}.ratio_cnv.trusted.txt
cnvkit.py call ${sample}.ratio_cnv.trusted.txt -m threshold -o ${sample}.ratio_cnv.call.txt
awk '{if ($6 != 2) print $0}' ${sample}.ratio_cnv.call.txt > ${sample}.ratio_cnv.call.filter.txt

ls ./

tar cvf ${sample}.tar ./

>>

runtime{
docker:docker
cluster:cluster_config
systemDisk:"cloud_ssd 40"
dataDisk:"cloud_ssd " + disk_size + " /cromwell_root/"
}

output{
File out_file = "${sample}.tar"
}

}

Loading…
取消
儲存