From ccc283db16853ed66cd4430840c75e35f98f71dd Mon Sep 17 00:00:00 2001 From: JulioV Date: Thu, 5 Mar 2020 10:32:38 -0500 Subject: [PATCH] Add day segment parameter to location barnett rule --- Snakefile | 4 +++- config.yaml | 3 ++- rules/features.snakefile | 5 +++-- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/Snakefile b/Snakefile index 3922b149..310886ab 100644 --- a/Snakefile +++ b/Snakefile @@ -23,7 +23,9 @@ rule all: pid=config["PIDS"], call_type=config["CALLS"]["TYPES"], segment = config["CALLS"]["DAY_SEGMENTS"]), - expand("data/processed/{pid}/location_barnett.csv", pid=config["PIDS"]), + expand("data/processed/{pid}/location_barnett_{segment}.csv", + pid=config["PIDS"], + segment = config["BARNETT_LOCATION"]["DAY_SEGMENTS"]), expand("data/processed/{pid}/bluetooth_{segment}.csv", pid=config["PIDS"], segment = config["BLUETOOTH"]["DAY_SEGMENTS"]), diff --git a/config.yaml b/config.yaml index 9325934c..9fe3baf4 100644 --- a/config.yaml +++ b/config.yaml @@ -68,7 +68,8 @@ RESAMPLE_FUSED_LOCATION: TIMEZONE: *timezone BARNETT_LOCATION: - METRICS: ["hometime","disttravelled","rog","maxdiam","maxhomedist","siglocsvisited","avgflightlen","stdflightlen","avgflightdur","stdflightdur","probpause","siglocentropy","minsmissing","circdnrtn","wkenddayrtn"] + DAY_SEGMENTS: [daily] # These metrics are only available on a daily basis + METRICS: ["hometime","disttravelled","rog","maxdiam","maxhomedist","siglocsvisited","avgflightlen","stdflightlen","avgflightdur","stdflightdur","probpause","siglocentropy","circdnrtn","wkenddayrtn"] LOCATIONS_TO_USE: ALL # ALL, ALL_EXCEPT_FUSED OR RESAMPLE_FUSED ACCURACY_LIMIT: 51 # meters, drops location coordinates with an accuracy higher than this. This number means there's a 68% probability the true location is within this radius TIMEZONE: *timezone diff --git a/rules/features.snakefile b/rules/features.snakefile index 568ee7f0..38bff894 100644 --- a/rules/features.snakefile +++ b/rules/features.snakefile @@ -55,9 +55,10 @@ rule location_barnett_metrics: metrics = config["BARNETT_LOCATION"]["METRICS"], locations_to_use = config["BARNETT_LOCATION"]["LOCATIONS_TO_USE"], accuracy_limit = config["BARNETT_LOCATION"]["ACCURACY_LIMIT"], - timezone = config["BARNETT_LOCATION"]["TIMEZONE"] + timezone = config["BARNETT_LOCATION"]["TIMEZONE"], + day_segment = "{day_segment}" output: - "data/processed/{pid}/location_barnett.csv" + "data/processed/{pid}/location_barnett_{day_segment}.csv" script: "../src/features/location_barnett_metrics.R"