From 76d6d7310d205ee26669b7083103f06aee66d1a1 Mon Sep 17 00:00:00 2001 From: fmalmeida Date: Wed, 12 Jan 2022 13:42:46 +0100 Subject: [PATCH] Fixed how quast is executed accross different profiles conda/docker/singularity --- modules/QualityAssessment/quast.nf | 20 +++++++++++++++++++- nextflow.config | 29 ++++++++++++++++------------- 2 files changed, 35 insertions(+), 14 deletions(-) diff --git a/modules/QualityAssessment/quast.nf b/modules/QualityAssessment/quast.nf index 59210d82..85d80564 100644 --- a/modules/QualityAssessment/quast.nf +++ b/modules/QualityAssessment/quast.nf @@ -14,9 +14,27 @@ process quast { single_param = !(single =~ /input.?/) ? "--single ${single}" : "" lreads_param = !(lreads =~ /input.?/) ? "--${lr_type} ${lreads}" : "" + if (params.selected_profile == "docker" || params.selected_profile == "conda") + """ + # run quast + quast.py \\ + -o ${assembler} \\ + -t ${params.threads} \\ + ${lreads_param} \\ + ${paired_param} \\ + ${single_param} \\ + --conserved-genes-finding \\ + --rna-finding \\ + --min-contig 100 \\ + ${params.quast_additional_parameters} \\ + ${contigs} + """ + + else if (params.selected_profile == "singularity") """ # fix busco usage in singularity - cp -R $CONDA_PREFIX/envs/mpgap-3.1/lib/python3.6/site-packages/quast_libs/busco ~/.quast + mkdir -p ~/.quast/busco + cp -R /opt/conda/envs/mpgap-*/lib/python3.6/site-packages/quast_libs/busco ~/.quast # run quast quast.py \\ diff --git a/nextflow.config b/nextflow.config index fcca1766..e79fad6d 100644 --- a/nextflow.config +++ b/nextflow.config @@ -193,27 +193,30 @@ profiles { // conda profile conda { - singularity.enabled = false - docker.enabled = false - process.conda = "$CONDA_PREFIX/envs/mpgap-3.1" + params.selected_profile = "conda" + singularity.enabled = false + docker.enabled = false + process.conda = "$CONDA_PREFIX/envs/mpgap-3.1" } // docker profile docker { - singularity.enabled = false - docker.enabled = true - docker.runOptions = '-u \$(id -u):\$(id -g)' - fixOwnership = true - process.container = "fmalmeida/mpgap:v3.1" + params.selected_profile = "docker" + singularity.enabled = false + docker.enabled = true + docker.runOptions = '-u \$(id -u):\$(id -g)' + fixOwnership = true + process.container = "fmalmeida/mpgap:v3.1" } // singularity profile singularity { - docker.enabled = false - singularity.enabled = true - singularity.autoMounts = true - process.container = "docker://fmalmeida/mpgap:v3.1" - singularity.autoMounts = true + params.selected_profile = "singularity" + docker.enabled = false + singularity.enabled = true + singularity.autoMounts = true + process.container = "docker://fmalmeida/mpgap:v3.1" + singularity.autoMounts = true } }