Skip to content

Commit

Permalink
Remove versioned_outdir param (#19)
Browse files Browse the repository at this point in the history
  • Loading branch information
dfornika authored Feb 20, 2024
1 parent 40ee459 commit 6bd6315
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 21 deletions.
6 changes: 3 additions & 3 deletions modules/mlst.nf
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion modules/provenance.nf
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
41 changes: 25 additions & 16 deletions modules/quast.nf
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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
"""
}
1 change: 0 additions & 1 deletion nextflow.config
Original file line number Diff line number Diff line change
Expand Up @@ -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'))
}
Expand Down

0 comments on commit 6bd6315

Please sign in to comment.