From c70bbff607ec4777e93806c483f42109e6debbff Mon Sep 17 00:00:00 2001 From: Yang Chen <60239063+yangchen2@users.noreply.github.com> Date: Sun, 22 Oct 2023 13:26:46 -0700 Subject: [PATCH 1/4] update MIT license to BSD-3 license --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index b21f048..456e061 100644 --- a/README.md +++ b/README.md @@ -103,4 +103,4 @@ See the [tutorial](tutorial.md) page for a walkthroughon using Qadabra workflow Coming soon: An [FAQs](FAQs.md) page of commonly asked question on the statistics and code pertaining to Qadabra. ## Citation -The manuscript for Qadabra is currently in progress. Please cite this GitHub page if Qadabra is used for your analysis. This project is licensed under the MIT License. See the [license](LICENSE) file for details. \ No newline at end of file +The manuscript for Qadabra is currently in progress. Please cite this GitHub page if Qadabra is used for your analysis. This project is licensed under the BSD-3 License. See the [license](LICENSE) file for details. From c09d96f750508b7b9ebbfac811bd10377b099e5a Mon Sep 17 00:00:00 2001 From: Yang Chen <60239063+yangchen2@users.noreply.github.com> Date: Sun, 5 Nov 2023 18:05:58 -0800 Subject: [PATCH 2/4] Metadata with all numerical SampleIDs not accepted, issue #50 --- qadabra/utils.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/qadabra/utils.py b/qadabra/utils.py index 9b0c816..ae7104d 100644 --- a/qadabra/utils.py +++ b/qadabra/utils.py @@ -17,7 +17,7 @@ def _validate_input( confounders: List[str] = None, ): logger.info("Loading metadata...") - md = pd.read_table(metadata, sep="\t", index_col=0) + md = pd.read_table(metadata, sep="\t", index_col=0, dtype={0:'str'}) if factor_name not in md.columns: raise ValueError(f"{factor_name} not found in metadata!") @@ -69,4 +69,4 @@ def _validate_input( raise ValueError("Tree tips are not a subset of table features!") else: logger.info("Reading phylogenetic tree...") - logger.info("(Optional tree file not provided. Skipping tree validation.)") \ No newline at end of file + logger.info("(Optional tree file not provided. Skipping tree validation.)") 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 3/4] 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 From 2aaff90054677e5f9b86123de77e91fe8519ea5f Mon Sep 17 00:00:00 2001 From: Yang Chen <60239063+yangchen2@users.noreply.github.com> Date: Sun, 5 Nov 2023 18:22:44 -0800 Subject: [PATCH 4/4] last commit should be pd.null not np.null --- qadabra/workflow/rules/common.smk | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/qadabra/workflow/rules/common.smk b/qadabra/workflow/rules/common.smk index 40a6d8f..c3298d1 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.isnull(d["confounders"]): + if not pd.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.isnull(d["confounders"]): + if not pd.isnull(d["confounders"]): confounders = d["confounders"].split(";") formula = f"{formula} + {' + '.join(confounders)}" return formula