Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The parameter "save_trimmed=true" mistakenly activates merging mode of fastp #1452

Open
yxkwgp opened this issue Nov 14, 2024 · 0 comments
Open
Labels
bug Something isn't working

Comments

@yxkwgp
Copy link

yxkwgp commented Nov 14, 2024

Description of the bug

When using fastp as trimmer and "save_trimmed=true", the command of fastp includes "-m --mergedout XXX.merged.fastq.gz". This mode performs a stringent overlap analysis by default and changes output files, as mentioned in the documentation of fastp (https://github.com/OpenGene/fastp). This is inconsistent with the design of trimming modules and downstream modules.

This bug can be traced to line 175 in the "subworkflows/nf-core/fastq_qc_trim_filter_setstrandedness/main.nf". The parameter "save_trimmed" was passed into the FASTQ_FASTQC_UMITOOLS_FASTP workflow as "save_merged".
if (trimmer == 'fastp') { FASTQ_FASTQC_UMITOOLS_FASTP ( ch_filtered_reads, skip_fastqc, with_umi, skip_umi_extract, umi_discard_read, skip_trimming, [], save_trimmed, save_trimmed, min_trimmed_reads )
In "subworkflows/nf-core/fastq_fastqc_umitools_fastp/main.nf"
workflow FASTQ_FASTQC_UMITOOLS_FASTP { take: reads // channel: [ val(meta), [ reads ] ] skip_fastqc // boolean: true/false with_umi // boolean: true/false skip_umi_extract // boolean: true/false umi_discard_read // integer: 0, 1 or 2 skip_trimming // boolean: true/false adapter_fasta // file: adapter.fasta save_trimmed_fail // boolean: true/false save_merged // boolean: true/false min_trimmed_reads // integer: > 0
In "/modules/nf-core/fastp/main.nf"
def merge_fastq = save_merged ? "-m --merged_out ${prefix}.merged.fastq.gz" : ''

Command used and terminal output

--trimmer fastp --save_trimmed true

Relevant files

XXX.fastp.json
"command": "fastp --in1 XXX_1.fastq.gz --in2 XXX_2.fastq.gz --out1 XXX_1.fastp.fastq.gz --out2 XXX_2.fastp.fastq.gz --json XXX.fastp.json --html XXX.fastp.html --unpaired1 XXX_1.fail.fastq.gz --unpaired2 XXX_2.fail.fastq.gz -m --merged_out XXX.merged.fastq.gz --thread 6 --detect_adapter_for_pe [extra_star_align_args]"

System information

No response

@yxkwgp yxkwgp added the bug Something isn't working label Nov 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant