Skip to content

Commit

Permalink
Merge pull request #49 from yangchen2/master
Browse files Browse the repository at this point in the history
PR to address issues #48, #50, and #51
  • Loading branch information
AmandaBirmingham authored Nov 16, 2023
2 parents d2c8827 + 2aaff90 commit b7da617
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
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.
4 changes: 2 additions & 2 deletions qadabra/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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!")
Expand Down Expand Up @@ -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.)")
logger.info("(Optional tree file not provided. Skipping tree validation.)")
6 changes: 3 additions & 3 deletions qadabra/workflow/rules/common.smk
Original file line number Diff line number Diff line change
Expand Up @@ -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"] = []
Expand All @@ -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
Expand Down Expand Up @@ -126,4 +126,4 @@ for dataset in datasets.iterrows():
dataset=names,
out=["empress"]
)
all_input = all_input + empress_output
all_input = all_input + empress_output

0 comments on commit b7da617

Please sign in to comment.