From 28bfa7345afe8f69b3a146eb36f18995c5af778d Mon Sep 17 00:00:00 2001 From: Yang Chen <60239063+yangchen2@users.noreply.github.com> Date: Sun, 5 Nov 2023 18:14:04 -0800 Subject: [PATCH] Confounders not accepted as string, issue #51 --- qadabra/workflow/rules/common.smk | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/qadabra/workflow/rules/common.smk b/qadabra/workflow/rules/common.smk index 46643b9..40a6d8f 100644 --- a/qadabra/workflow/rules/common.smk +++ b/qadabra/workflow/rules/common.smk @@ -8,7 +8,7 @@ names = datasets.index def get_dataset_cfg(wildcards, keys): d = datasets.loc[wildcards.dataset, keys].to_dict() if "confounders" in keys: - if not np.isnan(d["confounders"]): + if not np.isnull(d["confounders"]): d["confounders"] = d["confounders"].split(";") else: d["confounders"] = [] @@ -20,7 +20,7 @@ def get_songbird_formula(wildcards): covariate = d["factor_name"] reference = d["reference_level"] formula = f"C({covariate}, Treatment('{reference}'))" - if not np.isnan(d["confounders"]): + if not np.isnull(d["confounders"]): confounders = d["confounders"].split(";") formula = f"{formula} + {' + '.join(confounders)}" return formula @@ -126,4 +126,4 @@ for dataset in datasets.iterrows(): dataset=names, out=["empress"] ) - all_input = all_input + empress_output \ No newline at end of file + all_input = all_input + empress_output