diff --git a/.gitignore b/.gitignore index effbc73d..7540f78c 100644 --- a/.gitignore +++ b/.gitignore @@ -11,3 +11,4 @@ null/ .nf-test* .idea/ test_data +.venv diff --git a/CHANGELOG.md b/CHANGELOG.md index c2e9b240..33b9d142 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,9 +7,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### `Fixed` +- [#116](https://github.com/nf-core/seqsubmit/pull/116) + - All tests except the `*_existing_study` ones now register a new submission study, so they can be run with any Webin account ([#95](https://github.com/nf-core/seqsubmit/issues/95)). The `test_mag_complete_metadata_existing_study` and `test_assembly_complete_metadata_existing_study` tests submit to the existing study `PRJEB98843` and require maintainer Webin credentials + - `test_upload = true` is set explicitly in all test configs + - Study submission alias now has a random suffix, so parallel registrations started in the same second no longer collide + - `REGISTERSTUDY` now runs only when at least one input passed validation ([#113](https://github.com/nf-core/seqsubmit/issues/113)) - [#106](https://github.com/nf-core/seqsubmit/pull/106) - Added support for metatranscriptome submission for ASSEMBLYSUBMIT - - Set retry to assembly_uploader + - Set retry to GENERATE_ASSEMBLY_MANIFEST module - [#108](https://github.com/nf-core/seqsubmit/pull/108) - Added test usecase in test-datasets https://github.com/nf-core/test-datasets/pull/2324 with contamination=0 - [#107](https://github.com/nf-core/seqsubmit/pull/107) diff --git a/bin/submit_study.py b/bin/submit_study.py index 6c8b0d49..5c9a7ffa 100755 --- a/bin/submit_study.py +++ b/bin/submit_study.py @@ -13,6 +13,7 @@ import logging import os import sys +import uuid import xml.etree.ElementTree as ET from io import BytesIO from pathlib import Path @@ -327,7 +328,8 @@ def build_submission_xml( # SUBMISSION_SET submission_set = ET.SubElement(webin, "SUBMISSION_SET") submission = ET.SubElement(submission_set, "SUBMISSION") - sub_alias = f"study-submission-{datetime.datetime.now().strftime('%Y%m%d-%H%M%S')}" + # Random suffix keeps aliases unique when several submissions start in the same second + sub_alias = f"study-submission-{datetime.datetime.now().strftime('%Y%m%d-%H%M%S')}-{uuid.uuid4().hex[:4]}" submission.set("alias", sub_alias) actions = ET.SubElement(submission, "ACTIONS") main_action = ET.SubElement(actions, "ACTION") diff --git a/conf/test.config b/conf/test.config index 8f561785..93347675 100644 --- a/conf/test.config +++ b/conf/test.config @@ -24,14 +24,15 @@ params { // Input data input = params.pipelines_testdata_base_path + 'seqsubmit/samplesheets/mag_multiple_bins_missing_metadata.csv' + outdir = 'test_output' mode = "mags" - submission_study = "PRJEB98843" + submission_study = null + study_metadata = params.pipelines_testdata_base_path + 'seqsubmit/test_data/study_metadata/study_metadata.json' centre_name = "TEST_CENTER" test_upload = true cat_db = params.pipelines_testdata_base_path + 'seqsubmit/test_data/small_cat_db/tax-db.tar.gz' checkm2_db = null - } diff --git a/conf/test_assembly_complete_metadata.config b/conf/test_assembly_complete_metadata.config index 801cab7b..615e871b 100644 --- a/conf/test_assembly_complete_metadata.config +++ b/conf/test_assembly_complete_metadata.config @@ -20,14 +20,16 @@ process { params { config_profile_name = 'Test --mode metagenomic_assemblies complete_metadata profile' - config_profile_description = 'Tests single assembly submission with all metadata provided in the samplesheet so the pipeline skips coverage calculation and only performs the upload to ENA. Submits to a pre-existing ENA study passed via --submission_study.' + config_profile_description = 'Single-case assembly test with complete metadata values provided' // Input data input = params.pipelines_testdata_base_path + 'seqsubmit/samplesheets/assembly_complete_metadata.csv' outdir = 'test_output' mode = "metagenomic_assemblies" - submission_study = "PRJEB98843" + submission_study = null + study_metadata = params.pipelines_testdata_base_path + 'seqsubmit/test_data/study_metadata/study_metadata.json' centre_name = "TEST_CENTER" + test_upload = true } diff --git a/conf/test_assembly_no_study_complete_metadata.config b/conf/test_assembly_complete_metadata_existing_study.config similarity index 71% rename from conf/test_assembly_no_study_complete_metadata.config rename to conf/test_assembly_complete_metadata_existing_study.config index ac83a223..f526e9fe 100644 --- a/conf/test_assembly_no_study_complete_metadata.config +++ b/conf/test_assembly_complete_metadata_existing_study.config @@ -20,16 +20,15 @@ process { params { config_profile_name = 'Test --mode metagenomic_assemblies complete_metadata profile' - config_profile_description = 'Single-case assembly test with complete metadata values provided' + config_profile_description = 'Tests single assembly submission with all metadata provided in the samplesheet so the pipeline skips coverage calculation and only performs the upload to ENA. Submits to a pre-existing ENA study passed via --submission_study, so requires maintainer Webin credentials with access to PRJEB98843.' // Input data input = params.pipelines_testdata_base_path + 'seqsubmit/samplesheets/assembly_complete_metadata.csv' + outdir = 'test_output' mode = "metagenomic_assemblies" - submission_study = null - study_metadata = params.pipelines_testdata_base_path + 'seqsubmit/test_data/study_metadata/study_metadata.json' + submission_study = "PRJEB98843" centre_name = "TEST_CENTER" test_upload = true - } diff --git a/conf/test_assembly_no_coverage_paired_reads.config b/conf/test_assembly_no_coverage_paired_reads.config index 65c73e40..4afb1d82 100644 --- a/conf/test_assembly_no_coverage_paired_reads.config +++ b/conf/test_assembly_no_coverage_paired_reads.config @@ -27,7 +27,9 @@ params { outdir = 'test_output' mode = "metagenomic_assemblies" - submission_study = "PRJEB98843" + submission_study = null + study_metadata = params.pipelines_testdata_base_path + 'seqsubmit/test_data/study_metadata/study_metadata.json' centre_name = "TEST_CENTER" + test_upload = true } diff --git a/conf/test_assembly_no_coverage_single_reads.config b/conf/test_assembly_no_coverage_single_reads.config index 814de310..de9e064e 100644 --- a/conf/test_assembly_no_coverage_single_reads.config +++ b/conf/test_assembly_no_coverage_single_reads.config @@ -27,7 +27,9 @@ params { outdir = 'test_output' mode = "metagenomic_assemblies" - submission_study = "PRJEB98843" + submission_study = null + study_metadata = params.pipelines_testdata_base_path + 'seqsubmit/test_data/study_metadata/study_metadata.json' centre_name = "TEST_CENTER" + test_upload = true } diff --git a/conf/test_assembly_one_contig.config b/conf/test_assembly_one_contig.config index b27784ef..fcb7bc7f 100644 --- a/conf/test_assembly_one_contig.config +++ b/conf/test_assembly_one_contig.config @@ -27,7 +27,9 @@ params { outdir = 'test_output' mode = "metagenomic_assemblies" - submission_study = "PRJEB98843" + submission_study = null + study_metadata = params.pipelines_testdata_base_path + 'seqsubmit/test_data/study_metadata/study_metadata.json' centre_name = "TEST_CENTER" + test_upload = true } diff --git a/conf/test_full.config b/conf/test_full.config index 98d50424..b7278aa6 100644 --- a/conf/test_full.config +++ b/conf/test_full.config @@ -16,9 +16,11 @@ params { // Input data input = params.pipelines_testdata_base_path + 'seqsubmit/samplesheets/mag_multiple_bins_missing_metadata.csv' + outdir = 'test_output' mode = "mags" - submission_study = "PRJEB98843" + submission_study = null + study_metadata = params.pipelines_testdata_base_path + 'seqsubmit/test_data/study_metadata/study_metadata.json' centre_name = "TEST_CENTER" test_upload = true diff --git a/conf/test_mag_no_study_complete_metadata.config b/conf/test_mag_complete_metadata.config similarity index 97% rename from conf/test_mag_no_study_complete_metadata.config rename to conf/test_mag_complete_metadata.config index f316016b..4a1689e5 100644 --- a/conf/test_mag_no_study_complete_metadata.config +++ b/conf/test_mag_complete_metadata.config @@ -24,6 +24,7 @@ params { // Input data input = params.pipelines_testdata_base_path + 'seqsubmit/samplesheets/mag_complete_metadata.csv' + outdir = 'test_output' mode = "mags" submission_study = null @@ -34,5 +35,4 @@ params { cat_db = null checkm2_db = null - } diff --git a/conf/test_mag_complete_metadata.conf b/conf/test_mag_complete_metadata_existing_study.conf similarity index 91% rename from conf/test_mag_complete_metadata.conf rename to conf/test_mag_complete_metadata_existing_study.conf index 428878a3..edfba5a8 100644 --- a/conf/test_mag_complete_metadata.conf +++ b/conf/test_mag_complete_metadata_existing_study.conf @@ -20,10 +20,11 @@ process { params { config_profile_name = 'Test --mode mags complete_metadata profile' - config_profile_description = 'Tests single MAG submission with all metadata provided in the samplesheet, so the pipeline skips statistics and taxonomy calculation and only performs the upload to ENA. Submits to a pre-existing ENA study passed via --submission_study.' + config_profile_description = 'Tests single MAG submission with all metadata provided in the samplesheet, so the pipeline skips statistics and taxonomy calculation and only performs the upload to ENA. Submits to a pre-existing ENA study passed via --submission_study, so requires maintainer Webin credentials with access to PRJEB98843.' // Input data input = params.pipelines_testdata_base_path + 'seqsubmit/samplesheets/mag_complete_metadata.csv' + outdir = 'test_output' mode = "mags" submission_study = "PRJEB98843" @@ -33,5 +34,4 @@ params { cat_db = null checkm2_db = null - } diff --git a/conf/test_mag_no_coverage_paired_reads.conf b/conf/test_mag_no_coverage_paired_reads.conf index 954a9a21..920e9263 100644 --- a/conf/test_mag_no_coverage_paired_reads.conf +++ b/conf/test_mag_no_coverage_paired_reads.conf @@ -24,14 +24,15 @@ params { // Input data input = params.pipelines_testdata_base_path + 'seqsubmit/samplesheets/mag_no_coverage_paired_reads.csv' + outdir = 'test_output' mode = "mags" - submission_study = "PRJEB98843" + submission_study = null + study_metadata = params.pipelines_testdata_base_path + 'seqsubmit/test_data/study_metadata/study_metadata.json' centre_name = "TEST_CENTER" test_upload = true cat_db = null checkm2_db = null - } diff --git a/conf/test_mag_no_coverage_single_reads.conf b/conf/test_mag_no_coverage_single_reads.conf index 48924241..ebbc5ce3 100644 --- a/conf/test_mag_no_coverage_single_reads.conf +++ b/conf/test_mag_no_coverage_single_reads.conf @@ -24,14 +24,15 @@ params { // Input data input = params.pipelines_testdata_base_path + 'seqsubmit/samplesheets/mag_no_coverage_single_reads.csv' + outdir = 'test_output' mode = "mags" - submission_study = "PRJEB98843" + submission_study = null + study_metadata = params.pipelines_testdata_base_path + 'seqsubmit/test_data/study_metadata/study_metadata.json' centre_name = "TEST_CENTER" test_upload = true cat_db = null checkm2_db = null - } diff --git a/conf/test_mag_no_quality.conf b/conf/test_mag_no_quality.conf index 656bffea..4b8e12ce 100644 --- a/conf/test_mag_no_quality.conf +++ b/conf/test_mag_no_quality.conf @@ -24,9 +24,11 @@ params { // Input data input = params.pipelines_testdata_base_path + 'seqsubmit/samplesheets/mag_no_quality.csv' + outdir = 'test_output' mode = "mags" - submission_study = "PRJEB98843" + submission_study = null + study_metadata = params.pipelines_testdata_base_path + 'seqsubmit/test_data/study_metadata/study_metadata.json' centre_name = "TEST_CENTER" test_upload = true @@ -36,5 +38,4 @@ params { // which is not ideal but necessary to test the pipeline's behaviour with missing quality values // Track upstream issue here: https://github.com/chklovski/CheckM2/issues/140 checkm2_db = null - } diff --git a/conf/test_mag_no_rna_presence.conf b/conf/test_mag_no_rna_presence.conf index 1577455b..d9d29909 100644 --- a/conf/test_mag_no_rna_presence.conf +++ b/conf/test_mag_no_rna_presence.conf @@ -24,14 +24,15 @@ params { // Input data input = params.pipelines_testdata_base_path + 'seqsubmit/samplesheets/mag_no_rna_presence.csv' + outdir = 'test_output' mode = "mags" - submission_study = "PRJEB98843" + submission_study = null + study_metadata = params.pipelines_testdata_base_path + 'seqsubmit/test_data/study_metadata/study_metadata.json' centre_name = "TEST_CENTER" test_upload = true cat_db = null checkm2_db = null - } diff --git a/conf/test_mag_no_taxonomy.conf b/conf/test_mag_no_taxonomy.conf index bb9f6870..3fea8048 100644 --- a/conf/test_mag_no_taxonomy.conf +++ b/conf/test_mag_no_taxonomy.conf @@ -24,14 +24,15 @@ params { // Input data input = params.pipelines_testdata_base_path + 'seqsubmit/samplesheets/mag_no_taxonomy.csv' + outdir = 'test_output' mode = "mags" - submission_study = "PRJEB98843" + submission_study = null + study_metadata = params.pipelines_testdata_base_path + 'seqsubmit/test_data/study_metadata/study_metadata.json' centre_name = "TEST_CENTER" test_upload = true cat_db = params.pipelines_testdata_base_path + 'seqsubmit/test_data/small_cat_db/tax-db.tar.gz' checkm2_db = null - } diff --git a/conf/test_mag_one_contig.conf b/conf/test_mag_one_contig.conf index d9f57020..06ec0ec1 100644 --- a/conf/test_mag_one_contig.conf +++ b/conf/test_mag_one_contig.conf @@ -24,14 +24,15 @@ params { // Input data input = params.pipelines_testdata_base_path + 'seqsubmit/samplesheets/mag_one_contig.csv' + outdir = 'test_output' mode = "mags" - submission_study = "PRJEB98843" + submission_study = null + study_metadata = params.pipelines_testdata_base_path + 'seqsubmit/test_data/study_metadata/study_metadata.json' centre_name = "TEST_CENTER" test_upload = true cat_db = null checkm2_db = null - } diff --git a/conf/test_reads_paired.config b/conf/test_reads_paired.config index dc0ba4df..d4bbd084 100644 --- a/conf/test_reads_paired.config +++ b/conf/test_reads_paired.config @@ -27,7 +27,8 @@ params { outdir = 'test_output' mode = "reads" - submission_study = "PRJEB98843" + submission_study = null + study_metadata = params.pipelines_testdata_base_path + 'seqsubmit/test_data/study_metadata/study_metadata.json' centre_name = "TEST_CENTER" test_upload = true diff --git a/docs/CONTRIBUTING.md b/docs/CONTRIBUTING.md index f7dcfe1c..ef3539bb 100644 --- a/docs/CONTRIBUTING.md +++ b/docs/CONTRIBUTING.md @@ -230,7 +230,7 @@ All submissions are performed via [Webin-CLI](https://github.com/enasequence/web ### Testing Requirements -All new functionality must be covered by tests. Running nf-tests that perform ENA submission locally requires ENA webin credentials. Contributors may ask for testing credentials on the nf-core Slack [#seqsubmit](https://nfcore.slack.com/channels/seqsubmit) channel. +All new functionality must be covered by tests. Running nf-tests that perform ENA submission locally requires ENA Webin credentials. Tests that register a new study can be run with any free [Webin account](https://www.ebi.ac.uk/ena/submit/webin/login); this is every test except the `*_existing_study` ones. The `*_existing_study` tests submit to the existing study `PRJEB98843` and need maintainer credentials, which contributors may ask for on the nf-core Slack [#seqsubmit](https://nfcore.slack.com/channels/seqsubmit) channel. At minimum, include: diff --git a/nextflow.config b/nextflow.config index d3911f83..9bddb0bb 100644 --- a/nextflow.config +++ b/nextflow.config @@ -239,22 +239,22 @@ profiles { apptainer.runOptions = '--nv' singularity.runOptions = '--nv' } - test { includeConfig 'conf/test.config' } - test_full { includeConfig 'conf/test_full.config' } - test_mag_complete_metadata { includeConfig 'conf/test_mag_complete_metadata.conf' } - test_mag_no_study_complete_metadata { includeConfig 'conf/test_mag_no_study_complete_metadata.config' } - test_mag_no_coverage_single_reads { includeConfig 'conf/test_mag_no_coverage_single_reads.conf' } - test_mag_no_coverage_paired_reads { includeConfig 'conf/test_mag_no_coverage_paired_reads.conf' } - test_mag_no_quality { includeConfig 'conf/test_mag_no_quality.conf' } - test_mag_one_contig { includeConfig 'conf/test_mag_one_contig.conf' } - test_mag_no_rna_presence { includeConfig 'conf/test_mag_no_rna_presence.conf' } - test_mag_no_taxonomy { includeConfig 'conf/test_mag_no_taxonomy.conf' } - test_assembly_complete_metadata { includeConfig 'conf/test_assembly_complete_metadata.config' } - test_assembly_no_study_complete_metadata { includeConfig 'conf/test_assembly_no_study_complete_metadata.config' } - test_assembly_no_coverage_single_reads { includeConfig 'conf/test_assembly_no_coverage_single_reads.config' } - test_assembly_no_coverage_paired_reads { includeConfig 'conf/test_assembly_no_coverage_paired_reads.config' } - test_assembly_one_contig { includeConfig 'conf/test_assembly_one_contig.config' } - test_reads_paired { includeConfig 'conf/test_reads_paired.config' } + test { includeConfig 'conf/test.config' } + test_full { includeConfig 'conf/test_full.config' } + test_mag_complete_metadata_existing_study { includeConfig 'conf/test_mag_complete_metadata_existing_study.conf' } + test_mag_complete_metadata { includeConfig 'conf/test_mag_complete_metadata.config' } + test_mag_no_coverage_single_reads { includeConfig 'conf/test_mag_no_coverage_single_reads.conf' } + test_mag_no_coverage_paired_reads { includeConfig 'conf/test_mag_no_coverage_paired_reads.conf' } + test_mag_no_quality { includeConfig 'conf/test_mag_no_quality.conf' } + test_mag_one_contig { includeConfig 'conf/test_mag_one_contig.conf' } + test_mag_no_rna_presence { includeConfig 'conf/test_mag_no_rna_presence.conf' } + test_mag_no_taxonomy { includeConfig 'conf/test_mag_no_taxonomy.conf' } + test_assembly_complete_metadata_existing_study { includeConfig 'conf/test_assembly_complete_metadata_existing_study.config' } + test_assembly_complete_metadata { includeConfig 'conf/test_assembly_complete_metadata.config' } + test_assembly_no_coverage_single_reads { includeConfig 'conf/test_assembly_no_coverage_single_reads.config' } + test_assembly_no_coverage_paired_reads { includeConfig 'conf/test_assembly_no_coverage_paired_reads.config' } + test_assembly_one_contig { includeConfig 'conf/test_assembly_one_contig.config' } + test_reads_paired { includeConfig 'conf/test_reads_paired.config' } } // Load nf-core custom profiles from different institutions diff --git a/tests/assembly_complete_metadata.nf.test.snap b/tests/assembly_complete_metadata.nf.test.snap index 5085777d..1221e619 100644 --- a/tests/assembly_complete_metadata.nf.test.snap +++ b/tests/assembly_complete_metadata.nf.test.snap @@ -1,7 +1,7 @@ { "-profile test_assembly_complete_metadata": { "content": [ - 7, + 8, { "CONCAT_ACCESSIONS": { "coreutils": 9.4, @@ -22,6 +22,9 @@ "GENERATE_ASSEMBLY_MANIFEST": { "assembly_uploader": "1.3.6" }, + "REGISTERSTUDY": { + "mgnify-pipelines-toolkit": "1.5.1" + }, "SUBMIT": { "ena-webin-cli": "9.0.3", "mgnify-pipelines-toolkit": "1.5.1", diff --git a/tests/assembly_no_study_complete_metadata.nf.test b/tests/assembly_complete_metadata_existing_study.nf.test similarity index 83% rename from tests/assembly_no_study_complete_metadata.nf.test rename to tests/assembly_complete_metadata_existing_study.nf.test index 09c9f0be..b289247f 100644 --- a/tests/assembly_no_study_complete_metadata.nf.test +++ b/tests/assembly_complete_metadata_existing_study.nf.test @@ -1,13 +1,13 @@ nextflow_pipeline { - name "Test assembly submission workflow - complete_metadata" + name "Test assembly submission workflow - complete_metadata (submission to existing study)" script "../main.nf" tag "pipeline" tag "mode_assembly" - tag "test_assembly_no_study_complete_metadata" - profile "test_assembly_no_study_complete_metadata" + tag "test_assembly_complete_metadata_existing_study" + profile "test_assembly_complete_metadata_existing_study" - test("-profile test_assembly_no_study_complete_metadata") { + test("-profile test_assembly_complete_metadata_existing_study") { when { params { diff --git a/tests/assembly_no_study_complete_metadata.nf.test.snap b/tests/assembly_complete_metadata_existing_study.nf.test.snap similarity index 91% rename from tests/assembly_no_study_complete_metadata.nf.test.snap rename to tests/assembly_complete_metadata_existing_study.nf.test.snap index 27be885e..b2fd1c78 100644 --- a/tests/assembly_no_study_complete_metadata.nf.test.snap +++ b/tests/assembly_complete_metadata_existing_study.nf.test.snap @@ -1,7 +1,7 @@ { - "-profile test_assembly_no_study_complete_metadata": { + "-profile test_assembly_complete_metadata_existing_study": { "content": [ - 8, + 7, { "CONCAT_ACCESSIONS": { "coreutils": 9.4, @@ -22,9 +22,6 @@ "GENERATE_ASSEMBLY_MANIFEST": { "assembly_uploader": "1.3.6" }, - "REGISTERSTUDY": { - "mgnify-pipelines-toolkit": "1.5.1" - }, "SUBMIT": { "ena-webin-cli": "9.0.3", "mgnify-pipelines-toolkit": "1.5.1", @@ -74,10 +71,10 @@ "multiqc_citations.txt:md5,4c806e63a283ec1b7e78cdae3a923d4f" ] ], + "timestamp": "2026-10-16T11:08:01.267709", "meta": { - "nf-test": "0.9.2", - "nextflow": "26.04.1" - }, - "timestamp": "2026-10-15T11:45:06.881317" + "nf-test": "0.9.5", + "nextflow": "26.10.0" + } } } \ No newline at end of file diff --git a/tests/assembly_no_coverage_paired_reads.nf.test.snap b/tests/assembly_no_coverage_paired_reads.nf.test.snap index 79f3702b..b898bf04 100644 --- a/tests/assembly_no_coverage_paired_reads.nf.test.snap +++ b/tests/assembly_no_coverage_paired_reads.nf.test.snap @@ -1,7 +1,7 @@ { "-profile test_assembly_no_coverage_paired_reads": { "content": [ - 8, + 9, { "CONCAT_ACCESSIONS": { "coreutils": 9.4, @@ -25,6 +25,9 @@ "GENERATE_ASSEMBLY_MANIFEST": { "assembly_uploader": "1.3.6" }, + "REGISTERSTUDY": { + "mgnify-pipelines-toolkit": "1.5.1" + }, "SUBMIT": { "ena-webin-cli": "9.0.3", "mgnify-pipelines-toolkit": "1.5.1", @@ -77,10 +80,10 @@ "multiqc_citations.txt:md5,4c806e63a283ec1b7e78cdae3a923d4f" ] ], + "timestamp": "2026-10-15T15:39:15.438257", "meta": { - "nf-test": "0.9.2", - "nextflow": "26.04.1" - }, - "timestamp": "2026-10-15T11:45:06.881317" + "nf-test": "0.9.5", + "nextflow": "26.10.0" + } } } \ No newline at end of file diff --git a/tests/assembly_no_coverage_single_reads.nf.test.snap b/tests/assembly_no_coverage_single_reads.nf.test.snap index 4d754215..539dd28f 100644 --- a/tests/assembly_no_coverage_single_reads.nf.test.snap +++ b/tests/assembly_no_coverage_single_reads.nf.test.snap @@ -1,7 +1,7 @@ { "-profile test_assembly_no_coverage_single_reads": { "content": [ - 8, + 9, { "CONCAT_ACCESSIONS": { "coreutils": 9.4, @@ -25,6 +25,9 @@ "GENERATE_ASSEMBLY_MANIFEST": { "assembly_uploader": "1.3.6" }, + "REGISTERSTUDY": { + "mgnify-pipelines-toolkit": "1.5.1" + }, "SUBMIT": { "ena-webin-cli": "9.0.3", "mgnify-pipelines-toolkit": "1.5.1", @@ -77,10 +80,10 @@ "multiqc_citations.txt:md5,4c806e63a283ec1b7e78cdae3a923d4f" ] ], + "timestamp": "2026-10-15T16:34:10.672881", "meta": { - "nf-test": "0.9.2", - "nextflow": "26.04.1" - }, - "timestamp": "2026-10-15T11:45:06.881317" + "nf-test": "0.9.5", + "nextflow": "26.10.0" + } } } \ No newline at end of file diff --git a/tests/assembly_one_contig.nf.test.snap b/tests/assembly_one_contig.nf.test.snap index 5661f98d..491bbdf3 100644 --- a/tests/assembly_one_contig.nf.test.snap +++ b/tests/assembly_one_contig.nf.test.snap @@ -28,10 +28,10 @@ "multiqc_citations.txt:md5,4c806e63a283ec1b7e78cdae3a923d4f" ] ], + "timestamp": "2026-10-19T15:29:09.134422", "meta": { - "nf-test": "0.9.2", + "nf-test": "0.9.5", "nextflow": "26.04.1" - }, - "timestamp": "2026-05-14T10:39:20.087785" + } } } \ No newline at end of file diff --git a/tests/default.nf.test.snap b/tests/default.nf.test.snap index 4aadca31..10072b0f 100644 --- a/tests/default.nf.test.snap +++ b/tests/default.nf.test.snap @@ -1,7 +1,7 @@ { "-profile test": { "content": [ - 21, + 22, { "BARRNAP": { "barrnap": 0.9 @@ -40,6 +40,9 @@ "FALINT": { "falint": "1.2.0" }, + "REGISTERSTUDY": { + "mgnify-pipelines-toolkit": "1.5.1" + }, "RENAME_FASTA_FOR_CATPACK": { "bash": "5.2.37(1)-release" }, @@ -131,10 +134,10 @@ "multiqc_genome_metadata.txt:md5,2f42824e9296d918b7f944037c27c717" ] ], + "timestamp": "2026-10-19T15:27:49.508151", "meta": { - "nf-test": "0.9.3", - "nextflow": "26.04.0" - }, - "timestamp": "2026-06-24T15:59:38.733125" + "nf-test": "0.9.5", + "nextflow": "26.04.1" + } } } \ No newline at end of file diff --git a/tests/mag_complete_metadata.nf.test.snap b/tests/mag_complete_metadata.nf.test.snap index 54957593..db109eff 100644 --- a/tests/mag_complete_metadata.nf.test.snap +++ b/tests/mag_complete_metadata.nf.test.snap @@ -1,7 +1,7 @@ { "-profile test_mag_complete_metadata": { "content": [ - 7, + 8, { "CONCAT_ACCESSIONS": { "coreutils": 9.4, @@ -22,6 +22,9 @@ "FALINT": { "falint": "1.2.0" }, + "REGISTERSTUDY": { + "mgnify-pipelines-toolkit": "1.5.1" + }, "SUBMIT": { "ena-webin-cli": "9.0.3", "mgnify-pipelines-toolkit": "1.5.1", @@ -82,10 +85,10 @@ "multiqc_genome_metadata.txt:md5,4364c96b13eb232b290c9f29b0edcf5a" ] ], + "timestamp": "2026-10-19T13:46:10.420328", "meta": { - "nf-test": "0.9.3", - "nextflow": "26.04.0" - }, - "timestamp": "2026-06-24T16:02:07.683194" + "nf-test": "0.9.5", + "nextflow": "26.04.1" + } } } \ No newline at end of file diff --git a/tests/mag_no_study_complete_metadata.nf.test b/tests/mag_complete_metadata_existing_study.nf.test similarity index 84% rename from tests/mag_no_study_complete_metadata.nf.test rename to tests/mag_complete_metadata_existing_study.nf.test index d585286f..1dc5e0f4 100644 --- a/tests/mag_no_study_complete_metadata.nf.test +++ b/tests/mag_complete_metadata_existing_study.nf.test @@ -1,13 +1,13 @@ nextflow_pipeline { - name "Test genome submission workflow - complete_metadata" + name "Test genome submission workflow - complete_metadata (submission to existing study)" script "../main.nf" tag "pipeline" tag "mode_mag" - tag "test_mag_no_study_complete_metadata" - profile "test_mag_no_study_complete_metadata" + tag "test_mag_complete_metadata_existing_study" + profile "test_mag_complete_metadata_existing_study" - test("-profile test_mag_no_study_complete_metadata") { + test("-profile test_mag_complete_metadata_existing_study") { when { params { diff --git a/tests/mag_no_study_complete_metadata.nf.test.snap b/tests/mag_complete_metadata_existing_study.nf.test.snap similarity index 92% rename from tests/mag_no_study_complete_metadata.nf.test.snap rename to tests/mag_complete_metadata_existing_study.nf.test.snap index b838f6b5..39b86531 100644 --- a/tests/mag_no_study_complete_metadata.nf.test.snap +++ b/tests/mag_complete_metadata_existing_study.nf.test.snap @@ -1,7 +1,7 @@ { - "-profile test_mag_no_study_complete_metadata": { + "-profile test_mag_complete_metadata_existing_study": { "content": [ - 8, + 7, { "CONCAT_ACCESSIONS": { "coreutils": 9.4, @@ -22,9 +22,6 @@ "FALINT": { "falint": "1.2.0" }, - "REGISTERSTUDY": { - "mgnify-pipelines-toolkit": "1.5.1" - }, "SUBMIT": { "ena-webin-cli": "9.0.3", "mgnify-pipelines-toolkit": "1.5.1", @@ -85,10 +82,10 @@ "multiqc_genome_metadata.txt:md5,4364c96b13eb232b290c9f29b0edcf5a" ] ], + "timestamp": "2026-10-16T15:32:26.944716", "meta": { - "nf-test": "0.9.3", - "nextflow": "26.04.0" - }, - "timestamp": "2026-06-24T19:28:10.097952" + "nf-test": "0.9.5", + "nextflow": "26.10.0" + } } } \ No newline at end of file diff --git a/tests/mag_no_coverage_paired_reads.nf.test.snap b/tests/mag_no_coverage_paired_reads.nf.test.snap index 0725d600..a3b68e51 100644 --- a/tests/mag_no_coverage_paired_reads.nf.test.snap +++ b/tests/mag_no_coverage_paired_reads.nf.test.snap @@ -1,7 +1,7 @@ { "-profile test_mag_no_coverage_paired_reads": { "content": [ - 8, + 9, { "CONCAT_ACCESSIONS": { "coreutils": 9.4, @@ -25,6 +25,9 @@ "FALINT": { "falint": "1.2.0" }, + "REGISTERSTUDY": { + "mgnify-pipelines-toolkit": "1.5.1" + }, "SUBMIT": { "ena-webin-cli": "9.0.3", "mgnify-pipelines-toolkit": "1.5.1", @@ -88,10 +91,10 @@ "multiqc_genome_metadata.txt:md5,73ca3eaa259e29711518c466246aeed5" ] ], + "timestamp": "2026-10-16T11:28:13.637453", "meta": { - "nf-test": "0.9.3", - "nextflow": "26.04.0" - }, - "timestamp": "2026-06-24T16:04:05.724269" + "nf-test": "0.9.5", + "nextflow": "26.10.0" + } } } \ No newline at end of file diff --git a/tests/mag_no_coverage_single_reads.nf.test.snap b/tests/mag_no_coverage_single_reads.nf.test.snap index 3a432618..f56b7274 100644 --- a/tests/mag_no_coverage_single_reads.nf.test.snap +++ b/tests/mag_no_coverage_single_reads.nf.test.snap @@ -1,7 +1,7 @@ { "-profile test_mag_no_coverage_single_reads": { "content": [ - 8, + 9, { "CONCAT_ACCESSIONS": { "coreutils": 9.4, @@ -25,6 +25,9 @@ "FALINT": { "falint": "1.2.0" }, + "REGISTERSTUDY": { + "mgnify-pipelines-toolkit": "1.5.1" + }, "SUBMIT": { "ena-webin-cli": "9.0.3", "mgnify-pipelines-toolkit": "1.5.1", @@ -88,10 +91,10 @@ "multiqc_genome_metadata.txt:md5,f87520e8673df42da7971d6b4723d020" ] ], + "timestamp": "2026-10-16T11:59:29.524504", "meta": { - "nf-test": "0.9.3", - "nextflow": "26.04.0" - }, - "timestamp": "2026-06-24T16:06:35.115481" + "nf-test": "0.9.5", + "nextflow": "26.10.0" + } } } \ No newline at end of file diff --git a/tests/mag_no_rna_presence.nf.test.snap b/tests/mag_no_rna_presence.nf.test.snap index 7fec9d9f..e6349e8b 100644 --- a/tests/mag_no_rna_presence.nf.test.snap +++ b/tests/mag_no_rna_presence.nf.test.snap @@ -1,7 +1,7 @@ { "-profile test_mag_no_rna_presence": { "content": [ - 10, + 11, { "BARRNAP": { "barrnap": 0.9 @@ -28,6 +28,9 @@ "FALINT": { "falint": "1.2.0" }, + "REGISTERSTUDY": { + "mgnify-pipelines-toolkit": "1.5.1" + }, "SUBMIT": { "ena-webin-cli": "9.0.3", "mgnify-pipelines-toolkit": "1.5.1", @@ -100,10 +103,10 @@ "multiqc_genome_metadata.txt:md5,efa903988140642f4f3d12b8e034e7a1" ] ], + "timestamp": "2026-10-19T15:57:54.825156", "meta": { - "nf-test": "0.9.3", - "nextflow": "26.04.0" - }, - "timestamp": "2026-06-24T16:13:51.780521" + "nf-test": "0.9.5", + "nextflow": "26.04.1" + } } } \ No newline at end of file diff --git a/tests/mag_no_taxonomy.nf.test.snap b/tests/mag_no_taxonomy.nf.test.snap index 0aa4bc4d..725912d2 100644 --- a/tests/mag_no_taxonomy.nf.test.snap +++ b/tests/mag_no_taxonomy.nf.test.snap @@ -1,7 +1,7 @@ { "-profile test_mag_no_taxonomy": { "content": [ - 11, + 12, { "CATPACK_ADDNAMES_BINS": { "catpack": 6.0 @@ -31,6 +31,9 @@ "FALINT": { "falint": "1.2.0" }, + "REGISTERSTUDY": { + "mgnify-pipelines-toolkit": "1.5.1" + }, "RENAME_FASTA_FOR_CATPACK": { "bash": "5.2.37(1)-release" }, @@ -99,10 +102,10 @@ "multiqc_genome_metadata.txt:md5,c2bdf8ba36b55b5f48fa07a26e5222f5" ] ], + "timestamp": "2026-10-15T16:23:14.854681", "meta": { - "nf-test": "0.9.3", - "nextflow": "26.04.0" - }, - "timestamp": "2026-06-24T16:20:51.581304" + "nf-test": "0.9.5", + "nextflow": "26.10.0" + } } } \ No newline at end of file diff --git a/tests/mag_one_contig.nf.test.snap b/tests/mag_one_contig.nf.test.snap index 1181faee..be530c2e 100644 --- a/tests/mag_one_contig.nf.test.snap +++ b/tests/mag_one_contig.nf.test.snap @@ -28,10 +28,10 @@ "multiqc_citations.txt:md5,4c806e63a283ec1b7e78cdae3a923d4f" ] ], + "timestamp": "2026-10-19T15:29:21.389607", "meta": { - "nf-test": "0.9.2", + "nf-test": "0.9.5", "nextflow": "26.04.1" - }, - "timestamp": "2026-05-14T10:59:16.375369" + } } } \ No newline at end of file diff --git a/tests/reads_paired_end.nf.test.snap b/tests/reads_paired_end.nf.test.snap index d4c288e5..7df80d1f 100644 --- a/tests/reads_paired_end.nf.test.snap +++ b/tests/reads_paired_end.nf.test.snap @@ -1,7 +1,7 @@ { "-profile test_reads_paired": { "content": [ - 4, + 5, { "CONCAT_ACCESSIONS": { "coreutils": 9.4, @@ -10,7 +10,10 @@ }, "CREATE_READS_MANIFEST": { "mgnify-pipelines-toolkit": "1.5.1" - }, + }, + "REGISTERSTUDY": { + "mgnify-pipelines-toolkit": "1.5.1" + }, "SUBMIT": { "ena-webin-cli": "9.0.3", "mgnify-pipelines-toolkit": "1.5.1", @@ -45,7 +48,7 @@ "multiqc_citations.txt:md5,4c806e63a283ec1b7e78cdae3a923d4f" ] ], - "timestamp": "2026-06-04T12:21:08.055365", + "timestamp": "2026-10-19T15:18:28.953324", "meta": { "nf-test": "0.9.5", "nextflow": "26.04.1" diff --git a/workflows/assemblysubmit.nf b/workflows/assemblysubmit.nf index 90273abd..bb3fe00f 100644 --- a/workflows/assemblysubmit.nf +++ b/workflows/assemblysubmit.nf @@ -136,7 +136,8 @@ workflow ASSEMBLYSUBMIT { } else { // Register a new study using the study metadata file REGISTERSTUDY( - channel.of([[id: "study"], file(study_metadata)]), + // Only register a study when at least one assembly passed validation + FASTA_VALIDATION.out.valid_fastas.first().map { _it -> [[id: "study"], file(study_metadata)] }, test_upload, release_date ) diff --git a/workflows/genomesubmit.nf b/workflows/genomesubmit.nf index 83f2cee6..17edbf94 100644 --- a/workflows/genomesubmit.nf +++ b/workflows/genomesubmit.nf @@ -226,7 +226,8 @@ workflow GENOMESUBMIT { study_accession_ch = channel.of(submission_study) } else { REGISTERSTUDY( - channel.of([[id: "study"], file(study_metadata)]), + // Only register a study when at least one genome passed validation + FASTA_VALIDATION.out.valid_fastas.first().map { _it -> [[id: "study"], file(study_metadata)] }, test_upload, release_date )