From ef59688f2fdf627272f3746535268e492615f47b Mon Sep 17 00:00:00 2001 From: "James A. Fellows Yates" Date: Thu, 19 Dec 2024 14:58:42 +0100 Subject: [PATCH 1/5] Add CAT_pack download --- .../nf-core/catpack/download/environment.yml | 7 +++ modules/nf-core/catpack/download/main.nf | 47 ++++++++++++++++ modules/nf-core/catpack/download/meta.yml | 53 +++++++++++++++++++ .../catpack/download/tests/main.nf.test | 37 +++++++++++++ .../catpack/download/tests/main.nf.test.snap | 41 ++++++++++++++ 5 files changed, 185 insertions(+) create mode 100644 modules/nf-core/catpack/download/environment.yml create mode 100644 modules/nf-core/catpack/download/main.nf create mode 100644 modules/nf-core/catpack/download/meta.yml create mode 100644 modules/nf-core/catpack/download/tests/main.nf.test create mode 100644 modules/nf-core/catpack/download/tests/main.nf.test.snap diff --git a/modules/nf-core/catpack/download/environment.yml b/modules/nf-core/catpack/download/environment.yml new file mode 100644 index 00000000000..20d286ab5b7 --- /dev/null +++ b/modules/nf-core/catpack/download/environment.yml @@ -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" diff --git a/modules/nf-core/catpack/download/main.nf b/modules/nf-core/catpack/download/main.nf new file mode 100644 index 00000000000..003989de80e --- /dev/null +++ b/modules/nf-core/catpack/download/main.nf @@ -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 + """ +} diff --git a/modules/nf-core/catpack/download/meta.yml b/modules/nf-core/catpack/download/meta.yml new file mode 100644 index 00000000000..c22e352913a --- /dev/null +++ b/modules/nf-core/catpack/download/meta.yml @@ -0,0 +1,53 @@ +--- +name: "catpack_download" +## TODO nf-core: Add a description of the module and list keywords +description: write your description here +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"] + identifier: + +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/format_1049" + - versions: + - "versions.yml": + type: file + description: File containing software versions + pattern: "versions.yml" + +authors: + - "@jfy133" +maintainers: + - "@jfy133" diff --git a/modules/nf-core/catpack/download/tests/main.nf.test b/modules/nf-core/catpack/download/tests/main.nf.test new file mode 100644 index 00000000000..75060b19a30 --- /dev/null +++ b/modules/nf-core/catpack/download/tests/main.nf.test @@ -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" + + + 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() } + ) + } + + } + +} diff --git a/modules/nf-core/catpack/download/tests/main.nf.test.snap b/modules/nf-core/catpack/download/tests/main.nf.test.snap new file mode 100644 index 00000000000..5b7b7c01db5 --- /dev/null +++ b/modules/nf-core/catpack/download/tests/main.nf.test.snap @@ -0,0 +1,41 @@ +{ + "nr - stub": { + "content": [ + { + "0": [ + [ + { + "id": "nr", + "single_end": false + }, + [ + + ] + ] + ], + "1": [ + "versions.yml:md5,d851e296d4025a8060b6283ad3b63937" + ], + "rawdb": [ + [ + { + "id": "nr", + "single_end": false + }, + [ + + ] + ] + ], + "versions": [ + "versions.yml:md5,d851e296d4025a8060b6283ad3b63937" + ] + } + ], + "meta": { + "nf-test": "0.9.0", + "nextflow": "24.10.2" + }, + "timestamp": "2024-12-19T14:56:46.720677474" + } +} \ No newline at end of file From bb39d2685691b9373fecc03d692654085a6c8314 Mon Sep 17 00:00:00 2001 From: "James A. Fellows Yates" Date: Thu, 19 Dec 2024 14:59:08 +0100 Subject: [PATCH 2/5] Fixl inting --- modules/nf-core/catpack/download/meta.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/nf-core/catpack/download/meta.yml b/modules/nf-core/catpack/download/meta.yml index c22e352913a..fc8e36dbbc2 100644 --- a/modules/nf-core/catpack/download/meta.yml +++ b/modules/nf-core/catpack/download/meta.yml @@ -10,10 +10,10 @@ keywords: 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 + 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 + doi: "10.1186/s13059-019-1817-x" licence: ["MIT"] identifier: From 40c2c62b742868efae7af79db9b7ea5167199116 Mon Sep 17 00:00:00 2001 From: "James A. Fellows Yates" Date: Thu, 19 Dec 2024 15:01:09 +0100 Subject: [PATCH 3/5] Fix parameter --- modules/nf-core/catpack/download/main.nf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/nf-core/catpack/download/main.nf b/modules/nf-core/catpack/download/main.nf index 003989de80e..166a2ad0c81 100644 --- a/modules/nf-core/catpack/download/main.nf +++ b/modules/nf-core/catpack/download/main.nf @@ -24,7 +24,7 @@ process CATPACK_DOWNLOAD { CAT_pack \\ download \\ ${args} \\ - -db ${db} + --db ${db} -o ${prefix}/ cat <<-END_VERSIONS > versions.yml From abc16c6579c761aa0a04a25d60c9c64dd35a485b Mon Sep 17 00:00:00 2001 From: "James A. Fellows Yates" Date: Thu, 19 Dec 2024 15:52:20 +0100 Subject: [PATCH 4/5] Fix linting --- modules/nf-core/catpack/download/meta.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/modules/nf-core/catpack/download/meta.yml b/modules/nf-core/catpack/download/meta.yml index fc8e36dbbc2..c15c5b8593d 100644 --- a/modules/nf-core/catpack/download/meta.yml +++ b/modules/nf-core/catpack/download/meta.yml @@ -15,7 +15,6 @@ tools: tool_dev_url: "https://github.com/MGXlab/CAT_pack" doi: "10.1186/s13059-019-1817-x" licence: ["MIT"] - identifier: input: - - meta: From 535b9a9ed6f406efe4be90e6916594621bc864fc Mon Sep 17 00:00:00 2001 From: "James A. Fellows Yates" Date: Thu, 19 Dec 2024 16:19:50 +0100 Subject: [PATCH 5/5] Fixing linting and address comments from @jasmezz --- modules/nf-core/catpack/download/meta.yml | 5 ++--- modules/nf-core/catpack/download/tests/main.nf.test | 2 +- modules/nf-core/catpack/download/tests/main.nf.test.snap | 6 +++--- modules/nf-core/coptr/estimate/meta.yml | 4 ++-- 4 files changed, 8 insertions(+), 9 deletions(-) diff --git a/modules/nf-core/catpack/download/meta.yml b/modules/nf-core/catpack/download/meta.yml index c15c5b8593d..c4a25f94abd 100644 --- a/modules/nf-core/catpack/download/meta.yml +++ b/modules/nf-core/catpack/download/meta.yml @@ -1,7 +1,6 @@ --- name: "catpack_download" -## TODO nf-core: Add a description of the module and list keywords -description: write your description here +description: Downloads the required files for either Nr or GTDB for building into a CAT database keywords: - taxonomic classification - classification @@ -39,7 +38,7 @@ output: 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/format_1049" + - edam: "http://edamontology.org/data_1049" - versions: - "versions.yml": type: file diff --git a/modules/nf-core/catpack/download/tests/main.nf.test b/modules/nf-core/catpack/download/tests/main.nf.test index 75060b19a30..cc9aae700bf 100644 --- a/modules/nf-core/catpack/download/tests/main.nf.test +++ b/modules/nf-core/catpack/download/tests/main.nf.test @@ -9,7 +9,7 @@ nextflow_process { tag "catpack" tag "catpack/download" - + // Only stub because module downloads extremely large test("nr - stub") { options "-stub" diff --git a/modules/nf-core/catpack/download/tests/main.nf.test.snap b/modules/nf-core/catpack/download/tests/main.nf.test.snap index 5b7b7c01db5..aa21368768b 100644 --- a/modules/nf-core/catpack/download/tests/main.nf.test.snap +++ b/modules/nf-core/catpack/download/tests/main.nf.test.snap @@ -14,7 +14,7 @@ ] ], "1": [ - "versions.yml:md5,d851e296d4025a8060b6283ad3b63937" + "versions.yml:md5,e1493fe75b3b8cc2bc0cbd1d5ddfad44" ], "rawdb": [ [ @@ -28,7 +28,7 @@ ] ], "versions": [ - "versions.yml:md5,d851e296d4025a8060b6283ad3b63937" + "versions.yml:md5,e1493fe75b3b8cc2bc0cbd1d5ddfad44" ] } ], @@ -36,6 +36,6 @@ "nf-test": "0.9.0", "nextflow": "24.10.2" }, - "timestamp": "2024-12-19T14:56:46.720677474" + "timestamp": "2024-12-19T16:19:22.533589236" } } \ No newline at end of file diff --git a/modules/nf-core/coptr/estimate/meta.yml b/modules/nf-core/coptr/estimate/meta.yml index 2afb599563a..59af2da57c2 100644 --- a/modules/nf-core/coptr/estimate/meta.yml +++ b/modules/nf-core/coptr/estimate/meta.yml @@ -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: @@ -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" - versions: - "versions.yml":