Skip to content

Commit

Permalink
fix: emit software versions
Browse files Browse the repository at this point in the history
  • Loading branch information
kelly-sovacool committed Nov 22, 2023
1 parent 458badc commit 737d002
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
5 changes: 5 additions & 0 deletions modules/CCBR/custom/convertsicer/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ process CONVERT_SICER {
output:
tuple val(meta), path("${sicer_peaks.baseName}.converted.bed"), emit: bed
tuple val(meta), path("${sicer_peaks.baseName}.converted.broadPeak"), emit: peak, optional: true
path("versions.yml"), emit: versions

when:
task.ext.when == null || task.ext.when
Expand All @@ -22,6 +23,7 @@ process CONVERT_SICER {
$/
#!/usr/bin/env python
import math
import platform
with open("${sicer_peaks}",'r') as f:
intxt = f.readlines()
# input columns if input-normalized: chrom, start, end, ChIP tag count, control tag count, p-value, fold-enrichment, q-value
Expand Down Expand Up @@ -53,5 +55,8 @@ process CONVERT_SICER {
if outBroadPeak[0] != None:
with open("${sicer_peaks.baseName}.converted.broadPeak", 'w') as h:
h.write( "\n".join(outBroadPeak) )
with open("versions.yml", "w") as outfile:
outfile.write('"${task.process}":\\n')
outfile.write(f' Python: "{platform.python_version()}"\\n')
/$
}
4 changes: 4 additions & 0 deletions modules/CCBR/custom/convertsicer/meta.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ output:
type: file
description: broadPeak file
pattern: "*.broadPeak"
- versions:
type: file
description: File containing software versions
pattern: "versions.yml"
authors:
- "@kelly-sovacool"
maintainers:
Expand Down

0 comments on commit 737d002

Please sign in to comment.