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

Support obsm key to color UMAP #1500

Open
1 of 5 tasks
picciama opened this issue Nov 18, 2020 · 1 comment
Open
1 of 5 tasks

Support obsm key to color UMAP #1500

picciama opened this issue Nov 18, 2020 · 1 comment

Comments

@picciama
Copy link

picciama commented Nov 18, 2020

  • Additional function parameters / changed functionality / changed defaults?
  • New analysis tool: A simple analysis tool you have been using and are missing in sc.tools?
  • New plotting function: A kind of plot you would like to seein sc.pl?
  • External tools: Do you know an existing package that should go into sc.external.*?
  • Other?

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.

@ivirshup
Copy link
Member

This has been worked on here: scverse/anndata#342

The idea is to allow any vector from the anndata object to be used for coloring, but that PR seems a bit stalled at the moment. This would also be useful for providing parameters in other places, like regress_out.

@ivirshup ivirshup added this to the 1.8.0 milestone Feb 10, 2021
@ivirshup ivirshup modified the milestones: 1.8.0, 1.9.0 May 26, 2021
@ivirshup ivirshup modified the milestones: 1.9.0, 1.10.0 Mar 21, 2022
@ivirshup ivirshup modified the milestones: 1.10.0, 1.11.0 Feb 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants