scverse / scanpy

Single-cell analysis in Python. Scales to >1M cells.
https://scanpy.readthedocs.io
BSD 3-Clause "New" or "Revised" License
1.87k stars 595 forks source link

Dotplot color annotation #2194

Open Hrovatin opened 2 years ago

Hrovatin commented 2 years ago

Add color annotation to dotplot, e.g. same as row_colors and col_colors in seaborn heatmap.

ivirshup commented 2 years ago

Sounds reasonable. Could be like how add_labels or add_dendrogram works currently?

Hrovatin commented 2 years ago

Maybe like add_totals?

Hrovatin commented 2 years ago

@ivirshup Do you have an idea how this could be implemented - I am not even sure about the fig structure of the current dotplot and had problems finding the right plotting function

ivirshup commented 2 years ago

I think these plots are well overdue for a refactor.

It would make sense to me if the kind of marginal plots were abstracted out into their own classes. Maybe like MarginalBar, MarginalDendrogram, MarginalLabels.

But if you have any thoughts about how you think it could be done, or want to talk it over I'd be happy to do that.

stephenkraemer commented 2 years ago

I just saw on zulip that some of the functions in codaplot could be helpful here, sorry for the late reply. I'll post some more details on what is available in the package here tomorrow :)

stephenkraemer commented 2 years ago

From what I can gather, one goal here is to refactor the dotplot function and give it a complex heatmap layout, with a central heatmap using circle patches with a color and size aesthetic (= the dotplot) and one or more annotation heatmaps for rows and columns, which could be categorical or quantitative each.

Potentially relevant features in codaplot are

Does using codaplot for this issue sound at all interesting to you?

Hrovatin commented 2 years ago

For me sounds interesting, especially if you add circle pathes. But I guess @ivirshup should say if this should be added as scanpy dependency potentially.