Quite often I need to color UMAPs based on features that are not part of adata.X but adata.obsm for the reason that they are special. E.g. KO data with gRNAs versus endogenes/ target genes, or viral genes versus edogenes.
Example use case:
- Cluster cells based on endogenes
- UMAP and color by a bunch of viral genes
Clustering must not include these viral genes -> must be excluded from X.
I don't want to store so many additional columns in obs and I need to have these features separated in their own matrix for downstream analysis, which is why I want to use obsm.
Can we have sth. like this:
sc.pl.umap(adata, color='viral_genes') # adata.obsm['viral_genes'] is a pandas.DataFrame ?
It shouldn't be overcomplicated I think, since this only involves an additional check: if the elements in the color arg list are not found in obs.columns nor var.columns, then check the keys in obsm and use the entire dataframe behind this key.
sc.tools?sc.pl?sc.external.*?Quite often I need to color UMAPs based on features that are not part of
adata.Xbutadata.obsmfor the reason that they are special. E.g. KO data with gRNAs versus endogenes/ target genes, or viral genes versus edogenes.Example use case:
Clustering must not include these viral genes -> must be excluded from
X.I don't want to store so many additional columns in
obsand I need to have these features separated in their own matrix for downstream analysis, which is why I want to useobsm.Can we have sth. like this:
It shouldn't be overcomplicated I think, since this only involves an additional check: if the elements in the color arg list are not found in
obs.columnsnorvar.columns, then check the keys inobsmand use the entire dataframe behind this key.