Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
b3954d5
local-cd-search annotate and download modules
Ales-ibt Jan 9, 2026
895b307
Fixing lint
Ales-ibt Jan 9, 2026
acd1f00
Merge branch 'master' into feature/localcdsearch
Ales-ibt Jan 9, 2026
c344319
Update localcdsearch tool metadata in meta.yml
Ales-ibt Jan 9, 2026
8b108c0
Fix container URL selection logic in main.nf
Ales-ibt Jan 9, 2026
2ea6819
Fix container URL for local-cd-search
Ales-ibt Jan 9, 2026
3bb7e77
Fix container URL for local-cd-search
Ales-ibt Jan 9, 2026
a62d497
Fix container URL for local-cd-search
Ales-ibt Jan 9, 2026
9c89f90
Fix container URL for local-cd-search
Ales-ibt Jan 9, 2026
e4e0752
Fix container URL for local-cd-search
Ales-ibt Jan 9, 2026
a8e7d5c
Update modules/nf-core/localcdsearch/annotate/main.nf
Ales-ibt Jan 9, 2026
b7c1b43
Update modules/nf-core/localcdsearch/download/main.nf
Ales-ibt Jan 9, 2026
cd88e7f
Update modules/nf-core/localcdsearch/download/main.nf
Ales-ibt Jan 9, 2026
68fd0c8
Update modules/nf-core/localcdsearch/download/main.nf
Ales-ibt Jan 9, 2026
6fe433a
Update modules/nf-core/localcdsearch/download/main.nf
Ales-ibt Jan 9, 2026
b2a2fd9
Update modules/nf-core/localcdsearch/download/main.nf
Ales-ibt Jan 9, 2026
979823f
Update modules/nf-core/localcdsearch/download/main.nf
Ales-ibt Jan 9, 2026
6366acd
Update modules/nf-core/localcdsearch/download/meta.yml
Ales-ibt Jan 9, 2026
59e6941
Update modules/nf-core/localcdsearch/download/meta.yml
Ales-ibt Jan 9, 2026
3bee222
Update modules/nf-core/localcdsearch/download/meta.yml
Ales-ibt Jan 9, 2026
822536c
Singularity container added
Ales-ibt Jan 9, 2026
289b1af
edamontology added
Ales-ibt Jan 9, 2026
448a4ea
Updating test for one input only
Ales-ibt Jan 9, 2026
5426030
Updating snap
Ales-ibt Jan 9, 2026
86024dc
Updating test for db downloding
Ales-ibt Jan 9, 2026
c953ca8
Merge branch 'master' into feature/localcdsearch
Ales-ibt Jan 9, 2026
301780d
Merge branch 'master' into feature/localcdsearch
Ales-ibt Jan 12, 2026
b9a6632
Merge branch 'master' into feature/localcdsearch
Ales-ibt Jan 12, 2026
2c803fd
Update version handling in main.nf
Ales-ibt Jan 12, 2026
2c329bb
Update version expression in meta.yml
Ales-ibt Jan 12, 2026
bf16933
Refactor version handling in main.nf
Ales-ibt Jan 12, 2026
8a6184a
Update version retrieval expression in meta.yml
Ales-ibt Jan 12, 2026
64d0174
Add version information to stub
Ales-ibt Jan 12, 2026
2e368d7
Add version information to stub
Ales-ibt Jan 12, 2026
84f955a
Merge branch 'master' into feature/localcdsearch
Ales-ibt Jan 12, 2026
a75edc7
Update modules/nf-core/localcdsearch/download/meta.yml
Ales-ibt Jan 12, 2026
dd7c915
Refactor assertions to include process success check
Ales-ibt Jan 12, 2026
ede89e2
Refactor assertions for process success in tests
Ales-ibt Jan 12, 2026
6a5bb84
Merge branch 'master' into feature/localcdsearch
Ales-ibt Jan 12, 2026
bf7db4d
Update container URL for local-cd-search
Ales-ibt Jan 12, 2026
0d9b181
Remove redundant success assertion in tests
Ales-ibt Jan 12, 2026
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/localcdsearch/annotate/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::local-cd-search=0.3.0"
53 changes: 53 additions & 0 deletions modules/nf-core/localcdsearch/annotate/main.nf
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
process LOCALCDSEARCH_ANNOTATE {
tag "$meta.id"
label 'process_medium'

conda "${moduleDir}/environment.yml"
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
'https://community-cr-prod.seqera.io/docker/registry/v2/blobs/sha256/e1/e1ed921c933d8eeeb0db6d72ece09ec25edab9ad441c84b070acff1592af2d54/data' :
'biocontainers/local-cd-search:0.3.0--pyhdfd78af_0' }"

input:
tuple val(meta), path(fasta)
path db
val sites

output:
tuple val(meta), path("*_results.tsv"), emit: result
tuple val(meta), path("*_sites.tsv") , emit: annot_sites, optional: true
tuple val("${task.process}"), val('local-cd-search'), eval("echo ${VERSION}"), topic: versions, emit: versions_localcdsearch

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

script:
def args = task.ext.args ?: ''
VERSION = '0.3.0' // WARN: Version information not provided by tool on CLI. Please update this string when bumping container versions.
def prefix = task.ext.prefix ?: "${meta.id}"
def val_flag = sites ? "--sites-output ${prefix}_sites.tsv" : ''
def is_compressed = fasta.getExtension() == "gz"
def fasta_name = is_compressed ? fasta.getBaseName() : fasta
def uncompress_input = is_compressed ? "gzip -c -d ${fasta} > ${fasta_name}" : ''
"""
$uncompress_input

local-cd-search \\
annotate \\
$args \\
$val_flag \\
--threads $task.cpus \\
${fasta_name} \\
${prefix}_results.tsv \\
${db}
"""

