From 685ed6a546149ee6fdef37cfd2359ca4b92dddcf Mon Sep 17 00:00:00 2001 From: junos Date: Fri, 4 Feb 2022 17:37:00 +0100 Subject: [PATCH] Set up demographic data download. --- Snakefile | 1 + config.yaml | 14 ++++++++++++++ rules/models.smk | 9 +++++++++ src/data/download_demographic_data.py | 0 4 files changed, 24 insertions(+) create mode 100644 rules/models.smk create mode 100644 src/data/download_demographic_data.py diff --git a/Snakefile b/Snakefile index 7dc5ad3a..a42f8b6d 100644 --- a/Snakefile +++ b/Snakefile @@ -5,6 +5,7 @@ include: "rules/common.smk" include: "rules/renv.smk" include: "rules/preprocessing.smk" include: "rules/features.smk" +include: "rules/models.smk" include: "rules/reports.smk" import itertools diff --git a/config.yaml b/config.yaml index 2817cba9..169ed5be 100644 --- a/config.yaml +++ b/config.yaml @@ -622,3 +622,17 @@ ALL_CLEANING_OVERALL: MIN_OVERLAP_FOR_CORR_THRESHOLD: 0.5 CORR_THRESHOLD: 0.95 SRC_SCRIPT: src/features/all_cleaning_overall/rapids/main.R + +######################################################################################################################## +# Analysis Workflow Example # +######################################################################################################################## + +PARAMS_FOR_ANALYSIS: + DEMOGRAPHIC: + FOLDER: E:/STRAWbaseline + CONTAINER: [results-survey637813_final.csv, # Slovenia + results-survey358134_final.csv, # Belgium 1 + results-survey413767_final.csv # Belgium 2 + ] + FEATURES: [age, gender] + CATEGORICAL_FEATURES: [gender] diff --git a/rules/models.smk b/rules/models.smk new file mode 100644 index 00000000..51212c0b --- /dev/null +++ b/rules/models.smk @@ -0,0 +1,9 @@ +rule download_demographic_data: + input: + participant_file = "data/external/participant_files/{pid}.yaml", + data = config["PARAMS_FOR_ANALYSIS"]["DEMOGRAPHIC"]["FOLDER"] + "/" + config["PARAMS_FOR_ANALYSIS"]["DEMOGRAPHIC"]["CONTAINER"] + output: + "data/raw/{pid}/participant_baseline_raw.csv" + script: + "../src/data/download_demographic_data.py" + diff --git a/src/data/download_demographic_data.py b/src/data/download_demographic_data.py new file mode 100644 index 00000000..e69de29b