diff --git a/modules.json b/modules.json index 3b8cab2..7e7ea07 100644 --- a/modules.json +++ b/modules.json @@ -43,7 +43,7 @@ }, "fastp": { "branch": "master", - "git_sha": "7e8ad566883449e7939062b5e2bcf53fc1e0002f", + "git_sha": "2c70c1c1951aaf884d2e8d8d9c871db79f7b35aa", "patch": "modules/nf-core/modules/fastp/fastp.diff" }, "fastqc": { diff --git a/modules/nf-core/modules/fastp/fastp.diff b/modules/nf-core/modules/fastp/fastp.diff deleted file mode 100644 index a05d486..0000000 --- a/modules/nf-core/modules/fastp/fastp.diff +++ /dev/null @@ -1,33 +0,0 @@ -Changes in module 'nf-core/modules/fastp' ---- modules/nf-core/modules/fastp/main.nf -+++ modules/nf-core/modules/fastp/main.nf -@@ -33,9 +33,8 @@ - def fail_fastq = save_trimmed_fail ? "--failed_out ${prefix}.fail.fastq.gz" : '' - """ - [ ! -f ${prefix}.fastq.gz ] && ln -sf $reads ${prefix}.fastq.gz -- cat ${prefix}.fastq.gz \\ -- | fastp \\ -- --stdin \\ -+ -+ fastp \\ - --stdout \\ - --in1 ${prefix}.fastq.gz \\ - --thread $task.cpus \\ -@@ -45,6 +44,7 @@ - $args \\ - 2> ${prefix}.fastp.log \\ - | gzip -c > ${prefix}.fastp.fastq.gz -+ - cat <<-END_VERSIONS > versions.yml - "${task.process}": - fastp: \$(fastp --version 2>&1 | sed -e "s/fastp //g") -@@ -69,6 +69,7 @@ - --detect_adapter_for_pe \\ - $args \\ - 2> ${prefix}.fastp.log -+ - - cat <<-END_VERSIONS > versions.yml - "${task.process}": - -************************************************************ diff --git a/modules/nf-core/modules/fastp/main.nf b/modules/nf-core/modules/fastp/main.nf index abbdbad..11ea4db 100644 --- a/modules/nf-core/modules/fastp/main.nf +++ b/modules/nf-core/modules/fastp/main.nf @@ -26,14 +26,14 @@ process FASTP { script: def args = task.ext.args ?: '' - // Added soft-links to original fastqs for consistent naming in MultiQC def prefix = task.ext.prefix ?: "${meta.id}" + def fail_fastq = save_trimmed_fail && meta.single_end ? "--failed_out ${prefix}.fail.fastq.gz" : save_trimmed_fail && !meta.single_end ? "--unpaired1 ${prefix}_1.fail.fastq.gz --unpaired2 ${prefix}_2.fail.fastq.gz" : '' + // Added soft-links to original fastqs for consistent naming in MultiQC // Use single ended for interleaved. Add --interleaved_in in config. - if (meta.single_end) { - def fail_fastq = save_trimmed_fail ? "--failed_out ${prefix}.fail.fastq.gz" : '' + if ( task.ext.args?.contains('--interleaved_in') ) { """ [ ! -f ${prefix}.fastq.gz ] && ln -sf $reads ${prefix}.fastq.gz - + fastp \\ --stdout \\ --in1 ${prefix}.fastq.gz \\ @@ -45,13 +45,32 @@ process FASTP { 2> ${prefix}.fastp.log \\ | gzip -c > ${prefix}.fastp.fastq.gz + cat <<-END_VERSIONS > versions.yml + "${task.process}": + fastp: \$(fastp --version 2>&1 | sed -e "s/fastp //g") + END_VERSIONS + """ + } else if (meta.single_end) { + """ + [ ! -f ${prefix}.fastq.gz ] && ln -sf $reads ${prefix}.fastq.gz + + fastp \\ + --stdout \\ + --in1 ${prefix}.fastq.gz \\ + --out1 ${prefix}.fastp.fastq.gz \\ + --thread $task.cpus \\ + --json ${prefix}.fastp.json \\ + --html ${prefix}.fastp.html \\ + $fail_fastq \\ + $args \\ + 2> ${prefix}.fastp.log + cat <<-END_VERSIONS > versions.yml "${task.process}": fastp: \$(fastp --version 2>&1 | sed -e "s/fastp //g") END_VERSIONS """ } else { - def fail_fastq = save_trimmed_fail ? "--unpaired1 ${prefix}_1.fail.fastq.gz --unpaired2 ${prefix}_2.fail.fastq.gz" : '' def merge_fastq = save_merged ? "-m --merged_out ${prefix}.merged.fastq.gz" : '' """ [ ! -f ${prefix}_1.fastq.gz ] && ln -sf ${reads[0]} ${prefix}_1.fastq.gz @@ -69,7 +88,6 @@ process FASTP { --detect_adapter_for_pe \\ $args \\ 2> ${prefix}.fastp.log - cat <<-END_VERSIONS > versions.yml "${task.process}": diff --git a/modules/nf-core/modules/fastp/meta.yml b/modules/nf-core/modules/fastp/meta.yml index 598c336..2368fde 100644 --- a/modules/nf-core/modules/fastp/meta.yml +++ b/modules/nf-core/modules/fastp/meta.yml @@ -21,7 +21,8 @@ input: type: file description: | List of input FastQ files of size 1 and 2 for single-end and paired-end data, - respectively. + respectively. If you wish to run interleaved paired-end data, supply as single-end data + but with `--interleaved_in` in your `modules.conf`'s `ext.args` for the module. - save_trimmed_fail: type: boolean description: Specify true to save files that failed to pass trimming thresholds ending in `*.fail.fastq.gz`