From c9c80529892cb28a42e5bfc76bf6d9aa37b8cd66 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Famke=20Ba=CC=88uerle?= Date: Thu, 5 Sep 2024 12:44:55 +0200 Subject: [PATCH 01/16] add crabs/dbimport from readsimulator pipeline --- .../nf-core/crabs/dbimport/environment.yml | 7 ++ modules/nf-core/crabs/dbimport/main.nf | 56 +++++++++++++++ modules/nf-core/crabs/dbimport/meta.yml | 49 +++++++++++++ .../nf-core/crabs/dbimport/tests/main.nf.test | 59 ++++++++++++++++ .../crabs/dbimport/tests/main.nf.test.snap | 68 +++++++++++++++++++ .../crabs/dbimport/tests/nextflow.config | 7 ++ modules/nf-core/crabs/dbimport/tests/tags.yml | 2 + 7 files changed, 248 insertions(+) create mode 100644 modules/nf-core/crabs/dbimport/environment.yml create mode 100644 modules/nf-core/crabs/dbimport/main.nf create mode 100644 modules/nf-core/crabs/dbimport/meta.yml create mode 100644 modules/nf-core/crabs/dbimport/tests/main.nf.test create mode 100644 modules/nf-core/crabs/dbimport/tests/main.nf.test.snap create mode 100644 modules/nf-core/crabs/dbimport/tests/nextflow.config create mode 100644 modules/nf-core/crabs/dbimport/tests/tags.yml diff --git a/modules/nf-core/crabs/dbimport/environment.yml b/modules/nf-core/crabs/dbimport/environment.yml new file mode 100644 index 00000000000..78fa255d3d9 --- /dev/null +++ b/modules/nf-core/crabs/dbimport/environment.yml @@ -0,0 +1,7 @@ +name: crabs_dbimport +channels: + - conda-forge + - bioconda + - defaults +dependencies: + - "bioconda::crabs=0.1.1" diff --git a/modules/nf-core/crabs/dbimport/main.nf b/modules/nf-core/crabs/dbimport/main.nf new file mode 100644 index 00000000000..4696fbab3e9 --- /dev/null +++ b/modules/nf-core/crabs/dbimport/main.nf @@ -0,0 +1,56 @@ +process CRABS_DBIMPORT { + tag "$meta.id" + label 'process_medium' + + // WARN: Version information not provided by tool on CLI. Please update version string below when bumping container versions. + conda "${moduleDir}/environment.yml" + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/crabs:0.1.1--pyhb7b1952_0': + 'biocontainers/crabs:0.1.1--pyhb7b1952_0' }" + + input: + tuple val(meta), path(fasta) + + output: + tuple val(meta), path("*.fa"), emit: fasta + 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 VERSION = '0.1.1' // WARN: Version information not provided by tool on CLI. Please update this string when bumping container versions. + def is_compressed = fasta.name.endsWith(".gz") + def fasta_name = fasta.name.replace(".gz", "") + """ + if [ "${is_compressed}" == "true" ]; then + gzip -c -d ${fasta} > ${fasta_name} + fi + + crabs db_import \\ + --input ${fasta_name} \\ + --output ${prefix}.crabsdb.fa \\ + $args + + rm ${fasta_name} + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + crabs: $VERSION + END_VERSIONS + """ + + stub: + def prefix = task.ext.prefix ?: "${meta.id}" + def VERSION = '0.1.1' // WARN: Version information not provided by tool on CLI. Please update this string when bumping container versions. + """ + touch ${prefix}.fa + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + crabs: $VERSION + END_VERSIONS + """ +} diff --git a/modules/nf-core/crabs/dbimport/meta.yml b/modules/nf-core/crabs/dbimport/meta.yml new file mode 100644 index 00000000000..030a450a260 --- /dev/null +++ b/modules/nf-core/crabs/dbimport/meta.yml @@ -0,0 +1,49 @@ +name: crabs_dbimport +description: In-house generated or curated data can be imported into CRABS. +keywords: + - insilico + - PCR +tools: + - crabs: + description: | + Crabs (Creating Reference databases for Amplicon-Based Sequencing) + is a program to download and curate reference databases + for eDNA metabarcoding analyses + homepage: https://github.com/gjeunen/reference_database_creator + documentation: https://github.com/gjeunen/reference_database_creator?tab=readme-ov-file#running-crabs + tool_dev_url: https://github.com/gjeunen/reference_database_creator + doi: https://doi.org/10.1111/1755-0998.13741 + licence: ["MIT License"] + +input: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. `[ id:'sample1' ]` + - fasta: + type: file + description: In-house sequencing data + pattern: "*.{fa,fasta}" + +output: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. `[ id:'sample1' ]` + - versions: + type: file + description: File containing software versions + pattern: "versions.yml" + - fasta: + type: file + description: Reverse complemented Sequence + pattern: "*.{fa,fasta}" + +authors: + - "@famosab" + - "@a4000" +maintainers: + - "@famosab" + - "@a4000" diff --git a/modules/nf-core/crabs/dbimport/tests/main.nf.test b/modules/nf-core/crabs/dbimport/tests/main.nf.test new file mode 100644 index 00000000000..c5ef876f05e --- /dev/null +++ b/modules/nf-core/crabs/dbimport/tests/main.nf.test @@ -0,0 +1,59 @@ +nextflow_process { + + name "Test Process CRABS_DBIMPORT" + script "../main.nf" + process "CRABS_DBIMPORT" + config "./nextflow.config" + + tag "modules" + tag "modules_nfcore" + tag "crabs" + tag "crabs/dbimport" + + test("sarscov2 - fasta") { + + when { + process { + """ + input[0] = [ + [ id:'test' ], // meta map + file(params.modules_testdata_base_path +'genomics/sarscov2/genome/genome.fasta', checkIfExists: true) + ] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + + } + + test("sarscov2 - fasta - stub") { + + options "-stub" + + when { + process { + """ + input[0] = [ + [ id:'test' ], // meta map + file(params.modules_testdata_base_path +'genomics/sarscov2/genome/genome.fasta', checkIfExists: true) + ] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + + } + +} \ No newline at end of file diff --git a/modules/nf-core/crabs/dbimport/tests/main.nf.test.snap b/modules/nf-core/crabs/dbimport/tests/main.nf.test.snap new file mode 100644 index 00000000000..e01938f9fef --- /dev/null +++ b/modules/nf-core/crabs/dbimport/tests/main.nf.test.snap @@ -0,0 +1,68 @@ +{ + "sarscov2 - fasta - stub": { + "content": [ + { + "0": [ + [ + { + "id": "test" + }, + "test.fa:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "1": [ + "versions.yml:md5,aa9d175ec56d1dce0a3588883ab1b00a" + ], + "fasta": [ + [ + { + "id": "test" + }, + "test.fa:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "versions": [ + "versions.yml:md5,aa9d175ec56d1dce0a3588883ab1b00a" + ] + } + ], + "meta": { + "nf-test": "0.9.0", + "nextflow": "24.04.4" + }, + "timestamp": "2024-09-05T12:42:46.076137" + }, + "sarscov2 - fasta": { + "content": [ + { + "0": [ + [ + { + "id": "test" + }, + "test.crabsdb.fa:md5,f46e9d5dbadcfda9a8d7d01e4bf7dfb2" + ] + ], + "1": [ + "versions.yml:md5,aa9d175ec56d1dce0a3588883ab1b00a" + ], + "fasta": [ + [ + { + "id": "test" + }, + "test.crabsdb.fa:md5,f46e9d5dbadcfda9a8d7d01e4bf7dfb2" + ] + ], + "versions": [ + "versions.yml:md5,aa9d175ec56d1dce0a3588883ab1b00a" + ] + } + ], + "meta": { + "nf-test": "0.9.0", + "nextflow": "24.04.4" + }, + "timestamp": "2024-09-05T12:42:41.421262" + } +} \ No newline at end of file diff --git a/modules/nf-core/crabs/dbimport/tests/nextflow.config b/modules/nf-core/crabs/dbimport/tests/nextflow.config new file mode 100644 index 00000000000..282a7b2ebbd --- /dev/null +++ b/modules/nf-core/crabs/dbimport/tests/nextflow.config @@ -0,0 +1,7 @@ +process { + + withName: CRABS_DBIMPORT { + ext.args = "--seq_header species --delim ' '" + } + +} diff --git a/modules/nf-core/crabs/dbimport/tests/tags.yml b/modules/nf-core/crabs/dbimport/tests/tags.yml new file mode 100644 index 00000000000..6efca4ca891 --- /dev/null +++ b/modules/nf-core/crabs/dbimport/tests/tags.yml @@ -0,0 +1,2 @@ +crabs/dbimport: + - "modules/nf-core/crabs/dbimport/**" From 75e23c7a00dbab51f364e580fc1a965174596109 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Famke=20Ba=CC=88uerle?= Date: Thu, 5 Sep 2024 14:49:04 +0200 Subject: [PATCH 02/16] fix linting --- modules/nf-core/crabs/dbimport/meta.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/modules/nf-core/crabs/dbimport/meta.yml b/modules/nf-core/crabs/dbimport/meta.yml index 030a450a260..27424a0464b 100644 --- a/modules/nf-core/crabs/dbimport/meta.yml +++ b/modules/nf-core/crabs/dbimport/meta.yml @@ -2,7 +2,9 @@ name: crabs_dbimport description: In-house generated or curated data can be imported into CRABS. keywords: - insilico - - PCR + - amplicon + - sequencing + - inhouse tools: - crabs: description: | From a971dd7dd9d9d99c5c795f1ed6b1b5839add9faa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Famke=20Ba=CC=88uerle?= Date: Thu, 5 Sep 2024 14:54:53 +0200 Subject: [PATCH 03/16] remove defaults --- modules/nf-core/crabs/dbimport/environment.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/modules/nf-core/crabs/dbimport/environment.yml b/modules/nf-core/crabs/dbimport/environment.yml index 78fa255d3d9..b81fb837b14 100644 --- a/modules/nf-core/crabs/dbimport/environment.yml +++ b/modules/nf-core/crabs/dbimport/environment.yml @@ -2,6 +2,5 @@ name: crabs_dbimport channels: - conda-forge - bioconda - - defaults dependencies: - "bioconda::crabs=0.1.1" From 4306c6ccae64301757debb3bf308fa5177d9ba41 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Famke=20Ba=CC=88uerle?= Date: Thu, 5 Sep 2024 15:26:00 +0200 Subject: [PATCH 04/16] update crabs with wave containers --- modules/nf-core/crabs/dbimport/environment.yml | 7 ++++++- modules/nf-core/crabs/dbimport/main.nf | 11 ++++------- .../nf-core/crabs/dbimport/tests/main.nf.test.snap | 12 ++++++------ 3 files changed, 16 insertions(+), 14 deletions(-) diff --git a/modules/nf-core/crabs/dbimport/environment.yml b/modules/nf-core/crabs/dbimport/environment.yml index b81fb837b14..9a872a4af05 100644 --- a/modules/nf-core/crabs/dbimport/environment.yml +++ b/modules/nf-core/crabs/dbimport/environment.yml @@ -3,4 +3,9 @@ channels: - conda-forge - bioconda dependencies: - - "bioconda::crabs=0.1.1" + - wget=1.21.3 + - muscle=3.8.31 + - cutadapt>=4.0 + - vsearch>=2.13.3 + - pip: + - crabs==0.2 diff --git a/modules/nf-core/crabs/dbimport/main.nf b/modules/nf-core/crabs/dbimport/main.nf index 4696fbab3e9..a73339cb30b 100644 --- a/modules/nf-core/crabs/dbimport/main.nf +++ b/modules/nf-core/crabs/dbimport/main.nf @@ -2,11 +2,10 @@ process CRABS_DBIMPORT { tag "$meta.id" label 'process_medium' - // WARN: Version information not provided by tool on CLI. Please update version string below when bumping container versions. conda "${moduleDir}/environment.yml" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/crabs:0.1.1--pyhb7b1952_0': - 'biocontainers/crabs:0.1.1--pyhb7b1952_0' }" + 'oras://community.wave.seqera.io/library/cutadapt_muscle_vsearch_wget_pruned:0cd5cb1e549e5033': + 'community.wave.seqera.io/library/cutadapt_muscle_vsearch_wget_pruned:04f6c0370c0226c5' }" input: tuple val(meta), path(fasta) @@ -21,7 +20,6 @@ process CRABS_DBIMPORT { script: def args = task.ext.args ?: '' def prefix = task.ext.prefix ?: "${meta.id}" - def VERSION = '0.1.1' // WARN: Version information not provided by tool on CLI. Please update this string when bumping container versions. def is_compressed = fasta.name.endsWith(".gz") def fasta_name = fasta.name.replace(".gz", "") """ @@ -38,19 +36,18 @@ process CRABS_DBIMPORT { cat <<-END_VERSIONS > versions.yml "${task.process}": - crabs: $VERSION + crabs: \$(crabs --version | sed -e 's/crabs v//g') END_VERSIONS """ stub: def prefix = task.ext.prefix ?: "${meta.id}" - def VERSION = '0.1.1' // WARN: Version information not provided by tool on CLI. Please update this string when bumping container versions. """ touch ${prefix}.fa cat <<-END_VERSIONS > versions.yml "${task.process}": - crabs: $VERSION + crabs: \$(crabs --version | sed -e 's/crabs v//g') END_VERSIONS """ } diff --git a/modules/nf-core/crabs/dbimport/tests/main.nf.test.snap b/modules/nf-core/crabs/dbimport/tests/main.nf.test.snap index e01938f9fef..a237dcd51b7 100644 --- a/modules/nf-core/crabs/dbimport/tests/main.nf.test.snap +++ b/modules/nf-core/crabs/dbimport/tests/main.nf.test.snap @@ -11,7 +11,7 @@ ] ], "1": [ - "versions.yml:md5,aa9d175ec56d1dce0a3588883ab1b00a" + "versions.yml:md5,4f1f73cb937227ccf6abfa3002824535" ], "fasta": [ [ @@ -22,7 +22,7 @@ ] ], "versions": [ - "versions.yml:md5,aa9d175ec56d1dce0a3588883ab1b00a" + "versions.yml:md5,4f1f73cb937227ccf6abfa3002824535" ] } ], @@ -30,7 +30,7 @@ "nf-test": "0.9.0", "nextflow": "24.04.4" }, - "timestamp": "2024-09-05T12:42:46.076137" + "timestamp": "2024-09-05T15:25:04.701271" }, "sarscov2 - fasta": { "content": [ @@ -44,7 +44,7 @@ ] ], "1": [ - "versions.yml:md5,aa9d175ec56d1dce0a3588883ab1b00a" + "versions.yml:md5,4f1f73cb937227ccf6abfa3002824535" ], "fasta": [ [ @@ -55,7 +55,7 @@ ] ], "versions": [ - "versions.yml:md5,aa9d175ec56d1dce0a3588883ab1b00a" + "versions.yml:md5,4f1f73cb937227ccf6abfa3002824535" ] } ], @@ -63,6 +63,6 @@ "nf-test": "0.9.0", "nextflow": "24.04.4" }, - "timestamp": "2024-09-05T12:42:41.421262" + "timestamp": "2024-09-05T15:24:57.657881" } } \ No newline at end of file From 75f141b7a005dc157c6a071de62bcc06be362c1c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Famke=20Ba=CC=88uerle?= Date: Thu, 5 Sep 2024 15:41:00 +0200 Subject: [PATCH 05/16] update meta --- modules/nf-core/crabs/dbimport/environment.yml | 1 + modules/nf-core/crabs/dbimport/meta.yml | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/nf-core/crabs/dbimport/environment.yml b/modules/nf-core/crabs/dbimport/environment.yml index 9a872a4af05..81f9937843e 100644 --- a/modules/nf-core/crabs/dbimport/environment.yml +++ b/modules/nf-core/crabs/dbimport/environment.yml @@ -7,5 +7,6 @@ dependencies: - muscle=3.8.31 - cutadapt>=4.0 - vsearch>=2.13.3 + - pip>=23.2 - pip: - crabs==0.2 diff --git a/modules/nf-core/crabs/dbimport/meta.yml b/modules/nf-core/crabs/dbimport/meta.yml index 27424a0464b..e7ac1de3e70 100644 --- a/modules/nf-core/crabs/dbimport/meta.yml +++ b/modules/nf-core/crabs/dbimport/meta.yml @@ -14,7 +14,7 @@ tools: homepage: https://github.com/gjeunen/reference_database_creator documentation: https://github.com/gjeunen/reference_database_creator?tab=readme-ov-file#running-crabs tool_dev_url: https://github.com/gjeunen/reference_database_creator - doi: https://doi.org/10.1111/1755-0998.13741 + doi: 10.1111/1755-0998.13741 licence: ["MIT License"] input: From d29bb4d87cef7813aa7983b85fa28f8da4bf08fa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Famke=20Ba=CC=88uerle?= Date: Mon, 9 Sep 2024 09:06:15 +0200 Subject: [PATCH 06/16] remove name --- modules/nf-core/crabs/dbimport/environment.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/modules/nf-core/crabs/dbimport/environment.yml b/modules/nf-core/crabs/dbimport/environment.yml index 81f9937843e..732638a8038 100644 --- a/modules/nf-core/crabs/dbimport/environment.yml +++ b/modules/nf-core/crabs/dbimport/environment.yml @@ -1,4 +1,3 @@ -name: crabs_dbimport channels: - conda-forge - bioconda From 5f9a4f9d085a45ab7f25303efa8cf126b8c04874 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Famke=20Ba=CC=88uerle?= Date: Mon, 9 Sep 2024 09:34:38 +0200 Subject: [PATCH 07/16] update env --- modules/nf-core/crabs/dbimport/environment.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/modules/nf-core/crabs/dbimport/environment.yml b/modules/nf-core/crabs/dbimport/environment.yml index 732638a8038..489866b9e39 100644 --- a/modules/nf-core/crabs/dbimport/environment.yml +++ b/modules/nf-core/crabs/dbimport/environment.yml @@ -2,10 +2,10 @@ channels: - conda-forge - bioconda dependencies: - - wget=1.21.3 - - muscle=3.8.31 - - cutadapt>=4.0 - - vsearch>=2.13.3 - - pip>=23.2 + - bioconda::cutadapt=4.9 + - bioconda::muscle=3.8.31 + - bioconda::vsearch=2.28.1 + - conda-forge::wget=1.20.3 + - pip - pip: - - crabs==0.2 + - crabs==0.2.0 From bb36e93746033b7760f93674e08ae0635dba87ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Famke=20Ba=CC=88uerle?= Date: Mon, 9 Sep 2024 09:36:20 +0200 Subject: [PATCH 08/16] prettier --- modules/nf-core/crabs/dbimport/environment.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/nf-core/crabs/dbimport/environment.yml b/modules/nf-core/crabs/dbimport/environment.yml index 489866b9e39..5bbf98b7f43 100644 --- a/modules/nf-core/crabs/dbimport/environment.yml +++ b/modules/nf-core/crabs/dbimport/environment.yml @@ -8,4 +8,4 @@ dependencies: - conda-forge::wget=1.20.3 - pip - pip: - - crabs==0.2.0 + - crabs==0.2.0 From 084ab4d6ddc008689adcc3aff41fb846ccfe4974 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Famke=20Ba=CC=88uerle?= Date: Mon, 9 Sep 2024 10:03:34 +0200 Subject: [PATCH 09/16] fix pip version --- modules/nf-core/crabs/dbimport/environment.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/nf-core/crabs/dbimport/environment.yml b/modules/nf-core/crabs/dbimport/environment.yml index 5bbf98b7f43..ceed5f98e28 100644 --- a/modules/nf-core/crabs/dbimport/environment.yml +++ b/modules/nf-core/crabs/dbimport/environment.yml @@ -6,6 +6,6 @@ dependencies: - bioconda::muscle=3.8.31 - bioconda::vsearch=2.28.1 - conda-forge::wget=1.20.3 - - pip + - conda-forge::pip=24.2 - pip: - crabs==0.2.0 From ad306317c5f6621a54795e3db2696388759f6e4c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Famke=20Ba=CC=88uerle?= Date: Fri, 25 Oct 2024 13:04:48 +0200 Subject: [PATCH 10/16] update to 1.0.4 new structure needs resolving --- modules/nf-core/crabs/dbimport/environment.yml | 8 +------- modules/nf-core/crabs/dbimport/main.nf | 6 +++--- modules/nf-core/crabs/dbimport/tests/nextflow.config | 2 +- 3 files changed, 5 insertions(+), 11 deletions(-) diff --git a/modules/nf-core/crabs/dbimport/environment.yml b/modules/nf-core/crabs/dbimport/environment.yml index ceed5f98e28..20be3a698d8 100644 --- a/modules/nf-core/crabs/dbimport/environment.yml +++ b/modules/nf-core/crabs/dbimport/environment.yml @@ -2,10 +2,4 @@ channels: - conda-forge - bioconda dependencies: - - bioconda::cutadapt=4.9 - - bioconda::muscle=3.8.31 - - bioconda::vsearch=2.28.1 - - conda-forge::wget=1.20.3 - - conda-forge::pip=24.2 - - pip: - - crabs==0.2.0 + - bioconda::crabs==1.0.4 diff --git a/modules/nf-core/crabs/dbimport/main.nf b/modules/nf-core/crabs/dbimport/main.nf index a73339cb30b..f715c222bcd 100644 --- a/modules/nf-core/crabs/dbimport/main.nf +++ b/modules/nf-core/crabs/dbimport/main.nf @@ -4,8 +4,8 @@ process CRABS_DBIMPORT { conda "${moduleDir}/environment.yml" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'oras://community.wave.seqera.io/library/cutadapt_muscle_vsearch_wget_pruned:0cd5cb1e549e5033': - 'community.wave.seqera.io/library/cutadapt_muscle_vsearch_wget_pruned:04f6c0370c0226c5' }" + 'https://community-cr-prod.seqera.io/docker/registry/v2/blobs/sha256/e0/e0007b6b35c9783203b7fde287c383ac38168ecfee79639393e3cb1cd4afdaef/data': + 'community.wave.seqera.io/library/crabs:1.0.4--1de4f5571e3e4ab0' }" input: tuple val(meta), path(fasta) @@ -27,7 +27,7 @@ process CRABS_DBIMPORT { gzip -c -d ${fasta} > ${fasta_name} fi - crabs db_import \\ + crabs --import \\ --input ${fasta_name} \\ --output ${prefix}.crabsdb.fa \\ $args diff --git a/modules/nf-core/crabs/dbimport/tests/nextflow.config b/modules/nf-core/crabs/dbimport/tests/nextflow.config index 282a7b2ebbd..0a335183d8e 100644 --- a/modules/nf-core/crabs/dbimport/tests/nextflow.config +++ b/modules/nf-core/crabs/dbimport/tests/nextflow.config @@ -1,7 +1,7 @@ process { withName: CRABS_DBIMPORT { - ext.args = "--seq_header species --delim ' '" + ext.args = "--seq_header species --delim ' ' --import-format embl \\" } } From 5da0884bd2df5e7bba55337884ca6b97351afb47 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Famke=20Ba=CC=88uerle?= Date: Mon, 18 Nov 2024 14:26:39 +0100 Subject: [PATCH 11/16] update --- .../nf-core/crabs/dbimport/environment.yml | 2 +- modules/nf-core/crabs/dbimport/main.nf | 4 +- modules/nf-core/crabs/dbimport/meta.yml | 47 ++++++++++--------- 3 files changed, 27 insertions(+), 26 deletions(-) diff --git a/modules/nf-core/crabs/dbimport/environment.yml b/modules/nf-core/crabs/dbimport/environment.yml index 20be3a698d8..74ca9a2d9b3 100644 --- a/modules/nf-core/crabs/dbimport/environment.yml +++ b/modules/nf-core/crabs/dbimport/environment.yml @@ -2,4 +2,4 @@ channels: - conda-forge - bioconda dependencies: - - bioconda::crabs==1.0.4 + - bioconda::crabs=1.0.6 diff --git a/modules/nf-core/crabs/dbimport/main.nf b/modules/nf-core/crabs/dbimport/main.nf index f715c222bcd..b8fdfbd2def 100644 --- a/modules/nf-core/crabs/dbimport/main.nf +++ b/modules/nf-core/crabs/dbimport/main.nf @@ -4,8 +4,8 @@ process CRABS_DBIMPORT { 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/e0/e0007b6b35c9783203b7fde287c383ac38168ecfee79639393e3cb1cd4afdaef/data': - 'community.wave.seqera.io/library/crabs:1.0.4--1de4f5571e3e4ab0' }" + 'oras://community.wave.seqera.io/library/crabs:1.0.6--a95c7815a4a67eb2': + 'community.wave.seqera.io/library/crabs:1.0.6--462aa28d85ee454e' }" input: tuple val(meta), path(fasta) diff --git a/modules/nf-core/crabs/dbimport/meta.yml b/modules/nf-core/crabs/dbimport/meta.yml index e7ac1de3e70..0aeffde1558 100644 --- a/modules/nf-core/crabs/dbimport/meta.yml +++ b/modules/nf-core/crabs/dbimport/meta.yml @@ -16,33 +16,34 @@ tools: tool_dev_url: https://github.com/gjeunen/reference_database_creator doi: 10.1111/1755-0998.13741 licence: ["MIT License"] + identifier: "" input: - - meta: - type: map - description: | - Groovy Map containing sample information - e.g. `[ id:'sample1' ]` - - fasta: - type: file - description: In-house sequencing data - pattern: "*.{fa,fasta}" - + - - meta: + type: map + description: | + Groovy Map containing sample information + e.g. `[ id:'sample1' ]` + - fasta: + type: file + description: In-house sequencing data + pattern: "*.{fa,fasta}" output: - - meta: - type: map - description: | - Groovy Map containing sample information - e.g. `[ id:'sample1' ]` - - versions: - type: file - description: File containing software versions - pattern: "versions.yml" - fasta: - type: file - description: Reverse complemented Sequence - pattern: "*.{fa,fasta}" - + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. `[ id:'sample1' ]` + - "*.fa": + type: file + description: Reverse complemented Sequence + pattern: "*.{fa,fasta}" + - versions: + - versions.yml: + type: file + description: File containing software versions + pattern: "versions.yml" authors: - "@famosab" - "@a4000" From 0af0158aafd0946e10222b865c6a3abb83e6714e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Famke=20Ba=CC=88uerle?= Date: Wed, 20 Nov 2024 12:41:15 +0100 Subject: [PATCH 12/16] change ext args to new convention --- modules/nf-core/crabs/dbimport/tests/main.nf.test | 3 +++ modules/nf-core/crabs/dbimport/tests/nextflow.config | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/modules/nf-core/crabs/dbimport/tests/main.nf.test b/modules/nf-core/crabs/dbimport/tests/main.nf.test index c5ef876f05e..17b30264335 100644 --- a/modules/nf-core/crabs/dbimport/tests/main.nf.test +++ b/modules/nf-core/crabs/dbimport/tests/main.nf.test @@ -13,6 +13,9 @@ nextflow_process { test("sarscov2 - fasta") { when { + params { + module_args = "--seq_header species --delim ' ' --import-format embl \\" + } process { """ input[0] = [ diff --git a/modules/nf-core/crabs/dbimport/tests/nextflow.config b/modules/nf-core/crabs/dbimport/tests/nextflow.config index 0a335183d8e..9d003f3db15 100644 --- a/modules/nf-core/crabs/dbimport/tests/nextflow.config +++ b/modules/nf-core/crabs/dbimport/tests/nextflow.config @@ -1,7 +1,7 @@ process { withName: CRABS_DBIMPORT { - ext.args = "--seq_header species --delim ' ' --import-format embl \\" + ext.args = params.module_args } } From 441d68d31525422e14c81ffef43b67738482601f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Famke=20Ba=CC=88uerle?= Date: Mon, 3 Feb 2025 12:57:01 +0900 Subject: [PATCH 13/16] remove tags and move config file --- modules/nf-core/crabs/dbimport/tests/main.nf.test | 3 ++- modules/nf-core/crabs/dbimport/tests/tags.yml | 2 -- 2 files changed, 2 insertions(+), 3 deletions(-) delete mode 100644 modules/nf-core/crabs/dbimport/tests/tags.yml diff --git a/modules/nf-core/crabs/dbimport/tests/main.nf.test b/modules/nf-core/crabs/dbimport/tests/main.nf.test index 17b30264335..6473abb1cbc 100644 --- a/modules/nf-core/crabs/dbimport/tests/main.nf.test +++ b/modules/nf-core/crabs/dbimport/tests/main.nf.test @@ -3,7 +3,6 @@ nextflow_process { name "Test Process CRABS_DBIMPORT" script "../main.nf" process "CRABS_DBIMPORT" - config "./nextflow.config" tag "modules" tag "modules_nfcore" @@ -12,6 +11,8 @@ nextflow_process { test("sarscov2 - fasta") { + config "./nextflow.config" + when { params { module_args = "--seq_header species --delim ' ' --import-format embl \\" diff --git a/modules/nf-core/crabs/dbimport/tests/tags.yml b/modules/nf-core/crabs/dbimport/tests/tags.yml deleted file mode 100644 index 6efca4ca891..00000000000 --- a/modules/nf-core/crabs/dbimport/tests/tags.yml +++ /dev/null @@ -1,2 +0,0 @@ -crabs/dbimport: - - "modules/nf-core/crabs/dbimport/**" From b35bb1adde14311a777044a92e8d4b43eed54639 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Famke=20Ba=CC=88uerle?= Date: Mon, 3 Feb 2025 14:22:11 +0900 Subject: [PATCH 14/16] add tests with download taxonomy --- .../nf-core/crabs/dbimport/environment.yml | 2 +- modules/nf-core/crabs/dbimport/main.nf | 14 +++++-- .../nf-core/crabs/dbimport/tests/main.nf.test | 25 +++++++++++- .../crabs/dbimport/tests/main.nf.test.snap | 39 ++++++++----------- 4 files changed, 51 insertions(+), 29 deletions(-) diff --git a/modules/nf-core/crabs/dbimport/environment.yml b/modules/nf-core/crabs/dbimport/environment.yml index 74ca9a2d9b3..c9761a2d14b 100644 --- a/modules/nf-core/crabs/dbimport/environment.yml +++ b/modules/nf-core/crabs/dbimport/environment.yml @@ -2,4 +2,4 @@ channels: - conda-forge - bioconda dependencies: - - bioconda::crabs=1.0.6 + - bioconda::crabs=1.0.7 diff --git a/modules/nf-core/crabs/dbimport/main.nf b/modules/nf-core/crabs/dbimport/main.nf index b8fdfbd2def..ef00aea503f 100644 --- a/modules/nf-core/crabs/dbimport/main.nf +++ b/modules/nf-core/crabs/dbimport/main.nf @@ -4,11 +4,14 @@ process CRABS_DBIMPORT { conda "${moduleDir}/environment.yml" container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'oras://community.wave.seqera.io/library/crabs:1.0.6--a95c7815a4a67eb2': - 'community.wave.seqera.io/library/crabs:1.0.6--462aa28d85ee454e' }" + 'https://depot.galaxyproject.org/singularity/crabs:1.0.7--pyhdfd78af_0': + 'biocontainers/crabs:1.0.7--pyhdfd78af_0' }" input: tuple val(meta), path(fasta) + tuple val(meta2), path(accession2taxid) + tuple val(meta3), path(names) + tuple val(meta4), path(nodes) output: tuple val(meta), path("*.fa"), emit: fasta @@ -30,13 +33,16 @@ process CRABS_DBIMPORT { crabs --import \\ --input ${fasta_name} \\ --output ${prefix}.crabsdb.fa \\ + --acc2tax ${accession2taxid} \\ + --names ${names} \\ + --nodes ${nodes} \\ $args rm ${fasta_name} cat <<-END_VERSIONS > versions.yml "${task.process}": - crabs: \$(crabs --version | sed -e 's/crabs v//g') + crabs: \$(crabs --help | grep 'CRABS |' | sed 's/.*CRABS | \\(v[0-9.]*\\).*/\\1/') END_VERSIONS """ @@ -47,7 +53,7 @@ process CRABS_DBIMPORT { cat <<-END_VERSIONS > versions.yml "${task.process}": - crabs: \$(crabs --version | sed -e 's/crabs v//g') + crabs: \$(crabs --help | grep 'CRABS |' | sed 's/.*CRABS | \\(v[0-9.]*\\).*/\\1/') END_VERSIONS """ } diff --git a/modules/nf-core/crabs/dbimport/tests/main.nf.test b/modules/nf-core/crabs/dbimport/tests/main.nf.test index 6473abb1cbc..b9f50699511 100644 --- a/modules/nf-core/crabs/dbimport/tests/main.nf.test +++ b/modules/nf-core/crabs/dbimport/tests/main.nf.test @@ -8,6 +8,18 @@ nextflow_process { tag "modules_nfcore" tag "crabs" tag "crabs/dbimport" + tag "crabs/downloadtaxonomy" + + setup { + run("CRABS_DOWNLOADTAXONOMY") { + script "../../downloadtaxonomy/main.nf" + process { + """ + input[0] = [ id:'taxonomy' ] + """ + } + } + } test("sarscov2 - fasta") { @@ -15,7 +27,7 @@ nextflow_process { when { params { - module_args = "--seq_header species --delim ' ' --import-format embl \\" + module_args = "--import-format embl --ranks 'superkingdom;phylum;class;order;family;genus;species' \\" } process { """ @@ -23,6 +35,9 @@ nextflow_process { [ id:'test' ], // meta map file(params.modules_testdata_base_path +'genomics/sarscov2/genome/genome.fasta', checkIfExists: true) ] + input[1] = CRABS_DOWNLOADTAXONOMY.out.accession2taxid + input[2] = CRABS_DOWNLOADTAXONOMY.out.names + input[3] = CRABS_DOWNLOADTAXONOMY.out.nodes """ } } @@ -47,6 +62,9 @@ nextflow_process { [ id:'test' ], // meta map file(params.modules_testdata_base_path +'genomics/sarscov2/genome/genome.fasta', checkIfExists: true) ] + input[1] = CRABS_DOWNLOADTAXONOMY.out.accession2taxid + input[2] = CRABS_DOWNLOADTAXONOMY.out.names + input[3] = CRABS_DOWNLOADTAXONOMY.out.nodes """ } } @@ -54,7 +72,10 @@ nextflow_process { then { assertAll( { assert process.success }, - { assert snapshot(process.out).match() } + { assert snapshot( + process.out, + path(process.out.versions[0]).yaml + ).match() } ) } diff --git a/modules/nf-core/crabs/dbimport/tests/main.nf.test.snap b/modules/nf-core/crabs/dbimport/tests/main.nf.test.snap index a237dcd51b7..54f52067cb6 100644 --- a/modules/nf-core/crabs/dbimport/tests/main.nf.test.snap +++ b/modules/nf-core/crabs/dbimport/tests/main.nf.test.snap @@ -11,7 +11,7 @@ ] ], "1": [ - "versions.yml:md5,4f1f73cb937227ccf6abfa3002824535" + "versions.yml:md5,65a68b87678624e13a185da907b3be67" ], "fasta": [ [ @@ -22,47 +22,42 @@ ] ], "versions": [ - "versions.yml:md5,4f1f73cb937227ccf6abfa3002824535" + "versions.yml:md5,65a68b87678624e13a185da907b3be67" ] + }, + { + "CRABS_DBIMPORT": { + "crabs": "v1.0.7" + } } ], "meta": { - "nf-test": "0.9.0", - "nextflow": "24.04.4" + "nf-test": "0.9.2", + "nextflow": "24.10.4" }, - "timestamp": "2024-09-05T15:25:04.701271" + "timestamp": "2025-02-03T13:52:33.256766" }, "sarscov2 - fasta": { "content": [ { "0": [ - [ - { - "id": "test" - }, - "test.crabsdb.fa:md5,f46e9d5dbadcfda9a8d7d01e4bf7dfb2" - ] + ], "1": [ - "versions.yml:md5,4f1f73cb937227ccf6abfa3002824535" + ], "fasta": [ - [ - { - "id": "test" - }, - "test.crabsdb.fa:md5,f46e9d5dbadcfda9a8d7d01e4bf7dfb2" - ] + ], "versions": [ - "versions.yml:md5,4f1f73cb937227ccf6abfa3002824535" + ] } ], "meta": { - "nf-test": "0.9.0", - "nextflow": "24.04.4" + "nf-test": "0.9.2", + "nextflow": "24.10.4" }, - "timestamp": "2024-09-05T15:24:57.657881" + "timestamp": "2025-02-03T14:15:02.785883" } } \ No newline at end of file From a75fde14997171e65c9394607b601fce22e1ed50 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Famke=20Ba=CC=88uerle?= Date: Mon, 3 Feb 2025 14:30:00 +0900 Subject: [PATCH 15/16] add downloadtaxonomy module --- .../crabs/downloadtaxonomy/environment.yml | 7 + .../nf-core/crabs/downloadtaxonomy/main.nf | 53 +++++++ .../nf-core/crabs/downloadtaxonomy/meta.yml | 69 +++++++++ .../crabs/downloadtaxonomy/tests/main.nf.test | 58 ++++++++ .../downloadtaxonomy/tests/main.nf.test.snap | 137 ++++++++++++++++++ .../downloadtaxonomy/tests/nextflow.config | 7 + 6 files changed, 331 insertions(+) create mode 100644 modules/nf-core/crabs/downloadtaxonomy/environment.yml create mode 100644 modules/nf-core/crabs/downloadtaxonomy/main.nf create mode 100644 modules/nf-core/crabs/downloadtaxonomy/meta.yml create mode 100644 modules/nf-core/crabs/downloadtaxonomy/tests/main.nf.test create mode 100644 modules/nf-core/crabs/downloadtaxonomy/tests/main.nf.test.snap create mode 100644 modules/nf-core/crabs/downloadtaxonomy/tests/nextflow.config diff --git a/modules/nf-core/crabs/downloadtaxonomy/environment.yml b/modules/nf-core/crabs/downloadtaxonomy/environment.yml new file mode 100644 index 00000000000..79c320c88b9 --- /dev/null +++ b/modules/nf-core/crabs/downloadtaxonomy/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::crabs=1.0.7" diff --git a/modules/nf-core/crabs/downloadtaxonomy/main.nf b/modules/nf-core/crabs/downloadtaxonomy/main.nf new file mode 100644 index 00000000000..bbf525726a2 --- /dev/null +++ b/modules/nf-core/crabs/downloadtaxonomy/main.nf @@ -0,0 +1,53 @@ +process CRABS_DOWNLOADTAXONOMY { + 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/crabs:1.0.7--pyhdfd78af_0': + 'biocontainers/crabs:1.0.7--pyhdfd78af_0' }" + + input: + val(meta) + + output: + tuple val(meta), path("*/nucl_gb.accession2taxid"), emit: accession2taxid + tuple val(meta), path("*/names.dmp") , emit: names + tuple val(meta), path("*/nodes.dmp") , emit: nodes + tuple val(meta), path("*") , emit: downloadtaxonomy_dir + 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}" + """ + mkdir ${prefix} + + crabs --download-taxonomy \\ + --output ${prefix} \\ + $args + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + crabs: \$(crabs --help | grep 'CRABS |' | sed 's/.*CRABS | \\(v[0-9.]*\\).*/\\1/') + END_VERSIONS + """ + + stub: + def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" + """ + mkdir ${prefix} + touch ${prefix}/nucl_gb.accession2taxid + touch ${prefix}/names.dmp + touch ${prefix}/nodes.dmp + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + crabs: \$(crabs --help | grep 'CRABS |' | sed 's/.*CRABS | \\(v[0-9.]*\\).*/\\1/') + END_VERSIONS + """ +} diff --git a/modules/nf-core/crabs/downloadtaxonomy/meta.yml b/modules/nf-core/crabs/downloadtaxonomy/meta.yml new file mode 100644 index 00000000000..4a4480a2ae0 --- /dev/null +++ b/modules/nf-core/crabs/downloadtaxonomy/meta.yml @@ -0,0 +1,69 @@ +--- +# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/meta-schema.json +name: "crabs_downloadtaxonomy" +## TODO nf-core: Add a description of the module and list keywords +description: write your description here +keywords: + - sort + - example + - genomics +tools: + - "crabs": + ## TODO nf-core: Add a description and other details for the software below + description: "Crabs (Creating Reference databases for Amplicon-Based Sequencing) is a program to download and curate reference databases for eDNA metabarcoding analyses." + homepage: "None" + documentation: "None" + tool_dev_url: "https://github.com/gjeunen/reference_database_creator" + doi: "" + licence: ['MIT'] + identifier: + +## TODO nf-core: Add a description of all of the variables used as input +input: + # Only when we have meta + - - meta: + type: map + description: | + Groovy Map containing sample information + e.g. `[ id:'sample1', single_end:false ]` + + ## TODO nf-core: Delete / customise this example input + - bam: + type: file + description: Sorted BAM/CRAM/SAM file + pattern: "*.{bam,cram,sam}" + ontologies: + - edam: "http://edamontology.org/format_25722" + - edam: "http://edamontology.org/format_2573" + - edam: "http://edamontology.org/format_3462" + + +## TODO nf-core: Add a description of all of the variables used as output +output: + - bam: + #Only when we have meta + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. `[ id:'sample1', single_end:false ]` + ## TODO nf-core: Delete / customise this example output + - "*.bam": + type: file + description: Sorted BAM/CRAM/SAM file + pattern: "*.{bam,cram,sam}" + ontologies: + - edam: "http://edamontology.org/format_25722" + - edam: "http://edamontology.org/format_2573" + - edam: "http://edamontology.org/format_3462" + + - versions: + - "versions.yml": + type: file + description: File containing software versions + pattern: "versions.yml" + +authors: + - "@famosab" +maintainers: + - "@famosab" diff --git a/modules/nf-core/crabs/downloadtaxonomy/tests/main.nf.test b/modules/nf-core/crabs/downloadtaxonomy/tests/main.nf.test new file mode 100644 index 00000000000..4081178463c --- /dev/null +++ b/modules/nf-core/crabs/downloadtaxonomy/tests/main.nf.test @@ -0,0 +1,58 @@ +nextflow_process { + + name "Test Process CRABS_DOWNLOADTAXONOMY" + script "../main.nf" + process "CRABS_DOWNLOADTAXONOMY" + + tag "modules" + tag "modules_nfcore" + tag "crabs" + tag "crabs/downloadtaxonomy" + + test("download") { + + when { + params { + module_args = "--exclude 'acc2taxid,taxdump'" + } + process { + """ + input[0] = [ id:'test' ] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + + } + + test("download - stub") { + + options "-stub" + + when { + process { + """ + input[0] = [ id:'test' ] + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot( + process.out, + path(process.out.versions[0]).yaml + ).match() } + ) + } + + } + +} diff --git a/modules/nf-core/crabs/downloadtaxonomy/tests/main.nf.test.snap b/modules/nf-core/crabs/downloadtaxonomy/tests/main.nf.test.snap new file mode 100644 index 00000000000..1edf37d06ec --- /dev/null +++ b/modules/nf-core/crabs/downloadtaxonomy/tests/main.nf.test.snap @@ -0,0 +1,137 @@ +{ + "download": { + "content": [ + { + "0": [ + + ], + "1": [ + + ], + "2": [ + + ], + "3": [ + + ], + "accession2taxid": [ + + ], + "names": [ + + ], + "nodes": [ + + ], + "versions": [ + + ] + } + ], + "meta": { + "nf-test": "0.9.2", + "nextflow": "24.10.4" + }, + "timestamp": "2025-02-03T13:56:49.20584" + }, + "download - stub": { + "content": [ + { + "0": [ + [ + { + "id": "test" + }, + "nucl_gb.accession2taxid:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "1": [ + [ + { + "id": "test" + }, + "names.dmp:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "2": [ + [ + { + "id": "test" + }, + "nodes.dmp:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "3": [ + [ + { + "id": "test" + }, + [ + [ + "names.dmp:md5,d41d8cd98f00b204e9800998ecf8427e", + "nodes.dmp:md5,d41d8cd98f00b204e9800998ecf8427e", + "nucl_gb.accession2taxid:md5,d41d8cd98f00b204e9800998ecf8427e" + ], + "versions.yml:md5,b98b46449a638f8825d42a6abe7a742e" + ] + ] + ], + "4": [ + "versions.yml:md5,b98b46449a638f8825d42a6abe7a742e" + ], + "accession2taxid": [ + [ + { + "id": "test" + }, + "nucl_gb.accession2taxid:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "downloadtaxonomy_dir": [ + [ + { + "id": "test" + }, + [ + [ + "names.dmp:md5,d41d8cd98f00b204e9800998ecf8427e", + "nodes.dmp:md5,d41d8cd98f00b204e9800998ecf8427e", + "nucl_gb.accession2taxid:md5,d41d8cd98f00b204e9800998ecf8427e" + ], + "versions.yml:md5,b98b46449a638f8825d42a6abe7a742e" + ] + ] + ], + "names": [ + [ + { + "id": "test" + }, + "names.dmp:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "nodes": [ + [ + { + "id": "test" + }, + "nodes.dmp:md5,d41d8cd98f00b204e9800998ecf8427e" + ] + ], + "versions": [ + "versions.yml:md5,b98b46449a638f8825d42a6abe7a742e" + ] + }, + { + "CRABS_DOWNLOADTAXONOMY": { + "crabs": "v1.0.7" + } + } + ], + "meta": { + "nf-test": "0.9.2", + "nextflow": "24.10.4" + }, + "timestamp": "2025-02-03T14:07:27.923472" + } +} \ No newline at end of file diff --git a/modules/nf-core/crabs/downloadtaxonomy/tests/nextflow.config b/modules/nf-core/crabs/downloadtaxonomy/tests/nextflow.config new file mode 100644 index 00000000000..a570ad5f6c8 --- /dev/null +++ b/modules/nf-core/crabs/downloadtaxonomy/tests/nextflow.config @@ -0,0 +1,7 @@ +process { + + withName: 'CRABS_DOWNLOADTAXONOMY' { + ext.args = params.module_args + } + +} \ No newline at end of file From 8e1d1126f7dd174cf5d7f1ba82db910a0b969aa6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Famke=20Ba=CC=88uerle?= Date: Mon, 3 Feb 2025 14:42:04 +0900 Subject: [PATCH 16/16] remove dbimport from this PR --- .../nf-core/crabs/dbimport/environment.yml | 5 -- modules/nf-core/crabs/dbimport/main.nf | 59 ------------- modules/nf-core/crabs/dbimport/meta.yml | 52 ------------ .../nf-core/crabs/dbimport/tests/main.nf.test | 84 ------------------- .../crabs/dbimport/tests/main.nf.test.snap | 63 -------------- .../crabs/dbimport/tests/nextflow.config | 7 -- 6 files changed, 270 deletions(-) delete mode 100644 modules/nf-core/crabs/dbimport/environment.yml delete mode 100644 modules/nf-core/crabs/dbimport/main.nf delete mode 100644 modules/nf-core/crabs/dbimport/meta.yml delete mode 100644 modules/nf-core/crabs/dbimport/tests/main.nf.test delete mode 100644 modules/nf-core/crabs/dbimport/tests/main.nf.test.snap delete mode 100644 modules/nf-core/crabs/dbimport/tests/nextflow.config diff --git a/modules/nf-core/crabs/dbimport/environment.yml b/modules/nf-core/crabs/dbimport/environment.yml deleted file mode 100644 index c9761a2d14b..00000000000 --- a/modules/nf-core/crabs/dbimport/environment.yml +++ /dev/null @@ -1,5 +0,0 @@ -channels: - - conda-forge - - bioconda -dependencies: - - bioconda::crabs=1.0.7 diff --git a/modules/nf-core/crabs/dbimport/main.nf b/modules/nf-core/crabs/dbimport/main.nf deleted file mode 100644 index ef00aea503f..00000000000 --- a/modules/nf-core/crabs/dbimport/main.nf +++ /dev/null @@ -1,59 +0,0 @@ -process CRABS_DBIMPORT { - 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/crabs:1.0.7--pyhdfd78af_0': - 'biocontainers/crabs:1.0.7--pyhdfd78af_0' }" - - input: - tuple val(meta), path(fasta) - tuple val(meta2), path(accession2taxid) - tuple val(meta3), path(names) - tuple val(meta4), path(nodes) - - output: - tuple val(meta), path("*.fa"), emit: fasta - 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 = fasta.name.endsWith(".gz") - def fasta_name = fasta.name.replace(".gz", "") - """ - if [ "${is_compressed}" == "true" ]; then - gzip -c -d ${fasta} > ${fasta_name} - fi - - crabs --import \\ - --input ${fasta_name} \\ - --output ${prefix}.crabsdb.fa \\ - --acc2tax ${accession2taxid} \\ - --names ${names} \\ - --nodes ${nodes} \\ - $args - - rm ${fasta_name} - - cat <<-END_VERSIONS > versions.yml - "${task.process}": - crabs: \$(crabs --help | grep 'CRABS |' | sed 's/.*CRABS | \\(v[0-9.]*\\).*/\\1/') - END_VERSIONS - """ - - stub: - def prefix = task.ext.prefix ?: "${meta.id}" - """ - touch ${prefix}.fa - - cat <<-END_VERSIONS > versions.yml - "${task.process}": - crabs: \$(crabs --help | grep 'CRABS |' | sed 's/.*CRABS | \\(v[0-9.]*\\).*/\\1/') - END_VERSIONS - """ -} diff --git a/modules/nf-core/crabs/dbimport/meta.yml b/modules/nf-core/crabs/dbimport/meta.yml deleted file mode 100644 index 0aeffde1558..00000000000 --- a/modules/nf-core/crabs/dbimport/meta.yml +++ /dev/null @@ -1,52 +0,0 @@ -name: crabs_dbimport -description: In-house generated or curated data can be imported into CRABS. -keywords: - - insilico - - amplicon - - sequencing - - inhouse -tools: - - crabs: - description: | - Crabs (Creating Reference databases for Amplicon-Based Sequencing) - is a program to download and curate reference databases - for eDNA metabarcoding analyses - homepage: https://github.com/gjeunen/reference_database_creator - documentation: https://github.com/gjeunen/reference_database_creator?tab=readme-ov-file#running-crabs - tool_dev_url: https://github.com/gjeunen/reference_database_creator - doi: 10.1111/1755-0998.13741 - licence: ["MIT License"] - identifier: "" - -input: - - - meta: - type: map - description: | - Groovy Map containing sample information - e.g. `[ id:'sample1' ]` - - fasta: - type: file - description: In-house sequencing data - pattern: "*.{fa,fasta}" -output: - - fasta: - - meta: - type: map - description: | - Groovy Map containing sample information - e.g. `[ id:'sample1' ]` - - "*.fa": - type: file - description: Reverse complemented Sequence - pattern: "*.{fa,fasta}" - - versions: - - versions.yml: - type: file - description: File containing software versions - pattern: "versions.yml" -authors: - - "@famosab" - - "@a4000" -maintainers: - - "@famosab" - - "@a4000" diff --git a/modules/nf-core/crabs/dbimport/tests/main.nf.test b/modules/nf-core/crabs/dbimport/tests/main.nf.test deleted file mode 100644 index b9f50699511..00000000000 --- a/modules/nf-core/crabs/dbimport/tests/main.nf.test +++ /dev/null @@ -1,84 +0,0 @@ -nextflow_process { - - name "Test Process CRABS_DBIMPORT" - script "../main.nf" - process "CRABS_DBIMPORT" - - tag "modules" - tag "modules_nfcore" - tag "crabs" - tag "crabs/dbimport" - tag "crabs/downloadtaxonomy" - - setup { - run("CRABS_DOWNLOADTAXONOMY") { - script "../../downloadtaxonomy/main.nf" - process { - """ - input[0] = [ id:'taxonomy' ] - """ - } - } - } - - test("sarscov2 - fasta") { - - config "./nextflow.config" - - when { - params { - module_args = "--import-format embl --ranks 'superkingdom;phylum;class;order;family;genus;species' \\" - } - process { - """ - input[0] = [ - [ id:'test' ], // meta map - file(params.modules_testdata_base_path +'genomics/sarscov2/genome/genome.fasta', checkIfExists: true) - ] - input[1] = CRABS_DOWNLOADTAXONOMY.out.accession2taxid - input[2] = CRABS_DOWNLOADTAXONOMY.out.names - input[3] = CRABS_DOWNLOADTAXONOMY.out.nodes - """ - } - } - - then { - assertAll( - { assert process.success }, - { assert snapshot(process.out).match() } - ) - } - - } - - test("sarscov2 - fasta - stub") { - - options "-stub" - - when { - process { - """ - input[0] = [ - [ id:'test' ], // meta map - file(params.modules_testdata_base_path +'genomics/sarscov2/genome/genome.fasta', checkIfExists: true) - ] - input[1] = CRABS_DOWNLOADTAXONOMY.out.accession2taxid - input[2] = CRABS_DOWNLOADTAXONOMY.out.names - input[3] = CRABS_DOWNLOADTAXONOMY.out.nodes - """ - } - } - - then { - assertAll( - { assert process.success }, - { assert snapshot( - process.out, - path(process.out.versions[0]).yaml - ).match() } - ) - } - - } - -} \ No newline at end of file diff --git a/modules/nf-core/crabs/dbimport/tests/main.nf.test.snap b/modules/nf-core/crabs/dbimport/tests/main.nf.test.snap deleted file mode 100644 index 54f52067cb6..00000000000 --- a/modules/nf-core/crabs/dbimport/tests/main.nf.test.snap +++ /dev/null @@ -1,63 +0,0 @@ -{ - "sarscov2 - fasta - stub": { - "content": [ - { - "0": [ - [ - { - "id": "test" - }, - "test.fa:md5,d41d8cd98f00b204e9800998ecf8427e" - ] - ], - "1": [ - "versions.yml:md5,65a68b87678624e13a185da907b3be67" - ], - "fasta": [ - [ - { - "id": "test" - }, - "test.fa:md5,d41d8cd98f00b204e9800998ecf8427e" - ] - ], - "versions": [ - "versions.yml:md5,65a68b87678624e13a185da907b3be67" - ] - }, - { - "CRABS_DBIMPORT": { - "crabs": "v1.0.7" - } - } - ], - "meta": { - "nf-test": "0.9.2", - "nextflow": "24.10.4" - }, - "timestamp": "2025-02-03T13:52:33.256766" - }, - "sarscov2 - fasta": { - "content": [ - { - "0": [ - - ], - "1": [ - - ], - "fasta": [ - - ], - "versions": [ - - ] - } - ], - "meta": { - "nf-test": "0.9.2", - "nextflow": "24.10.4" - }, - "timestamp": "2025-02-03T14:15:02.785883" - } -} \ No newline at end of file diff --git a/modules/nf-core/crabs/dbimport/tests/nextflow.config b/modules/nf-core/crabs/dbimport/tests/nextflow.config deleted file mode 100644 index 9d003f3db15..00000000000 --- a/modules/nf-core/crabs/dbimport/tests/nextflow.config +++ /dev/null @@ -1,7 +0,0 @@ -process { - - withName: CRABS_DBIMPORT { - ext.args = params.module_args - } - -}