Skip to content
Open
Show file tree
Hide file tree
Changes from all 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/grimer/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::grimer=1.1.0"
41 changes: 41 additions & 0 deletions modules/nf-core/grimer/main.nf
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
process GRIMER {
tag "$meta.id"
label 'process_single'

conda "${moduleDir}/environment.yml"
container "${ workflow.containerEngine in ['singularity', 'apptainer'] && !task.ext.singularity_pull_docker_container ?
'https://depot.galaxyproject.org/singularity/grimer:1.1.0--pyhdfd78af_0':
'quay.io/biocontainers/grimer:1.1.0--pyhdfd78af_0' }"

input:
tuple val(meta), path(input_table)
path sample_metadata
path config

output:
tuple val(meta), path("*.html"), emit: report
tuple val("${task.process}"), val('grimer'), eval('grimer --version 2>&1 | tail -1'), emit: versions_grimer, topic: versions

when:
task.ext.when == null || task.ext.when

script:
def args = task.ext.args ?: ''
def prefix = task.ext.prefix ?: "${meta.id}"
def m_arg = sample_metadata ? "-m ${sample_metadata}" : ''
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
def m_arg = sample_metadata ? "-m ${sample_metadata}" : ''
def m_arg = sample_metadata ? "-m ${sample_metadata}" : ''

def c_arg = config ? "-c ${config}" : ''
"""
grimer \\
-i ${input_table} \\
${m_arg} \\
${c_arg} \\
-o ${prefix}.html \\
${args}
"""

stub:
def prefix = task.ext.prefix ?: "${meta.id}"
"""
touch ${prefix}.html
"""
}
95 changes: 95 additions & 0 deletions modules/nf-core/grimer/meta.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
name: grimer
description: |
Generates an interactive HTML dashboard integrating taxonomy,
annotation, and metadata to detect contamination in metagenomic
and amplicon sequencing datasets. GRIMER is independent of
quantification methods and directly analyses contingency tables.
keywords:
- metagenomics
- contamination
- visualisation
- taxonomy
- viromics
- microbiome
- dashboard
tools:
- grimer:
description: |
GRIMER performs automated contamination analysis and generates
portable interactive dashboards from contingency tables,
integrating taxonomy, annotation and metadata.
homepage: https://github.com/pirovc/grimer
documentation: https://pirovc.github.io/grimer/
tool_dev_url: https://github.com/pirovc/grimer
doi: "10.1101/2021.06.22.449360"
licence:
- "MIT"
identifier: biotools:grimer
args_id: "$args"
input:
- - meta:
type: map
description: |
Groovy Map containing sample information.
e.g. [ id:'sample1' ]
- input_table:
type: file
description: |
Tab-separated count/observation table or .biom file.
Rows are observations; columns are samples.
pattern: "*.{tsv,biom}"
ontologies:
- edam: http://edamontology.org/format_3475
- edam: http://edamontology.org/format_3746
- sample_metadata:
type: file
description: Tab-separated metadata file. Rows are samples; columns are
metadata fields. Optional, pass [] to omit.
pattern: "*.tsv"
ontologies:
- edam: http://edamontology.org/format_3475
- config:
type: file
description: |
YAML configuration file defining external tool references,
controls, and annotations. Optional, pass [] to omit.
pattern: "*.{yml,yaml}"
ontologies:
- edam: http://edamontology.org/format_3750
output:
report:
- - meta:
type: map
description: Groovy Map containing sample information.
- "*.html":
type: file
description: |
Interactive HTML dashboard report integrating taxonomy,
contamination analysis, heatmaps, and correlation plots.
pattern: "*.html"
ontologies: []
versions_grimer:
- - ${task.process}:
type: string
description: The name of the process
- grimer:
type: string
description: The name of the tool
- grimer --version 2>&1 | tail -1:
type: eval
description: The expression to obtain the version of the tool
topics:
versions:
- - ${task.process}:
type: string
description: The name of the process
- grimer:
type: string
description: The name of the tool
- grimer --version 2>&1 | tail -1:
type: eval
description: The expression to obtain the version of the tool
authors:
- "@Jonahnki"
maintainers:
- "@Jonahnki"
41 changes: 41 additions & 0 deletions modules/nf-core/grimer/tests/main.nf.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
nextflow_process {

name "Test Process GRIMER"
script "../main.nf"
process "GRIMER"

tag "modules"
tag "modules_nfcore"
tag "grimer"

test("grimer - tsv - stub") {
Comment thread
SPPearce marked this conversation as resolved.

options "-stub"

when {
process {
"""
def count_table = file(workDir.resolve('test_count_table.tsv').toString())
count_table.text = '''#OTU_ID\tsample1\tsample2\tsample3
Bacteria;Proteobacteria\t1250\t890\t2100
Bacteria;Firmicutes\t430\t1200\t320
Viruses;Caudoviricetes\t45\t120\t88
'''
input[0] = [
[ id: 'test_stub' ],
count_table
]
input[1] = []
input[2] = []
"""
}
}

then {
assertAll(
{ assert process.success },
{ assert snapshot(process.out).match() }
)
}
}
}
43 changes: 43 additions & 0 deletions modules/nf-core/grimer/tests/main.nf.test.snap
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
{
"grimer - tsv - stub": {
"content": [
{
"0": [
[
{
"id": "test_stub"
},
"test_stub.html:md5,d41d8cd98f00b204e9800998ecf8427e"
]
],
"1": [
[
"GRIMER",
"grimer",
"bash: line 1: grimer: command not found"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This isn't correct ;)
Need to run the snapshot with a profile (docker/singularity/conda) that has the tool.

]
],
"report": [
[
{
"id": "test_stub"
},
"test_stub.html:md5,d41d8cd98f00b204e9800998ecf8427e"
]
],
"versions_grimer": [
[
"GRIMER",
"grimer",
"bash: line 1: grimer: command not found"
]
]
}
],
"timestamp": "2026-05-19T20:09:53.966038203",
"meta": {
"nf-test": "0.9.5",
"nextflow": "25.04.6"
}
}
}
2 changes: 2 additions & 0 deletions modules/nf-core/grimer/tests/tags.yml
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file is not required (and hasn't been for some time)

Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
grimer:
- modules/nf-core/grimer/**
Loading