Skip to content

Commit

Permalink
Moving conda-check and replacing exit 1 with error-cmd
Browse files Browse the repository at this point in the history
  • Loading branch information
asp8200 committed Aug 1, 2023
1 parent 5b116ec commit 1711cb5
Show file tree
Hide file tree
Showing 10 changed files with 44 additions and 49 deletions.
9 changes: 4 additions & 5 deletions modules/nf-core/bases2fastq/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand All @@ -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}" : ""
Expand Down
9 changes: 4 additions & 5 deletions modules/nf-core/basicpy/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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
Expand Down
9 changes: 4 additions & 5 deletions modules/nf-core/bcl2fastq/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand All @@ -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 ?: ''
Expand Down
9 changes: 4 additions & 5 deletions modules/nf-core/bclconvert/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand All @@ -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 ?: ''
Expand Down
12 changes: 8 additions & 4 deletions modules/nf-core/cellpose/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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" : ""
Expand All @@ -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.
"""
Expand Down
9 changes: 4 additions & 5 deletions modules/nf-core/cellranger/count/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -21,6 +16,10 @@ 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"
Expand Down
9 changes: 4 additions & 5 deletions modules/nf-core/cellranger/mkfastq/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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()}"
"""
Expand Down
9 changes: 4 additions & 5 deletions modules/nf-core/cellranger/mkgtf/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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"
"""
Expand Down
9 changes: 4 additions & 5 deletions modules/nf-core/cellranger/mkref/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 \\
Expand Down
9 changes: 4 additions & 5 deletions modules/nf-core/cellranger/mkvdjref/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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) {
exit 1, "CELLRANGER_MKREF module does not support Conda. Please use Docker / Singularity / Podman instead."
}
def args = task.ext.args ?: ''
"""
cellranger \\
Expand Down

0 comments on commit 1711cb5

Please sign in to comment.