You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@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
co.cross_plot is one high level possibility to construct complex heatmaps with the 'central data heatmap + annotation heatmaps' layout. Among other things, it can automatically cluster columns or rows based on the central data heatmap and apply the clustering to the annotation heatmaps. It can also plot dendrograms. This is an experimental function with some quirks, I did want to improve the concept soon-ish.
co.heatmap is the base heatmap plotting function in codaplot. It provides a simple way to plot categorical heatmaps and add spacers within heatmaps. Both tasks are not trivial with matplotlib base plot functions. This would be helpful for adding categorical annotation heatmaps, even if you don't want to use co.cross_plot as it is right now.
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.
Activity
ivirshup commentedon Mar 29, 2022
Sounds reasonable. Could be like how
add_labelsoradd_dendrogramworks currently?Hrovatin commentedon Mar 29, 2022
Maybe like
add_totals?Hrovatin commentedon Apr 1, 2022
@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 commentedon Apr 5, 2022
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 commentedon Jun 1, 2022
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 commentedon Jun 2, 2022
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
co.cross_plot is one high level possibility to construct complex heatmaps with the 'central data heatmap + annotation heatmaps' layout. Among other things, it can automatically cluster columns or rows based on the central data heatmap and apply the clustering to the annotation heatmaps. It can also plot dendrograms. This is an experimental function with some quirks, I did want to improve the concept soon-ish.
co.heatmap is the base heatmap plotting function in codaplot. It provides a simple way to plot categorical heatmaps and add spacers within heatmaps. Both tasks are not trivial with matplotlib base plot functions. This would be helpful for adding categorical annotation heatmaps, even if you don't want to use co.cross_plot as it is right now.
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?
Hrovatin commentedon Jun 2, 2022
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.