Skip to content

Commit

Permalink
proovframe map init push (#6790)
Browse files Browse the repository at this point in the history
* proovframe map init push

* stub test renamed properly

* text contains test instead, because conda was failing (produces 0s column isntead of a values column)

* meta spacing fixed
  • Loading branch information
vagkaratzas authored Oct 16, 2024
1 parent aa2f432 commit eaeecb1
Show file tree
Hide file tree
Showing 5 changed files with 219 additions and 0 deletions.
7 changes: 7 additions & 0 deletions modules/nf-core/proovframe/map/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::proovframe=0.9.7"
48 changes: 48 additions & 0 deletions modules/nf-core/proovframe/map/main.nf
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
process PROOVFRAME_MAP {
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/proovframe:0.9.7--hdfd78af_1':
'biocontainers/proovframe:0.9.7--hdfd78af_1' }"

input:
tuple val(meta), path(faa), path(fasta)

output:
tuple val(meta), path("*.tsv"), emit: tsv
path "versions.yml" , emit: versions

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

script:
def args = task.ext.args ?: ''
def prefix = task.ext.prefix ?: "${meta.id}"
"""
proovframe \\
map \\
${args} \\
-a ${faa} \\
-o ${prefix}.tsv \\
${fasta}
cat <<-END_VERSIONS > versions.yml
"${task.process}":
proovframe: 0.9.7
END_VERSIONS
"""

stub:
def args = task.ext.args ?: ''
def prefix = task.ext.prefix ?: "${meta.id}"
"""
touch ${prefix}.tsv
cat <<-END_VERSIONS > versions.yml
"${task.process}":
proovframe: 0.9.7
END_VERSIONS
"""
}
56 changes: 56 additions & 0 deletions modules/nf-core/proovframe/map/meta.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
---
# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/meta-schema.json
name: "proovframe_map"
description: frame-shift correction for long read (meta)genomics - maps proteins to reads
keywords:
- frame-shift correction
- long-read sequencing
- sequence analysis
tools:
- "proovframe":
description: "frame-shift correction for long read (meta)genomics"
homepage: "https://github.com/thackl/proovframe"
documentation: "https://github.com/thackl/proovframe"
tool_dev_url: "https://github.com/thackl/proovframe"
doi: "10.1101/2021.08.23.457338"
licence: ["MIT"]
identifier: biotools:proovframe

input:
- - meta:
type: map
description: |
Groovy Map containing sample information
e.g. `[ id:'sample1', single_end:false ]`
- faa:
type: file
description: A FASTA file containing a database of guide protein sequences
pattern: "*.{faa,fasta,fa}"
- fasta:
type: file
description: A FASTA file containing raw read nucleotide sequences
pattern: "*.{fasta,fa}"

output:
- tsv:
- meta:
type: map
description: |
Groovy Map containing sample information
e.g. `[ id:'sample1', single_end:false ]`
- "*.tsv":
type: file
description: Output TSV file with the frameshift-aware protein to read alignments
pattern: "*.tsv"
- versions:
- "versions.yml":
type: file
description: File containing software versions
pattern: "versions.yml"

authors:
- "@manuelcarbajo"
- "@MGS-sails"
- "@vagkaratzas"
maintainers:
- "@vagkaratzas"
59 changes: 59 additions & 0 deletions modules/nf-core/proovframe/map/tests/main.nf.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
nextflow_process {

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

tag "modules"
tag "modules_nfcore"
tag "proovframe"
tag "proovframe/map"

test("sarscov2 - tsv") {

when {
process {
"""
input[0] = [
[ id:'test', single_end:false ], // meta map
file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/proteome.fasta', checkIfExists: true),
file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true)
]
"""
}
}

then {
assertAll(
{ assert process.success },
{ assert path(process.out.tsv[0][1]).text.contains('MT192765.1 ENSSASP00005000002.1 100.0 7096 1 0 259 21545 1') },
{ assert snapshot(process.out.versions).match() }
)
}

}

test("sarscov2 - tsv - stub") {
options '-stub'

when {
process {
"""
input[0] = [
[ id:'test', single_end:false ], // meta map
file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/proteome.fasta', checkIfExists: true),
file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true)
]
"""
}
}

then {
assertAll(
{ assert process.success },
{ assert snapshot(process.out).match() }
)
}
}

}
49 changes: 49 additions & 0 deletions modules/nf-core/proovframe/map/tests/main.nf.test.snap
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
{
"sarscov2 - tsv": {
"content": [
[
"versions.yml:md5,f49f29b8134fdb539364ee46855eb313"
]
],
"meta": {
"nf-test": "0.9.0",
"nextflow": "23.04.5"
},
"timestamp": "2024-10-16T15:02:00.599243234"
},
"sarscov2 - tsv - stub": {
"content": [
{
"0": [
[
{
"id": "test",
"single_end": false
},
"test.tsv:md5,d41d8cd98f00b204e9800998ecf8427e"
]
],
"1": [
"versions.yml:md5,f49f29b8134fdb539364ee46855eb313"
],
"tsv": [
[
{
"id": "test",
"single_end": false
},
"test.tsv:md5,d41d8cd98f00b204e9800998ecf8427e"
]
],
"versions": [
"versions.yml:md5,f49f29b8134fdb539364ee46855eb313"
]
}
],
"meta": {
"nf-test": "0.9.0",
"nextflow": "23.04.5"
},
"timestamp": "2024-10-16T15:02:21.855444606"
}
}

0 comments on commit eaeecb1

Please sign in to comment.