Skip to content

hhblits #8697

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

Merged
merged 5 commits into from
Jun 24, 2025
Merged

hhblits #8697

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
7 changes: 7 additions & 0 deletions modules/nf-core/hhsuite/hhblits/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::hhsuite=3.3.0
58 changes: 58 additions & 0 deletions modules/nf-core/hhsuite/hhblits/main.nf
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
process HHSUITE_HHBLITS {
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/hhsuite:3.3.0--py311pl5321h9f068be_13':
'biocontainers/hhsuite:3.3.0--py311pl5321h9f068be_13' }"

input:
tuple val(meta) , path(aln)
tuple val(meta2), path(hh_db)

output:
tuple val(meta), path("*.hhr"), emit: hhr
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}"
def is_compressed = aln.getExtension() == "gz" ? true : false
def aln_name = is_compressed ? aln.getBaseName() : aln
"""
if [ "${is_compressed}" == "true" ]; then
gzip -c -d ${aln} > ${aln_name}
fi
file=\$(find ${hh_db}/ -type f -name '*_cs219.ffdata' | head -n 1)
base=\$(basename "\$file")
db_name=\${base%_cs219.ffdata}
hhblits \\
$args \\
-cpu $task.cpus \\
-i ${aln_name} \\
-d ${hh_db}/\$db_name \\
-o ${prefix}.hhr
cat <<-END_VERSIONS > versions.yml
"${task.process}":
hh-suite: \$(hhblits -h | grep 'HHblits' | sed -n -e 's/.*\\([0-9]\\+\\.[0-9]\\+\\.[0-9]\\+\\).*/\\1/p')
END_VERSIONS
"""

stub:
def prefix = task.ext.prefix ?: "${meta.id}"
"""
touch ${prefix}.hhr
cat <<-END_VERSIONS > versions.yml
"${task.process}":
hh-suite: \$(hhblits -h | grep 'HHblits' | sed -n -e 's/.*\\([0-9]\\+\\.[0-9]\\+\\.[0-9]\\+\\).*/\\1/p')
END_VERSIONS
"""
}
60 changes: 60 additions & 0 deletions modules/nf-core/hhsuite/hhblits/meta.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/meta-schema.json
name: "hhsuite_hhblits"
description: Fast and sensitive protein sequence searching based on the pairwise alignment
of hidden Markov models (HMMs)
keywords:
- sensitive search
- HMM
- alignment
tools:
- "hhsuite":
description: "HH-suite3 for fast remote homology detection and deep protein annotation"
homepage: "https://github.com/soedinglab/hh-suite"
documentation: "https://github.com/soedinglab/hh-suite/wiki"
tool_dev_url: "https://github.com/soedinglab/hh-suite"
doi: "10.1371/journal.pone.0082138"
licence: ["GPL v3"]
identifier: biotools:hh-suite
input:
- - meta:
type: map
description: |
Groovy Map containing sample information
e.g. `[ id:'sample1' ]`
- aln:
type: file
description: Input multiple sequence alignment file in a2m or a3m format
pattern: "*.{a2m,a2m.gz,a3m,a3m.gz}"
ontologies:
- edam: "http://edamontology.org/format_3281" # A2M
- - meta2:
type: map
description: |
Groovy Map containing sample information
e.g. `[ id:'sample1' ]`
- hh_db:
type: directory
description: Input hhsuite formatted database
pattern: "*/"
output:
- hhr:
- meta:
type: map
description: |
Groovy Map containing sample information
e.g. `[ id:'sample1' ]`
- "*.hhr":
type: file
description: Human-readable result file in a custom text format designed by the HH-suite
pattern: "*.hhr"
- versions:
- versions.yml:
type: file
description: File containing software versions
pattern: "versions.yml"
ontologies:
- edam: http://edamontology.org/format_3750 # YAML
authors:
- "@vagkaratzas"
maintainers:
- "@vagkaratzas"
87 changes: 87 additions & 0 deletions modules/nf-core/hhsuite/hhblits/tests/main.nf.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
nextflow_process {

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

tag "modules"
tag "modules_nfcore"
tag "hhsuite"
tag "hhsuite/reformat"
tag "hhsuite/hhblits"
tag "untar"

setup {
run ("UNTAR") {
script "../../../untar/main.nf"
process {
"""
input[0] = [
[ id:'pfam' ],
file(params.modules_testdata_base_path + 'proteomics/hhsuite/pfam.tar.gz', checkIfExists: true)
]
"""
}
}

run("HHSUITE_REFORMAT") {
script "../../reformat/main.nf"
process {
"""
input[0] = [
[ id:'test' ],
file(params.modules_testdata_base_path + '../../multiplesequencealign/testdata/setoxin.ref', checkIfExists: true)
]
input[1] = "fas"
input[2] = "a3m"
"""
}
}
}

test("multiplesequencealign - setoxin - a3m") {

when {
process {
"""
input[0] = HHSUITE_REFORMAT.out.msa
input[1] = UNTAR.out.untar
"""
}
}

then {
assertAll(
{ assert process.success },
{ assert path(process.out.hhr[0][1]).text.contains('F1R383_DANRE/124-372') },
{ assert snapshot(
process.out.versions.collect { path(it).yaml }
).match()}
)
}

}

test("multiplesequencealign - setoxin - a3m - stub") {

options "-stub"

when {
process {
"""
input[0] = HHSUITE_REFORMAT.out.msa
input[1] = UNTAR.out.untar
"""
}
}

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

}

}
51 changes: 51 additions & 0 deletions modules/nf-core/hhsuite/hhblits/tests/main.nf.test.snap
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
{
"multiplesequencealign - setoxin - a3m": {
"content": [
[
{
"HHSUITE_HHBLITS": {
"hh-suite": "3.3.0"
}
}
]
],
"meta": {
"nf-test": "0.9.2",
"nextflow": "25.04.4"
},
"timestamp": "2025-06-24T10:38:48.008591861"
},
"multiplesequencealign - setoxin - a3m - stub": {
"content": [
{
"0": [
[
{
"id": "test"
},
"test.hhr:md5,d41d8cd98f00b204e9800998ecf8427e"
]
],
"1": [
"versions.yml:md5,fd681533d725c041db71d10567cabaea"
],
"hhr": [
[
{
"id": "test"
},
"test.hhr:md5,d41d8cd98f00b204e9800998ecf8427e"
]
],
"versions": [
"versions.yml:md5,fd681533d725c041db71d10567cabaea"
]
}
],
"meta": {
"nf-test": "0.9.2",
"nextflow": "25.04.4"
},
"timestamp": "2025-06-24T10:38:56.32982718"
}
}
Loading