Update version reporting
This commit is contained in:
parent
527307b0e5
commit
b61a1c0f5f
@ -4,6 +4,7 @@
|
||||
import argparse
|
||||
|
||||
from aplanat.components import fastcat
|
||||
from aplanat.components import simple as scomponents
|
||||
from aplanat.report import WFReport
|
||||
import conda_versions
|
||||
|
||||
@ -13,6 +14,9 @@ def main():
|
||||
parser = argparse.ArgumentParser()
|
||||
parser.add_argument("report", help="Report output file")
|
||||
parser.add_argument("summaries", nargs='+', help="Read summary file.")
|
||||
parser.add_argument(
|
||||
"--versions", required=True,
|
||||
help="directory containing CSVs containing name,version.")
|
||||
parser.add_argument(
|
||||
"--revision", default='unknown',
|
||||
help="git branch/tag of the executed workflow")
|
||||
@ -27,17 +31,8 @@ def main():
|
||||
|
||||
report.add_section(
|
||||
section=fastcat.full_report(args.summaries))
|
||||
|
||||
section = report.add_section()
|
||||
section.markdown('''
|
||||
### Software versions
|
||||
The table below highlights versions of key software used within the analysis.
|
||||
''')
|
||||
req = [
|
||||
'python', 'aplanat', 'pysam', 'fastcat']
|
||||
versions = conda_versions.scrape_data(
|
||||
as_dataframe=True, include=req)
|
||||
section.table(versions[['Name', 'Version', 'Build']], index=False)
|
||||
report.add_section(
|
||||
section=scomponents.version_table(args.versions))
|
||||
|
||||
# write report
|
||||
report.write(args.report)
|
||||
|
||||
@ -6,6 +6,6 @@ channels:
|
||||
- defaults
|
||||
dependencies:
|
||||
- python==3.8.*
|
||||
- aplanat >=0.3.5
|
||||
- aplanat >=0.5.0
|
||||
- pysam
|
||||
- fastcat
|
||||
|
||||
18
main.nf
18
main.nf
@ -46,14 +46,27 @@ process summariseReads {
|
||||
}
|
||||
|
||||
|
||||
process getVersions {
|
||||
label "pysam"
|
||||
cpus 1
|
||||
output:
|
||||
path "versions.txt"
|
||||
script:
|
||||
"""
|
||||
python -c "import pysam; print(f'pysam,{pysam.__version})" >> versions.txt
|
||||
fastcat --version | sed 's/^/fastcat,/' >> versions.txt
|
||||
"""
|
||||
}
|
||||
|
||||
process makeReport {
|
||||
label "pysam"
|
||||
input:
|
||||
path "seqs.txt"
|
||||
path "versions/*"
|
||||
output:
|
||||
path "wf-template-report.html"
|
||||
"""
|
||||
report.py wf-template-report.html seqs.txt
|
||||
report.py wf-template-report.html --versions versions.txt seqs.txt
|
||||
"""
|
||||
}
|
||||
|
||||
@ -81,7 +94,8 @@ workflow pipeline {
|
||||
reads
|
||||
main:
|
||||
summary = summariseReads(reads)
|
||||
report = makeReport(summary)
|
||||
software_versions = getVersions()
|
||||
report = makeReport(summary, software_versions.collect())
|
||||
emit:
|
||||
summary.concat(report)
|
||||
}
|
||||
|
||||
@ -55,7 +55,7 @@ profiles {
|
||||
}
|
||||
process {
|
||||
withLabel:pysam {
|
||||
conda = "environment.yaml"
|
||||
conda = "${projectDir}/environment.yaml"
|
||||
}
|
||||
shell = ['/bin/bash', '-euo', 'pipefail']
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user