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.

79 lines
3.1KB

  1. task fastp {
  2. String sample_id
  3. File read1
  4. File read2
  5. String adapter_sequence
  6. String adapter_sequence_r2
  7. String docker
  8. String cluster
  9. String umi_loc
  10. Int trim_front1
  11. Int trim_tail1
  12. Int max_len1
  13. Int trim_front2
  14. Int trim_tail2
  15. Int max_len2
  16. Int disable_adapter_trimming
  17. Int length_required
  18. Int umi_len
  19. Int UMI
  20. Int qualified_quality_phred
  21. Int length_required1
  22. Int disable_quality_filtering
  23. command <<<
  24. mkdir -p /cromwell_root/tmp/fastp/
  25. ##1.Disable_quality_filtering
  26. if [ ${disable_quality_filtering} -gt 0 ]
  27. then
  28. cp ${read1} /cromwell_root/tmp/fastp/{sample_id}_R1.fastq.tmp1.gz
  29. cp ${read2} /cromwell_root/tmp/fastp/{sample_id}_R2.fastq.tmp1.gz
  30. else
  31. fastp --thread 4 --trim_front1 ${trim_front1} --trim_tail1 ${trim_tail1} --max_len1 ${max_len1} --trim_front2 ${trim_front2} --trim_tail2 ${trim_tail2} --max_len2 ${max_len2} -i ${read1} -I ${read2} -o /cromwell_root/tmp/fastp/${sample_id}_R1.fastq.tmp1.gz -O /cromwell_root/tmp/fastp/${sample_id}_R2.fastq.tmp1.gz -j ${sample_id}.json -h ${sample_id}.html
  32. fi
  33. ##2.UMI
  34. if [ ${UMI} -gt 0 ]
  35. then
  36. cp /cromwell_root/tmp/fastp/${sample_id}_R1.fastq.tmp1.gz /cromwell_root/tmp/fastp/${sample_id}_R1.fastq.tmp2.gz
  37. cp /cromwell_root/tmp/fastp/${sample_id}_R2.fastq.tmp1.gz /cromwell_root/tmp/fastp/${sample_id}_R2.fastq.tmp2.gz
  38. else
  39. fastp --thread 4 -U --umi_loc=${umi_loc} --umi_len=${umi_len} --trim_front1 ${trim_front1} --trim_tail1 ${trim_tail1} --max_len1 ${max_len1} --trim_front2 ${trim_front2} --trim_tail2 ${trim_tail2} --max_len2 ${max_len2} -i /cromwell_root/tmp/fastp/${sample_id}_R1.fastq.tmp1.gz -I /cromwell_root/tmp/fastp/${sample_id}_R2.fastq.tmp1.gz -o /cromwell_root/tmp/fastp/${sample_id}_R1.fastq.tmp2.gz -O /cromwell_root/tmp/fastp/${sample_id}_R2.fastq.tmp2.gz -j ${sample_id}.json -h ${sample_id}.html
  40. fi
  41. ##3.Trim
  42. if [ ${disable_adapter_trimming} -gt 0 ]
  43. then
  44. fastp --thread 4 -l ${length_required} -q ${qualified_quality_phred} -u ${length_required1} /
  45. --adapter_sequence ${adapter_sequence} --adapter_sequence_r2 ${adapter_sequence_r2} /
  46. --detect_adapter_for_pe /
  47. --trim_front1 ${trim_front1} --trim_tail1 ${trim_tail1} /
  48. --max_len1 ${max_len1} --trim_front2 ${trim_front2} /
  49. --trim_tail2 ${trim_tail2} --max_len2 ${max_len2} /
  50. -i /cromwell_root/tmp/fastp/${sample_id}_R1.fastq.tmp2.gz -I /cromwell_root/tmp/fastp/${sample_id}_R2.fastq.tmp2.gz /
  51. -o ${sample_id}_R1.fastq.gz -O ${sample_id}_R2.fastq.gz /
  52. -j ${sample_id}.json -h ${sample_id}.html
  53. else
  54. cp /cromwell_root/tmp/fastp/${sample_id}_R1.fastq.tmp2.gz ${sample_id}_R1.fastq.gz
  55. cp /cromwell_root/tmp/fastp/${sample_id}_R2.fastq.tmp2.gz ${sample_id}_R2.fastq.gz
  56. fi
  57. >>>
  58. runtime {
  59. docker: docker
  60. cluster: cluster
  61. systemDisk: "cloud_ssd 40"
  62. dataDisk: "cloud_ssd 200 /cromwell_root/"
  63. }
  64. output {
  65. File json = "${sample_id}.json"
  66. File report = "${sample_id}.html"
  67. File Trim_R1 = "${sample_id}_R1.fastq.gz"
  68. File Trim_R2 = "${sample_id}_R2.fastq.gz"
  69. }
  70. }