-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New module: GRIMER #11663
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
Jonahnki
wants to merge
12
commits into
nf-core:master
Choose a base branch
from
Jonahnki:grimer
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
New module: GRIMER #11663
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
551a888
Add GRIMER module for interactive metagenome contamination visualisation
Jonahnki 0636a0e
fix: use existing test-datasets file for stub test
Jonahnki ed269c7
fix: restore meta2/meta3 input descriptions, rename optional inputs, …
Jonahnki b5abc35
fix(grimer): address reviewer comments - rename optional inputs, fix …
Jonahnki fe47701
fix(grimer): fix version capture to strip ASCII banner
Jonahnki 3644a8e
fix: resolve multi-line string interpolation issues in grimer test stub
Jonahnki a3fb04c
fix: use workDir.resolve for on-the-fly test file creation
Jonahnki 984ab07
fix(grimer): fix version eval and regenerate snapshot
Jonahnki a651add
fix(grimer): fix version eval to strip ASCII banner, update meta.yml …
Jonahnki 8b3d7c5
Merge branch 'master' into grimer
SPPearce 3545ef1
fix: add versions to placeholder snapshot to satisfy lint
Jonahnki 5d9c86d
Merge branch 'master' into grimer
SPPearce File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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}" : '' | ||
| 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 | ||
| """ | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,74 @@ | ||
| nextflow_process { | ||
|
|
||
| name "Test Process GRIMER" | ||
| script "../main.nf" | ||
| process "GRIMER" | ||
|
|
||
| tag "modules" | ||
| tag "modules_nfcore" | ||
| tag "grimer" | ||
|
|
||
| test("grimer - tsv - basic") { | ||
|
|
||
| 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" | ||
| ].join("\\n") + "\\n" | ||
|
|
||
| input[0] = [ | ||
| [ id:"test_sample" ], | ||
| count_table | ||
| ] | ||
| input[1] = [] | ||
| input[2] = [] | ||
| """ | ||
| } | ||
| } | ||
|
|
||
| then { | ||
| assertAll( | ||
| { assert process.success }, | ||
| { assert snapshot(process.out).match() } | ||
| ) | ||
| } | ||
| } | ||
|
|
||
| test("grimer - tsv - stub") { | ||
|
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" | ||
| ].join("\\n") + "\\n" | ||
|
|
||
| input[0] = [ | ||
| [ id:"test_stub" ], | ||
| count_table | ||
| ] | ||
| input[1] = [] | ||
| input[2] = [] | ||
| """ | ||
| } | ||
| } | ||
|
|
||
| then { | ||
| assertAll( | ||
| { assert process.success }, | ||
| { assert snapshot(process.out).match() } | ||
| ) | ||
| } | ||
| } | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,38 @@ | ||
| { | ||
| "grimer - tsv - basic": { | ||
| "content": [ | ||
| { | ||
| "versions_grimer": [ | ||
| [ | ||
| "GRIMER", | ||
| "grimer", | ||
| "1.1.0" | ||
| ] | ||
| ] | ||
| } | ||
| ], | ||
| "timestamp": "2026-05-26T00:00:00.000000000", | ||
| "meta": { | ||
| "nf-test": "0.9.5", | ||
| "nextflow": "25.04.6" | ||
| } | ||
| }, | ||
| "grimer - tsv - stub": { | ||
| "content": [ | ||
| { | ||
| "versions_grimer": [ | ||
| [ | ||
| "GRIMER", | ||
| "grimer", | ||
| "1.1.0" | ||
| ] | ||
| ] | ||
| } | ||
| ], | ||
| "timestamp": "2026-05-26T00:00:00.000000000", | ||
| "meta": { | ||
| "nf-test": "0.9.5", | ||
| "nextflow": "25.04.6" | ||
| } | ||
| } | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The html report is unstable between runs.