Skip to content

Commit

Permalink
hmmalign version bump. standardised output format, ported to nf-test
Browse files Browse the repository at this point in the history
  • Loading branch information
vagkaratzas committed Nov 13, 2024
1 parent 76fc14f commit 8d30931
Show file tree
Hide file tree
Showing 6 changed files with 149 additions and 12 deletions.
2 changes: 1 addition & 1 deletion modules/nf-core/hmmer/hmmalign/environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ channels:
- conda-forge
- bioconda
dependencies:
- bioconda::hmmer=3.3.2
- bioconda::hmmer=3.4
21 changes: 16 additions & 5 deletions modules/nf-core/hmmer/hmmalign/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,16 @@ process HMMER_HMMALIGN {

conda "${moduleDir}/environment.yml"
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
'https://depot.galaxyproject.org/singularity/hmmer:3.3.2--h1b792b2_1' :
'biocontainers/hmmer:3.3.2--h1b792b2_1' }"
'https://depot.galaxyproject.org/singularity/hmmer:3.4--hdbdd923_2' :
'biocontainers/hmmer:3.4--hdbdd923_2' }"

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

output:
tuple val(meta), path("*.sthlm.gz"), emit: sthlm
path "versions.yml" , emit: versions
tuple val(meta), path("*.sto.gz"), emit: sto
path "versions.yml" , emit: versions

when:
task.ext.when == null || task.ext.when
Expand All @@ -25,7 +25,18 @@ process HMMER_HMMALIGN {
hmmalign \\
$args \\
$hmm \\
$fasta | gzip -c > ${prefix}.sthlm.gz
$fasta | gzip -c > ${prefix}.sto.gz
cat <<-END_VERSIONS > versions.yml
"${task.process}":
hmmer: \$(hmmalign -h | grep -o '^# HMMER [0-9.]*' | sed 's/^# HMMER *//')
END_VERSIONS
"""

stub:
def prefix = task.ext.prefix ?: "${meta.id}"
"""
echo | gzip > ${prefix}.sto.gz
cat <<-END_VERSIONS > versions.yml
"${task.process}":
Expand Down
7 changes: 4 additions & 3 deletions modules/nf-core/hmmer/hmmalign/meta.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,16 +30,16 @@ input:
description: A gzipped HMM file
pattern: "*.hmm.gz"
output:
- sthlm:
- sto:
- meta:
type: map
description: |
Groovy Map containing sample information
e.g. [ id:'test', single_end:false ]
- "*.sthlm.gz":
- "*.sto.gz":
type: file
description: Multiple alignment in gzipped Stockholm format
pattern: "*.sthlm.gz"
pattern: "*.sto.gz"
- versions:
- versions.yml:
type: file
Expand All @@ -51,3 +51,4 @@ authors:
maintainers:
- "@erikrikarddaniel"
- "@jfy133"
- "@vagkaratzas"
60 changes: 60 additions & 0 deletions modules/nf-core/hmmer/hmmalign/tests/main.nf.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@

nextflow_process {

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

tag "modules"
tag "modules_nfcore"
tag "hmmer"
tag "hmmer/hmmalign"

test("test-hmmer-hmmalign") {

when {
process {
"""
input[0] = [
[ id: 'test' ], // meta map
file(params.modules_testdata_base_path + 'delete_me/hmmer/e_coli_k12_16s.fna.gz', checkIfExists: true)
]
input[1] = file(params.modules_testdata_base_path + 'delete_me/hmmer/bac.16S_rRNA.hmm.gz', checkIfExists: true)
"""
}
}

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

test("test-hmmer-hmmalign-stub") {
options '-stub'

when {
process {
"""
input[0] = [
[ id: 'test' ], // meta map
file(params.modules_testdata_base_path + 'delete_me/hmmer/e_coli_k12_16s.fna.gz', checkIfExists: true)
]
input[1] = file(params.modules_testdata_base_path + 'delete_me/hmmer/bac.16S_rRNA.hmm.gz', checkIfExists: true)
"""
}
}

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

}
68 changes: 68 additions & 0 deletions modules/nf-core/hmmer/hmmalign/tests/main.nf.test.snap
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
{
"test-hmmer-hmmalign": {
"content": [
{
"0": [
[
{
"id": "test"
},
"test.sto.gz:md5,4ae989d5ade2aaae9578cb88ba031e8f"
]
],
"1": [
"versions.yml:md5,601e13e7a1e6057766d862a828d501c4"
],
"sto": [
[
{
"id": "test"
},
"test.sto.gz:md5,4ae989d5ade2aaae9578cb88ba031e8f"
]
],
"versions": [
"versions.yml:md5,601e13e7a1e6057766d862a828d501c4"
]
}
],
"meta": {
"nf-test": "0.9.0",
"nextflow": "23.04.5"
},
"timestamp": "2024-11-13T12:37:26.551497424"
},
"test-hmmer-hmmalign-stub": {
"content": [
{
"0": [
[
{
"id": "test"
},
"test.sto.gz:md5,68b329da9893e34099c7d8ad5cb9c940"
]
],
"1": [
"versions.yml:md5,601e13e7a1e6057766d862a828d501c4"
],
"sto": [
[
{
"id": "test"
},
"test.sto.gz:md5,68b329da9893e34099c7d8ad5cb9c940"
]
],
"versions": [
"versions.yml:md5,601e13e7a1e6057766d862a828d501c4"
]
}
],
"meta": {
"nf-test": "0.9.0",
"nextflow": "23.04.5"
},
"timestamp": "2024-11-13T12:37:32.244343836"
}
}
3 changes: 0 additions & 3 deletions tests/config/pytest_modules.yml
Original file line number Diff line number Diff line change
Expand Up @@ -299,9 +299,6 @@ hmmer/eslalimask:
hmmer/eslreformat:
- modules/nf-core/hmmer/eslreformat/**
- tests/modules/nf-core/hmmer/eslreformat/**
hmmer/hmmalign:
- modules/nf-core/hmmer/hmmalign/**
- tests/modules/nf-core/hmmer/hmmalign/**
hmtnote/annotate:
- modules/nf-core/hmtnote/annotate/**
- tests/modules/nf-core/hmtnote/annotate/**
Expand Down

0 comments on commit 8d30931

Please sign in to comment.