Closed jdeu1023 closed 1 year ago
Looks good! A few small points.
threshold=NULL
, groups="drop_last"
, etc?set.seed
?scales = "free"
in the call to facet_wrap
, as gRNAs can vary considerably with respect to their maximum count.I've addressed your first two points but the 3rd will take a little longer, since using scales = "free_x"
causes it to drop empty levels in each facet which looks bad/confusing, so I need to make it so that it keeps empty levels that are below the max per facet but only drops the empty levels that are after the max for each facet. As an example, here's what happens if I just do scales = "free_x"
with no other changes
Honestly I think I like not using "free_x", since then to me at least they're more directly comparable. Plus with the exponential scale even if they're fairly different it won't ever be that many empty bars in the tail. But if you strongly disagree I'm happy to make this happen!
But maybe the middle ground of keeping the empty interior bars and just not plotting the empty tail ones will be best.
I see. I did not realize that scales = "free"
had this behavior for barplots.
I do think that it would be ideal if we had free scales, as the purpose of this plot is to guide the gRNA-to-cell assignment step, which is done on a per-gRNA basis. Comparisons across gRNAs are not as relevant as comparisons across cells within a given gRNA.
However, in the interest of time, perhaps we can settle on just using scales = "free_y"
. Does this seem reasonable?
@timothy-barry Is this more what you had in mind? These are now totally independent plots put into a grid via cowplot
.
If you like this I'll try to clean up the x and y axis labels so they aren't repeated every time.
Yes, this looks great. Let's do it.
Hi @timothy-barry I've spent way too long on this so hopefully this works! I was trying to get a single x and y axis label but without using extra packages and still keeping it a ggplot object that proved really hard (eg I could do it using some functions from grid
and gridExtra
but then the returned object isn't a ggplot
anymore; furthermore, on Stack Overflow I found some comments by the author of cowplot
regarding that he thinks every axis should be labeled so this kind of thing is deliberately not something he had in mind with cowplot
). The challenge was getting the axis text to stay where I want it for any resizing / plotting window pane size. That's what led me to settling on this, where I'm just keeping the outer edge ones. I hope this works! If this isn't what you had in mind I think I'll need to move on to other things for the next couple days but I can come back to it later.
This is an example where it's deliberately crowded just to show how it looks then, since this is the harder case to get right.
This looks good to me. Nice work!
Default example:
threshold=12 example: