diff --git a/modules/nf-core/dds/createproject/environment.yml b/modules/nf-core/dds/createproject/environment.yml new file mode 100644 index 000000000000..03a90bb0a036 --- /dev/null +++ b/modules/nf-core/dds/createproject/environment.yml @@ -0,0 +1,10 @@ +--- +# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/environment-schema.json +channels: + - conda-forge + - bioconda +dependencies: + - conda-forge::pip=25.3 + - conda-forge::python=3.12.13 + - pip: + - dds-cli==2.14.3 diff --git a/modules/nf-core/dds/createproject/main.nf b/modules/nf-core/dds/createproject/main.nf new file mode 100644 index 000000000000..8b18a79a2b2e --- /dev/null +++ b/modules/nf-core/dds/createproject/main.nf @@ -0,0 +1,38 @@ +process DDS_CREATEPROJECT { + label 'process_single' + + conda "${moduleDir}/environment.yml" + container "${ workflow.containerEngine in ['singularity', 'apptainer'] && !task.ext.singularity_pull_docker_container ? + 'https://community-cr-prod.seqera.io/docker/registry/v2/blobs/sha256/73/7352a40103ce629fbc72986922a68e8f9cc35630b89ee836a0c03dfd676f2341/data': + 'community.wave.seqera.io/library/pip_python_dds-cli:4a7daeb54b4c7a8c' }" + + input: + val title + val description + val pi + path token_file + + output: + path 'output.log', emit: log + tuple val("${task.process}"), val('dds'), eval("dds --version | sed 's/.*version //'"), topic: versions, emit: versions_dds + + when: + task.ext.when == null || task.ext.when + + script: + def args = task.ext.args ?: '' + + """ + # dds requires 600 permissions on the token file; copy first since Nextflow stages inputs as symlinks + cp $token_file token.conf + chmod 600 token.conf + dds --token-path token.conf project create --title "$title" --description "$description" --principal-investigator "$pi" > output.log + """ + + stub: + def args = task.ext.args ?: '' + + """ + touch output.log + """ +} diff --git a/modules/nf-core/dds/createproject/meta.yml b/modules/nf-core/dds/createproject/meta.yml new file mode 100644 index 000000000000..985ebd55732b --- /dev/null +++ b/modules/nf-core/dds/createproject/meta.yml @@ -0,0 +1,90 @@ +--- +# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/meta-schema.json +name: "dds_createproject" +description: This module is used to create a project on the SciLifeLab Data + Delivery System (DDS). +keywords: + - DDS + - SciLifeLab + - data delivery +tools: + - "dds": + description: "The Data Delivery System (DDS) is a cloud-based system for the delivery + of data from SciLifeLab platforms to their users." + homepage: "https://delivery.scilifelab.se" + documentation: "https://scilifelabdatacentre.github.io/dds_cli/" + tool_dev_url: "https://github.com/ScilifelabDataCentre/dds_cli" + licence: + - "MIT" + identifier: "" +input: + - title: + type: string + description: The title of the project. + - description: + type: string + description: A description of the project. + - pi: + type: string + description: Email of the Principal Investigator. + - token_file: + type: file + description: Path to a DDS CLI token file (created via `dds auth`). Must be + readable by the pipeline user. + ontologies: [] +output: + versions_dds: + - - ${task.process}: + type: string + description: The name of the process + - dds: + type: string + description: The name of the tool + - dds --version | sed 's/.*version //': + type: eval + description: The expression to obtain the version of the tool + log: + - output.log: + type: file + description: File containing the projectID of the project created. + ontologies: [] +topics: + versions: + - - ${task.process}: + type: string + description: The name of the process + - dds: + type: string + description: The name of the tool + - dds --version | sed 's/.*version //': + type: eval + description: The expression to obtain the version of the tool +authors: + - "@annaasklof" + - "@mashehu" +maintainers: + - "@annaasklof" +containers: + docker: + linux/amd64: + name: community.wave.seqera.io/library/pip_python_dds-cli:4a7daeb54b4c7a8c + build_id: bd-4a7daeb54b4c7a8c_1 + scan_id: sc-175817d0c023f7c1_1 + linux/arm64: + name: community.wave.seqera.io/library/pip_python_dds-cli:ab6efd1ed8af3fea + build_id: bd-ab6efd1ed8af3fea_1 + scan_id: sc-af3babfa6db44fcc_1 + singularity: + linux/amd64: + name: oras://community.wave.seqera.io/library/pip_python_dds-cli:a1d1c0e2a13b5df4 + build_id: bd-a1d1c0e2a13b5df4_1 + https: https://community-cr-prod.seqera.io/docker/registry/v2/blobs/sha256/73/7352a40103ce629fbc72986922a68e8f9cc35630b89ee836a0c03dfd676f2341/data + linux/arm64: + name: oras://community.wave.seqera.io/library/pip_python_dds-cli:6f4fcdba4a36c4ed + build_id: bd-6f4fcdba4a36c4ed_1 + https: https://community-cr-prod.seqera.io/docker/registry/v2/blobs/sha256/09/098a7aae2590da026a7b3f0e087492a2c10378a7f3e34f9dc8b80f9281555dd5/data + conda: + linux/amd64: + lock_file: modules/nf-core/dds/createproject/.conda-lock/linux_amd64-bd-4a7daeb54b4c7a8c_1.txt + linux/arm64: + lock_file: modules/nf-core/dds/createproject/.conda-lock/linux_arm64-bd-ab6efd1ed8af3fea_1.txt diff --git a/modules/nf-core/dds/createproject/tests/main.nf.test b/modules/nf-core/dds/createproject/tests/main.nf.test new file mode 100644 index 000000000000..3ed066580171 --- /dev/null +++ b/modules/nf-core/dds/createproject/tests/main.nf.test @@ -0,0 +1,34 @@ +nextflow_process { + + name "Test Process DDS_CREATEPROJECT" + script "../main.nf" + process "DDS_CREATEPROJECT" + + tag "modules" + tag "modules_nfcore" + tag "dds" + tag "dds/createproject" + + test("dds/createproject - stub") { + + options "-stub" + + when { + process { + """ + input[0] = "Test title" + input[1] = "Test description" + input[2] = "test-pi@mail.com" + input[3] = file(params.modules_testdata_base_path + 'generic/txt/hello.txt') + """ + } + } + + then { + assertAll( + { assert process.success }, + { assert snapshot(sanitizeOutput(process.out)).match()} + ) + } + } +} diff --git a/modules/nf-core/dds/createproject/tests/main.nf.test.snap b/modules/nf-core/dds/createproject/tests/main.nf.test.snap new file mode 100644 index 000000000000..3f27bd1a918c --- /dev/null +++ b/modules/nf-core/dds/createproject/tests/main.nf.test.snap @@ -0,0 +1,23 @@ +{ + "dds/createproject - stub": { + "content": [ + { + "log": [ + "output.log:md5,d41d8cd98f00b204e9800998ecf8427e" + ], + "versions_dds": [ + [ + "DDS_CREATEPROJECT", + "dds", + "2.14.3" + ] + ] + } + ], + "timestamp": "2026-06-26T14:21:53.921262", + "meta": { + "nf-test": "0.9.5", + "nextflow": "26.04.4" + } + } +} \ No newline at end of file