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. 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.)") diff --git a/qadabra/workflow/rules/common.smk b/qadabra/workflow/rules/common.smk index 46643b9..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.isnan(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.isnan(d["confounders"]): + if not pd.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