Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove versioned_outdir param #19

Merged
merged 1 commit into from
Feb 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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