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.

43 lines
1.4KB

  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. # export SENTIEON_LICENSE=${SENTIEON_LICENSE}
  18. # nt=$(nproc)
  19. # ${SENTIEON_INSTALL_DIR}/bin/bwa mem -M -R "@RG\tID:${group}\tSM:${sample}\tPL:${pl}" -t $nt -K 10000000 ${ref_dir}/${fasta} ${fastq_1} ${fastq_2} | ${SENTIEON_INSTALL_DIR}/bin/sentieon util sort -o ${user_define_name}_${project}_${sample}.sorted.bam -t $nt --sam2bam -i -
  20. bwa mem -M -R "@RG\tID:${group}\tSM:${sample}\tPL:${pl}" -t $(nproc) -K 10000000 ${ref_dir}/${fasta} ${fastq_1} ${fastq_2} \
  21. | samtools view -bS -@ $(nproc) - \
  22. | samtools sort -@ $(nproc) -o ${user_define_name}_${project}_${sample}.sorted.bam -
  23. samtools index -@ $(nproc) \
  24. -o ${user_define_name}_${project}_${sample}.sorted.bam.bai \
  25. ${user_define_name}_${project}_${sample}.sorted.bam
  26. >>>
  27. runtime {
  28. docker:docker
  29. cluster: cluster_config
  30. systemDisk: "cloud_ssd 40"
  31. dataDisk: "cloud_ssd " + disk_size + " /cromwell_root/"
  32. }
  33. output {
  34. File sorted_bam = "${user_define_name}_${project}_${sample}.sorted.bam"
  35. File sorted_bam_index = "${user_define_name}_${project}_${sample}.sorted.bam.bai"
  36. }
  37. }