Skip to content

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

@zsfrbkv

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().

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions