diff --git a/modules/nf-core/fgumi/extract/environment.yml b/modules/nf-core/fgumi/extract/environment.yml new file mode 100644 index 00000000000..7960b0e5a1c --- /dev/null +++ b/modules/nf-core/fgumi/extract/environment.yml @@ -0,0 +1,7 @@ +--- +# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/environment-schema.json +channels: + - conda-forge + - bioconda +dependencies: + - "bioconda::fgumi=0.2.0" diff --git a/modules/nf-core/fgumi/extract/main.nf b/modules/nf-core/fgumi/extract/main.nf new file mode 100644 index 00000000000..fb17d5adf0d --- /dev/null +++ b/modules/nf-core/fgumi/extract/main.nf @@ -0,0 +1,38 @@ +process FGUMI_EXTRACT { + tag "${meta.id}" + label 'process_single' + + conda "${moduleDir}/environment.yml" + container "${workflow.containerEngine in ['singularity', 'apptainer'] && !task.ext.singularity_pull_docker_container + ? 'https://community-cr-prod.seqera.io/docker/registry/v2/blobs/sha256/a5/a510706f3481fae12ff6100d6e4ad298b8bf464a2d93a6afe35e9cf26542d080/data' + : 'community.wave.seqera.io/library/fgumi:0.2.0--fe028e7a64e5da27'}" + + input: + tuple val(meta), path(reads), val(library) + + output: + tuple val(meta), path("*.bam"), emit: bam + tuple val("${task.process}"), val('fgumi'), eval('fgumi --version | sed "s/^fgumi //"'), topic: versions, emit: versions_fgumi + + when: + task.ext.when == null || task.ext.when + + script: + def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" + + """ + fgumi extract \\ + --inputs ${reads.join(' ')} \\ + --output ${prefix}.bam \\ + ${args} \\ + --sample ${prefix} \\ + --library "${library}" + """ + + stub: + def prefix = task.ext.prefix ?: "${meta.id}" + """ + touch ${prefix}.bam + """ +} diff --git a/modules/nf-core/fgumi/extract/meta.yml b/modules/nf-core/fgumi/extract/meta.yml new file mode 100644 index 00000000000..7d62b590c47 --- /dev/null +++ b/modules/nf-core/fgumi/extract/meta.yml @@ -0,0 +1,70 @@ +name: fgumi_extract +description: Extract unique molecular indices (UMIs) from FASTQ files and write + an unaligned BAM file. +keywords: + - umi + - extract + - fastq + - bam +tools: + - fgumi: + description: High-performance tools for working with UMI-tagged sequencing + data. + homepage: https://github.com/fulcrumgenomics/fgumi + documentation: https://docs.rs/fgumi + tool_dev_url: https://github.com/fulcrumgenomics/fgumi + licence: + - "MIT" + identifier: "" +input: + - - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - reads: + type: file + description: Input FASTQ files used for UMI extraction. + pattern: "*.fastq.gz" + ontologies: + - edam: http://edamontology.org/format_3989 + - library: + type: string + description: Library name to store in the output BAM read group. +output: + bam: + - - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - "*.bam": + type: file + description: Unaligned BAM with extracted UMIs in SAM tags. + pattern: "*.bam" + ontologies: [] + versions_fgumi: + - - ${task.process}: + type: string + description: The process the versions were collected from + - fgumi: + type: string + description: The tool name + - 'fgumi --version | sed "s/^fgumi //"': + type: eval + description: The expression to obtain the version of the tool +topics: + versions: + - - ${task.process}: + type: string + description: The process the versions were collected from + - fgumi: + type: string + description: The tool name + - 'fgumi --version | sed "s/^fgumi //"': + type: eval + description: The expression to obtain the version of the tool +authors: + - "@atrigila" +maintainers: + - "@atrigila" diff --git a/modules/nf-core/fgumi/extract/tests/main.nf.test b/modules/nf-core/fgumi/extract/tests/main.nf.test new file mode 100644 index 00000000000..44ce2572e72 --- /dev/null +++ b/modules/nf-core/fgumi/extract/tests/main.nf.test @@ -0,0 +1,73 @@ +nextflow_process { + + name "Test Process FGUMI_EXTRACT" + script "../main.nf" + process "FGUMI_EXTRACT" + + tag "modules" + tag "modules_nfcore" + tag "fgumi" + tag "fgumi/extract" + + config "./nextflow.config" + + test("homo_sapiens - [fastq1, fastq2]") { + + when { + params { + module_args = '' + } + process { + """ + input[0] = [ + [ id:'test' ], + [ + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/fastq/test.umi_1.fastq.gz', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/fastq/test.umi_2.fastq.gz', checkIfExists: true) + ], + 'illumina', + ] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(sanitizeOutput(process.out)).match() } + ) + } + + } + + test("homo_sapiens - [fastq1, fastq2] - stub") { + + options "-stub" + + when { + params { + module_args = "--read-structures +T +M" + } + process { + """ + input[0] = [ + [ id:'test' ], + [ + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/fastq/test.umi_1.fastq.gz', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/fastq/test.umi_2.fastq.gz', checkIfExists: true) + ], + 'test', + ] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(sanitizeOutput(process.out)).match() } + ) + } + + } +} diff --git a/modules/nf-core/fgumi/extract/tests/main.nf.test.snap b/modules/nf-core/fgumi/extract/tests/main.nf.test.snap new file mode 100644 index 00000000000..8c054cafd78 --- /dev/null +++ b/modules/nf-core/fgumi/extract/tests/main.nf.test.snap @@ -0,0 +1,54 @@ +{ + "homo_sapiens - [fastq1, fastq2]": { + "content": [ + { + "bam": [ + [ + { + "id": "test" + }, + "test.bam:md5,9c2476e5c354f57bed109e582b8953be" + ] + ], + "versions_fgumi": [ + [ + "FGUMI_EXTRACT", + "fgumi", + "0.2.0" + ] + ] + } + ], + "timestamp": "2026-05-07T12:48:51.477812468", + "meta": { + "nf-test": "0.9.5", + "nextflow": "26.04.0" + } + }, + "homo_sapiens - [fastq1, fastq2] - stub": { + "content": [ + { + "bam": [ + [ + { + "id": "test" + }, + "test.bam:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "versions_fgumi": [ + [ + "FGUMI_EXTRACT", + "fgumi", + "0.2.0" + ] + ] + } + ], + "timestamp": "2026-05-07T12:49:21.767581495", + "meta": { + "nf-test": "0.9.5", + "nextflow": "26.04.0" + } + } +} \ No newline at end of file diff --git a/modules/nf-core/fgumi/extract/tests/nextflow.config b/modules/nf-core/fgumi/extract/tests/nextflow.config new file mode 100644 index 00000000000..54ef8845085 --- /dev/null +++ b/modules/nf-core/fgumi/extract/tests/nextflow.config @@ -0,0 +1,5 @@ +process { + withName: FGUMI_EXTRACT { + ext.args = { "${params.module_args}" } + } +}