Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PR to address issues #48, #50, and #51 #49

Merged
merged 4 commits into from
Nov 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading