rapids/rules/reports.snakefile

61 lines
2.5 KiB
Plaintext
Raw Normal View History

2019-10-25 17:12:55 +02:00
rule heatmap_rows:
input:
2020-02-20 16:16:03 +01:00
sensor = "data/raw/{pid}/{sensor}_with_datetime.csv",
pid_file = "data/external/{pid}"
2019-10-25 17:12:55 +02:00
params:
table = "{sensor}",
2020-02-07 17:14:19 +01:00
pid = "{pid}",
2020-07-09 19:01:50 +02:00
bin_size = config["PHONE_VALID_SENSED_BINS"]["BIN_SIZE"]
2019-10-25 17:12:55 +02:00
output:
"reports/figures/{pid}/{sensor}_heatmap_rows.html"
script:
"../src/visualization/heatmap_rows.py"
rule compliance_heatmap:
input:
2020-02-20 16:16:03 +01:00
sensor = "data/interim/{pid}/phone_sensed_bins.csv",
pid_file = "data/external/{pid}"
params:
pid = "{pid}",
2020-07-09 19:01:50 +02:00
bin_size = config["PHONE_VALID_SENSED_BINS"]["BIN_SIZE"]
output:
"reports/figures/{pid}/compliance_heatmap.html"
script:
"../src/visualization/compliance_heatmap.py"
rule overall_compliance_heatmap:
input:
phone_sensed_bins = expand("data/interim/{pid}/phone_sensed_bins.csv", pid=config["PIDS"]),
phone_valid_sensed_days = expand("data/interim/{pid}/phone_valid_sensed_days.csv", pid=config["PIDS"]),
pid_files = expand("data/external/{pid}", pid=config["PIDS"])
params:
local_timezone = config["READABLE_DATETIME"]["FIXED_TIMEZONE"],
2020-07-09 19:01:50 +02:00
bin_size = config["PHONE_VALID_SENSED_BINS"]["BIN_SIZE"],
min_bins_per_hour = config["PHONE_VALID_SENSED_DAYS"]["MIN_VALID_BINS_PER_HOUR"]
output:
"reports/figures/overall_compliance_heatmap.html"
script:
"../src/visualization/overall_compliance_heatmap.py"
rule battery_consumption_rates_barchart:
input:
2020-02-20 16:16:03 +01:00
sensor = "data/processed/{pid}/battery_daily.csv",
pid_file = "data/external/{pid}"
params:
pid = "{pid}"
output:
"reports/figures/{pid}/battery_consumption_rates_barchart.html"
script:
"../src/visualization/battery_consumption_rates_barchart.py"
2019-12-18 21:23:42 +01:00
PHONE_SENSORS = []
PHONE_SENSORS.extend([config["MESSAGES"]["DB_TABLE"], config["CALLS"]["DB_TABLE"], config["BARNETT_LOCATION"]["DB_TABLE"], config["BLUETOOTH"]["DB_TABLE"], config["BATTERY"]["DB_TABLE"], config["SCREEN"]["DB_TABLE"], config["LIGHT"]["DB_TABLE"], config["ACCELEROMETER"]["DB_TABLE"], config["APPLICATIONS_FOREGROUND"]["DB_TABLE"],config["WIFI"]["DB_TABLE"]])
2019-12-18 21:23:42 +01:00
rule compliance_report:
input:
sensor_heatmaps = expand("reports/figures/{{pid}}/{sensor}_heatmap_rows.html", sensor=PHONE_SENSORS),
2019-12-18 21:23:42 +01:00
compliance_heatmap = rules.compliance_heatmap.output
output:
"reports/compliance/{pid}/compliance_report.html",
script:
"../src/visualization/compliance_report.Rmd"