Delete mystudy.snakefile and add all rules to models.snakefile
parent
8d71329e0e
commit
21c3251066
|
@ -4,7 +4,6 @@ include: "rules/preprocessing.snakefile"
|
||||||
include: "rules/features.snakefile"
|
include: "rules/features.snakefile"
|
||||||
include: "rules/models.snakefile"
|
include: "rules/models.snakefile"
|
||||||
include: "rules/reports.snakefile"
|
include: "rules/reports.snakefile"
|
||||||
include: "rules/mystudy.snakefile" # You can add snakfiles with rules tailored to your project
|
|
||||||
|
|
||||||
import itertools
|
import itertools
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,41 @@
|
||||||
ruleorder: nan_cells_ratio_of_cleaned_features > merge_features_and_targets
|
ruleorder: nan_cells_ratio_of_cleaned_features > merge_features_and_targets
|
||||||
|
|
||||||
|
rule days_to_analyse:
|
||||||
|
input:
|
||||||
|
participant_info = "data/raw/{pid}/" + config["PARAMS_FOR_ANALYSIS"]["GROUNDTRUTH_TABLE"] + "_raw.csv"
|
||||||
|
params:
|
||||||
|
days_before_surgery = "{days_before_surgery}",
|
||||||
|
days_in_hospital = "{days_in_hospital}",
|
||||||
|
days_after_discharge= "{days_after_discharge}"
|
||||||
|
output:
|
||||||
|
"data/interim/{pid}/days_to_analyse_{days_before_surgery}_{days_in_hospital}_{days_after_discharge}.csv"
|
||||||
|
script:
|
||||||
|
"../src/models/select_days_to_analyse.py"
|
||||||
|
|
||||||
|
rule targets:
|
||||||
|
input:
|
||||||
|
participant_info = "data/raw/{pid}/" + config["PARAMS_FOR_ANALYSIS"]["GROUNDTRUTH_TABLE"] + "_raw.csv"
|
||||||
|
params:
|
||||||
|
pid = "{pid}",
|
||||||
|
summarised = "{summarised}",
|
||||||
|
targets_ratio_threshold = config["PARAMS_FOR_ANALYSIS"]["TARGETS_RATIO_THRESHOLD"],
|
||||||
|
targets_value_threshold = config["PARAMS_FOR_ANALYSIS"]["TARGETS_VALUE_THRESHOLD"]
|
||||||
|
output:
|
||||||
|
"data/processed/{pid}/targets_{summarised}.csv"
|
||||||
|
script:
|
||||||
|
"../src/models/targets.py"
|
||||||
|
|
||||||
|
rule demographic_features:
|
||||||
|
input:
|
||||||
|
participant_info = "data/raw/{pid}/" + config["PARAMS_FOR_ANALYSIS"]["GROUNDTRUTH_TABLE"] + "_raw.csv"
|
||||||
|
params:
|
||||||
|
pid = "{pid}",
|
||||||
|
features = config["PARAMS_FOR_ANALYSIS"]["DEMOGRAPHIC_FEATURES"]
|
||||||
|
output:
|
||||||
|
"data/processed/{pid}/demographic_features.csv"
|
||||||
|
script:
|
||||||
|
"../src/features/demographic_features.py"
|
||||||
|
|
||||||
def input_merge_features_of_single_participant(wildcards):
|
def input_merge_features_of_single_participant(wildcards):
|
||||||
if wildcards.source == "phone_fitbit_features":
|
if wildcards.source == "phone_fitbit_features":
|
||||||
return expand("data/processed/{pid}/{features}_{day_segment}.csv", pid=wildcards.pid, features=config["PARAMS_FOR_ANALYSIS"]["PHONE_FEATURES"] + config["PARAMS_FOR_ANALYSIS"]["FITBIT_FEATURES"], day_segment=wildcards.day_segment)
|
return expand("data/processed/{pid}/{features}_{day_segment}.csv", pid=wildcards.pid, features=config["PARAMS_FOR_ANALYSIS"]["PHONE_FEATURES"] + config["PARAMS_FOR_ANALYSIS"]["FITBIT_FEATURES"], day_segment=wildcards.day_segment)
|
||||||
|
|
|
@ -1,35 +0,0 @@
|
||||||
rule days_to_analyse:
|
|
||||||
input:
|
|
||||||
participant_info = "data/raw/{pid}/" + config["PARAMS_FOR_ANALYSIS"]["GROUNDTRUTH_TABLE"] + "_raw.csv"
|
|
||||||
params:
|
|
||||||
days_before_surgery = "{days_before_surgery}",
|
|
||||||
days_in_hospital = "{days_in_hospital}",
|
|
||||||
days_after_discharge= "{days_after_discharge}"
|
|
||||||
output:
|
|
||||||
"data/interim/{pid}/days_to_analyse_{days_before_surgery}_{days_in_hospital}_{days_after_discharge}.csv"
|
|
||||||
script:
|
|
||||||
"../src/models/select_days_to_analyse.py"
|
|
||||||
|
|
||||||
rule targets:
|
|
||||||
input:
|
|
||||||
participant_info = "data/raw/{pid}/" + config["PARAMS_FOR_ANALYSIS"]["GROUNDTRUTH_TABLE"] + "_raw.csv"
|
|
||||||
params:
|
|
||||||
pid = "{pid}",
|
|
||||||
summarised = "{summarised}",
|
|
||||||
targets_ratio_threshold = config["PARAMS_FOR_ANALYSIS"]["TARGETS_RATIO_THRESHOLD"],
|
|
||||||
targets_value_threshold = config["PARAMS_FOR_ANALYSIS"]["TARGETS_VALUE_THRESHOLD"]
|
|
||||||
output:
|
|
||||||
"data/processed/{pid}/targets_{summarised}.csv"
|
|
||||||
script:
|
|
||||||
"../src/models/targets.py"
|
|
||||||
|
|
||||||
rule demographic_features:
|
|
||||||
input:
|
|
||||||
participant_info = "data/raw/{pid}/" + config["PARAMS_FOR_ANALYSIS"]["GROUNDTRUTH_TABLE"] + "_raw.csv"
|
|
||||||
params:
|
|
||||||
pid = "{pid}",
|
|
||||||
features = config["PARAMS_FOR_ANALYSIS"]["DEMOGRAPHIC_FEATURES"]
|
|
||||||
output:
|
|
||||||
"data/processed/{pid}/demographic_features.csv"
|
|
||||||
script:
|
|
||||||
"../src/features/demographic_features.py"
|
|
Loading…
Reference in New Issue