From e4e4f8090caa7c2f3fd71caa62792a1ea9ff4b59 Mon Sep 17 00:00:00 2001 From: Ramprasad Neethiraj <20065894+ramprasadn@users.noreply.github.com> Date: Thu, 5 May 2022 23:59:12 +0200 Subject: [PATCH 1/9] combine multiple pytor --- modules/cnvpytor/view/main.nf | 16 +++++++++------- tests/modules/cnvpytor/view/main.nf | 6 +++--- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/modules/cnvpytor/view/main.nf b/modules/cnvpytor/view/main.nf index ad2249b8..1bb61a38 100644 --- a/modules/cnvpytor/view/main.nf +++ b/modules/cnvpytor/view/main.nf @@ -8,7 +8,7 @@ process CNVPYTOR_VIEW { 'quay.io/biocontainers/cnvpytor:1.2.1--pyhdfd78af_0' }" input: - tuple val(meta), path(pytor) + tuple val(meta), path(pytor_files) val bin_sizes val output_format @@ -23,17 +23,18 @@ process CNVPYTOR_VIEW { script: def output_suffix = output_format ?: 'vcf' - def bins = bin_sizes ?: '1000' + def bins = bin_sizes ?: '1000' + def input = pytor_files.join(" ") + def prefix = task.ext.prefix ?: "${meta.id}" """ python3 < versions.yml "${task.process}": diff --git a/tests/modules/cnvpytor/view/main.nf b/tests/modules/cnvpytor/view/main.nf index b865dd6d..3b99c314 100644 --- a/tests/modules/cnvpytor/view/main.nf +++ b/tests/modules/cnvpytor/view/main.nf @@ -8,7 +8,7 @@ workflow test_cnvpytor_view { input = [ [ id:'test'], // meta map - file(params.test_data['homo_sapiens']['illumina']['test_pytor'], checkIfExists: true) + [file(params.test_data['homo_sapiens']['illumina']['test_pytor'], checkIfExists: true)] ] bin_sizes = "10000 100000" @@ -20,7 +20,7 @@ workflow test_cnvpytor_view_tsvout { input = [ [ id:'test'], // meta map - file(params.test_data['homo_sapiens']['illumina']['test_pytor'], checkIfExists: true) + [file(params.test_data['homo_sapiens']['illumina']['test_pytor'], checkIfExists: true)] ] output_suffix = "tsv" @@ -32,7 +32,7 @@ workflow test_cnvpytor_view_stub { input = [ [ id:'test'], // meta map - file(params.test_data['homo_sapiens']['illumina']['test_pytor'], checkIfExists: true) + [file(params.test_data['homo_sapiens']['illumina']['test_pytor'], checkIfExists: true)] ] bin_sizes = [] From af73544010cc9563ec7d7160aeb825ae28ec217f Mon Sep 17 00:00:00 2001 From: Ramprasad Neethiraj <20065894+ramprasadn@users.noreply.github.com> Date: Fri, 6 May 2022 00:13:49 +0200 Subject: [PATCH 2/9] update meta --- modules/cnvpytor/view/meta.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/cnvpytor/view/meta.yml b/modules/cnvpytor/view/meta.yml index 1392e90e..e4e68fad 100644 --- a/modules/cnvpytor/view/meta.yml +++ b/modules/cnvpytor/view/meta.yml @@ -17,9 +17,9 @@ input: description: | Groovy Map containing sample information e.g. [ id:'test' ] - - pytor: + - pytor_files: type: file - description: pytor file containing read depth data + description: pytor file containing cnv calls. To merge calls from multiple samples use a list of files. pattern: "*.{pytor}" - bin_sizes: type: string From 313d76e00525c8e975dabce0c34973fd53c3f4dd Mon Sep 17 00:00:00 2001 From: Ramprasad Neethiraj <20065894+ramprasadn@users.noreply.github.com> Date: Fri, 6 May 2022 00:18:16 +0200 Subject: [PATCH 3/9] update svdb version --- modules/svdb/merge/main.nf | 6 +++--- modules/svdb/query/main.nf | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/modules/svdb/merge/main.nf b/modules/svdb/merge/main.nf index 4a39940c..0d56fea2 100644 --- a/modules/svdb/merge/main.nf +++ b/modules/svdb/merge/main.nf @@ -2,10 +2,10 @@ process SVDB_MERGE { tag "$meta.id" label 'process_medium' - conda (params.enable_conda ? "bioconda::svdb=2.6.0" : null) + conda (params.enable_conda ? "bioconda::svdb=2.6.1" : null) container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/svdb:2.6.0--py39h5371cbf_0': - 'quay.io/biocontainers/svdb:2.6.0--py39h5371cbf_0' }" + 'https://depot.galaxyproject.org/singularity/svdb:2.6.1--py39h5371cbf_0': + 'quay.io/biocontainers/svdb:2.6.1--py39h5371cbf_0' }" input: tuple val(meta), path(vcfs) diff --git a/modules/svdb/query/main.nf b/modules/svdb/query/main.nf index c669b5a5..dbab5259 100644 --- a/modules/svdb/query/main.nf +++ b/modules/svdb/query/main.nf @@ -2,10 +2,10 @@ process SVDB_QUERY { tag "$meta.id" label 'process_medium' - conda (params.enable_conda ? "bioconda::svdb=2.6.0" : null) + conda (params.enable_conda ? "bioconda::svdb=2.6.1" : null) container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/svdb:2.6.0--py39h5371cbf_0': - 'quay.io/biocontainers/svdb:2.6.0--py39h5371cbf_0' }" + 'https://depot.galaxyproject.org/singularity/svdb:2.6.1--py39h5371cbf_0': + 'quay.io/biocontainers/svdb:2.6.1--py39h5371cbf_0' }" input: tuple val(meta), path(vcf) From 853b623969357753468365aa538eb92b2bcb8ce9 Mon Sep 17 00:00:00 2001 From: Matthias De Smet <11850640+matthdsm@users.noreply.github.com> Date: Fri, 6 May 2022 09:20:40 +0200 Subject: [PATCH 4/9] new module: md5sum --- modules/md5sum/main.nf | 35 +++++++++++++++++++++++++ modules/md5sum/meta.yml | 39 ++++++++++++++++++++++++++++ tests/config/pytest_modules.yml | 12 ++++++--- tests/modules/md5sum/main.nf | 15 +++++++++++ tests/modules/md5sum/nextflow.config | 3 +++ tests/modules/md5sum/test.yml | 8 ++++++ 6 files changed, 108 insertions(+), 4 deletions(-) create mode 100644 modules/md5sum/main.nf create mode 100644 modules/md5sum/meta.yml create mode 100644 tests/modules/md5sum/main.nf create mode 100644 tests/modules/md5sum/nextflow.config create mode 100644 tests/modules/md5sum/test.yml diff --git a/modules/md5sum/main.nf b/modules/md5sum/main.nf new file mode 100644 index 00000000..0b101811 --- /dev/null +++ b/modules/md5sum/main.nf @@ -0,0 +1,35 @@ +process MD5SUM { + tag "$meta.id" + label 'process_low' + + if (params.enable_conda) { + exit 1, "Conda environments cannot be used when using bcl-convert. Please use docker or singularity containers." + } + container "debian:bullseye-slim" + + input: + tuple val(meta), path(file) + + output: + tuple val(meta), path("*.md5"), emit: checksum + 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}" + + """ + md5sum \\ + $args \\ + ${file} \\ + > ${file}.md5 + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + md5sum: \$(echo \$(md5sum --version 2>&1 | head -n 1| sed 's/^.*) //;' )) + END_VERSIONS + """ +} diff --git a/modules/md5sum/meta.yml b/modules/md5sum/meta.yml new file mode 100644 index 00000000..d4f1939d --- /dev/null +++ b/modules/md5sum/meta.yml @@ -0,0 +1,39 @@ +name: "md5sum" +description: Create an MD5 (128-bit) checksum +keywords: + - checksum +tools: + - "md5sum": + description: Create an MD5 (128-bit) checksum + homepage: "https://www.gnu.org" + documentation: "https://man7.org/linux/man-pages/man1/md5sum.1.html" + licence: GPLv3+ + +input: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - file: + type: file + description: Any file + pattern: "*.*" + +output: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - versions: + type: file + description: File containing software versions + pattern: "versions.yml" + - checksum: + type: file + description: File containing checksum + pattern: "*.md5" + +authors: + - "@matthdsm" diff --git a/tests/config/pytest_modules.yml b/tests/config/pytest_modules.yml index 81f98d59..a5a7c083 100644 --- a/tests/config/pytest_modules.yml +++ b/tests/config/pytest_modules.yml @@ -1058,10 +1058,6 @@ krona/kronadb: - modules/krona/kronadb/** - tests/modules/krona/kronadb/** -krona/ktupdatetaxonomy: - - modules/krona/ktupdatetaxonomy/** - - tests/modules/krona/ktupdatetaxonomy/** - krona/ktimporttaxonomy: - modules/krona/ktimporttaxonomy/** - tests/modules/krona/ktimporttaxonomy/** @@ -1070,6 +1066,10 @@ krona/ktimporttext: - modules/krona/ktimporttext/** - tests/modules/krona/ktimporttext/** +krona/ktupdatetaxonomy: + - modules/krona/ktupdatetaxonomy/** + - tests/modules/krona/ktupdatetaxonomy/** + last/dotplot: - modules/last/dotplot/** - tests/modules/last/dotplot/** @@ -1190,6 +1190,10 @@ maxbin2: - modules/maxbin2/** - tests/modules/maxbin2/** +md5sum: + - modules/md5sum/** + - tests/modules/md5sum/** + medaka: - modules/medaka/** - tests/modules/medaka/** diff --git a/tests/modules/md5sum/main.nf b/tests/modules/md5sum/main.nf new file mode 100644 index 00000000..f90642b6 --- /dev/null +++ b/tests/modules/md5sum/main.nf @@ -0,0 +1,15 @@ +#!/usr/bin/env nextflow + +nextflow.enable.dsl = 2 + +include { MD5SUM } from '../../../modules/md5sum/main.nf' + +workflow test_md5sum { + + input = [ + [ id:'test', single_end:false ], // meta map + file(params.test_data['sarscov2']['illumina']['test_paired_end_bam'], checkIfExists: true) + ] + + MD5SUM ( input ) +} diff --git a/tests/modules/md5sum/nextflow.config b/tests/modules/md5sum/nextflow.config new file mode 100644 index 00000000..0293c16f --- /dev/null +++ b/tests/modules/md5sum/nextflow.config @@ -0,0 +1,3 @@ +process { + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } +} diff --git a/tests/modules/md5sum/test.yml b/tests/modules/md5sum/test.yml new file mode 100644 index 00000000..1e6517a7 --- /dev/null +++ b/tests/modules/md5sum/test.yml @@ -0,0 +1,8 @@ +- name: md5sum test_md5sum + command: nextflow run tests/modules/md5sum -entry test_md5sum -c tests/config/nextflow.config + tags: + - md5sum + files: + - path: output/md5sum/test.paired_end.bam.md5 + md5sum: 1163095be8fdfb2acb3cc6c027389c4b + - path: output/md5sum/versions.yml From 09e729ad414bc51d91b487edf720e7bb9b80abb7 Mon Sep 17 00:00:00 2001 From: Matthias De Smet <11850640+matthdsm@users.noreply.github.com> Date: Fri, 6 May 2022 10:28:14 +0200 Subject: [PATCH 5/9] added sha256sum --- modules/shasum/main.nf | 35 ++++++++++++++++++++++++ modules/shasum/meta.yml | 40 ++++++++++++++++++++++++++++ tests/config/pytest_modules.yml | 4 +++ tests/modules/shasum/main.nf | 15 +++++++++++ tests/modules/shasum/nextflow.config | 5 ++++ tests/modules/shasum/test.yml | 8 ++++++ 6 files changed, 107 insertions(+) create mode 100644 modules/shasum/main.nf create mode 100644 modules/shasum/meta.yml create mode 100644 tests/modules/shasum/main.nf create mode 100644 tests/modules/shasum/nextflow.config create mode 100644 tests/modules/shasum/test.yml diff --git a/modules/shasum/main.nf b/modules/shasum/main.nf new file mode 100644 index 00000000..a2c37da7 --- /dev/null +++ b/modules/shasum/main.nf @@ -0,0 +1,35 @@ +process SHASUM { + tag "$meta.id" + label 'process_low' + + if (params.enable_conda) { + exit 1, "Conda environments cannot be used when using bcl-convert. Please use docker or singularity containers." + } + container "debian:bullseye-slim" + + input: + tuple val(meta), path(file) + + output: + tuple val(meta), path("*.sha256"), emit: checksum + 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}" + + """ + sha256sum \\ + $args \\ + ${file} \\ + > ${file}.sha256 + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + sha256sum: \$(echo \$(sha256sum --version 2>&1 | head -n 1| sed 's/^.*) //;' )) + END_VERSIONS + """ +} diff --git a/modules/shasum/meta.yml b/modules/shasum/meta.yml new file mode 100644 index 00000000..f16e0771 --- /dev/null +++ b/modules/shasum/meta.yml @@ -0,0 +1,40 @@ +name: "shasum" +description: Print SHA256 (256-bit) checksums. +keywords: + - checksum + - sha256 +tools: + - "md5sum": + description: Create an SHA256 (256-bit) checksum. + homepage: "https://www.gnu.org" + documentation: "https://linux.die.net/man/1/shasum" + licence: GPLv3+ + +input: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - file: + type: file + description: Any file + pattern: "*.*" + +output: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - versions: + type: file + description: File containing software versions + pattern: "versions.yml" + - checksum: + type: file + description: File containing checksum + pattern: "*.sha256" + +authors: + - "@matthdsm" diff --git a/tests/config/pytest_modules.yml b/tests/config/pytest_modules.yml index a5a7c083..effe6fe2 100644 --- a/tests/config/pytest_modules.yml +++ b/tests/config/pytest_modules.yml @@ -1739,6 +1739,10 @@ seqwish/induce: - modules/seqwish/induce/** - tests/modules/seqwish/induce/** +shasum: + - modules/shasum/** + - tests/modules/shasum/** + shigatyper: - modules/shigatyper/** - tests/modules/shigatyper/** diff --git a/tests/modules/shasum/main.nf b/tests/modules/shasum/main.nf new file mode 100644 index 00000000..817ea6f0 --- /dev/null +++ b/tests/modules/shasum/main.nf @@ -0,0 +1,15 @@ +#!/usr/bin/env nextflow + +nextflow.enable.dsl = 2 + +include { SHASUM } from '../../../modules/shasum/main.nf' + +workflow test_shasum { + + input = [ + [ id:'test', single_end:false ], // meta map + file(params.test_data['sarscov2']['illumina']['test_paired_end_bam'], checkIfExists: true) + ] + + SHASUM ( input ) +} diff --git a/tests/modules/shasum/nextflow.config b/tests/modules/shasum/nextflow.config new file mode 100644 index 00000000..50f50a7a --- /dev/null +++ b/tests/modules/shasum/nextflow.config @@ -0,0 +1,5 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + +} \ No newline at end of file diff --git a/tests/modules/shasum/test.yml b/tests/modules/shasum/test.yml new file mode 100644 index 00000000..6778d156 --- /dev/null +++ b/tests/modules/shasum/test.yml @@ -0,0 +1,8 @@ +- name: shasum test_shasum + command: nextflow run tests/modules/shasum -entry test_shasum -c tests/config/nextflow.config + tags: + - shasum + files: + - path: output/shasum/test.paired_end.bam.sha256 + md5sum: 138a19e100f09fc975ea1b717da9b6dd + - path: output/shasum/versions.yml From 77d825e0439c4d9a1d68a329c97012e4b99f3e40 Mon Sep 17 00:00:00 2001 From: Matthias De Smet <11850640+matthdsm@users.noreply.github.com> Date: Fri, 6 May 2022 10:39:13 +0200 Subject: [PATCH 6/9] fix copy paste errors --- modules/md5sum/main.nf | 2 +- modules/shasum/main.nf | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/md5sum/main.nf b/modules/md5sum/main.nf index 0b101811..2cdb8bf6 100644 --- a/modules/md5sum/main.nf +++ b/modules/md5sum/main.nf @@ -3,7 +3,7 @@ process MD5SUM { label 'process_low' if (params.enable_conda) { - exit 1, "Conda environments cannot be used when using bcl-convert. Please use docker or singularity containers." + exit 1, "Conda environments cannot be used when using md5sum. Please use docker or singularity containers." } container "debian:bullseye-slim" diff --git a/modules/shasum/main.nf b/modules/shasum/main.nf index a2c37da7..e7a18da6 100644 --- a/modules/shasum/main.nf +++ b/modules/shasum/main.nf @@ -3,7 +3,7 @@ process SHASUM { label 'process_low' if (params.enable_conda) { - exit 1, "Conda environments cannot be used when using bcl-convert. Please use docker or singularity containers." + exit 1, "Conda environments cannot be used when using sha256sum. Please use docker or singularity containers." } container "debian:bullseye-slim" From 1c7205d68389a899ee6b4f8c11343701c2c07ce8 Mon Sep 17 00:00:00 2001 From: Matthias De Smet <11850640+matthdsm@users.noreply.github.com> Date: Fri, 6 May 2022 10:44:51 +0200 Subject: [PATCH 7/9] fixed container definitions --- modules/md5sum/main.nf | 8 ++++---- modules/shasum/main.nf | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/modules/md5sum/main.nf b/modules/md5sum/main.nf index 2cdb8bf6..7b66625e 100644 --- a/modules/md5sum/main.nf +++ b/modules/md5sum/main.nf @@ -2,10 +2,10 @@ process MD5SUM { tag "$meta.id" label 'process_low' - if (params.enable_conda) { - exit 1, "Conda environments cannot be used when using md5sum. Please use docker or singularity containers." - } - container "debian:bullseye-slim" + conda (params.enable_conda ? "conda-forge::coreutils=8.25" : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/coreutils:8.31--h14c3975_0' : + 'quay.io/biocontainers/coreutils:8.31--h14c3975_0' }" input: tuple val(meta), path(file) diff --git a/modules/shasum/main.nf b/modules/shasum/main.nf index e7a18da6..11f9376c 100644 --- a/modules/shasum/main.nf +++ b/modules/shasum/main.nf @@ -2,10 +2,10 @@ process SHASUM { tag "$meta.id" label 'process_low' - if (params.enable_conda) { - exit 1, "Conda environments cannot be used when using sha256sum. Please use docker or singularity containers." - } - container "debian:bullseye-slim" + conda (params.enable_conda ? "conda-forge::coreutils=8.25" : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/coreutils:8.31--h14c3975_0' : + 'quay.io/biocontainers/coreutils:8.31--h14c3975_0' }" input: tuple val(meta), path(file) From 1ccea5ff4d3dffbf9a8e53032481cc9246d4e23d Mon Sep 17 00:00:00 2001 From: Ramprasad Neethiraj <20065894+ramprasadn@users.noreply.github.com> Date: Fri, 6 May 2022 10:56:58 +0200 Subject: [PATCH 8/9] remove prefix def in callcnvs --- modules/cnvpytor/callcnvs/main.nf | 1 - 1 file changed, 1 deletion(-) diff --git a/modules/cnvpytor/callcnvs/main.nf b/modules/cnvpytor/callcnvs/main.nf index 092f6def..69c9d40e 100644 --- a/modules/cnvpytor/callcnvs/main.nf +++ b/modules/cnvpytor/callcnvs/main.nf @@ -20,7 +20,6 @@ process CNVPYTOR_CALLCNVS { script: def bins = bin_sizes ?: '1000' - def prefix = task.ext.prefix ?: "${meta.id}" """ cnvpytor \\ -root $pytor \\ From bd1b80f36e1b9a978e598e4b47f6705ede34da37 Mon Sep 17 00:00:00 2001 From: Matthias De Smet <11850640+matthdsm@users.noreply.github.com> Date: Fri, 6 May 2022 11:07:05 +0200 Subject: [PATCH 9/9] fix software definitions --- modules/md5sum/main.nf | 6 +++--- modules/shasum/main.nf | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/modules/md5sum/main.nf b/modules/md5sum/main.nf index 7b66625e..2b516f1b 100644 --- a/modules/md5sum/main.nf +++ b/modules/md5sum/main.nf @@ -2,10 +2,10 @@ process MD5SUM { tag "$meta.id" label 'process_low' - conda (params.enable_conda ? "conda-forge::coreutils=8.25" : null) + conda (params.enable_conda ? "conda-forge::coreutils=9.1" : null) container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/coreutils:8.31--h14c3975_0' : - 'quay.io/biocontainers/coreutils:8.31--h14c3975_0' }" + 'https://depot.galaxyproject.org/singularity/ubuntu:20.04' : + 'ubuntu:20.04' }" input: tuple val(meta), path(file) diff --git a/modules/shasum/main.nf b/modules/shasum/main.nf index 11f9376c..0e288435 100644 --- a/modules/shasum/main.nf +++ b/modules/shasum/main.nf @@ -2,10 +2,10 @@ process SHASUM { tag "$meta.id" label 'process_low' - conda (params.enable_conda ? "conda-forge::coreutils=8.25" : null) + conda (params.enable_conda ? "conda-forge::coreutils=9.1" : null) container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/coreutils:8.31--h14c3975_0' : - 'quay.io/biocontainers/coreutils:8.31--h14c3975_0' }" + 'https://depot.galaxyproject.org/singularity/ubuntu:20.04' : + 'ubuntu:20.04' }" input: tuple val(meta), path(file)