2020-07-22 22:47:32 +02:00
|
|
|
rule heatmap_features_correlations:
|
2019-10-25 17:12:55 +02:00
|
|
|
input:
|
2020-07-22 22:47:32 +02:00
|
|
|
features = expand("data/processed/{pid}/{sensor}_{day_segment}.csv", pid=config["PIDS"], sensor=config["HEATMAP_FEATURES_CORRELATIONS"]["PHONE_FEATURES"]+config["HEATMAP_FEATURES_CORRELATIONS"]["FITBIT_FEATURES"], day_segment=config["DAY_SEGMENTS"]),
|
2020-07-27 02:11:25 +02:00
|
|
|
phone_valid_sensed_days = expand("data/interim/{pid}/phone_valid_sensed_days_{{min_valid_hours_per_day}}hours_{{min_valid_bins_per_hour}}bins.csv", pid=config["PIDS"])
|
2020-07-22 22:47:32 +02:00
|
|
|
params:
|
|
|
|
min_rows_ratio = config["HEATMAP_FEATURES_CORRELATIONS"]["MIN_ROWS_RATIO"],
|
2020-07-23 02:00:14 +02:00
|
|
|
corr_threshold = config["HEATMAP_FEATURES_CORRELATIONS"]["CORR_THRESHOLD"],
|
|
|
|
corr_method = config["HEATMAP_FEATURES_CORRELATIONS"]["CORR_METHOD"]
|
2020-07-22 22:47:32 +02:00
|
|
|
output:
|
2020-07-27 02:11:25 +02:00
|
|
|
"reports/data_exploration/{min_valid_hours_per_day}hours_{min_valid_bins_per_hour}bins/heatmap_features_correlations.html"
|
2020-07-22 22:47:32 +02:00
|
|
|
script:
|
|
|
|
"../src/visualization/heatmap_features_correlations.py"
|
|
|
|
|
|
|
|
rule histogram_valid_sensed_hours:
|
|
|
|
input:
|
2020-07-27 02:11:25 +02:00
|
|
|
phone_valid_sensed_days = expand("data/interim/{pid}/phone_valid_sensed_days_{{min_valid_hours_per_day}}hours_{{min_valid_bins_per_hour}}bins.csv", pid=config["PIDS"])
|
2020-07-22 22:47:32 +02:00
|
|
|
output:
|
2020-07-27 02:11:25 +02:00
|
|
|
"reports/data_exploration/{min_valid_hours_per_day}hours_{min_valid_bins_per_hour}bins/histogram_valid_sensed_hours.html"
|
2020-07-22 22:47:32 +02:00
|
|
|
script:
|
|
|
|
"../src/visualization/histogram_valid_sensed_hours.py"
|
|
|
|
|
|
|
|
rule heatmap_days_by_sensors:
|
|
|
|
input:
|
|
|
|
sensors = expand("data/raw/{{pid}}/{sensor}_with_datetime.csv", sensor=config["HEATMAP_DAYS_BY_SENSORS"]["PHONE_SENSORS_TABLES"]),
|
2020-07-27 02:11:25 +02:00
|
|
|
phone_valid_sensed_days = "data/interim/{pid}/phone_valid_sensed_days_{min_valid_hours_per_day}hours_{min_valid_bins_per_hour}bins.csv"
|
2019-10-25 17:12:55 +02:00
|
|
|
params:
|
2020-02-07 17:14:19 +01:00
|
|
|
pid = "{pid}",
|
2020-07-22 22:47:32 +02:00
|
|
|
expected_num_of_days = config["HEATMAP_DAYS_BY_SENSORS"]["EXPECTED_NUM_OF_DAYS"]
|
|
|
|
output:
|
2020-07-27 02:11:25 +02:00
|
|
|
"reports/interim/{min_valid_hours_per_day}hours_{min_valid_bins_per_hour}bins/{pid}/heatmap_days_by_sensors.html"
|
2020-07-22 22:47:32 +02:00
|
|
|
script:
|
|
|
|
"../src/visualization/heatmap_days_by_sensors.py"
|
|
|
|
|
|
|
|
rule heatmap_days_by_sensors_all_participants:
|
|
|
|
input:
|
2020-07-27 02:11:25 +02:00
|
|
|
heatmap_rows = expand("reports/interim/{{min_valid_hours_per_day}}hours_{{min_valid_bins_per_hour}}bins/{pid}/heatmap_days_by_sensors.html", pid=config["PIDS"])
|
2019-10-25 17:12:55 +02:00
|
|
|
output:
|
2020-07-27 02:11:25 +02:00
|
|
|
"reports/data_exploration/{min_valid_hours_per_day}hours_{min_valid_bins_per_hour}bins/heatmap_days_by_sensors_all_participants.html"
|
2019-10-25 17:12:55 +02:00
|
|
|
script:
|
2020-07-22 22:47:32 +02:00
|
|
|
"../src/visualization/heatmap_days_by_sensors_all_participants.Rmd"
|
2019-11-01 19:26:51 +01:00
|
|
|
|
2020-07-22 22:47:32 +02:00
|
|
|
rule heatmap_sensed_bins:
|
2019-11-01 19:26:51 +01:00
|
|
|
input:
|
2020-02-20 16:16:03 +01:00
|
|
|
sensor = "data/interim/{pid}/phone_sensed_bins.csv",
|
|
|
|
pid_file = "data/external/{pid}"
|
2019-11-01 19:26:51 +01:00
|
|
|
params:
|
2019-12-05 17:07:40 +01:00
|
|
|
pid = "{pid}",
|
2020-07-22 22:47:32 +02:00
|
|
|
bin_size = config["HEATMAP_SENSED_BINS"]["BIN_SIZE"]
|
2019-11-01 19:26:51 +01:00
|
|
|
output:
|
2020-07-22 22:47:32 +02:00
|
|
|
"reports/interim/heatmap_sensed_bins/{pid}/heatmap_sensed_bins.html"
|
2019-11-01 19:26:51 +01:00
|
|
|
script:
|
2020-07-22 22:47:32 +02:00
|
|
|
"../src/visualization/heatmap_sensed_bins.py"
|
|
|
|
|
|
|
|
rule heatmap_sensed_bins_all_participants:
|
|
|
|
input:
|
|
|
|
heatmap_sensed_bins = expand("reports/interim/heatmap_sensed_bins/{pid}/heatmap_sensed_bins.html", pid=config["PIDS"])
|
|
|
|
output:
|
|
|
|
"reports/data_exploration/heatmap_sensed_bins_all_participants.html"
|
|
|
|
script:
|
|
|
|
"../src/visualization/heatmap_sensed_bins_all_participants.Rmd"
|
2019-11-08 18:18:21 +01:00
|
|
|
|
2020-02-25 19:27:17 +01:00
|
|
|
rule overall_compliance_heatmap:
|
|
|
|
input:
|
|
|
|
phone_sensed_bins = expand("data/interim/{pid}/phone_sensed_bins.csv", pid=config["PIDS"]),
|
2020-07-24 18:58:48 +02:00
|
|
|
phone_valid_sensed_days = expand("data/interim/{pid}/phone_valid_sensed_days_{{min_valid_hours_per_day}}hours_{{min_valid_bins_per_hour}}bins.csv", pid=config["PIDS"]),
|
2020-02-25 19:27:17 +01:00
|
|
|
pid_files = expand("data/external/{pid}", pid=config["PIDS"])
|
|
|
|
params:
|
2020-07-24 18:58:48 +02:00
|
|
|
only_show_valid_days = config["OVERALL_COMPLIANCE_HEATMAP"]["ONLY_SHOW_VALID_DAYS"],
|
2020-02-25 19:27:17 +01:00
|
|
|
local_timezone = config["READABLE_DATETIME"]["FIXED_TIMEZONE"],
|
2020-07-22 22:47:32 +02:00
|
|
|
expected_num_of_days = config["OVERALL_COMPLIANCE_HEATMAP"]["EXPECTED_NUM_OF_DAYS"],
|
|
|
|
bin_size = config["OVERALL_COMPLIANCE_HEATMAP"]["BIN_SIZE"],
|
2020-07-24 18:58:48 +02:00
|
|
|
min_bins_per_hour = "{min_valid_bins_per_hour}"
|
2020-02-25 19:27:17 +01:00
|
|
|
output:
|
2020-07-24 18:58:48 +02:00
|
|
|
"reports/data_exploration/{min_valid_hours_per_day}hours_{min_valid_bins_per_hour}bins/overall_compliance_heatmap.html"
|
2020-02-25 19:27:17 +01:00
|
|
|
script:
|
|
|
|
"../src/visualization/overall_compliance_heatmap.py"
|
|
|
|
|
2020-07-22 22:47:32 +02:00
|
|
|
# rule heatmap_rows:
|
|
|
|
# input:
|
|
|
|
# sensor = "data/raw/{pid}/{sensor}_with_datetime.csv",
|
|
|
|
# pid_file = "data/external/{pid}"
|
|
|
|
# params:
|
|
|
|
# table = "{sensor}",
|
|
|
|
# pid = "{pid}",
|
|
|
|
# bin_size = config["PHONE_VALID_SENSED_BINS"]["BIN_SIZE"]
|
|
|
|
# output:
|
|
|
|
# "reports/figures/{pid}/{sensor}_heatmap_rows.html"
|
|
|
|
# script:
|
|
|
|
# "../src/visualization/heatmap_rows.py"
|
2019-12-18 21:23:42 +01:00
|
|
|
|
2020-07-22 22:47:32 +02:00
|
|
|
# rule battery_consumption_rates_barchart:
|
|
|
|
# input:
|
|
|
|
# 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"
|
2020-06-23 17:33:34 +02:00
|
|
|
|
2020-07-22 22:47:32 +02:00
|
|
|
# rule compliance_report:
|
|
|
|
# input:
|
|
|
|
# sensor_heatmaps = expand("reports/figures/{{pid}}/{sensor}_heatmap_rows.html", sensor=PHONE_SENSORS),
|
|
|
|
# compliance_heatmap = rules.compliance_heatmap.output
|
|
|
|
# output:
|
|
|
|
# "reports/compliance/{pid}/compliance_report.html",
|
|
|
|
# script:
|
|
|
|
# "../src/visualization/compliance_report.Rmd"
|