rapids/rules/features.snakefile

177 lines
6.2 KiB
Plaintext
Raw Normal View History

rule sms_metrics:
2019-10-24 22:27:43 +02:00
input:
"data/raw/{pid}/messages_with_datetime.csv"
params:
sms_type = "{sms_type}",
day_segment = "{day_segment}",
metrics = lambda wildcards: config["SMS"]["METRICS"][wildcards.sms_type]
2019-10-24 22:27:43 +02:00
output:
"data/processed/{pid}/sms_{sms_type}_{day_segment}.csv"
2019-10-24 22:27:43 +02:00
script:
"../src/features/sms_metrics.R"
2019-10-25 16:21:09 +02:00
rule call_metrics:
2019-10-25 16:21:09 +02:00
input:
2019-11-12 21:12:43 +01:00
"data/raw/{pid}/calls_with_datetime_unified.csv"
2019-10-25 16:21:09 +02:00
params:
call_type = "{call_type}",
day_segment = "{day_segment}",
metrics = lambda wildcards: config["CALLS"]["METRICS"][wildcards.call_type]
2019-10-25 16:21:09 +02:00
output:
"data/processed/{pid}/call_{call_type}_{day_segment}.csv"
2019-10-25 16:21:09 +02:00
script:
2019-11-06 21:43:41 +01:00
"../src/features/call_metrics.R"
2019-11-05 16:47:55 +01:00
rule battery_deltas:
input:
"data/raw/{pid}/battery_with_datetime_unified.csv"
2019-11-05 16:47:55 +01:00
output:
"data/processed/{pid}/battery_deltas.csv"
script:
2019-11-05 21:17:20 +01:00
"../src/features/battery_deltas.R"
2019-11-27 21:27:48 +01:00
rule screen_deltas:
input:
screen = "data/raw/{pid}/screen_with_datetime.csv",
participant_info = "data/external/{pid}"
2019-11-27 21:27:48 +01:00
output:
"data/processed/{pid}/screen_deltas.csv"
script:
"../src/features/screen_deltas.R"
2019-11-27 21:53:37 +01:00
rule google_activity_recognition_deltas:
input:
"data/raw/{pid}/plugin_google_activity_recognition_with_datetime.csv"
output:
2019-11-28 00:06:31 +01:00
"data/processed/{pid}/plugin_google_activity_recognition_deltas.csv"
2019-11-27 21:53:37 +01:00
script:
"../src/features/google_activity_recognition_deltas.R"
2019-11-05 21:17:20 +01:00
rule location_barnett_metrics:
input:
raw = "data/raw/{pid}/locations_raw.csv",
fused = rules.resample_fused_location.output
2019-11-05 21:17:20 +01:00
params:
metrics = config["BARNETT_LOCATION"]["METRICS"],
locations_to_use = config["BARNETT_LOCATION"]["LOCATIONS_TO_USE"],
2019-11-05 21:17:20 +01:00
accuracy_limit = config["BARNETT_LOCATION"]["ACCURACY_LIMIT"],
timezone = config["BARNETT_LOCATION"]["TIMEZONE"],
day_segment = "{day_segment}"
2019-11-05 21:17:20 +01:00
output:
"data/processed/{pid}/location_barnett_{day_segment}.csv"
2019-11-05 21:17:20 +01:00
script:
2019-11-06 18:19:30 +01:00
"../src/features/location_barnett_metrics.R"
rule bluetooth_features:
2019-11-06 18:19:30 +01:00
input:
"data/raw/{pid}/bluetooth_with_datetime.csv"
params:
day_segment = "{day_segment}",
features = config["BLUETOOTH"]["FEATURES"]
2019-11-06 18:19:30 +01:00
output:
"data/processed/{pid}/bluetooth_{day_segment}.csv"
script:
"../src/features/bluetooth_features.R"
rule activity_metrics:
input:
2019-11-28 00:06:31 +01:00
gar_events = "data/raw/{pid}/plugin_google_activity_recognition_with_datetime.csv",
gar_deltas = "data/processed/{pid}/plugin_google_activity_recognition_deltas.csv"
2019-11-18 20:22:08 +01:00
params:
segment = "{day_segment}",
metrics = config["GOOGLE_ACTIVITY_RECOGNITION"]["METRICS"]
output:
2019-11-18 20:22:08 +01:00
"data/processed/{pid}/google_activity_recognition_{day_segment}.csv"
script:
"../src/features/google_activity_recognition.py"
rule battery_metrics:
input:
"data/processed/{pid}/battery_deltas.csv"
params:
day_segment = "{day_segment}",
metrics = config["BATTERY"]["METRICS"]
output:
"data/processed/{pid}/battery_{day_segment}.csv"
script:
"../src/features/battery_metrics.py"
2019-11-27 20:25:17 +01:00
rule screen_metrics:
input:
screen_deltas = "data/processed/{pid}/screen_deltas.csv",
phone_sensed_bins = "data/interim/{pid}/phone_sensed_bins.csv"
2019-11-27 20:25:17 +01:00
params:
day_segment = "{day_segment}",
reference_hour_first_use = config["SCREEN"]["REFERENCE_HOUR_FIRST_USE"],
2019-12-02 17:22:50 +01:00
metrics_deltas = config["SCREEN"]["METRICS_DELTAS"],
episode_types = config["SCREEN"]["EPISODE_TYPES"],
bin_size = config["PHONE_VALID_SENSED_DAYS"]["BIN_SIZE"]
2019-11-27 20:25:17 +01:00
output:
"data/processed/{pid}/screen_{day_segment}.csv"
script:
"../src/features/screen_metrics.py"
2020-01-14 15:51:39 +01:00
rule light_metrics:
input:
"data/raw/{pid}/light_with_datetime.csv",
params:
day_segment = "{day_segment}",
metrics = config["LIGHT"]["METRICS"],
output:
"data/processed/{pid}/light_{day_segment}.csv"
script:
"../src/features/light_metrics.py"
2020-01-15 20:15:24 +01:00
rule accelerometer_features:
2020-01-15 20:15:24 +01:00
input:
"data/raw/{pid}/accelerometer_with_datetime.csv",
params:
day_segment = "{day_segment}",
features = config["ACCELEROMETER"]["FEATURES"],
2020-01-15 20:15:24 +01:00
output:
"data/processed/{pid}/accelerometer_{day_segment}.csv"
script:
"../src/features/accelerometer_features.py"
2020-01-29 22:22:53 +01:00
2020-02-07 17:52:55 +01:00
rule applications_foreground_metrics:
input:
"data/interim/{pid}/applications_foreground_with_datetime_with_genre.csv",
params:
day_segment = "{day_segment}",
single_categories = config["APPLICATIONS_FOREGROUND"]["SINGLE_CATEGORIES"],
multiple_categories = config["APPLICATIONS_FOREGROUND"]["MULTIPLE_CATEGORIES"],
single_apps = config["APPLICATIONS_FOREGROUND"]["SINGLE_APPS"],
excluded_categories = config["APPLICATIONS_FOREGROUND"]["EXCLUDED_CATEGORIES"],
excluded_apps = config["APPLICATIONS_FOREGROUND"]["EXCLUDED_APPS"],
metrics = config["APPLICATIONS_FOREGROUND"]["METRICS"],
output:
"data/processed/{pid}/applications_foreground_{day_segment}.csv"
script:
"../src/features/applications_foreground_metrics.py"
2020-02-07 17:35:15 +01:00
rule fitbit_heartrate_metrics:
input:
"data/raw/{pid}/fitbit_heartrate_with_datetime.csv",
params:
day_segment = "{day_segment}",
metrics = config["HEARTRATE"]["METRICS"],
output:
"data/processed/{pid}/fitbit_heartrate_{day_segment}.csv"
script:
"../src/features/fitbit_heartrate_metrics.py"
rule fitbit_step_features:
2020-01-29 22:22:53 +01:00
input:
steps_data = "data/raw/{pid}/fitbit_steps_with_datetime.csv",
params:
day_segment = "{day_segment}",
features_all_steps = config["STEP"]["FEATURES"]["ALL_STEPS"],
features_sedentary_bout = config["STEP"]["FEATURES"]["SEDENTARY_BOUT"],
features_active_bout = config["STEP"]["FEATURES"]["ACTIVE_BOUT"],
threshold_active_bout = config["STEP"]["THRESHOLD_ACTIVE_BOUT"],
include_zero_step_rows = config["STEP"]["INCLUDE_ZERO_STEP_ROWS"]
2020-01-29 22:22:53 +01:00
output:
"data/processed/{pid}/fitbit_step_{day_segment}.csv"
script:
"../src/features/fitbit_step_features.py"