Add html compliance report
parent
c411f99cc6
commit
3fbc1b5b92
|
@ -37,6 +37,7 @@ rule all:
|
|||
expand("reports/figures/{pid}/{sensor}_heatmap_rows.html", pid=config["PIDS"], sensor=config["SENSORS"]),
|
||||
expand("reports/figures/{pid}/compliance_heatmap.html", pid=config["PIDS"]),
|
||||
expand("reports/figures/{pid}/battery_consumption_rates_barchart.html", pid=config["PIDS"]),
|
||||
expand("reports/compliance/{pid}/compliance_report.html", pid=config["PIDS"]),
|
||||
|
||||
rule clean:
|
||||
shell:
|
||||
|
|
|
@ -29,3 +29,12 @@ rule battery_consumption_rates_barchart:
|
|||
"reports/figures/{pid}/battery_consumption_rates_barchart.html"
|
||||
script:
|
||||
"../src/visualization/battery_consumption_rates_barchart.py"
|
||||
|
||||
rule compliance_report:
|
||||
input:
|
||||
sensor_heatmaps = expand("reports/figures/{{pid}}/{sensor}_heatmap_rows.html", sensor=config["SENSORS"]),
|
||||
compliance_heatmap = rules.compliance_heatmap.output
|
||||
output:
|
||||
"reports/compliance/{pid}/compliance_report.html",
|
||||
script:
|
||||
"../src/visualization/compliance_report.Rmd"
|
|
@ -0,0 +1,39 @@
|
|||
---
|
||||
title: "Compliance Report"
|
||||
author:
|
||||
- "MoSHI Pipeline"
|
||||
date: "`r format(Sys.time(), '%d %B, %Y')`"
|
||||
params:
|
||||
rmd: "compliance_report.Rmd"
|
||||
output:
|
||||
html_document:
|
||||
highlight: tango
|
||||
number_sections: no
|
||||
theme: default
|
||||
toc: yes
|
||||
toc_depth: 3
|
||||
toc_float:
|
||||
collapsed: no
|
||||
smooth_scroll: yes
|
||||
---
|
||||
|
||||
```{r include=FALSE}
|
||||
source("packrat/init.R")
|
||||
```
|
||||
|
||||
## Overall phone compliance
|
||||
|
||||
```{r, echo=FALSE}
|
||||
htmltools::includeHTML(snakemake@input[["compliance_heatmap"]])
|
||||
```
|
||||
|
||||
## Per sensor compliance
|
||||
```{r, echo=FALSE}
|
||||
heatmaps <- snakemake@input[["sensor_heatmaps"]]
|
||||
heatmaps.html <- vector(mode="list", length(heatmaps))
|
||||
|
||||
for(sensor_id in 1:length(heatmaps)){
|
||||
heatmaps.html[[sensor_id]] <- htmltools::includeHTML(heatmaps[sensor_id])
|
||||
}
|
||||
htmltools::tagList(heatmaps.html)
|
||||
```
|
Loading…
Reference in New Issue