Skip to content
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

ADD CATPACK_DOWNLOAD #7253

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
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
7 changes: 7 additions & 0 deletions modules/nf-core/catpack/download/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::cat=6.0.1"
47 changes: 47 additions & 0 deletions modules/nf-core/catpack/download/main.nf
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
process CATPACK_DOWNLOAD {
tag "${meta.id}"
label 'process_single'

conda "${moduleDir}/environment.yml"
container "${workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container
? 'https://depot.galaxyproject.org/singularity/cat:6.0.1--hdfd78af_0'
: 'biocontainers/cat:6.0.1--hdfd78af_0'}"

input:
tuple val(meta), val(db)

output:
tuple val(meta), path("${db}/"), emit: rawdb
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}"
"""
CAT_pack \\
download \\
${args} \\
--db ${db}
-o ${prefix}/

cat <<-END_VERSIONS > versions.yml
"${task.process}":
catpack: \$(CAT_pack --version | sed 's/CAT_pack pack v//g;s/ .*//g')
END_VERSIONS
"""

stub:
def args = task.ext.args ?: ''
def prefix = task.ext.prefix ?: "${meta.id}"
"""
mkdir ${prefix}/

cat <<-END_VERSIONS > versions.yml
"${task.process}":
catpack: \$(CAT_pack --version | sed 's/CAT_pack pack v//g;s/ .*//g')
END_VERSIONS
"""
}
51 changes: 51 additions & 0 deletions modules/nf-core/catpack/download/meta.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
---
name: "catpack_download"
description: Downloads the required files for either Nr or GTDB for building into a CAT database
keywords:
- taxonomic classification
- classification
- database
- download
tools:
- "catpack":
description: "CAT/BAT: tool for taxonomic classification of contigs and metagenome-assembled genomes (MAGs)"
homepage: "https://github.com/MGXlab/CAT_pack"
documentation: "https://github.com/MGXlab/CAT_pack"
tool_dev_url: "https://github.com/MGXlab/CAT_pack"
doi: "10.1186/s13059-019-1817-x"
licence: ["MIT"]

input:
- - meta:
type: map
description: |
Groovy Map containing sample information
e.g. `[ id:'sample1', single_end:false ]`
- db:
type: string
description: Which database to download
pattern: "nr|gtdb"

output:
- rawdb:
- meta:
type: map
description: |
Groovy Map containing sample information
e.g. `[ id:'sample1', single_end:false ]`
- "${db}/":
type: directory
description: Directory containing all the required NCBI Nr or GTDB database files required for building into a CAT database
pattern: "${db}/"
ontologies:
- edam: "http://edamontology.org/data_1049"
- versions:
- "versions.yml":
type: file
description: File containing software versions
pattern: "versions.yml"

authors:
- "@jfy133"
maintainers:
- "@jfy133"
37 changes: 37 additions & 0 deletions modules/nf-core/catpack/download/tests/main.nf.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
nextflow_process {

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

tag "modules"
tag "modules_nfcore"
tag "catpack"
tag "catpack/download"

jfy133 marked this conversation as resolved.
Show resolved Hide resolved
// Only stub because module downloads extremely large
test("nr - stub") {

options "-stub"

when {
process {
"""
input[0] = [
[ id:'nr', single_end:false ], // meta map
'nr',
]
"""
}
}

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

}

}
41 changes: 41 additions & 0 deletions modules/nf-core/catpack/download/tests/main.nf.test.snap
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
{
"nr - stub": {
"content": [
{
"0": [
[
{
"id": "nr",
"single_end": false
},
[

]
]
],
"1": [
"versions.yml:md5,e1493fe75b3b8cc2bc0cbd1d5ddfad44"
],
"rawdb": [
[
{
"id": "nr",
"single_end": false
},
[

]
]
],
"versions": [
"versions.yml:md5,e1493fe75b3b8cc2bc0cbd1d5ddfad44"
]
}
],
"meta": {
"nf-test": "0.9.0",
"nextflow": "24.10.2"
},
"timestamp": "2024-12-19T16:19:22.533589236"
}
}
4 changes: 2 additions & 2 deletions modules/nf-core/coptr/estimate/meta.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ input:
description: Python pickle file containing coverage maps
pattern: "*.pkl"
ontologies:
- edam: "http://edamontology.org/format_4002"
- edam: "http://edamontology.org/format_4002"

output:
- ptr:
Expand All @@ -42,7 +42,7 @@ output:
description: CSV table with rows as reference genomes, columns samples and entries as log2 PTR
pattern: "*.csv"
ontologies:
- edam: "http://edamontology.org/format_3752"
- edam: "http://edamontology.org/data_3752"
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
- edam: "http://edamontology.org/data_3752"
- edam: "http://edamontology.org/format_3752"

I think you want format here; with data the link would be broken.


- versions:
- "versions.yml":
Expand Down
Loading