ncborcherding / escape

Easy single cell analysis platform for enrichment
https://www.borch.dev/uploads/screpertoire/articles/running_escape
MIT License
143 stars 20 forks source link

splitEnrichment with >2 levels #96

Open jeremymsimon opened 5 months ago

jeremymsimon commented 5 months ago

Hey @ncborcherding - I have a dataset where there are 3 sample groupings that I'd like to compare. Is it possible to implement something in splitEnrichment that allows for >2 factor levels? It seems to try to plot it, but it is a bit hard to see and it throws a warning. I can use geyserEnrichment instead but it's harder to compare visually across facets. Thanks!

ncborcherding commented 5 months ago

Hey Jeremy,

What would you envision for split across > 2 variables - I am open to trying it out.

In the meantime, I think adding a stop argument for >2 probably makes sense.

Thanks, Nick

jeremymsimon commented 5 months ago

Agree that a true "split" can only make sense with 2, but does this or another plotting function allow for multiple grouping variables? In other words, if my x here were cluster/ident, but I had three sample groups and thus 3 violins per x, I'd be happy with that- sort of like the end result of:

ggplot(mtcars, aes(factor(gear), mpg)) + geom_violin(aes(fill = factor(carb)))
ncborcherding commented 5 months ago

Let me play around with it - I am working on a commit as we speak for escape, I'll tag this issue.