From f0d29d0d1a546abc74491e0b7cfbd8d0959f5027 Mon Sep 17 00:00:00 2001 From: junos Date: Wed, 1 Dec 2021 18:14:27 +0100 Subject: [PATCH] Incorporate DB query for usernames into snakemake workflow. --- config.yaml | 8 ++++---- environment.yml | 12 ++++++++---- rules/preprocessing.smk | 9 +++++++++ 3 files changed, 21 insertions(+), 8 deletions(-) diff --git a/config.yaml b/config.yaml index 37ceb31c..ccc7682b 100644 --- a/config.yaml +++ b/config.yaml @@ -7,16 +7,16 @@ PIDS: [nokia_0000003] # See https://www.rapids.science/latest/setup/configuration/#automatic-creation-of-participant-files CREATE_PARTICIPANT_FILES: - USERNAMES_CSV: "data/external/example_usernames.csv" - CSV_FILE_PATH: "data/external/example_participants.csv" # see docs for required format + USERNAMES_CSV: "data/external/main_study_usernames.csv" + CSV_FILE_PATH: "data/external/main_study_participants.csv" # see docs for required format PHONE_SECTION: ADD: True IGNORED_DEVICE_IDS: [] FITBIT_SECTION: - ADD: True + ADD: False IGNORED_DEVICE_IDS: [] EMPATICA_SECTION: - ADD: True + ADD: False IGNORED_DEVICE_IDS: [] # See https://www.rapids.science/latest/setup/configuration/#time-segments diff --git a/environment.yml b/environment.yml index 42f7a3ac..9aaeb5e4 100644 --- a/environment.yml +++ b/environment.yml @@ -1,4 +1,4 @@ -name: rapids202108 +name: rapids channels: - conda-forge - defaults @@ -13,8 +13,8 @@ dependencies: - blas=1.0 - brotlipy=0.7.0 - bzip2=1.0.8 - - ca-certificates=2021.7.5 - - certifi=2021.5.30 + - ca-certificates + - certifi - cffi=1.14.4 - chardet=3.0.4 - click=7.1.2 @@ -56,20 +56,23 @@ dependencies: - numpy=1.19.2 - numpy-base=1.19.2 - openblas=0.3.4 - - openssl=1.1.1k + - openssl - pandas=1.1.5 - pbr=5.5.1 - pip=20.3.3 - plotly=4.14.1 - poyo=0.5.0 - psutil=5.7.2 + - psycopg2 - py-xgboost=0.90 - pycparser=2.20 - pyerfa=1.7.1.1 - pyopenssl=20.0.1 + - pyprojroot - pysocks=1.7.1 - python=3.7.9 - python-dateutil=2.8.1 + - python-dotenv - python_abi=3.7 - pytz=2020.4 - pyyaml=5.3.1 @@ -82,6 +85,7 @@ dependencies: - six=1.15.0 - smmap=3.0.4 - smmap2=3.0.1 + - sqlalchemy - sqlite=3.33.0 - threadpoolctl=2.1.0 - tk=8.6.10 diff --git a/rules/preprocessing.smk b/rules/preprocessing.smk index ad162c70..40ccf5ee 100644 --- a/rules/preprocessing.smk +++ b/rules/preprocessing.smk @@ -4,6 +4,15 @@ rule create_example_participant_files: shell: "echo 'PHONE:\n DEVICE_IDS: [a748ee1a-1d0b-4ae9-9074-279a2b6ba524]\n PLATFORMS: [android]\n LABEL: test-01\n START_DATE: 2020-04-23 00:00:00\n END_DATE: 2020-05-04 23:59:59\nFITBIT:\n DEVICE_IDS: [a748ee1a-1d0b-4ae9-9074-279a2b6ba524]\n LABEL: test-01\n START_DATE: 2020-04-23 00:00:00\n END_DATE: 2020-05-04 23:59:59\n' >> ./data/external/participant_files/example01.yaml && echo 'PHONE:\n DEVICE_IDS: [13dbc8a3-dae3-4834-823a-4bc96a7d459d]\n PLATFORMS: [ios]\n LABEL: test-02\n START_DATE: 2020-04-23 00:00:00\n END_DATE: 2020-05-04 23:59:59\nFITBIT:\n DEVICE_IDS: [13dbc8a3-dae3-4834-823a-4bc96a7d459d]\n LABEL: test-02\n START_DATE: 2020-04-23 00:00:00\n END_DATE: 2020-05-04 23:59:59\n' >> ./data/external/participant_files/example02.yaml" +rule query_device_empatica_ids: + params: + baseline_folder = "/mnt/e/STRAWbaseline/" + output: + usernames_file = config["CREATE_PARTICIPANT_FILES"]["USERNAMES_CSV"], + timezone_file = "data/external/timezone.csv" + script: + "../../participants/prepare_usernames_file.py" + rule prepare_participants_csv: input: username_list = config["CREATE_PARTICIPANT_FILES"]["USERNAMES_CSV"]