From 294c4a2fc28cb30ccbe792ecf22318413d5b04b6 Mon Sep 17 00:00:00 2001 From: Usman Rashid Date: Wed, 28 Feb 2024 10:51:45 +1300 Subject: [PATCH] Fixed linting issues --- lib/WorkflowAssemblyqc.groovy | 21 +++++++-------------- modules/local/createreport.nf | 20 ++++++++++++++++++-- 2 files changed, 25 insertions(+), 16 deletions(-) diff --git a/lib/WorkflowAssemblyqc.groovy b/lib/WorkflowAssemblyqc.groovy index 7a11ebeb..e5b77980 100755 --- a/lib/WorkflowAssemblyqc.groovy +++ b/lib/WorkflowAssemblyqc.groovy @@ -14,44 +14,37 @@ class WorkflowAssemblyqc { public static void initialise(params, log) { // Check for ncbi_fcs_adaptor_empire if (!params.ncbi_fcs_adaptor_skip && !params.ncbi_fcs_adaptor_empire) { - log.error('ncbi_fcs_adaptor_empire must be provided when executing NCBI FCS Adaptor') - System.exit(1) + Nextflow.error('ncbi_fcs_adaptor_empire must be provided when executing NCBI FCS Adaptor') } // Check for ncbi_fcs_gx_tax_id if (!params.ncbi_fcs_gx_skip && !params.ncbi_fcs_gx_tax_id) { - log.error('ncbi_fcs_gx_tax_id must be provided when executing NCBI FCS GX') - System.exit(1) + Nextflow.error('ncbi_fcs_gx_tax_id must be provided when executing NCBI FCS GX') } // Check for ncbi_fcs_gx_db_path if (!params.ncbi_fcs_gx_skip && !params.ncbi_fcs_gx_db_path) { - log.error('ncbi_fcs_gx_db_path must be provided when executing NCBI FCS GX') - System.exit(1) + Nextflow.error('ncbi_fcs_gx_db_path must be provided when executing NCBI FCS GX') } // Check for busco_mode if (!params.busco_skip && !params.busco_mode) { - log.error("busco_mode must be provided when executing BUSCO") - System.exit(1) + Nextflow.error("busco_mode must be provided when executing BUSCO") } // Check for busco_lineage_datasets if (!params.busco_skip && !params.busco_lineage_datasets) { - log.error('busco_lineage_datasets must be provided when executing BUSCO') - System.exit(1) + Nextflow.error('busco_lineage_datasets must be provided when executing BUSCO') } // Check for tidk_repeat_seq if (!params.tidk_skip && !params.tidk_repeat_seq) { - log.error('tidk_repeat_seq must be provided when executing TIDK') - System.exit(1) + Nextflow.error('tidk_repeat_seq must be provided when executing TIDK') } // Check for kraken2_db_path if (!params.kraken2_skip && !params.kraken2_db_path) { - log.error('kraken2_db_path must be provided when executing Kraken2') - System.exit(1) + Nextflow.error('kraken2_db_path must be provided when executing Kraken2') } } diff --git a/modules/local/createreport.nf b/modules/local/createreport.nf index 41c69b24..29ea765c 100644 --- a/modules/local/createreport.nf +++ b/modules/local/createreport.nf @@ -21,18 +21,34 @@ process CREATEREPORT { val params_json output: - path 'report.html' - path 'report.json' + path 'report.html' , emit: html + path 'report.json' , emit: json + path "versions.yml" , emit: versions + + when: + task.ext.when == null || task.ext.when script: """ echo -n '$params_json' > params_json.json assemblyqc.py > report.html + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + python: \$(python --version | tr -d 'Python[:space:]') + pandas: \$(python -c "import pandas; print(pandas.__version__)") + END_VERSIONS """ stub: """ touch report.html touch report.json + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + python: \$(python --version | tr -d 'Python[:space:]') + pandas: \$(python -c "import pandas; print(pandas.__version__)") + END_VERSIONS """ }