rapids/docs/usage/quick_rule.rst

60 lines
1.9 KiB
ReStructuredText
Raw Normal View History

2020-03-10 17:32:16 +01:00
Minimal Working Example
=======================
2020-03-09 22:07:51 +01:00
2020-03-10 17:32:16 +01:00
The following is a quick guide for creating and running a simple pipeline to extract Call metrics for daily and night epochs of one participant monitored on the US East coast.
2020-03-09 22:07:51 +01:00
2020-03-10 17:27:27 +01:00
#. Make sure your database connection credentials in ``.env`` are correct. See step 1 of :ref:`Usage Section <db-configuration>`.
2020-03-09 22:07:51 +01:00
2020-03-10 17:27:27 +01:00
#. Create at least one participant file ``p01`` under ``data/external/``. See step 2 of :ref:`Usage Section <db-configuration>`.
2020-03-09 22:07:51 +01:00
2020-03-10 17:32:16 +01:00
#. Make sure your Conda (python) environment is active. See step 6 of :ref:`install-page`.
2020-03-09 22:07:51 +01:00
2020-03-10 17:27:27 +01:00
#. Replace the contents of the ``Snakefile`` with the following snippet
2020-03-09 22:07:51 +01:00
::
configfile: "config.yaml"
2020-05-14 22:06:13 +02:00
include: "rules/renv.snakefile"
2020-03-09 22:07:51 +01:00
include: "rules/preprocessing.snakefile"
include: "rules/features.snakefile"
include: "rules/reports.snakefile"
rule all:
input:
expand("data/processed/{pid}/call_{call_type}_{day_segment}.csv",
pid=config["PIDS"],
call_type=config["CALLS"]["TYPES"],
day_segment = config["CALLS"]["DAY_SEGMENTS"]),
2020-03-10 17:27:27 +01:00
#. Modify the following settings in the ``config.yaml`` file with the values shown below (leave all other settings as they are)
2020-03-09 22:07:51 +01:00
::
SENSORS: [calls]
FITBIT_TABLE: []
FITBIT_SENSORS: []
PIDS: [p01]
DAY_SEGMENTS: &day_segments
[daily, night]
TIMEZONE: &timezone
America/New_York
DATABASE_GROUP: &database_group
MY_GROUP
For more information on the ``calls`` sensor see :ref:`call-sensor-doc`
2020-03-10 17:27:27 +01:00
#. Run the following command to execute RAPIDS
2020-03-09 22:07:51 +01:00
::
2020-05-15 01:43:58 +02:00
snakemake -j1
2020-03-09 22:07:51 +01:00
2020-03-10 17:27:27 +01:00
#. Daily and night call metrics will be found in files under the ``data/processed/p01/`` directory.
2020-03-09 22:07:51 +01:00