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
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

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
"""
}
23 changes: 16 additions & 7 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,9 +22,9 @@ 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
Expand Down Expand Up @@ -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
50 changes: 41 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,10 @@ 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),
process.out.versions_mygene[0]
).match() }
)
}
}
Expand All @@ -49,9 +51,10 @@ 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),
process.out.versions_mygene[0]
).match() }
)
}
}
Expand All @@ -74,8 +77,10 @@ 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),
process.out.versions_mygene[0]
).match() }
)
}
}
Expand All @@ -98,8 +103,35 @@ 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),
process.out.versions_mygene[0]
).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),
process.out.versions_mygene[0]
).match() }
)
}
}
Expand Down
Loading
Loading