From 7549e07d74dc5f88a32e7cb037b8be044af03444 Mon Sep 17 00:00:00 2001 From: Dan Fornika Date: Tue, 20 Feb 2024 14:36:38 -0800 Subject: [PATCH] Remove versioned_outdir param --- modules/mlst.nf | 6 +++--- modules/provenance.nf | 2 +- modules/quast.nf | 41 +++++++++++++++++++++++++---------------- nextflow.config | 1 - 4 files changed, 29 insertions(+), 21 deletions(-) diff --git a/modules/mlst.nf b/modules/mlst.nf index 4b1f507..12697f5 100644 --- a/modules/mlst.nf +++ b/modules/mlst.nf @@ -2,7 +2,7 @@ process mlst { tag { sample_id } - publishDir params.versioned_outdir ? "${params.outdir}/${sample_id}/${params.pipeline_short_name}-v${params.pipeline_minor_version}-output" : "${params.outdir}/${sample_id}", mode: 'copy', pattern: "${sample_id}_mlst.json" + publishDir "${params.outdir}/${sample_id}", mode: 'copy', pattern: "${sample_id}_mlst.json" input: tuple val(sample_id), path(assembly) @@ -40,8 +40,8 @@ process parse_alleles { executor 'local' - publishDir params.versioned_outdir ? "${params.outdir}/${sample_id}/${params.pipeline_short_name}-v${params.pipeline_minor_version}-output" : "${params.outdir}/${sample_id}", mode: 'copy', pattern: "${sample_id}_alleles.csv" - publishDir params.versioned_outdir ? "${params.outdir}/${sample_id}/${params.pipeline_short_name}-v${params.pipeline_minor_version}-output" : "${params.outdir}/${sample_id}", mode: 'copy', pattern: "${sample_id}_sequence_type.csv" + publishDir "${params.outdir}/${sample_id}", mode: 'copy', pattern: "${sample_id}_alleles.csv" + publishDir "${params.outdir}/${sample_id}", mode: 'copy', pattern: "${sample_id}_sequence_type.csv" input: tuple val(sample_id), path(mlst_csv), path(mlst_json) diff --git a/modules/provenance.nf b/modules/provenance.nf index 966b423..e1286fa 100644 --- a/modules/provenance.nf +++ b/modules/provenance.nf @@ -4,7 +4,7 @@ process collect_provenance { executor 'local' - publishDir params.versioned_outdir ? "${params.outdir}/${sample_id}/${params.pipeline_short_name}-v${params.pipeline_minor_version}-output" : "${params.outdir}/${sample_id}", pattern: "${sample_id}_*_provenance.yml", mode: 'copy' + publishDir "${params.outdir}/${sample_id}", pattern: "${sample_id}_*_provenance.yml", mode: 'copy' input: tuple val(sample_id), path(provenance_files) diff --git a/modules/quast.nf b/modules/quast.nf index 012db10..acc9ba9 100644 --- a/modules/quast.nf +++ b/modules/quast.nf @@ -3,26 +3,35 @@ process quast { tag { sample_id } input: - tuple val(sample_id), path(assembly) + tuple val(sample_id), path(assembly) output: - tuple val(sample_id), path("${sample_id}_quast.tsv"), emit: tsv - tuple val(sample_id), path("${sample_id}_quast_provenance.yml"), emit: provenance + tuple val(sample_id), path("${sample_id}_quast.tsv"), emit: tsv + tuple val(sample_id), path("${sample_id}_quast_provenance.yml"), emit: provenance script: - """ - printf -- "- process_name: quast\\n" > ${sample_id}_quast_provenance.yml - printf -- " tool_name: quast\\n tool_version: \$(quast --version | cut -d ' ' -f 2 | tr -d 'v')\\n" >> ${sample_id}_quast_provenance.yml - - quast --threads ${task.cpus} \ + """ + printf -- "- process_name: quast\\n" >> ${sample_id}_quast_provenance.yml + printf -- " tools:\\n" >> ${sample_id}_quast_provenance.yml + printf -- " - tool_name: quast\\n" >> ${sample_id}_quast_provenance.yml + printf -- " tool_version: \$(quast --version | cut -d ' ' -f 2 | tr -d 'v')\\n" >> ${sample_id}_quast_provenance.yml + printf -- " parameters:\\n" >> ${sample_id}_quast_provenance.yml + printf -- " - parameter: --space-efficient\\n" >> ${sample_id}_quast_provenance.yml + printf -- " value: null\\n" >> ${sample_id}_quast_provenance.yml + printf -- " - parameter: --fast\\n" >> ${sample_id}_quast_provenance.yml + printf -- " value: null\\n" >> ${sample_id}_quast_provenance.yml + printf -- " - parameter: --min-contig\\n" >> ${sample_id}_quast_provenance.yml + printf -- " value: 0\\n" >> ${sample_id}_quast_provenance.yml + + quast --threads ${task.cpus} \ --space-efficient \ --fast \ --min-contig 0 \ ${assembly} \ --output-dir ${sample_id} - mv ${sample_id}/transposed_report.tsv ${sample_id}_quast.tsv - """ + mv ${sample_id}/transposed_report.tsv ${sample_id}_quast.tsv + """ } process parse_quast_report { @@ -31,16 +40,16 @@ process parse_quast_report { executor 'local' - publishDir params.versioned_outdir ? "${params.outdir}/${sample_id}/${params.pipeline_short_name}-v${params.pipeline_minor_version}-output" : "${params.outdir}/${sample_id}", pattern: "${sample_id}_quast.csv", mode: 'copy' + publishDir "${params.outdir}/${sample_id}", pattern: "${sample_id}_quast.csv", mode: 'copy' input: - tuple val(sample_id), path(quast_report) + tuple val(sample_id), path(quast_report) output: - tuple val(sample_id), path("${sample_id}_quast.csv") + tuple val(sample_id), path("${sample_id}_quast.csv") script: - """ - parse_quast_report.py ${quast_report} > ${sample_id}_quast.csv - """ + """ + parse_quast_report.py ${quast_report} > ${sample_id}_quast.csv + """ } diff --git a/nextflow.config b/nextflow.config index 0b8a6c8..04a0308 100644 --- a/nextflow.config +++ b/nextflow.config @@ -18,7 +18,6 @@ params { minid = 95 mincov = 10 minscore = 50 - versioned_outdir = false pipeline_short_name = parsePipelineName(manifest.toMap().get('name')) pipeline_minor_version = parseMinorVersion(manifest.toMap().get('version')) }