2019-10-24 18:11:24 +02:00
|
|
|
configfile: "config.yaml"
|
|
|
|
include: "rules/preprocessing.snakefile"
|
2019-10-24 22:27:43 +02:00
|
|
|
include: "rules/features.snakefile"
|
2019-10-25 17:12:55 +02:00
|
|
|
include: "rules/reports.snakefile"
|
2019-10-24 18:11:24 +02:00
|
|
|
|
|
|
|
rule all:
|
|
|
|
input:
|
2019-10-24 22:08:05 +02:00
|
|
|
expand("data/raw/{pid}/{sensor}_raw.csv", pid=config["PIDS"], sensor=config["SENSORS"]),
|
2019-10-24 22:27:43 +02:00
|
|
|
expand("data/raw/{pid}/{sensor}_with_datetime.csv", pid=config["PIDS"], sensor=config["SENSORS"]),
|
2019-11-05 16:47:55 +01:00
|
|
|
expand("data/processed/{pid}/battery_deltas.csv", pid=config["PIDS"]),
|
2019-11-27 21:27:48 +01:00
|
|
|
expand("data/processed/{pid}/screen_deltas.csv", pid=config["PIDS"]),
|
2019-12-04 18:04:20 +01:00
|
|
|
expand("data/processed/{pid}/plugin_google_activity_recognition_deltas.csv", pid=config["PIDS"]),
|
2019-11-05 18:34:22 +01:00
|
|
|
expand("data/interim/{pid}/phone_valid_sensed_days.csv", pid=config["PIDS"]),
|
2019-12-04 17:33:25 +01:00
|
|
|
expand("data/interim/{pid}/phone_sensed_bins.csv", pid=config["PIDS"]),
|
2019-11-06 21:38:08 +01:00
|
|
|
expand("data/processed/{pid}/sms_{sms_type}_{day_segment}.csv",
|
2019-10-24 22:27:43 +02:00
|
|
|
pid=config["PIDS"],
|
2019-11-06 21:38:08 +01:00
|
|
|
sms_type = config["SMS"]["TYPES"],
|
|
|
|
day_segment = config["SMS"]["DAY_SEGMENTS"]),
|
2019-11-06 20:47:33 +01:00
|
|
|
expand("data/processed/{pid}/call_{call_type}_{segment}.csv",
|
2019-10-25 16:21:09 +02:00
|
|
|
pid=config["PIDS"],
|
2019-11-06 20:47:33 +01:00
|
|
|
call_type=config["CALLS"]["TYPES"],
|
|
|
|
segment = config["CALLS"]["DAY_SEGMENTS"]),
|
2019-11-06 18:32:35 +01:00
|
|
|
expand("data/processed/{pid}/location_barnett.csv", pid=config["PIDS"]),
|
2019-11-06 18:19:30 +01:00
|
|
|
expand("data/processed/{pid}/bluetooth_{segment}.csv",
|
|
|
|
pid=config["PIDS"],
|
|
|
|
segment = config["BLUETOOTH"]["DAY_SEGMENTS"]),
|
2019-11-18 20:22:08 +01:00
|
|
|
expand("data/processed/{pid}/google_activity_recognition_{segment}.csv",pid=config["PIDS"],
|
|
|
|
segment = config["GOOGLE_ACTIVITY_RECOGNITION"]["DAY_SEGMENTS"]),
|
2019-11-25 18:53:32 +01:00
|
|
|
expand("data/processed/{pid}/battery_{day_segment}.csv",
|
|
|
|
pid = config["PIDS"],
|
|
|
|
day_segment = config["BATTERY"]["DAY_SEGMENTS"]),
|
2019-11-27 20:25:17 +01:00
|
|
|
expand("data/processed/{pid}/screen_{day_segment}.csv",
|
|
|
|
pid = config["PIDS"],
|
|
|
|
day_segment = config["SCREEN"]["DAY_SEGMENTS"]),
|
2019-11-01 19:26:51 +01:00
|
|
|
# Reports
|
|
|
|
expand("reports/figures/{pid}/{sensor}_heatmap_rows.html", pid=config["PIDS"], sensor=config["SENSORS"]),
|
2019-12-04 21:32:20 +01:00
|
|
|
expand("reports/figures/{pid}/compliance_heatmap.html", pid=config["PIDS"]),
|
2019-11-08 18:18:21 +01:00
|
|
|
expand("reports/figures/{pid}/battery_consumption_rates_barchart.html", pid=config["PIDS"]),
|
2019-10-24 18:11:24 +02:00
|
|
|
|
|
|
|
# --- Packrat Rules --- #
|
|
|
|
## Taken from https://github.com/lachlandeer/snakemake-econ-r
|
|
|
|
|
|
|
|
## packrat_install: installs packrat onto machine
|
|
|
|
rule packrat_install:
|
|
|
|
shell:
|
|
|
|
"R -e 'install.packages(\"packrat\", repos=\"http://cran.us.r-project.org\")'"
|
|
|
|
|
|
|
|
## packrat_install: initialize a packrat environment for this project
|
|
|
|
rule packrat_init:
|
|
|
|
shell:
|
|
|
|
"R -e 'packrat::init()'"
|
|
|
|
|
|
|
|
## packrat_snap : Look for new R packages in files & archives them
|
|
|
|
rule packrat_snap:
|
|
|
|
shell:
|
|
|
|
"R -e 'packrat::snapshot()'"
|
|
|
|
|
|
|
|
## packrat_restore: Installs archived packages onto a new machine
|
|
|
|
rule packrat_restore:
|
|
|
|
shell:
|
|
|
|
"R -e 'packrat::restore()'"
|