Open Hrovatin opened 2 years ago
Sounds reasonable. Could be like how add_labels
or add_dendrogram
works currently?
Maybe like add_totals
?
@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
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.
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 :)
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
i have an alternative function to co.heatmap in my snippets library which is capable of creating heatmaps using rectangle or circle patches with size and color aesthetics, but i havent added it to codaplot yet. You can always create circle patch heatmaps with standard scatterplots, but this has drawbacks when you want to be able to add spacers within the plot or when you want full control of the circle patch sizes (so that they fit perfectly within the row at maximum size). From what I understand such a patch based function would be helpful, right?
I would be happy to contribute some base functionality for this issue by adding improvements to codaplot, ie provide the circle patch heatmap function and a better complex heatmap function than the currently available co.cross_plot. I do plan on maintaining codaplot for the foreseeable future and have been using it for my own projects for quite a while now. At the moment it's a relatively small library (when you subtract the experimental modules) and could be quickly refactored into a single scanpy module if something happens and I find myself unable to maintain and expand the library over the next years.
Does using codaplot for this issue sound at all interesting to you?
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.
sc.tools
?sc.pl
?sc.external.*
?Add color annotation to dotplot, e.g. same as row_colors and col_colors in seaborn heatmap.