DavisLaboratory / standR

Spatial transcriptomics analyses and decoding in R
https://davislaboratory.github.io/standR/
Other
18 stars 4 forks source link

Add StatStratum import from ggalluvial and move ggalluvial to imports #2

Closed kieranrcampbell closed 2 years ago

kieranrcampbell commented 2 years ago

I was working through the standr tutorial and got an error on plotSampleInfo:

> plotSampleInfo(spe, column2plot = c("SlideName","SegmentLabel"))
Error in `check_subclass()`:
! Can't find `stat` called 'stratum'
Backtrace:
 1. standR::plotSampleInfo(spe, column2plot = c("SlideName", "SegmentLabel"))
 2. ggplot2::geom_text(stat = "stratum", size = textsize)
 3. ggplot2::layer(...)
 4. ggplot2:::check_subclass(stat, "Stat", env = parent.frame())

A quick google found this stackoverflow answer that suggested adding StatStratum <- ggalluvial::StatStratum. This worked when done in the code calling plotSampleInfo but not plotSampleInfo itself. However, explicitly importing StatStratum from ggalluvial in the package appears to work, which is what this pull request does.

ningbioinfo commented 2 years ago

Sorry for the late reply @kieranrcampbell , initially the ggalluvial package was put in the suggest list rather than the import list was because I didn't want to blow up the size of the import package. Hence we add the loading package code for ggalluvial specifically in the vignette. But we've noticed that lots of our collaborators also like that function and I'll definitely merge your pull request to make thins easier by the next release of the bioconductor (should be October this year).