You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

split_gvcf_files.wdl 946B

3 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. task split_gvcf_files {
  2. File filtered_gvcf
  3. String project
  4. String docker
  5. String cluster_config
  6. String disk_size
  7. command <<<
  8. cat ${filtered_gvcf} | grep '#CHROM' | sed s'/\t/\n/g' > name
  9. ncol=`cat name | wc -l`
  10. sed -i '1,9d' name
  11. for i in $(seq 10 $ncol); do cat ${filtered_gvcf} | cut -f1-9,$i > $i.splited.vcf; done
  12. ls *splited.vcf | sort -n | paste - name > rename
  13. cat rename | while read a b
  14. do
  15. mv $a $b.splited.vcf
  16. sample=$(echo $b | cut -f6 -d_)
  17. rep=$(echo $b | cut -f7 -d_)
  18. echo $sample >> quartet_sample
  19. echo $rep >> quartet_rep
  20. done
  21. python /opt/how_many_samples.py -sample quartet_sample -rep quartet_rep
  22. >>>
  23. runtime {
  24. docker:docker
  25. cluster: cluster_config
  26. systemDisk: "cloud_ssd 40"
  27. dataDisk: "cloud_ssd " + disk_size + " /cromwell_root/"
  28. }
  29. output {
  30. Array[File] splited_vcf = glob("*.splited.vcf")
  31. File sister_tag = "sister_tag"
  32. File quartet_tag = "quartet_tag"
  33. }
  34. }