Skip to content

pl.umap/tsne/draw_graph colored by principal component or diffusion component #613

Description

@LisaSikkema

Dear scanpy developers,

I would like to color my tsnes, umaps and graph layouts by specific principal components or diffusion components. Any chance you could add an option to use columns from obsm objects as colors for these plots? (Or maybe that's already possible and I missed it...?)
Thanks for your help.

Best,
Lisa

Activity

  1. LuckyMD commented on Apr 18, 2019

    @LuckyMD
    Contributor

    Hi Lisa,
    I reckon this is a sensible request for cases when you give PCs or DCs a biological interpretation. It shouldn't be hard to implement I guess. But @fidelram will have a better overview of this.

    A temporary workaround would be to do the following:

    adata.obs['pc1'] = adata.obsm['X_pca'][:,0]
    sc.pl.umap(adata, color='pc1')
    
  2. gokceneraslan commented on Apr 19, 2019

    @gokceneraslan
    Contributor

    I think it'll be very cool to make this lookup dynamic somehow e.g. sc.pl.umap(adata, color='X_PCA:1').

  3. ivirshup commented on Apr 23, 2019

    @ivirshup
    Member

    @gokceneraslan, how about a tuple like ({obsm_key}, {obsm_value_column})? It's more verbose, but I think more flexible, particularly if obsm starts to allow more kinds of values.

    Here's an example (using some stuff on personal branches):

    image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions