From 716ef3019b66772a817b417078edce2f7b337858 Mon Sep 17 00:00:00 2001 From: Anders Sune Pedersen <37172585+asp8200@users.noreply.github.com> Date: Wed, 2 Aug 2023 12:47:19 +0200 Subject: [PATCH] Move conda-checks (first batch) (#3686) * Moving conda-check and replacing exit 1 with error-cmd * Adding conda-check in stub-section * Adding conda-check in stub-section * Updating certain md5sums. Ok by Emiller88. Related to https://github.com/nf-core/modules/pull/3558 * Switching from exit 1 to error-cmd and correcting error-msg --- modules/nf-core/bases2fastq/main.nf | 9 ++++----- modules/nf-core/basicpy/main.nf | 13 ++++++++----- modules/nf-core/bcl2fastq/main.nf | 9 ++++----- modules/nf-core/bclconvert/main.nf | 9 ++++----- modules/nf-core/cellpose/main.nf | 12 ++++++++---- modules/nf-core/cellranger/count/main.nf | 13 ++++++++----- modules/nf-core/cellranger/mkfastq/main.nf | 13 ++++++++----- modules/nf-core/cellranger/mkgtf/main.nf | 9 ++++----- modules/nf-core/cellranger/mkref/main.nf | 9 ++++----- modules/nf-core/cellranger/mkvdjref/main.nf | 9 ++++----- tests/modules/nf-core/bases2fastq/test.yml | 6 +++--- 11 files changed, 59 insertions(+), 52 deletions(-) diff --git a/modules/nf-core/bases2fastq/main.nf b/modules/nf-core/bases2fastq/main.nf index c26d9aca9cf..44d83102dec 100644 --- a/modules/nf-core/bases2fastq/main.nf +++ b/modules/nf-core/bases2fastq/main.nf @@ -4,11 +4,6 @@ process BASES2FASTQ { container "nf-core/bases2fastq:1.1.0" - // Exit if running this module with -profile conda / -profile mamba - if (workflow.profile.tokenize(',').intersect(['conda', 'mamba']).size() >= 1) { - exit 1, "BASES2FASTQ module does not support Conda. Please use Docker / Singularity / Podman instead." - } - input: tuple val(meta), path(run_manifest), path(run_dir) @@ -26,6 +21,10 @@ process BASES2FASTQ { task.ext.when == null || task.ext.when script: + // Exit if running this module with -profile conda / -profile mamba + if (workflow.profile.tokenize(',').intersect(['conda', 'mamba']).size() >= 1) { + error "BASES2FASTQ module does not support Conda. Please use Docker / Singularity / Podman instead." + } def args = task.ext.args ?: '' def prefix = task.ext.prefix ?: "${meta.id}" def runManifest = run_manifest ? "-r ${run_manifest}" : "" diff --git a/modules/nf-core/basicpy/main.nf b/modules/nf-core/basicpy/main.nf index bfebe901ce8..cfcf9ac1ae8 100644 --- a/modules/nf-core/basicpy/main.nf +++ b/modules/nf-core/basicpy/main.nf @@ -2,11 +2,6 @@ process BASICPY { tag "$meta.id" label 'process_single' - // Exit if running this module with -profile conda / -profile mamba - if (workflow.profile.tokenize(',').intersect(['conda', 'mamba']).size() >= 1) { - exit 1, "Basicpy module does not support Conda. Please use Docker / Singularity instead." - } - container "docker.io/yfukai/basicpy-docker-mcmicro:0.2.1" input: @@ -20,6 +15,10 @@ process BASICPY { task.ext.when == null || task.ext.when script: + // Exit if running this module with -profile conda / -profile mamba + if (workflow.profile.tokenize(',').intersect(['conda', 'mamba']).size() >= 1) { + error "Basicpy module does not support Conda. Please use Docker / Singularity instead." + } def args = task.ext.args ?: '' def prefix = task.ext.prefix ?: "${meta.id}" def VERSION = "1.0.1" // WARN: Version information not provided by tool on CLI. Please update this string when bumping @@ -33,6 +32,10 @@ process BASICPY { """ stub: + // Exit if running this module with -profile conda / -profile mamba + if (workflow.profile.tokenize(',').intersect(['conda', 'mamba']).size() >= 1) { + error "Basicpy module does not support Conda. Please use Docker / Singularity instead." + } """ touch ${prefix}.-dfp.tiff touch ${prefix}.-dfp.tiff diff --git a/modules/nf-core/bcl2fastq/main.nf b/modules/nf-core/bcl2fastq/main.nf index 8bf02ddd8aa..1797bc67c76 100644 --- a/modules/nf-core/bcl2fastq/main.nf +++ b/modules/nf-core/bcl2fastq/main.nf @@ -4,11 +4,6 @@ process BCL2FASTQ { container "nf-core/bcl2fastq:2.20.0.422" - // Exit if running this module with -profile conda / -profile mamba - if (workflow.profile.tokenize(',').intersect(['conda', 'mamba']).size() >= 1) { - exit 1, "BCL2FASTQ module does not support Conda. Please use Docker / Singularity / Podman instead." - } - input: tuple val(meta), path(samplesheet), path(run_dir) @@ -26,6 +21,10 @@ process BCL2FASTQ { task.ext.when == null || task.ext.when script: + // Exit if running this module with -profile conda / -profile mamba + if (workflow.profile.tokenize(',').intersect(['conda', 'mamba']).size() >= 1) { + error "BCL2FASTQ module does not support Conda. Please use Docker / Singularity / Podman instead." + } def args = task.ext.args ?: '' def args2 = task.ext.args2 ?: '' def args3 = task.ext.args3 ?: '' diff --git a/modules/nf-core/bclconvert/main.nf b/modules/nf-core/bclconvert/main.nf index 122950dca9c..2d8b7857df6 100644 --- a/modules/nf-core/bclconvert/main.nf +++ b/modules/nf-core/bclconvert/main.nf @@ -4,11 +4,6 @@ process BCLCONVERT { container "nf-core/bclconvert:4.0.3" - // Exit if running this module with -profile conda / -profile mamba - if (workflow.profile.tokenize(',').intersect(['conda', 'mamba']).size() >= 1) { - exit 1, "BCLCONVERT module does not support Conda. Please use Docker / Singularity / Podman instead." - } - input: tuple val(meta), path(samplesheet), path(run_dir) @@ -26,6 +21,10 @@ process BCLCONVERT { task.ext.when == null || task.ext.when script: + // Exit if running this module with -profile conda / -profile mamba + if (workflow.profile.tokenize(',').intersect(['conda', 'mamba']).size() >= 1) { + error "BCLCONVERT module does not support Conda. Please use Docker / Singularity / Podman instead." + } def args = task.ext.args ?: '' def args2 = task.ext.args2 ?: '' def args3 = task.ext.args3 ?: '' diff --git a/modules/nf-core/cellpose/main.nf b/modules/nf-core/cellpose/main.nf index f0f462e0ff2..a2b2206923a 100644 --- a/modules/nf-core/cellpose/main.nf +++ b/modules/nf-core/cellpose/main.nf @@ -2,10 +2,6 @@ process CELLPOSE { tag "$meta.id" label 'process_medium' - // Exit if running this module with -profile conda / -profile mamba - if (workflow.profile.tokenize(',').intersect(['conda', 'mamba']).size() >= 1) { - exit 1, "I did not manage to create a cellpose module in Conda that works in all OSes. Please use Docker / Singularity / Podman instead."} - container "docker.io/biocontainers/cellpose:2.1.1_cv2" input: @@ -20,6 +16,10 @@ process CELLPOSE { task.ext.when == null || task.ext.when script: + // Exit if running this module with -profile conda / -profile mamba + if (workflow.profile.tokenize(',').intersect(['conda', 'mamba']).size() >= 1) { + error "I did not manage to create a cellpose module in Conda that works in all OSes. Please use Docker / Singularity / Podman instead." + } def args = task.ext.args ?: '' def prefix = task.ext.prefix ?: "${meta.id}" def model_command = model ? "--pretrained_model $model" : "" @@ -38,6 +38,10 @@ process CELLPOSE { END_VERSIONS """ stub: + // Exit if running this module with -profile conda / -profile mamba + if (workflow.profile.tokenize(',').intersect(['conda', 'mamba']).size() >= 1) { + error "I did not manage to create a cellpose module in Conda that works in all OSes. Please use Docker / Singularity / Podman instead." + } def prefix = task.ext.prefix ?: "${meta.id}" def VERSION = "2.1.1" // WARN: Version information not provided by tool on CLI. Please update this string when bumping container versions. """ diff --git a/modules/nf-core/cellranger/count/main.nf b/modules/nf-core/cellranger/count/main.nf index 0a76cbd4169..d7a191fc721 100644 --- a/modules/nf-core/cellranger/count/main.nf +++ b/modules/nf-core/cellranger/count/main.nf @@ -4,11 +4,6 @@ process CELLRANGER_COUNT { container "nf-core/cellranger:7.1.0" - // Exit if running this module with -profile conda / -profile mamba - if (workflow.profile.tokenize(',').intersect(['conda', 'mamba']).size() >= 1) { - exit 1, "CELLRANGER_COUNT module does not support Conda. Please use Docker / Singularity / Podman instead." - } - input: tuple val(meta), path(reads, stageAs: "fastq_???/*") path reference @@ -21,11 +16,19 @@ process CELLRANGER_COUNT { task.ext.when == null || task.ext.when script: + // Exit if running this module with -profile conda / -profile mamba + if (workflow.profile.tokenize(',').intersect(['conda', 'mamba']).size() >= 1) { + error "CELLRANGER_COUNT module does not support Conda. Please use Docker / Singularity / Podman instead." + } args = task.ext.args ?: '' prefix = task.ext.prefix ?: "${meta.id}" template "cellranger_count.py" stub: + // Exit if running this module with -profile conda / -profile mamba + if (workflow.profile.tokenize(',').intersect(['conda', 'mamba']).size() >= 1) { + error "CELLRANGER_COUNT module does not support Conda. Please use Docker / Singularity / Podman instead." + } def prefix = task.ext.prefix ?: "${meta.id}" """ mkdir -p "${prefix}/outs/" diff --git a/modules/nf-core/cellranger/mkfastq/main.nf b/modules/nf-core/cellranger/mkfastq/main.nf index f57780afbf0..7a128edbd0b 100644 --- a/modules/nf-core/cellranger/mkfastq/main.nf +++ b/modules/nf-core/cellranger/mkfastq/main.nf @@ -4,11 +4,6 @@ process CELLRANGER_MKFASTQ { container "docker.io/nfcore/cellrangermkfastq:7.1.0" - // Exit if running this module with -profile conda / -profile mamba - if (workflow.profile.tokenize(',').intersect(['conda', 'mamba']).size() >= 1) { - exit 1, "CELLRANGER_MKFASTQ module does not support Conda. Please use Docker / Singularity / Podman instead." - } - input: path bcl path csv @@ -21,6 +16,10 @@ process CELLRANGER_MKFASTQ { task.ext.when == null || task.ext.when script: + // Exit if running this module with -profile conda / -profile mamba + if (workflow.profile.tokenize(',').intersect(['conda', 'mamba']).size() >= 1) { + error "CELLRANGER_MKFASTQ module does not support Conda. Please use Docker / Singularity / Podman instead." + } def args = task.ext.args ?: '' def prefix = task.ext.prefix ?: "${bcl.getSimpleName()}" """ @@ -38,6 +37,10 @@ process CELLRANGER_MKFASTQ { """ stub: + // Exit if running this module with -profile conda / -profile mamba + if (workflow.profile.tokenize(',').intersect(['conda', 'mamba']).size() >= 1) { + error "CELLRANGER_MKFASTQ module does not support Conda. Please use Docker / Singularity / Podman instead." + } def prefix = task.ext.prefix ?: "${bcl.getSimpleName()}" """ mkdir -p "${prefix}/outs/fastq_path/" diff --git a/modules/nf-core/cellranger/mkgtf/main.nf b/modules/nf-core/cellranger/mkgtf/main.nf index 5411b0fdbfc..e0b0dd67e55 100644 --- a/modules/nf-core/cellranger/mkgtf/main.nf +++ b/modules/nf-core/cellranger/mkgtf/main.nf @@ -4,11 +4,6 @@ process CELLRANGER_MKGTF { container "nf-core/cellranger:7.1.0" - // Exit if running this module with -profile conda / -profile mamba - if (workflow.profile.tokenize(',').intersect(['conda', 'mamba']).size() >= 1) { - exit 1, "CELLRANGER_MKGTF module does not support Conda. Please use Docker / Singularity / Podman instead." - } - input: path gtf @@ -20,6 +15,10 @@ process CELLRANGER_MKGTF { task.ext.when == null || task.ext.when script: + // Exit if running this module with -profile conda / -profile mamba + if (workflow.profile.tokenize(',').intersect(['conda', 'mamba']).size() >= 1) { + error "CELLRANGER_MKGTF module does not support Conda. Please use Docker / Singularity / Podman instead." + } def args = task.ext.args ?: '' def prefix = task.ext.prefix ?: "${gtf.baseName}.filtered" """ diff --git a/modules/nf-core/cellranger/mkref/main.nf b/modules/nf-core/cellranger/mkref/main.nf index b4b9c547369..986891b8e48 100644 --- a/modules/nf-core/cellranger/mkref/main.nf +++ b/modules/nf-core/cellranger/mkref/main.nf @@ -4,11 +4,6 @@ process CELLRANGER_MKREF { container "nf-core/cellranger:7.1.0" - // Exit if running this module with -profile conda / -profile mamba - if (workflow.profile.tokenize(',').intersect(['conda', 'mamba']).size() >= 1) { - exit 1, "CELLRANGER_MKREF module does not support Conda. Please use Docker / Singularity / Podman instead." - } - input: path fasta path gtf @@ -22,6 +17,10 @@ process CELLRANGER_MKREF { task.ext.when == null || task.ext.when script: + // Exit if running this module with -profile conda / -profile mamba + if (workflow.profile.tokenize(',').intersect(['conda', 'mamba']).size() >= 1) { + error "CELLRANGER_MKREF module does not support Conda. Please use Docker / Singularity / Podman instead." + } def args = task.ext.args ?: '' """ cellranger \\ diff --git a/modules/nf-core/cellranger/mkvdjref/main.nf b/modules/nf-core/cellranger/mkvdjref/main.nf index 6d2ccc3949a..64e877f7e15 100644 --- a/modules/nf-core/cellranger/mkvdjref/main.nf +++ b/modules/nf-core/cellranger/mkvdjref/main.nf @@ -4,11 +4,6 @@ process CELLRANGER_MKVDJREF { container "nf-core/cellranger:7.1.0" - // Exit if running this module with -profile conda / -profile mamba - if (workflow.profile.tokenize(',').intersect(['conda', 'mamba']).size() >= 1) { - exit 1, "CELLRANGER_MKREF module does not support Conda. Please use Docker / Singularity / Podman instead." - } - input: path fasta path gtf @@ -22,6 +17,10 @@ process CELLRANGER_MKVDJREF { task.ext.when == null || task.ext.when script: + // Exit if running this module with -profile conda / -profile mamba + if (workflow.profile.tokenize(',').intersect(['conda', 'mamba']).size() >= 1) { + error "CELLRANGER_MKVDJREF module does not support Conda. Please use Docker / Singularity / Podman instead." + } def args = task.ext.args ?: '' """ cellranger \\ diff --git a/tests/modules/nf-core/bases2fastq/test.yml b/tests/modules/nf-core/bases2fastq/test.yml index 88fe9c238da..9e2aa9ac129 100644 --- a/tests/modules/nf-core/bases2fastq/test.yml +++ b/tests/modules/nf-core/bases2fastq/test.yml @@ -5,14 +5,14 @@ files: - path: output/bases2fastq/output/Bases2Fastq-Sim_QC.html - path: output/bases2fastq/output/Metrics.csv - md5sum: 0ec6da2b82e191098283474356024abf + md5sum: a8094b308b5653071ac029a27733e4a6 - path: output/bases2fastq/output/RunManifest.json md5sum: a07dce8ee25c2a6f9355b677c26b53e2 - path: output/bases2fastq/output/RunStats.json - path: output/bases2fastq/output/UnassignedSequences.csv md5sum: 11c1693830ce941b8cfb8d2431a59097 - path: output/bases2fastq/output/Samples/DefaultSample/DefaultSample_R1.fastq.gz - md5sum: 218abc70f61e8e8199a68f83ae836184 + md5sum: 831c90ea31eff881e825cda691da77ae - path: output/bases2fastq/output/Samples/DefaultSample/DefaultSample_R2.fastq.gz - md5sum: b95109bfb204daa150b61239d3368ee2 + md5sum: e6c1f7ec00910ef195ff3d427c7a9f23 - path: output/bases2fastq/output/Samples/DefaultSample/DefaultSample_stats.json