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

Fix provenance format #18

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
4 changes: 3 additions & 1 deletion modules/hash_files.nf
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ process hash_files {
"""
shasum -a 256 ${files_to_hash} | tr -s ' ' ',' > ${sample_id}_${file_type}.sha256.csv
while IFS=',' read -r hash filename; do
printf -- "- input_filename: \$filename\\n input_path: \$(realpath \$filename)\\n sha256: \$hash\\n" >> ${sample_id}_${file_type}_provenance.yml
printf -- "- input_filename: \$filename\\n" >> ${sample_id}_${file_type}_provenance.yml
printf -- " input_path: \$(realpath \$filename)\\n" >> ${sample_id}_${file_type}_provenance.yml
printf -- " sha256: \$hash\\n" >> ${sample_id}_${file_type}_provenance.yml
done < ${sample_id}_${file_type}.sha256.csv
"""
}
17 changes: 12 additions & 5 deletions modules/mlst.nf
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,18 @@ process mlst {

script:
"""
printf -- "- process_name: mlst\\n" > ${sample_id}_mlst_provenance.yml
printf -- " tool_name: mlst\\n tool_version: \$(mlst --version | cut -d ' ' -f 2)\\n parameters:\\n" >> ${sample_id}_mlst_provenance.yml
printf -- " - parameter: minid\\n value: ${params.minid}\\n" >> ${sample_id}_mlst_provenance.yml
printf -- " - parameter: mincov\\n value: ${params.mincov}\\n" >> ${sample_id}_mlst_provenance.yml
printf -- " - parameter: minscore\\n value: ${params.minscore}\\n" >> ${sample_id}_mlst_provenance.yml
printf -- "- process_name: mlst\\n" >> ${sample_id}_mlst_provenance.yml
printf -- " tools:\\n" >> ${sample_id}_mlst_provenance.yml
printf -- " - tool_name: mlst\\n" >> ${sample_id}_mlst_provenance.yml
printf -- " tool_version: \$(mlst --version | cut -d ' ' -f 2)\\n" >> ${sample_id}_mlst_provenance.yml
printf -- " parameters:\\n" >> ${sample_id}_mlst_provenance.yml
printf -- " - parameter: minid\\n" >> ${sample_id}_mlst_provenance.yml
printf -- " value: ${params.minid}\\n" >> ${sample_id}_mlst_provenance.yml
printf -- " - parameter: mincov\\n" >> ${sample_id}_mlst_provenance.yml
printf -- " value: ${params.mincov}\\n" >> ${sample_id}_mlst_provenance.yml
printf -- " - parameter: minscore\\n" >> ${sample_id}_mlst_provenance.yml
printf -- " value: ${params.minscore}\\n" >> ${sample_id}_mlst_provenance.yml

mlst \
--minid ${params.minid} \
--mincov ${params.mincov} \
Expand Down
4 changes: 3 additions & 1 deletion modules/provenance.nf
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ process pipeline_provenance {

script:
"""
printf -- "- pipeline_name: ${pipeline_name}\\n pipeline_version: ${pipeline_version}\\n- timestamp_analysis_start: ${analysis_start}\\n" > pipeline_provenance.yml
printf -- "- pipeline_name: ${pipeline_name}\\n" >> pipeline_provenance.yml
printf -- " pipeline_version: ${pipeline_version}\\n" >> pipeline_provenance.yml
printf -- " timestamp_analysis_start: ${analysis_start}\\n" >> pipeline_provenance.yml
"""
}
2 changes: 1 addition & 1 deletion nextflow.config
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
manifest {
author = 'Dan Fornika'
name = 'BCCDC-PHL/mlst-nf'
version = '0.1.3'
version = '0.1.4'
description = 'BCCDC-PHL MLST'
mainScript = 'main.nf'
nextflowVersion = '>=20.01.0'
Expand Down