Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
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
14 changes: 13 additions & 1 deletion modules/nf-core/mygene/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,23 @@ process MYGENE {
output:
tuple val(meta), path("*.gmt"), emit: gmt
tuple val(meta), path("*.tsv"), emit: tsv , optional: true
path "versions.yml" , emit: versions
path "versions.yml" , emit: versions_mygene, topic: versions
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

You forgot this part


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

script:
template "mygene.py"

stub:
def prefix = task.ext.prefix ?: "${meta.id}"
"""
touch ${prefix}.gmt
touch ${prefix}.tsv

cat <<-END_VERSIONS > versions.yml
"${task.process}":
mygene: \$(python3 -c 'import mygene; print(mygene.__version__)')
END_VERSIONS
"""
}
27 changes: 18 additions & 9 deletions modules/nf-core/mygene/meta.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ tools:
documentation: "https://docs.mygene.info/projects/mygene-py/en/latest/"
tool_dev_url: "https://github.com/biothings/mygene.py"
doi: "10.1093/nar/gks1114"
licence: ["Apache-2.0"]
licence:
- "Apache-2.0"
identifier: biotools:mygene

input:
- - meta:
type: map
Expand All @@ -22,13 +22,13 @@ input:
e.g. `[ id:'sample1' ]`
- gene_list:
type: file
description: A tsv/csv file that contains a list of gene ids in one of the columns.
By default, the column name should be "gene_id", but this can be changed by
using "--columname gene_id" in ext.args.
description: A tsv/csv file that contains a list of gene ids in one of the
columns. By default, the column name should be "gene_id", but this can
be changed by using "--columname gene_id" in ext.args.
pattern: "*.{csv,tsv}"
ontologies:
- edam: http://edamontology.org/format_3752 # CSV
- edam: http://edamontology.org/format_3475 # TSV
- edam: http://edamontology.org/format_3752
Comment thread
mribeirodantas marked this conversation as resolved.
Outdated
- edam: http://edamontology.org/format_3475
output:
gmt:
- - meta:
Expand All @@ -55,14 +55,23 @@ output:
query, mygene_id, go_id, go_term, go_evidence, go_category, symbol, name, taxid
pattern: "*.tsv"
ontologies:
- edam: http://edamontology.org/format_3475 # TSV
- edam: http://edamontology.org/format_3475

versions_mygene:
- versions.yml:
type: file
description: File containing software versions
pattern: "versions.yml"
ontologies:
- edam: http://edamontology.org/format_3750
topics:
versions:
- versions.yml:
type: file
description: File containing software versions
pattern: "versions.yml"
ontologies:
- edam: http://edamontology.org/format_3750 # YAML
- edam: http://edamontology.org/format_3750
authors:
- "@suzannejin"
maintainers:
Expand Down
35 changes: 26 additions & 9 deletions modules/nf-core/mygene/tests/main.nf.test
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@ nextflow_process {
then {
assertAll(
{ assert process.success },
{ assert snapshot(process.out.gmt).match("mygene - default options - gmt") },
{ assert snapshot(process.out.versions).match("mygene - default options - versions") }
{ assert snapshot(sanitizeOutput(process.out)).match() }
)
}
}
Expand All @@ -49,9 +48,7 @@ nextflow_process {
then {
assertAll(
{ assert process.success },
{ assert snapshot(process.out.gmt).match("mygene - default with tsv file - gmt") },
{ assert snapshot(process.out.tsv).match("mygene - default with tsv file - tsv") },
{ assert snapshot(process.out.versions).match("mygene - default with tsv file - versions") }
{ assert snapshot(sanitizeOutput(process.out)).match() }
)
}
}
Expand All @@ -74,8 +71,7 @@ nextflow_process {
then {
assertAll(
{ assert process.success },
{ assert snapshot(process.out.gmt).match("mygene - filter by go category - gmt") },
{ assert snapshot(process.out.versions).match("mygene - filter by go category - versions") }
{ assert snapshot(sanitizeOutput(process.out)).match() }
)
}
}
Expand All @@ -98,8 +94,29 @@ nextflow_process {
then {
assertAll(
{ assert process.success },
{ assert snapshot(process.out.gmt).match("mygene - filter by go evidence - gmt") },
{ assert snapshot(process.out.versions).match("mygene - filter by go evidence - versions") }
{ assert snapshot(sanitizeOutput(process.out)).match() }
)
}
}

test("mygene - stub") {

options "-stub"

when {
process {
"""
input[0] = [
[id : 'test'],
file("https://raw.githubusercontent.com/nf-core/test-datasets/modules/data/genomics/mus_musculus/rnaseq_expression/SRP254919.gene_meta.tsv")
]
"""
}
}
then {
assertAll(
{ assert process.success },
{ assert snapshot(sanitizeOutput(process.out)).match() }
)
}
}
Expand Down
Loading
Loading