Skip to content

Commit

Permalink
Fix provenance format (#18)
Browse files Browse the repository at this point in the history
  • Loading branch information
dfornika authored Feb 20, 2024
1 parent 6018ee5 commit 40ee459
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 8 deletions.
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

0 comments on commit 40ee459

Please sign in to comment.