Update version reporting
This commit is contained in:
parent
527307b0e5
commit
b61a1c0f5f
@ -4,6 +4,7 @@
|
|||||||
import argparse
|
import argparse
|
||||||
|
|
||||||
from aplanat.components import fastcat
|
from aplanat.components import fastcat
|
||||||
|
from aplanat.components import simple as scomponents
|
||||||
from aplanat.report import WFReport
|
from aplanat.report import WFReport
|
||||||
import conda_versions
|
import conda_versions
|
||||||
|
|
||||||
@ -13,6 +14,9 @@ def main():
|
|||||||
parser = argparse.ArgumentParser()
|
parser = argparse.ArgumentParser()
|
||||||
parser.add_argument("report", help="Report output file")
|
parser.add_argument("report", help="Report output file")
|
||||||
parser.add_argument("summaries", nargs='+', help="Read summary 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(
|
parser.add_argument(
|
||||||
"--revision", default='unknown',
|
"--revision", default='unknown',
|
||||||
help="git branch/tag of the executed workflow")
|
help="git branch/tag of the executed workflow")
|
||||||
@ -27,17 +31,8 @@ def main():
|
|||||||
|
|
||||||
report.add_section(
|
report.add_section(
|
||||||
section=fastcat.full_report(args.summaries))
|
section=fastcat.full_report(args.summaries))
|
||||||
|
report.add_section(
|
||||||
section = report.add_section()
|
section=scomponents.version_table(args.versions))
|
||||||
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)
|
|
||||||
|
|
||||||
# write report
|
# write report
|
||||||
report.write(args.report)
|
report.write(args.report)
|
||||||
|
|||||||
@ -6,6 +6,6 @@ channels:
|
|||||||
- defaults
|
- defaults
|
||||||
dependencies:
|
dependencies:
|
||||||
- python==3.8.*
|
- python==3.8.*
|
||||||
- aplanat >=0.3.5
|
- aplanat >=0.5.0
|
||||||
- pysam
|
- pysam
|
||||||
- fastcat
|
- 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 {
|
process makeReport {
|
||||||
label "pysam"
|
label "pysam"
|
||||||
input:
|
input:
|
||||||
path "seqs.txt"
|
path "seqs.txt"
|
||||||
|
path "versions/*"
|
||||||
output:
|
output:
|
||||||
path "wf-template-report.html"
|
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
|
reads
|
||||||
main:
|
main:
|
||||||
summary = summariseReads(reads)
|
summary = summariseReads(reads)
|
||||||
report = makeReport(summary)
|
software_versions = getVersions()
|
||||||
|
report = makeReport(summary, software_versions.collect())
|
||||||
emit:
|
emit:
|
||||||
summary.concat(report)
|
summary.concat(report)
|
||||||
}
|
}
|
||||||
|
|||||||
@ -55,7 +55,7 @@ profiles {
|
|||||||
}
|
}
|
||||||
process {
|
process {
|
||||||
withLabel:pysam {
|
withLabel:pysam {
|
||||||
conda = "environment.yaml"
|
conda = "${projectDir}/environment.yaml"
|
||||||
}
|
}
|
||||||
shell = ['/bin/bash', '-euo', 'pipefail']
|
shell = ['/bin/bash', '-euo', 'pipefail']
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user