-
Notifications
You must be signed in to change notification settings - Fork 1k
Add mifaser #11643
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
vinisalazar
wants to merge
11
commits into
nf-core:master
Choose a base branch
from
vinisalazar:add_mifaser
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
Add mifaser #11643
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
e877187
New module mifaser/environment
vinisalazar 44e34b4
New module mifaser/main
vinisalazar 3cde904
New module mifaser/meta
vinisalazar ccaaeb9
New module mifaser/tests
vinisalazar 6948d5f
mifaser/mifaser: add test snapshot
vinisalazar dd4abe3
Merge branch 'master' into add_mifaser
vinisalazar aed9678
mifaser: switch to biocontainers 1.60, fix db path
vinisalazar 4275599
Merge branch 'master' into add_mifaser
vinisalazar 3806226
mifaser: correct path of test file
vinisalazar 51ace6a
mifaser: fix Java syntax error
vinisalazar 386b2a4
mifaser: update snapshot
vinisalazar 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
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::mifaser=1.60 |
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,50 @@ | ||||||
| process MIFASER { | ||||||
| tag "${meta.id}" | ||||||
| label 'process_medium' | ||||||
|
|
||||||
| conda "${moduleDir}/environment.yml" | ||||||
| container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? | ||||||
| 'https://depot.galaxyproject.org/singularity/mifaser:1.60--pyh106432d_0' : | ||||||
| 'quay.io/biocontainers/mifaser:1.60--pyh106432d_0' }" | ||||||
|
|
||||||
| input: | ||||||
| tuple val(meta), path(reads) | ||||||
| path db | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
|
|
||||||
| output: | ||||||
| tuple val(meta), path("*multi_ec.tsv"), emit: multi_ec | ||||||
| tuple val(meta), path("*analysis.tsv"), emit: analysis | ||||||
| tuple val(meta), path("*ec_count.tsv"), emit: ec_counts | ||||||
| tuple val("${task.process}"), val('mi-faser'), eval("mifaser --version 2>&1 | sed 's/* v//'"), emit: versions_mifaser, topic: versions | ||||||
|
|
||||||
| when: | ||||||
| task.ext.when == null || task.ext.when | ||||||
|
|
||||||
| script: | ||||||
| def args = task.ext.args ?: '' | ||||||
| def prefix = task.ext.prefix ?: "${meta.id}" | ||||||
| def input_flag = meta.single_end ? "-f" : "-l" | ||||||
| """ | ||||||
| mifaser \\ | ||||||
| ${args} \\ | ||||||
| ${input_flag} ${reads} \\ | ||||||
| --threads 1 \\ | ||||||
| --cpu ${task.cpus} \\ | ||||||
| --databasefolder \$PWD/${db} \\ | ||||||
| --outputfolder mifaser-${prefix}/ | ||||||
|
|
||||||
| for suf in multi_ec.tsv analysis.tsv ec_count.tsv; do | ||||||
| mv mifaser-${prefix}/\${suf} ${prefix}_\${suf} | ||||||
| done | ||||||
| """ | ||||||
|
|
||||||
| stub: | ||||||
| def args = task.ext.args ?: '' | ||||||
| def prefix = task.ext.prefix ?: "${meta.id}" | ||||||
| """ | ||||||
| echo ${args} | ||||||
| for suf in multi_ec.tsv analysis.tsv ec_count.tsv; do | ||||||
| touch ${prefix}_\${suf} | ||||||
| done | ||||||
| """ | ||||||
| } | ||||||
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,91 @@ | ||
| name: "mifaser" | ||
| description: Functional annotation of metagenomic reads by assigning enzyme | ||
| commission (EC) numbers | ||
| keywords: | ||
| - metagenomics | ||
| - functional annotation | ||
| - EC numbers | ||
| - fastq | ||
| tools: | ||
| - "mifaser": | ||
| description: "mi-faser: microsecond functional annotation of sequences, a massive | ||
| scalability upgrade" | ||
| homepage: "https://sourceforge.net/projects/mifaser/" | ||
| documentation: "https://sourceforge.net/projects/mifaser/" | ||
| tool_dev_url: "https://sourceforge.net/projects/mifaser/" | ||
| doi: "10.1093/nar/gkx1209" | ||
| licence: | ||
| - "NPOSL-3.0" | ||
| identifier: "" | ||
| input: | ||
| - - meta: | ||
| type: map | ||
| description: | | ||
| Groovy Map containing sample information | ||
| e.g. `[ id:'sample1', single_end:true ]` | ||
| - reads: | ||
| type: file | ||
| description: | | ||
| Single-end or paired-end FASTQ files. Use meta.single_end to indicate input type. | ||
| pattern: "*.{fastq,fastq.gz,fq,fq.gz}" | ||
| ontologies: | ||
| - edam: "http://edamontology.org/format_1930" | ||
| - db: | ||
| type: directory | ||
| description: Path to the mi-faser database folder | ||
| output: | ||
| multi_ec: | ||
| - - meta: | ||
| type: map | ||
| description: Groovy Map containing sample information | ||
| - "*multi_ec.tsv": | ||
| type: file | ||
| description: TSV file with multi-EC functional assignments per read | ||
| pattern: "*multi_ec.tsv" | ||
| ontologies: | ||
| - edam: http://edamontology.org/format_3475 | ||
| analysis: | ||
| - - meta: | ||
| type: map | ||
| description: Groovy Map containing sample information | ||
| - "*analysis.tsv": | ||
| type: file | ||
| description: TSV file with per-sample functional analysis summary | ||
| pattern: "*analysis.tsv" | ||
| ontologies: | ||
| - edam: http://edamontology.org/format_3475 | ||
| ec_counts: | ||
| - - meta: | ||
| type: map | ||
| description: Groovy Map containing sample information | ||
| - "*ec_count.tsv": | ||
| type: file | ||
| description: TSV file with EC number counts | ||
| pattern: "*ec_count.tsv" | ||
| ontologies: | ||
| - edam: http://edamontology.org/format_3475 | ||
| versions_mifaser: | ||
| - - "${task.process}": | ||
| type: string | ||
| description: Process name | ||
| - "mi-faser": | ||
| type: string | ||
| description: Tool name | ||
| - "mifaser --version 2>&1 | sed 's/* v//'": | ||
| type: eval | ||
| description: mifaser version string | ||
| topics: | ||
| versions: | ||
| - - "${task.process}": | ||
| type: string | ||
| description: Process name | ||
| - "mi-faser": | ||
| type: string | ||
| description: Tool name | ||
| - "mifaser --version 2>&1 | sed 's/* v//'": | ||
| type: eval | ||
| description: mifaser version string | ||
| authors: | ||
| - "@nickp60" | ||
| maintainers: | ||
| - "@nickp60" |
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,73 @@ | ||
| nextflow_process { | ||
|
|
||
| name "Test Process MIFASER" | ||
| script "../main.nf" | ||
| process "MIFASER" | ||
| tag "modules" | ||
| tag "modules_nfcore" | ||
| tag "mifaser" | ||
| tag "untar" | ||
|
|
||
| setup { | ||
| run("UNTAR") { | ||
| script "modules/nf-core/untar/main.nf" | ||
| process { | ||
| """ | ||
| input[0] = Channel.of([ | ||
| [], | ||
| file( | ||
| 'https://github.com/nf-core/test-datasets/raw/refs/heads/funcprofiler/data/database/mifaser/GS-24-all.tar.gz', | ||
| checkIfExists: true | ||
| ) | ||
| ]) | ||
| """ | ||
| } | ||
| } | ||
| } | ||
|
|
||
| test("sarscov2 - single-end fastq") { | ||
| when { | ||
| process { | ||
| """ | ||
| input[0] = [ | ||
| [ id:'test', single_end:true ], | ||
| [ file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fastq/test_1.fastq.gz', checkIfExists: true) ] | ||
| ] | ||
| input[1] = UNTAR.out.untar.map{ meta, dir -> dir.resolve("database/mifaser/GS-24-all") } | ||
| """ | ||
| } | ||
| } | ||
| then { | ||
| assertAll( | ||
| { assert process.success }, | ||
| { assert snapshot( | ||
| process.out.multi_ec, | ||
| process.out.analysis, | ||
| process.out.ec_counts, | ||
| process.out.findAll { key, val -> key.startsWith('versions') } | ||
| ).match() } | ||
| ) | ||
| } | ||
| } | ||
|
|
||
| test("sarscov2 - single-end fastq - stub") { | ||
| options "-stub" | ||
| when { | ||
| process { | ||
| """ | ||
| input[0] = [ | ||
| [ id:'test', single_end:true ], | ||
| [ file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fastq/test_1.fastq.gz', checkIfExists: true) ] | ||
| ] | ||
| input[1] = UNTAR.out.untar.map{ meta, dir -> dir.resolve("database/mifaser/GS-24-all") } | ||
| """ | ||
| } | ||
| } | ||
| 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,126 @@ | ||
| { | ||
| "sarscov2 - single-end fastq - stub": { | ||
| "content": [ | ||
| { | ||
| "0": [ | ||
| [ | ||
| { | ||
| "id": "test", | ||
| "single_end": true | ||
| }, | ||
| "test_multi_ec.tsv:md5,d41d8cd98f00b204e9800998ecf8427e" | ||
| ] | ||
| ], | ||
| "1": [ | ||
| [ | ||
| { | ||
| "id": "test", | ||
| "single_end": true | ||
| }, | ||
| "test_analysis.tsv:md5,d41d8cd98f00b204e9800998ecf8427e" | ||
| ] | ||
| ], | ||
| "2": [ | ||
| [ | ||
| { | ||
| "id": "test", | ||
| "single_end": true | ||
| }, | ||
| "test_ec_count.tsv:md5,d41d8cd98f00b204e9800998ecf8427e" | ||
| ] | ||
| ], | ||
| "3": [ | ||
| [ | ||
| "MIFASER", | ||
| "mi-faser", | ||
| "mifaser 1.60 (03/23/20)" | ||
| ] | ||
| ], | ||
| "analysis": [ | ||
| [ | ||
| { | ||
| "id": "test", | ||
| "single_end": true | ||
| }, | ||
| "test_analysis.tsv:md5,d41d8cd98f00b204e9800998ecf8427e" | ||
| ] | ||
| ], | ||
| "ec_counts": [ | ||
| [ | ||
| { | ||
| "id": "test", | ||
| "single_end": true | ||
| }, | ||
| "test_ec_count.tsv:md5,d41d8cd98f00b204e9800998ecf8427e" | ||
| ] | ||
| ], | ||
| "multi_ec": [ | ||
| [ | ||
| { | ||
| "id": "test", | ||
| "single_end": true | ||
| }, | ||
| "test_multi_ec.tsv:md5,d41d8cd98f00b204e9800998ecf8427e" | ||
| ] | ||
| ], | ||
| "versions_mifaser": [ | ||
| [ | ||
| "MIFASER", | ||
| "mi-faser", | ||
| "mifaser 1.60 (03/23/20)" | ||
| ] | ||
| ] | ||
| } | ||
| ], | ||
| "timestamp": "2026-05-15T14:21:18.968578", | ||
| "meta": { | ||
| "nf-test": "0.9.5", | ||
| "nextflow": "26.04.1" | ||
| } | ||
| }, | ||
| "sarscov2 - single-end fastq": { | ||
| "content": [ | ||
| [ | ||
| [ | ||
| { | ||
| "id": "test", | ||
| "single_end": true | ||
| }, | ||
| "test_multi_ec.tsv:md5,08ad0cac1771a190e63cd76a3b3ab686" | ||
| ] | ||
| ], | ||
| [ | ||
| [ | ||
| { | ||
| "id": "test", | ||
| "single_end": true | ||
| }, | ||
| "test_analysis.tsv:md5,722399e3bfd7af4273b36779a111db8a" | ||
| ] | ||
| ], | ||
| [ | ||
| [ | ||
| { | ||
| "id": "test", | ||
| "single_end": true | ||
| }, | ||
| "test_ec_count.tsv:md5,195e3e0db1dd8b603a7e8d91e85e480d" | ||
| ] | ||
| ], | ||
| { | ||
| "versions_mifaser": [ | ||
| [ | ||
| "MIFASER", | ||
| "mi-faser", | ||
| "mifaser 1.60 (03/23/20)" | ||
| ] | ||
| ] | ||
| } | ||
| ], | ||
| "timestamp": "2026-05-15T14:21:10.040918", | ||
| "meta": { | ||
| "nf-test": "0.9.5", | ||
| "nextflow": "26.04.1" | ||
| } | ||
| } | ||
| } |
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.
If you need to use the database for every incoming sample ( sample 1, sample 2, etc.), you need to use
each: https://docs.seqera.io/nextflow/process#input-repeaters-eachOtherwise, the process will only run for the first incoming sample and not for potentially more