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.

68 line
2.6KB

  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. ##1.Disable_quality_filtering
  25. if [ ${disable_quality_filtering} -gt 0 ]
  26. then
  27. mv ${read1} {sample_id}_R1.fastq.tmp1.gz
  28. mv ${read2} {sample_id}_R2.fastq.tmp1.gz
  29. else
  30. 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 ${sample_id}_R1.fastq.tmp1.gz -O ${sample_id}_R2.fastq.tmp1.gz -j ${sample_id}.json -h ${sample_id}.html
  31. ##2.UMI
  32. if [ ${UMI} -gt 0 ]
  33. then
  34. mv ${sample_id}_R1.fastq.tmp1.gz ${sample_id}_R1.fastq.tmp2.gz
  35. mv ${sample_id}_R2.fastq.tmp1.gz ${sample_id}_R2.fastq.tmp2.gz
  36. else
  37. 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 ${sample_id}_R1.fastq.tmp1.gz -I ${sample_id}_R2.fastq.tmp1.gz -o ${sample_id}_R1.fastq.tmp2.gz -O ${sample_id}_R2.fastq.tmp2.gz -j ${sample_id}.json -h ${sample_id}.html
  38. ##3.Trim
  39. if [ ${disable_adapter_trimming} -gt 0 ]
  40. then
  41. fastp --thread 4 -l ${length_required} -q ${qualified_quality_phred} -u ${length_required1} --adapter_sequence ${adapter_sequence} --adapter_sequence_r2 ${adapter_sequence_r2} --detect_adapter_for_pe --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 ${sample_id}_R1.fastq.tmp2.gz -I ${sample_id}_R2.fastq.tmp2.gz -o ${sample_id}_R1.fastq.gz -O ${sample_id}_R2.fastq.gz -j ${sample_id}.json -h ${sample_id}.html
  42. else
  43. mv ${sample_id}_R1.fastq.tmp2.gz ${sample_id}_R1.fastq.gz
  44. mv ${sample_id}_R2.fastq.tmp2.gz ${sample_id}_R2.fastq.gz
  45. fi
  46. >>>
  47. runtime {
  48. docker: docker
  49. cluster: cluster
  50. systemDisk: "cloud_ssd 40"
  51. dataDisk: "cloud_ssd 200 /cromwell_root/"
  52. }
  53. output {
  54. File json = "${sample_id}.json"
  55. File report = "${sample_id}.html"
  56. File Trim_R1 = "${sample_id}_R1.fastq.gz"
  57. File Trim_R2 = "${sample_id}_R2.fastq.gz"
  58. }
  59. }