stub:
def args = task.ext.args ?: ''
VERSION = '0.3.0' // WARN: Version information not provided by tool on CLI. Please update this string when bumping container versions.
def prefix = task.ext.prefix ?: "${meta.id}"
"""
echo $args
touch ${prefix}_results.tsv
${sites ? "touch ${prefix}_sites.tsv" : ''}
"""
}
89 changes: 89 additions & 0 deletions modules/nf-core/localcdsearch/annotate/meta.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/meta-schema.json
name: "localcdsearch_annotate"
description: A command-line tool for local protein domain annotation using NCBI's Conserved Domain Database (CDD)
keywords:
- cdd
- rpsblast
- rpsbproc
- protein
- domain
- annotation
tools:
- "localcdsearch":
description: "Protein annotation using local PSSM databases from CDD."
homepage: "https://github.com/apcamargo/local-cd-search"
documentation: "https://github.com/apcamargo/local-cd-search"
tool_dev_url: "https://github.com/apcamargo/local-cd-search"
licence: ["MIT"]
identifier: ""
input:
- - meta:
type: map
description: |
Groovy Map containing sample information
e.g. `[ id:'sample1' ]`
- fasta:
type: file
description: Input fasta file containing protein queries sequences
pattern: "*.{fa,fasta,fa.gz,fasta.gz}"
ontologies:
- edam: "http://edamontology.org/format_1929" # FASTA
- db:
type: directory
description: Directory containing the metadata and databse directories
pattern: "*"
- sites:
type: boolean
description: When true an extra tsv output file is generated

output:
result:
- - meta:
type: map
description: |
Groovy Map containing sample information
e.g. `[ id:'sample1' ]`
- "*_results.tsv":
type: file
description: tab-separated file with hits filtered by CDD's curated bit-score thresholds
pattern: "*_results.tsv"
ontologies:
- edam: http://edamontology.org/format_3475 # TSV
annot_sites:
- - meta:
type: map
description: |
Groovy Map containing sample information
e.g. `[ id:'sample1' ]`
- "*_sites.tsv":
type: file
description: If --sites-output is specified, an additional tab-separated file is created with functional site annotations
pattern: "*_sites.tsv"
ontologies:
- edam: http://edamontology.org/format_3475 # TSV
versions_localcdsearch:
- - "${task.process}":
type: string
description: The name of the process
- "local-cd-search":
type: string
description: The name of the tool
- "echo ${VERSION}":
type: eval
description: The expression to obtain the version of the tool

topics:
versions:
- - ${task.process}:
type: string
description: The name of the process
- local-cd-search:
type: string
description: The name of the tool
- echo ${VERSION}:
type: eval
description: The expression to obtain the version of the tool
authors:
- "@Ales-ibt"
maintainers:
- "@Ales-ibt"
126 changes: 126 additions & 0 deletions modules/nf-core/localcdsearch/annotate/tests/main.nf.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,126 @@
nextflow_process {

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

tag "modules"
tag "modules_nfcore"
tag "localcdsearch"
tag "localcdsearch/annotate"
tag "localcdsearch/download"

setup {
run("LOCALCDSEARCH_DOWNLOAD") {
script "../../download/main.nf"
process {
"""
input[0] = ['smart']
"""
}
}
}

test("sarscov2 - smart") {

when {
process {
"""
input[0] = [ [id:'test'], file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/proteome.fasta', checkIfExists: true) ]
input[1] = LOCALCDSEARCH_DOWNLOAD.out.db
Copy link
Contributor

Choose a reason for hiding this comment

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

Just curious, if you had downloaded multiple dbs, would this still be the same? Or do you need to select one or more of the downloaded dbs somehow?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The downloader tool creates the databases directory structure and the annotator detects all the available databases in the given directory. Then the tool runs the annotation versus ALL the detected databases. There's no way to select which database to use when multiple databases exists

input[2] = false
"""
}
}

then {
assertAll (
{ assert process.success },
{ assert snapshot(
process.out.result,
process.out.findAll { key, val -> key.startsWith("versions")}
).match() }
)
}

}

test("sarscov2 - smart - stub") {

options "-stub"

when {
process {
"""
input[0] = [ [id:'test'], file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/proteome.fasta', checkIfExists: true) ]
input[1] = LOCALCDSEARCH_DOWNLOAD.out.db
input[2] = false
"""
}
}

then {
assertAll(
{ assert process.success },
{ assert snapshot(
process.out.result,
process.out.findAll { key, val -> key.startsWith("versions")}
).match() }
)
}

}

test("sarscov2 - smart - sites") {

when {
process {
"""
input[0] = [ [id:'test'], file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/proteome.fasta', checkIfExists: true) ]
input[1] = LOCALCDSEARCH_DOWNLOAD.out.db
input[2] = true
"""
}
}

then {
assertAll(
{ assert process.success },
{ assert snapshot(
process.out.result,
process.out.annot_sites,
process.out.findAll { key, val -> key.startsWith("versions")}
).match() }
)
}

}

test("sarscov2 - smart - sites - stub") {

options "-stub"

when {
process {
"""
input[0] = [ [id:'test'], file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/proteome.fasta', checkIfExists: true) ]
input[1] = LOCALCDSEARCH_DOWNLOAD.out.db
input[2] = true
"""
}
}

then {
assertAll(
{ assert process.success },
{ assert snapshot(
process.out.result,
process.out.annot_sites,
process.out.findAll { key, val -> key.startsWith("versions")}
).match() }
)
}

}

}
Loading
Loading