diff --git a/modules/nf-core/cellbender/removebackground/main.nf b/modules/nf-core/cellbender/removebackground/main.nf index 4cd0d6d3c748..ee0b435a1793 100644 --- a/modules/nf-core/cellbender/removebackground/main.nf +++ b/modules/nf-core/cellbender/removebackground/main.nf @@ -30,13 +30,14 @@ process CELLBENDER_REMOVEBACKGROUND { prefix = task.ext.prefix ?: "${meta.id}" args = task.ext.args ?: "" use_gpu = task.ext.use_gpu ? "--cuda" : "" + input = task.ext.input ?: "${h5ad}" """ TMPDIR=. cellbender remove-background \ ${args} \ --cpu-threads ${task.cpus} \ --estimator-multiple-cpu \ ${use_gpu} \ - --input ${h5ad} \ + --input ${input} \ --output ${prefix}.h5 """ diff --git a/modules/nf-core/cellbender/removebackground/tests/main.nf.test b/modules/nf-core/cellbender/removebackground/tests/main.nf.test index c1213509ddaf..187c5f064203 100644 --- a/modules/nf-core/cellbender/removebackground/tests/main.nf.test +++ b/modules/nf-core/cellbender/removebackground/tests/main.nf.test @@ -38,6 +38,41 @@ nextflow_process { ) } } + test("test_cellbender_removebackground mtx") { + config './epochs.config' + config './mtx.config' + when { + process { + """ + input[0] = [ + [ id:'test' ], // meta map + [ + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/scrnaseq/10x_mtx/SRR28679756_raw/matrix.mtx.gz', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/scrnaseq/10x_mtx/SRR28679756_raw/barcodes.tsv.gz', checkIfExists: true), + file(params.modules_testdata_base_path + 'genomics/homo_sapiens/scrnaseq/10x_mtx/SRR28679756_raw/features.tsv.gz', checkIfExists: true) + ] + ] + """ + } + } + then { + assertAll( + {assert process.success}, + {assert snapshot( + process.out.findAll { key, val -> key.startsWith('versions') }, + process.out.h5.collect{file(it[1]).name}, + process.out.filtered_h5.collect{file(it[1]).name}, + process.out.posterior_h5.collect{file(it[1]).name}, + process.out.barcodes.collect{file(it[1]).name}, + process.out.metrics.collect{file(it[1]).name}, + process.out.report.collect{file(it[1]).name}, + process.out.pdf.collect{file(it[1]).name}, + process.out.log.collect{file(it[1]).name} + ).match() + } + ) + } + } test("test_cellbender_removebackground - stub") { options '-stub' diff --git a/modules/nf-core/cellbender/removebackground/tests/main.nf.test.snap b/modules/nf-core/cellbender/removebackground/tests/main.nf.test.snap index 65d6369856fa..bce31e86691e 100644 --- a/modules/nf-core/cellbender/removebackground/tests/main.nf.test.snap +++ b/modules/nf-core/cellbender/removebackground/tests/main.nf.test.snap @@ -41,6 +41,48 @@ "nextflow": "25.10.4" } }, + "test_cellbender_removebackground mtx": { + "content": [ + { + "versions_cellbender": [ + [ + "CELLBENDER_REMOVEBACKGROUND", + "cellbender", + "0.3.2" + ] + ] + }, + [ + "test.h5" + ], + [ + "test_filtered.h5" + ], + [ + "test_posterior.h5" + ], + [ + "test_cell_barcodes.csv" + ], + [ + "test_metrics.csv" + ], + [ + "test_report.html" + ], + [ + "test.pdf" + ], + [ + "test.log" + ] + ], + "timestamp": "2026-05-10T13:44:53.496209", + "meta": { + "nf-test": "0.9.5", + "nextflow": "26.03.1" + } + }, "test_cellbender_removebackground - stub": { "content": [ { diff --git a/modules/nf-core/cellbender/removebackground/tests/mtx.config b/modules/nf-core/cellbender/removebackground/tests/mtx.config new file mode 100644 index 000000000000..675b8d0778c0 --- /dev/null +++ b/modules/nf-core/cellbender/removebackground/tests/mtx.config @@ -0,0 +1,6 @@ + +process { + withName: CELLBENDER_REMOVEBACKGROUND { + ext.input = "." // --input implies that CBRB will read matrix.mtx.gz, barcodes.tsv.gz, and features.tsv.gz from the current directory. + } +}