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.

40 lines
1.0KB

  1. task mapping {
  2. File ref_dir
  3. String fasta
  4. File fastq_1
  5. File fastq_2
  6. String group
  7. String sample
  8. String project
  9. String pl
  10. String user_define_name = sub(basename(fastq_1, "_R1.fastq.gz"), "_R1.fq.gz$", "")
  11. String docker
  12. String cluster_config
  13. String disk_size
  14. command <<<
  15. set -o pipefail
  16. set -e
  17. bwa mem -M -R "@RG\tID:${group}\tSM:${sample}\tPL:${pl}" -t $(nproc) -K 10000000 ${ref_dir}/${fasta} ${fastq_1} ${fastq_2} \
  18. | samtools view -bS -@ $(nproc) - \
  19. | samtools sort -@ $(nproc) -o ${user_define_name}_${project}_${sample}.sorted.bam -
  20. samtools index -@ $(nproc) \
  21. -o ${user_define_name}_${project}_${sample}.sorted.bam.bai \
  22. ${user_define_name}_${project}_${sample}.sorted.bam
  23. >>>
  24. runtime {
  25. docker:docker
  26. cluster: cluster_config
  27. systemDisk: "cloud_ssd 40"
  28. dataDisk: "cloud_ssd " + disk_size + " /cromwell_root/"
  29. }
  30. output {
  31. File sorted_bam = "${user_define_name}_${project}_${sample}.sorted.bam"
  32. File sorted_bam_index = "${user_define_name}_${project}_${sample}.sorted.bam.bai"
  33. }
  34. }