您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

variantsNorm.wdl 1.2KB

5 年前
5 年前
1234567891011121314151617181920212223242526272829303132333435
  1. task variantsNorm {
  2. File vcf
  3. File ref_dir
  4. String fasta
  5. String sampleName
  6. String docker
  7. String cluster_config
  8. String disk_size
  9. command <<<
  10. cat ${vcf} | grep '#' > header
  11. cat ${vcf} | grep -v '#' > body
  12. cat body | grep -w '^chr1\|^chr2\|^chr3\|^chr4\|^chr5\|^chr6\|^chr7\|^chr8\|^chr9\|^chr10\|^chr11\|^chr12\|^chr13\|^chr14\|^chr15\|^chr16\|^chr17\|^chr18\|^chr19\|^chr20\|^chr21\|^chr22\|^chrX' > body.filtered
  13. cat header body.filtered > ${sampleName}.filtered.vcf
  14. /opt/hall-lab/bcftools-1.9/bin/bcftools norm -f ${ref_dir}/${fasta} ${sampleName}.filtered.vcf > ${sampleName}.normed.vcf
  15. cat ${sampleName}.normed.vcf | grep -v '#' | cut -f8 | sed s'/MQ=/\t/g' | cut -f2 | sed s'/;/\t/g' | cut -f1 > MQ
  16. cat ${sampleName}.normed.vcf | grep -v '#' | awk '{print $1"\t"$2"\t"$3"\t"$4"\t"$5"\t"$6"\t"$7"\t"$8"\t"$9":MQ""\t"$10}' | paste - MQ -d ":" > body
  17. cat ${sampleName}.normed.vcf | grep '#' | cat - body > ${sampleName}.normed.mq.vcf
  18. >>>
  19. runtime {
  20. docker:docker
  21. cluster: cluster_config
  22. systemDisk: "cloud_ssd 40"
  23. dataDisk: "cloud_ssd " + disk_size + " /cromwell_root/"
  24. }
  25. output {
  26. File normed_vcf = "${sampleName}.normed.vcf"
  27. File normed_mq_vcf = "${sampleName}.normed.mq.vcf"
  28. }
  29. }