Skip to content
Draft
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions modules/nf-core/fgumi/extract/environment.yml
Original file line number Diff line number Diff line change
@@ -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"
39 changes: 39 additions & 0 deletions modules/nf-core/fgumi/extract/main.nf
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
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)

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"
if (!args.contains('--sample') || !args.contains('--library')) {
error("fgumi extract requires both --sample and --library to be supplied via task.ext.args")
}

"""
fgumi extract \\
--inputs ${reads.join(' ')} \\
--output ${prefix}.bam \\
${args}
"""

stub:
def prefix = task.ext.prefix ?: "${meta.id}.fgumi_extract"
"""
touch ${prefix}.bam
"""
}
63 changes: 63 additions & 0 deletions modules/nf-core/fgumi/extract/meta.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
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"]
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: []
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"
101 changes: 101 additions & 0 deletions modules/nf-core/fgumi/extract/tests/main.nf.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
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 = '--library illumina'
prefix = ''
}
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)
]
]
"""
}
}

then {
assertAll(
{ assert process.success },
{ assert snapshot(sanitizeOutput(process.out)).match() }
)
}

}

test("homo_sapiens - [fastq1, fastq2] - missing library") {

when {
params {
module_args = '--read-structures +T +M'
prefix = ''
}
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)
]
]
"""
}
}

then {
assertAll(
{ assert !process.success },
{ assert process.errorReport.contains('fgumi extract requires both --sample and --library') }
)
}
}

test("homo_sapiens - [fastq1, fastq2] - stub") {

options "-stub"

when {
params {
module_args = "--sample test --library test --read-structures +T +M"
prefix = ''
}
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)
]
]
"""
}
}

then {
assertAll(
{ assert process.success },
{ assert snapshot(sanitizeOutput(process.out)).match() }
)
}

}
}
54 changes: 54 additions & 0 deletions modules/nf-core/fgumi/extract/tests/main.nf.test.snap
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
{
"homo_sapiens - [fastq1, fastq2]": {
"content": [
{
"bam": [
[
{
"id": "test"
},
"test.fgumi_extract.bam:md5,8d7b8ec04bbfe4285cddced4c82aea7d"
]
],
"versions_fgumi": [
[
"FGUMI_EXTRACT",
"fgumi",
"0.2.0"
]
]
}
],
"timestamp": "2026-05-07T12:35:44.755887347",
"meta": {
"nf-test": "0.9.5",
"nextflow": "26.04.0"
}
},
"homo_sapiens - [fastq1, fastq2] - stub": {
"content": [
{
"bam": [
[
{
"id": "test"
},
"test.fgumi_extract.bam:md5,d41d8cd98f00b204e9800998ecf8427e"
]
],
"versions_fgumi": [
[
"FGUMI_EXTRACT",
"fgumi",
"0.2.0"
]
]
}
],
"timestamp": "2026-05-07T12:36:12.822185537",
"meta": {
"nf-test": "0.9.5",
"nextflow": "26.04.0"
}
}
}
6 changes: 6 additions & 0 deletions modules/nf-core/fgumi/extract/tests/nextflow.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
process {
withName: FGUMI_EXTRACT {
ext.args = { "--sample ${meta.id} ${params.module_args}" }
ext.prefix = params.prefix
}
}
Loading