Skip to content

Commit

Permalink
fix size error in plot_da_beeswarm (#551)
Browse files Browse the repository at this point in the history
Co-authored-by: EC2 Default User <ec2-user@ip-172-31-19-17.eu-west-2.compute.internal>
  • Loading branch information
emdann and EC2 Default User authored Mar 6, 2024
1 parent 44af066 commit b51a2c9
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
2 changes: 1 addition & 1 deletion pertpy/plot/_milopy.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ def da_beeswarm(
Args:
mdata: MuData object
anno_col: Column in adata.uns['nhood_adata'].obs to use as annotation. (default: 'nhood_annotation'.)
anno_col: Column in mdata['milo'].var to use as annotation. (default: 'nhood_annotation'.)
alpha: Significance threshold. (default: 0.1)
subset_nhoods: List of nhoods to plot. If None, plot all nhoods. (default: None)
palette: Name of Seaborn color palette for violinplots.
Expand Down
4 changes: 1 addition & 3 deletions pertpy/tools/_milo.py
Original file line number Diff line number Diff line change
Expand Up @@ -861,7 +861,7 @@ def plot_da_beeswarm(
nhood_adata.obs[anno_col]
except KeyError:
raise RuntimeError(
f"Unable to find {anno_col} in mdata.uns['nhood_adata']. Run 'milopy.utils.annotate_nhoods(adata, anno_col)' first"
f"Unable to find {anno_col} in mdata['milo'].var. Run 'milopy.utils.annotate_nhoods(adata, anno_col)' first"
) from None

if subset_nhoods is not None:
Expand Down Expand Up @@ -897,7 +897,6 @@ def plot_da_beeswarm(
y=anno_col,
x="logFC",
order=sorted_annos,
size=190,
inner=None,
orient="h",
palette=palette,
Expand All @@ -910,7 +909,6 @@ def plot_da_beeswarm(
y=anno_col,
x="logFC",
order=sorted_annos,
size=190,
inner=None,
orient="h",
linewidth=0,
Expand Down

0 comments on commit b51a2c9

Please sign in to comment.