Skip to content

cluster cells within groups when plotting with scanpy.pl.heatmap() #3129

Description

@zsfrbkv

What kind of feature would you like to request?

Additional function parameters / changed functionality / changed defaults?

Please describe your wishes

I find the function scanpy.pl.heatmap() useful to see how a gene is expressed in single cells within each group specified. I think the clustering of groups is helpful as well. However, I find this function lacking one crucial functionality which is additional clustering of cells within a group.

In case of grouping per cell types it might not be that important, but imagine one was to group by samples and plot some pathway gene expression. Then it would be very helpful to be able to see clusters of cells within each group (e.g. sample) expressing some pathways and not expressing the others. Right now seeing patterns is much harder since the cells are not clustered by their expression signatures.

I suppose this would require running dendrogram twice -- one time for groups and one time for cells within each group. Not sure how to implement a way around this with the current function implementation without rewriting the internal code for _reorder_categories_after_dendrogram().

Activity

  1. added
    Triage 🩺
    on Jun 28, 2024
  2. JakeLehle commented on Oct 9, 2024

    @JakeLehle

    I like this suggestion and would also really like to see this improvement made for my own analysis.

  3. added and removed
    Triage 🩺
    on Dec 16, 2024
  4. added this to the 1.11.0 milestone on Dec 16, 2024
  5. flying-sheep commented on Dec 16, 2024

    @flying-sheep
    Member

    I think this is a great suggestion!

  6. modified the milestones: 1.11.0, 1.12.0 on Dec 20, 2024
  7. modified the milestones: 1.12.0, 1.13.0 on Nov 10, 2025
  8. modified the milestones: 1.13.0, 1.14.0 on Nov 13, 2026
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

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions