diff --git a/modules/nf-core/bbmap/bbsplit/main.nf b/modules/nf-core/bbmap/bbsplit/main.nf index bce2208321c3..b709084b2242 100644 --- a/modules/nf-core/bbmap/bbsplit/main.nf +++ b/modules/nf-core/bbmap/bbsplit/main.nf @@ -18,6 +18,7 @@ process BBMAP_BBSPLIT { output: path "bbsplit_index" , optional:true, emit: index tuple val(meta), path('*primary*fastq.gz'), optional:true, emit: primary_fastq + tuple val(meta), path('*unmapped*fastq.gz'), optional:true, emit: unmapped_fastq tuple val(meta), path('*fastq.gz') , optional:true, emit: all_fastq tuple val(meta), path('*txt') , optional:true, emit: stats tuple val(meta), path('*.log') , optional:true, emit: log @@ -46,6 +47,7 @@ process BBMAP_BBSPLIT { def fastq_out='' def index_files='' def refstats_cmd='' + def fastq_unmapped='' def use_index = index ? true : false if (only_build_index) { @@ -64,6 +66,7 @@ process BBMAP_BBSPLIT { } fastq_in = meta.single_end ? "in=${reads}" : "in=${reads[0]} in2=${reads[1]}" fastq_out = meta.single_end ? "basename=${prefix}_%.fastq.gz" : "basename=${prefix}_%_#.fastq.gz" + fastq_unmapped = meta.single_end ? "outu=${prefix}_unmapped.fastq.gz" : "outu=${prefix}_unmapped_#.fastq.gz" refstats_cmd = 'refstats=' + prefix + '.stats.txt' } """ @@ -93,6 +96,7 @@ process BBMAP_BBSPLIT { $fastq_in \\ $fastq_out \\ $refstats_cmd \\ + $fastq_unmapped \\ $args 2>| >(tee ${prefix}.log >&2) # Summary files will have an absolute path that will make the index @@ -123,6 +127,7 @@ process BBMAP_BBSPLIT { echo '' | gzip > ${prefix}_primary.fastq.gz ${other_refs} touch ${prefix}.stats.txt + touch ${prefix}_unmapped.fastq.gz fi touch ${prefix}.log diff --git a/modules/nf-core/bbmap/bbsplit/meta.yml b/modules/nf-core/bbmap/bbsplit/meta.yml index ecab992d0df7..02a0d27f4380 100644 --- a/modules/nf-core/bbmap/bbsplit/meta.yml +++ b/modules/nf-core/bbmap/bbsplit/meta.yml @@ -1,5 +1,6 @@ name: bbmap_bbsplit -description: Split sequencing reads by mapping them to multiple references simultaneously +description: Split sequencing reads by mapping them to multiple references + simultaneously keywords: - align - map @@ -8,8 +9,8 @@ keywords: - reference tools: - bbmap: - description: BBMap is a short read aligner, as well as various other bioinformatic - tools. + description: BBMap is a short read aligner, as well as various other + bioinformatic tools. homepage: https://jgi.doe.gov/data-and-tools/software-tools/bbtools/bb-tools-user-guide/ documentation: https://jgi.doe.gov/data-and-tools/software-tools/bbtools/bb-tools-user-guide/ licence: ["UC-LBL license (see package)"] @@ -40,7 +41,8 @@ input: description: List of other reference ids apart from the primary - other_ref_paths: type: list - description: Path to other references paths corresponding to "other_ref_names" + description: Path to other references paths corresponding to + "other_ref_names" - only_build_index: type: string description: true = only build index; false = mapping @@ -62,6 +64,18 @@ output: pattern: "*primary*fastq.gz" ontologies: - edam: http://edamontology.org/format_3989 # GZIP format + unmapped_fastq: + - - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - "*unmapped*fastq.gz": + type: file + description: Unmapped FASTQ file + pattern: "*unmapped*fastq.gz" + ontologies: + - edam: http://edamontology.org/format_3989 # GZIP format all_fastq: - - meta: type: map diff --git a/modules/nf-core/bbmap/bbsplit/tests/main.nf.test b/modules/nf-core/bbmap/bbsplit/tests/main.nf.test index 82985102f266..5bc75577f2ab 100644 --- a/modules/nf-core/bbmap/bbsplit/tests/main.nf.test +++ b/modules/nf-core/bbmap/bbsplit/tests/main.nf.test @@ -87,7 +87,7 @@ nextflow_process { """ input[0] = Channel.of([ [ id:'test', single_end:true ], // meta map - file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fastq/test_1.fastq.gz', checkIfExists: true) + file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fastq/sarscov2_mus-musculus.fastq.gz', checkIfExists: true) ]) input[1] = BBMAP_BBSPLIT_INDEX.out.index input[2] = [] @@ -103,6 +103,7 @@ nextflow_process { { assert path(process.out.log[0][1]).text.contains("If you wish to regenerate the index") }, { assert snapshot( process.out.primary_fastq, + process.out.unmapped_fastq, process.out.stats, process.out.findAll { key, val -> key.startsWith("versions") } ).match()} diff --git a/modules/nf-core/bbmap/bbsplit/tests/main.nf.test.snap b/modules/nf-core/bbmap/bbsplit/tests/main.nf.test.snap index b5fbb54f36e9..7fc2a9dbdc4f 100644 --- a/modules/nf-core/bbmap/bbsplit/tests/main.nf.test.snap +++ b/modules/nf-core/bbmap/bbsplit/tests/main.nf.test.snap @@ -16,7 +16,16 @@ "id": "test", "single_end": true }, - "test.stats.txt:md5,2cbf69b72e5f4f8508306b54e8fe2861" + "test_unmapped.fastq.gz:md5,c513990406ea4296dfd81073adcdb6e1" + ] + ], + [ + [ + { + "id": "test", + "single_end": true + }, + "test.stats.txt:md5,dfdb1be5d832dfecca787ced0bdf6d2a" ] ], { @@ -33,7 +42,7 @@ "nf-test": "0.9.3", "nextflow": "25.10.2" }, - "timestamp": "2026-01-19T14:51:21.775776" + "timestamp": "2026-01-28T17:04:15.937554023" }, "sarscov2_se_fastq_fasta_chr22_fasta - build index": { "content": [ diff --git a/subworkflows/nf-core/fastq_qc_trim_filter_setstrandedness/meta.yml b/subworkflows/nf-core/fastq_qc_trim_filter_setstrandedness/meta.yml index 644a567a5c1d..69b4c262a716 100644 --- a/subworkflows/nf-core/fastq_qc_trim_filter_setstrandedness/meta.yml +++ b/subworkflows/nf-core/fastq_qc_trim_filter_setstrandedness/meta.yml @@ -1,5 +1,7 @@ name: "fastq_qc_trim_filter_setstrandedness" -description: Performs linting, quality control, trimming, filtering, and strandedness determination on RNA-seq FASTQ files, preparing them for downstream analysis. +description: Performs linting, quality control, trimming, filtering, and + strandedness determination on RNA-seq FASTQ files, preparing them for + downstream analysis. keywords: - fastq - rnaseq @@ -94,7 +96,8 @@ input: description: BBSplit index directory or tar.gz archive pattern: "{*,*.tar.gz}" - ch_rrna_fastas: - description: Channel containing one or more FASTA files containing rRNA sequences for use with SortMeRNA or Bowtie2 + description: Channel containing one or more FASTA files containing rRNA + sequences for use with SortMeRNA or Bowtie2 structure: - meta: type: map @@ -105,7 +108,8 @@ input: pattern: "*.{fa,fasta}" - skip_bbsplit: type: boolean - description: Whether to skip BBSplit for removal of non-reference genome reads + description: Whether to skip BBSplit for removal of non-reference genome + reads - skip_fastqc: type: boolean description: Whether to skip FastQC @@ -114,7 +118,8 @@ input: description: Whether to skip trimming - skip_umi_extract: type: boolean - description: Skip the UMI extraction from the read in case the UMIs have been moved to the headers in advance of the pipeline run + description: Skip the UMI extraction from the read in case the UMIs have + been moved to the headers in advance of the pipeline run - skip_linting: type: boolean description: Whether to skip linting of FastQ files @@ -126,14 +131,16 @@ input: description: Whether to create sortmerna index before running sortmerna - make_bowtie2_index: type: boolean - description: Whether to create bowtie2 index before running bowtie2 for rRNA removal + description: Whether to create bowtie2 index before running bowtie2 for rRNA + removal - trimmer: type: string description: Specifies the trimming tool to use enum: ["trimgalore", "fastp"] - min_trimmed_reads: type: integer - description: Minimum number of trimmed reads below which samples are removed from further processing + description: Minimum number of trimmed reads below which samples are removed + from further processing - save_trimmed: type: boolean description: Save the trimmed FastQ files in the results directory? @@ -153,14 +160,18 @@ input: description: Enable UMI-based read deduplication - umi_discard_read: type: integer - description: After UMI barcode extraction discard either R1 or R2 by setting this parameter to 1 or 2, respectively + description: After UMI barcode extraction discard either R1 or R2 by setting + this parameter to 1 or 2, respectively - stranded_threshold: type: float min: 0.5 - description: The fraction of stranded reads that must be assigned to a strandedness for confident assignment. Must be at least 0.5. + description: The fraction of stranded reads that must be assigned to a + strandedness for confident assignment. Must be at least 0.5. - unstranded_threshold: type: float - description: The difference in fraction of stranded reads assigned to 'forward' and 'reverse' below which a sample is classified as 'unstranded'. + description: The difference in fraction of stranded reads assigned to + 'forward' and 'reverse' below which a sample is classified as + 'unstranded'. output: - reads: @@ -174,7 +185,8 @@ output: description: Preprocessed FastQ files pattern: "*.{fq,fastq},{,.gz}" - multiqc_files: - description: MultiQC-compatible output files from tools used in preprocessing + description: MultiQC-compatible output files from tools used in + preprocessing structure: - meta: type: map @@ -192,13 +204,6 @@ output: - count: type: integer description: Number of reads after trimming - - versions: - description: File containing software versions - structure: - - versions: - type: file - description: File containing software versions - pattern: "versions.yml" - lint_log: description: Log files from FastQ linting structure: