You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I think we should introduce a standardized “mask” argument to scanpy functions. This would be a boolean array (or reference to a boolean array in obs/ var) which masks out certain data entries.
This can be thought of as a generalization of how highly variable genes is handled. As an example:
One of the big advantages of making this more widespread is that tasks which previously required using .raw or creating new anndata objects will be much easier
Some uses for this change:
Plotting
A big one is plotting. Right now if you want to show gene expression for a subset of cells, you have to manually work with the Matplotlib Axes:
ax=sc.pl.umap(pbmc, show=False)
sc.pl.umap(
pbmc[pbmc.obs["louvain"].isin(['CD4 T cells', 'B cells', 'CD8 T cells',])],
color="LDHB",
ax=ax,
)
If a user could provide a mask, this could be reduced, and would make plotting more than one value possible:
I think we should introduce a standardized “mask” argument to scanpy functions. This would be a boolean array (or reference to a boolean array in
obs
/var
) which masks out certain data entries.This can be thought of as a generalization of how highly variable genes is handled. As an example:
Would be equivalent to:
One of the big advantages of making this more widespread is that tasks which previously required using
.raw
or creating new anndata objects will be much easierSome uses for this change:
Plotting
A big one is plotting. Right now if you want to show gene expression for a subset of cells, you have to manually work with the Matplotlib Axes:
If a user could provide a mask, this could be reduced, and would make plotting more than one value possible:
Other uses
This has come up before in a few contexts:
Implementation
I think this could fit quite well into the
sc.get
getter/ validation functions (#828 (comment)).The text was updated successfully, but these errors were encountered: