Clustered_DotPlot Plotting Meta Data when split.by
samuel-marsh opened this issue · 1 comments
@mmandanas tagging you here following up on discussion in #44. Will post updates here when I have them
After some more reflection I'm actually not going to to add ability to plot meta data via Clustered_DotPlot
because I think it creates issues because of nature of plotting scaled values.
To explain further, first let's say you were plotting %mito counts. Having the z-score of %mito counts isn't really informative. Maybe it shows that one group or cluster is higher than the other but the scaling and rendering in the plot exaggerates those differences.
For module scores the issue could actually be worse. This is because you could have module score that isn't actually showing enrichment at all but when plotted as scaled data the range of scores would give the deceptive appearance of being enriched.
To explain further this is something that I dealt with in my publication 2022 (PDF here. How do we determine if a cell displays an enriched score. The solution we used in that paper was to:
- Create 1000 random gene lists of same length as gene list of interest
- Module score all of those gene lists
- Then for each of those thousand scores calculate outlier threshold (median + 3x MAD)
- Then find the top 2.5% quantile of those outlier scores and set that as cutoff.
- Any cell above cutoff was determined to be enriched and any cell below was not enriched.
So if there is scenario where no cells displays an actual enrichment of a score the plot would still show differences between groups that distort the results.
In the end my goal for this package is to provide users with intuitive functions and visualizations and I think plotting metadata in the dotplot actually breaks that because your intuition about what a meta data variable plot means would be incorrect.
For those variables I think traditional barplots or violin plots provide a better visualization.
If you disagree I'm happy to discuss more but that's where I have landed currently on this.
Thanks again!
Sam