diff --git a/src/nf_modules/fastp/main.nf b/src/nf_modules/fastp/main.nf index 8b26437596eaaac2f079dd2129b191ba470c079e..82f8d88062e982cd784f8673bc0267507dce3e69 100644 --- a/src/nf_modules/fastp/main.nf +++ b/src/nf_modules/fastp/main.nf @@ -1,6 +1,48 @@ version = "0.20.1" container_url = "lbmc/fastp:${version}" +process fastp { + container = "${container_url}" + label "big_mem_multi_cpus" + tag "$pair_id" + publishDir "results/QC/fastp/", mode: 'copy', pattern: "*.html" + + input: + tuple val(pair_id), path(reads) + + output: + tuple val(pair_id), path("*.fastq.gz"), emit: fastq + tuple val(pair_id), path("*.html"), emit: html + tuple val(pair_id), path("*.json"), emit: report + + script: +if (reads instanceof List) +""" +fastp --thread ${task.cpus} \ +--qualified_quality_phred 20 \ +--disable_length_filtering \ +--detect_adapter_for_pe \ +--in1 ${reads[0]} \ +--in2 ${reads[1]} \ +--out1 ${pair_id}_R1_trim.fastq.gz \ +--out2 ${pair_id}_R2_trim.fastq.gz \ +--html ${pair_id}.html \ +--json ${pair_id}_fastp.json \ +--report_title ${pair_id} +""" +else +""" +fastp --thread ${task.cpus} \ +--qualified_quality_phred 20 \ +--disable_length_filtering \ +--detect_adapter_for_pe \ +--in1 ${reads} \ +--out1 ${pair_id}_trim.fastq.gz \ +--html ${pair_id}.html \ +--json ${pair_id}_fastp.json \ +--report_title ${pair_id} +""" +} process fastp_pairedend { container = "${container_url}"