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.

60 lines
2.1KB

  1. task fastp {
  2. String sample_id
  3. File read
  4. String adapter_sequence
  5. String docker
  6. String cluster
  7. String disk_size
  8. String umi_loc
  9. Int trim_front1
  10. Int trim_tail1
  11. Int max_len1
  12. Int disable_adapter_trimming
  13. Int length_required
  14. Int umi_len
  15. Int UMI
  16. Int qualified_quality_phred
  17. Int length_required1
  18. Int disable_quality_filtering
  19. Int length_limit
  20. command <<<
  21. mkdir -p /cromwell_root/tmp/fastp/
  22. ##1.Disable_quality_filtering
  23. if [ "${disable_quality_filtering}" == 0 ]
  24. then
  25. cp ${read} /cromwell_root/tmp/fastp/{sample_id}.fastq.tmp1.gz
  26. else
  27. fastp --thread 4 --trim_front1 ${trim_front1} --trim_tail1 ${trim_tail1} --max_len1 ${max_len1} -i ${read} -o /cromwell_root/tmp/fastp/${sample_id}.fastq.tmp1.gz -j ${sample_id}.json -h ${sample_id}.html
  28. fi
  29. ##2.UMI
  30. if [ "${UMI}" == 0 ]
  31. then
  32. cp /cromwell_root/tmp/fastp/${sample_id}.fastq.tmp1.gz /cromwell_root/tmp/fastp/${sample_id}.fastq.tmp2.gz
  33. else
  34. fastp --thread 4 -U --umi_loc=${umi_loc} --umi_len=${umi_len} --trim_front1 ${trim_front1} --trim_tail1 ${trim_tail1} --max_len1 ${max_len1} -i /cromwell_root/tmp/fastp/${sample_id}.fastq.tmp1.gz -o /cromwell_root/tmp/fastp/${sample_id}.fastq.tmp2.gz -j ${sample_id}.json -h ${sample_id}.html
  35. fi
  36. ##3.Trim
  37. if [ "${disable_adapter_trimming}" == 0 ]
  38. then
  39. fastp --thread 4 -l ${length_required} -q ${qualified_quality_phred} -u ${length_required1} --adapter_sequence ${adapter_sequence} --length_limit ${length_limit} --trim_front1 ${trim_front1} --trim_tail1 ${trim_tail1} -i /cromwell_root/tmp/fastp/${sample_id}.fastq.tmp2.gz -o ${sample_id}.fastq.gz -j ${sample_id}.json -h ${sample_id}.html
  40. else
  41. cp /cromwell_root/tmp/fastp/${sample_id}.fastq.tmp2.gz ${sample_id}.fastq.gz
  42. fi
  43. >>>
  44. runtime {
  45. docker: docker
  46. cluster: cluster
  47. systemDisk: "cloud_ssd 40"
  48. dataDisk: "cloud_ssd " + disk_size + " /cromwell_root/"
  49. }
  50. output {
  51. File json = "${sample_id}.json"
  52. File report = "${sample_id}.html"
  53. File Trim = "${sample_id}.fastq.gz"
  54. }
  55. }