Giter VIP home page Giter VIP logo

ggrastr's Introduction

<VPetukhov> CRAN status CRAN downloads

ggrastr

Rasterize only specific layers of a ggplot2 plot (for instance, large scatter plots with many points) while keeping all labels and text in vector format. This allows users to keep plots within a reasonable size limit without losing the vector properties of scale-sensitive information.

Installation

To install the stable version from CRAN, use:

install.packages('ggrastr')

To install the latest version, use:

install.packages('devtools')
devtools::install_github('VPetukhov/ggrastr', build_vignettes = TRUE)

Rasterize any ggplot2 layer

Note that with ggrastr version 0.2.0, any ggplot2 geom provided by the user can be rasterized with the function rasterise(). Furthermore, when the aspect ratio is distorted, points are rendered without distortion.

For more details and examples, see the vignettes:

Geoms provided

We also provide wrappers for several geoms to guarantee compatibility with an older version of ggrastr. However, we encourage users to use the rasterise() function instead.

  • geom_point_rast: raster scatter plots
  • geom_jitter_rast: raster jittered scatter plots
  • geom_boxplot_jitter: boxplots that allows to jitter and rasterize outlier points
  • geom_tile_rast: raster heatmap
  • geom_beeswarm_rast: raster bee swarm plots
  • geom_quasirandom_rast: raster quasirandom scatter plot

Troubleshooting

If your R session crashes when you try to render a rasterized plot, it's probably the case that your version of Cairo was built for another version of R (see Upgrading to a new version of R). To check if you are using a proper version, run the command below and ensure that the "Built" version is the same as your R version.

pkgs <- as.data.frame(installed.packages(), stringsAsFactors = FALSE, row.names = FALSE)
pkgs[pkgs$Package == 'Cairo', c("Package", "LibPath", "Version", "Built")]

To ensure that Cairo works, try running Cairo::Cairo(type='raster'); dev.off() and check if it crashes your R session.

Citation

If you find ggrastr useful for your publication, please cite:

Viktor Petukhov, Teun van den Brand and Evan Biederstedt (2021).
ggrastr: Raster Layers for 'ggplot2'. R package version 1.0.2.
https://CRAN.R-project.org/package=ggrastr

ggrastr's People

Contributors

bjreisman avatar evanbiederstedt avatar jan-glx avatar jsta avatar kpjonsson avatar teunbrand avatar vpetukhov avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

ggrastr's Issues

Rasterise geom_sf layer

The vignette states that any ggplot2 layer can be rasterised using the function rasterise().

However, this does not seem to work for ggplot2::geom_sf() layers. A reproducible example is below:

library(sf)
library(maps)
world1 <- sf::st_as_sf(maps::map('world', plot = FALSE, fill = TRUE))
library(ggplot2)
ggplot2::ggplot() + ggplot2::geom_sf(data = world1)

image

library(ggrastr)
ggplot2::ggplot() + ggrastr::rasterise(ggplot2::geom_sf(data = world1))

Error: Cannot rasterise an object of class list. Must be either 'cairo', 'ragg', or 'ragg_png'.
2: stop("Cannot rasterise an object of class ", class(layer)[1], ". Must be either 'cairo', 'ragg', or 'ragg_png'.", call. = FALSE)
1: ggrastr::rasterise(ggplot2::geom_sf(data = world1))

Indeed, by design geom_sf returns a list:

lapply(ggplot2::geom_sf(data = world1),class)

[[1]]
[1] "LayerInstance" "LayerSf" "Layer" "ggproto" "gg"

[[2]]
[1] "CoordSf" "CoordCartesian" "Coord" "ggproto" "gg"

This seems to trip the check in rasterise:

  if (!inherits(layer, "Layer")) {
    stop("Cannot rasterise an object of class `", class(layer)[1], "`. Must be either 'cairo', 'ragg', or 'ragg_png'.", call. = FALSE)
  }

So:

  1. Can geom_sf layers be rasterised given that they contain a layer object (or is there a better way to rasterise such data)?
  2. Is this error message not a bit misleading since the check indicates that the object must be of class 'Layer', whereas the message seems to refer to the graphics device?

`rasterise` function for ggplot object

The current rasterise function needs to be applied for individual layers. And it requires using it on the plot construction stage. I just realized that it should be easy to add a function like rasterise.ggplot(gg, layers=c('Point', 'Tile')), which takes an existing plot and replaces all layers of types specified in layers with its rasterized versions. In this case, a user can call rasterise after the plot is created, so packages would not need to depend on ggrastr at all. For example, in sccore::embeddingPlot we could deprecate the rasterization parameters and users would just use con$plotGraph(...) %>% rasterize(dpi=150). There are four more packages that depend on ggrastr, and I think this functionality would save some effort for their developers, as well.

Not sure if the following implementation works in general case, but at least it does on a couple of examples:

rasterise.gg <- function(gg, layers=c('Point', 'Tile'), ...) {
  gg$layers <- lapply(gg$layers, function(lay) {
    if (length(intersect(class(lay$geom), paste0('Geom', layers))) > 0) rasterize(lay, ...) else lay
  })
  return(gg)
}

So we just need to specify that the current rasterise is rasterise.Layer.

officially but very softly deprecate` geom_xxx_rast`

In #21 (comment)_ @evanbiederstedt wrote:

Throwing a warning at this stage after several months feels a bit confusing/pedantic. I worry it will cause more confusion than necessary.

I agree that hard or even soft deprecation that throws a warning at top-level might cause more harm than good, but you could document it as deprecated (as opposed to the current labeling as equal alternative), I believe that would make the use of ggraster easier to learn and teach in the long run.

Upload to CRAN

I would like to include the ggrastr function to a visualisation package that I am working on. To import the method properly it would be very convenient if it is uploaded as package to CRAN.

Thank you,
Ricard.

Playing nice with facet_wrap

Large points are distorted when using facet_wrap, e.g.

N=100
data.frame(x=runif(N), y=runif(N), d=runif(N) %>%
             cut(seq(0,1,by=1/3))) %>% 
             ggplot(aes(x,y)) + geom_point_rast(size=10) + facet_wrap(~d)

gives
image

whereas using geom_point you get
image

File size of rasterized plots

Hello,

I have a plot where I'am plotting around 30,000 points using rasterize, and I also have some ggplot2 layers like an abline and axis titles, but the output PDF is 2.1MB. I feel this is kind of large (especially compared to the png file) and can atcually make things slow if I import it into an editor like inkscape. I wonder whether this is expected and if choosing different plot backend can actually help further reduce the size.

Thanks so much!

Installation from source fails with Cairo-related error

Hi,

First, thanks for your package!

Second, I ran into an error when I tried building from source.

What I did

I ran

devtools::install_github('VPetukhov/ggrastr', build_vignettes = TRUE)

Expected Behavior

Installing package from source with build_vignettes=TRUE option will successfully install the package.

Actual Behavior

The installation fails when processing Raster_geoms.Rmd.

What I saw

> devtools::install_github('VPetukhov/ggrastr', build_vignettes = TRUE)
Downloading GitHub repo VPetukhov/ggrastr@HEAD
✓  checking for file ‘/private/var/folders/nw/d2ffk2_96xn2c4v5l5z3l4r00000gn/T/RtmpX91hKw/remotes87d71a79e846/VPetukhov-ggrastr-1ef0ff5/DESCRIPTION’ ...
─  preparing ‘ggrastr’:
✓  checking DESCRIPTION meta-information ...
─  installing the package to build vignettes
E  creating vignettes (6.7s)
   --- re-building ‘Raster_geoms.Rmd’ using rmarkdown
   Quitting from lines 24-30 (Raster_geoms.Rmd) 
   Error: processing vignette 'Raster_geoms.Rmd' failed with diagnostics:
   .onLoad failed in loadNamespace() for 'Cairo', details:
     call: dyn.load(file, DLLpath = DLLpath, ...)
     error: unable to load shared object '/Library/Frameworks/R.framework/Versions/4.0/Resources/library/Cairo/libs/Cairo.so':
     dlopen(/Library/Frameworks/R.framework/Versions/4.0/Resources/library/Cairo/libs/Cairo.so, 6): Library not loaded: /opt/X11/lib/libXrender.1.dylib
     Referenced from: /Library/Frameworks/R.framework/Versions/4.0/Resources/library/Cairo/libs/Cairo.so
     Reason: image not found
   --- failed re-building ‘Raster_geoms.Rmd’
   
   SUMMARY: processing the following file failed:
     ‘Raster_geoms.Rmd’
   
   Error: Vignette re-building failed.
   Execution halted
Error: Failed to install 'ggrastr' from GitHub:
  System command 'R' failed, exit status: 1, stdout + stderr (last 10 lines):
E>   dlopen(/Library/Frameworks/R.framework/Versions/4.0/Resources/library/Cairo/libs/Cairo.so, 6): Library not loaded: /opt/X11/lib/libXrender.1.dylib
E>   Referenced from: /Library/Frameworks/R.framework/Versions/4.0/Resources/library/Cairo/libs/Cairo.so
E>   Reason: image not found
E> --- failed re-building ‘Raster_geoms.Rmd’
E> 
E> SUMMARY: processing the following file failed:
E>   ‘Raster_geoms.Rmd’
E> 
E> Error: Vignette re-building failed.
E> Execution halted

Additional session info

RStudio Version 1.4.1700

─ Session info ───────────────────────────────────────────────────────
 setting  value                       
 version  R version 4.0.3 (2020-10-10)
 os       macOS  11.2.2               
 system   x86_64, darwin17.0          
 ui       RStudio                     
 language (EN)                        
 collate  en_US.UTF-8                 
 ctype    en_US.UTF-8                 
 tz       America/New_York            
 date     2021-05-10                  

─ Packages ───────────────────────────────────────────────────────────
 package     * version date       lib source        
 cachem        1.0.4   2021-02-13 [1] CRAN (R 4.0.2)
 callr         3.7.0   2021-04-20 [1] CRAN (R 4.0.2)
 cli           2.5.0   2021-04-26 [1] CRAN (R 4.0.2)
 crayon        1.4.1   2021-02-08 [1] CRAN (R 4.0.2)
 curl          4.3.1   2021-04-30 [1] CRAN (R 4.0.2)
 desc          1.3.0   2021-03-05 [1] CRAN (R 4.0.2)
 devtools      2.4.1   2021-05-05 [1] CRAN (R 4.0.2)
 digest        0.6.27  2020-10-24 [1] CRAN (R 4.0.2)
 ellipsis      0.3.2   2021-04-29 [1] CRAN (R 4.0.2)
 evaluate      0.14    2019-05-28 [1] CRAN (R 4.0.1)
 fastmap       1.1.0   2021-01-25 [1] CRAN (R 4.0.2)
 fs            1.5.0   2020-07-31 [1] CRAN (R 4.0.2)
 glue          1.4.2   2020-08-27 [1] CRAN (R 4.0.2)
 htmltools     0.5.1.1 2021-01-22 [1] CRAN (R 4.0.2)
 knitr         1.33    2021-04-24 [1] CRAN (R 4.0.2)
 lifecycle     1.0.0   2021-02-15 [1] CRAN (R 4.0.2)
 magrittr      2.0.1   2020-11-17 [1] CRAN (R 4.0.2)
 memoise       2.0.0   2021-01-26 [1] CRAN (R 4.0.2)
 pkgbuild      1.2.0   2020-12-15 [1] CRAN (R 4.0.2)
 pkgload       1.2.1   2021-04-06 [1] CRAN (R 4.0.2)
 prettyunits   1.1.1   2020-01-24 [1] CRAN (R 4.0.2)
 processx      3.5.2   2021-04-30 [1] CRAN (R 4.0.2)
 ps            1.6.0   2021-02-28 [1] CRAN (R 4.0.2)
 purrr         0.3.4   2020-04-17 [1] CRAN (R 4.0.2)
 R6            2.5.0   2020-10-28 [1] CRAN (R 4.0.2)
 remotes       2.3.0   2021-04-01 [1] CRAN (R 4.0.2)
 rlang         0.4.11  2021-04-30 [1] CRAN (R 4.0.2)
 rmarkdown     2.7     2021-02-19 [1] CRAN (R 4.0.2)
 rprojroot     2.0.2   2020-11-15 [1] CRAN (R 4.0.2)
 rstudioapi    0.13    2020-11-12 [1] CRAN (R 4.0.2)
 sessioninfo   1.1.1   2018-11-05 [1] CRAN (R 4.0.2)
 testthat      3.0.2   2021-02-14 [1] CRAN (R 4.0.2)
 usethis       2.0.1   2021-02-10 [1] CRAN (R 4.0.2)
 withr         2.4.2   2021-04-18 [1] CRAN (R 4.0.2)
 xfun          0.22    2021-03-11 [1] CRAN (R 4.0.2)
 yaml          2.2.1   2020-02-01 [1] CRAN (R 4.0.2)

[1] /Library/Frameworks/R.framework/Versions/4.0/Resources/library

Unicode characters in rasterised layer

Hi!

Thanks for developing ggrastr, it's exactly what I was looking for. I noticed that some unicode characters are not rendered correctly after being rasterised. Here's a minimal example:

library(ggplot2)
library(ggrastr)

df = ggplot2::mpg
p = ggplot(df, aes(x=cty,y=hwy,shape=drv)) +
    geom_point(size=10) + 
    scale_shape_manual(values=c("\u25CF","\u25BA","\u25A0"))
p

Which produces the following plot as expected:
image

Whereas the following appears to change some unicode characters:

rasterise(p)

image

Any idea what might be causing that?

I understand that this issue might not be high priority. For now my workaround has been to embed the points encoded by unicode characters in a non-rasterised layer, but of course that only works if most of your points are rasterised as expected.

geom_segment_raster

Hello, I was wondering if there is a chance that you implement the geom_segment_rast function? I am a computational biologist doing single-cell genomics. Your package with the function geom_point_rast is very popular in the field as it is very helpful in visualizing single-cells at a UMAP/tSNE embedding. I recently realized that it will be very helpful to rasterize the geom_segment. See a demo below. This is why I initiate this issue. Many thanks.

  data("iris")
  head(iris)
  emb_a <- as_tibble(iris[, 1:2])
  emb_b <- as_tibble(iris[, 3:4])
  z <- iris[, 5]
  
  emb_a_x <- 'Sepal.Length' 
  emb_a_y <- 'Sepal.Width'
  emb_b_x <- 'Petal.Length'
  emb_b_y <- 'Petal.Width'
  spacing_h <- 0.3
  spacing_v <- 0
  emb_a <- emb_a %>% mutate(across(where(is.numeric), function(x) {scales::rescale(x, to=c(0.1, 1.1))} ))
  emb_b <- emb_b %>% mutate(across(where(is.numeric), function(x) {scales::rescale(x, to=c(0.1, 1.1))} ))
  if (spacing_h > 0) {
  emb_b[, emb_b_x] <- emb_b[, emb_b_x] + diff(range(emb_a[, emb_a_x])) + spacing_h
  }
  if (spacing_v > 0) {
  emb_b[, emb_b_y] <- emb_b[, emb_b_y] + diff(range(emb_a[, emb_a_y])) + spacing_v
  }
  
  df <- cbind(emb_a, emb_b, z)
  
  ggplot() +
    geom_point_rast(
      data=df, aes_string(x=emb_a_x, y=emb_a_y, color='z')) + 
    geom_point_rast(
      data=df, aes_string(x=emb_b_x, y=emb_b_y, color='z')) + 
    coord_equal() + 
    theme_void() +
    geom_rect(aes(xmin=min(emb_a[, emb_a_x])-0.1,
                  xmax=max(emb_a[, emb_a_x])+0.1,
                  ymin=min(emb_a[, emb_a_y])-0.1,
                  ymax=max(emb_a[, emb_a_y])+0.1), 
              fill=NA, color='black'
    ) +
    geom_rect(aes(xmin=min(emb_b[, emb_b_x])-0.1,
                  xmax=max(emb_b[, emb_b_x])+0.1,
                  ymin=min(emb_b[, emb_b_y])-0.1,
                  ymax=max(emb_b[, emb_b_y])+0.1), 
              fill=NA, color='black'
    ) +
    geom_segment(
      data = df, 
      aes_string(x=emb_a_x, y=emb_a_y,
                 xend=emb_b_x, yend=emb_b_y,
                 color='z'), alpha=0.5, lwd=0.1)
image

Error in `fortify()`

Hello,

Thank you for developing this awesome package:
I am currently using ggrastr_1.0.1. I encountered an error in fortify(); it would be great if you could help me. Thank you!

> p1 <- NucSeq %>%
+   ggplot(aes(x=UMAP_1, y=UMAP_2, color=Celltypes)) +
+   scale_color_manual(values= c("#f8766d", "#c49a00", "#53b400", "#00c094", "#00b6eb", "#a58aff", "#fb61d7")) + #, "#7CAE00", "#00C19A", "#00B8E7", "#8494FF", "#ED68ED"
+   rasterise(
+     geom_point(
+       [email protected],
+       aes(x=UMAP_1, y=UMAP_2), alpha=1, size=0.1 # color='lightgray',
+     ),
+     dpi = 600) +
+   umap_theme + ggtitle('UMAP colored by NucSeq Celltypes')

Error occurred:

Error in `fortify()`:
! `data` must be a <data.frame>, or an object coercible by `fortify()`, not a <Seurat> object.
Run `rlang::last_trace()` to see where the error occurred.

I run into this problem for some reason, but it was not a problem months ago using the same code.

Here is my sessionInfo();

> sessionInfo()
R version 4.2.2 (2022-10-31)
Platform: x86_64-conda-linux-gnu (64-bit)
Running under: Rocky Linux 8.7 (Green Obsidian)

Matrix products: default
BLAS/LAPACK: /dfs7/swaruplab/zechuas/tools_software/miniconda3/envs/scRNAnATAC_R/lib/libopenblasp-r0.3.21.so

locale:
 [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C
 [3] LC_TIME=en_US.UTF-8        LC_COLLATE=en_US.UTF-8
 [5] LC_MONETARY=en_US.UTF-8    LC_MESSAGES=en_US.UTF-8
 [7] LC_PAPER=en_US.UTF-8       LC_NAME=C
 [9] LC_ADDRESS=C               LC_TELEPHONE=C
[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base

other attached packages:
 [1] hdWGCNA_0.2.13     ggrastr_1.0.1      viridis_0.6.2      viridisLite_0.4.2
 [5] scCustomize_1.1.1  UCell_2.2.0        cowplot_1.1.1      Matrix_1.5-3
 [9] lubridate_1.9.2    forcats_1.0.0      stringr_1.5.0      dplyr_1.1.0
[13] purrr_1.0.1        readr_2.1.4        tidyr_1.3.0        tibble_3.2.1
[17] ggplot2_3.4.2      tidyverse_2.0.0    SeuratObject_4.1.3 Seurat_4.3.0

loaded via a namespace (and not attached):
  [1] utf8_1.2.3                  spatstat.explore_3.0-6
  [3] reticulate_1.28             tidyselect_1.2.0
  [5] RSQLite_2.3.0               AnnotationDbi_1.60.0
  [7] htmlwidgets_1.6.1           grid_4.2.2
  [9] BiocParallel_1.32.5         Rtsne_0.16
 [11] munsell_0.5.0               preprocessCore_1.60.2
 [13] codetools_0.2-19            ica_1.0-3
 [15] interp_1.1-3                future_1.31.0
 [17] miniUI_0.1.1.1              tester_0.1.7
 [19] withr_2.5.0                 spatstat.random_3.1-3
 [21] colorspace_2.1-0            progressr_0.13.0
 [23] Biobase_2.58.0              knitr_1.42
 [25] rstudioapi_0.14             stats4_4.2.2
 [27] SingleCellExperiment_1.20.0 ROCR_1.0-11
 [29] tensor_1.5                  listenv_0.9.0
 [31] labeling_0.4.2              MatrixGenerics_1.10.0
 [33] harmony_0.1.1               GenomeInfoDbData_1.2.9
 [35] polyclip_1.10-4             farver_2.1.1
 [37] bit64_4.0.5                 parallelly_1.34.0
 [39] vctrs_0.6.2                 generics_0.1.3
 [41] xfun_0.37                   timechange_0.2.0
 [43] fastcluster_1.2.3           R6_2.5.1
 [45] doParallel_1.0.17           GenomeInfoDb_1.34.9
 [47] ggbeeswarm_0.7.2            bitops_1.0-7
 [49] spatstat.utils_3.0-1        cachem_1.0.6
 [51] DelayedArray_0.24.0         promises_1.2.0.1
 [53] scales_1.2.1                nnet_7.3-18
 [55] beeswarm_0.4.0              gtable_0.3.3
 [57] globals_0.16.2              goftest_1.2-3
 [59] WGCNA_1.72-1                rlang_1.1.1
 [61] GlobalOptions_0.1.2         splines_4.2.2
 [63] lazyeval_0.2.2              impute_1.72.3
 [65] checkmate_2.1.0             spatstat.geom_3.0-6
 [67] reshape2_1.4.4              abind_1.4-5
 [69] backports_1.4.1             httpuv_1.6.9
 [71] Hmisc_4.8-0                 tools_4.2.2
 [73] ellipsis_0.3.2              RColorBrewer_1.1-3
 [75] BiocGenerics_0.44.0         dynamicTreeCut_1.63-1
 [77] ggridges_0.5.4              Rcpp_1.0.10
 [79] plyr_1.8.8                  base64enc_0.1-3
 [81] zlibbioc_1.44.0             RCurl_1.98-1.10
 [83] rpart_4.1.19                deldir_1.0-6
 [85] pbapply_1.7-0               S4Vectors_0.36.1
 [87] zoo_1.8-11                  SummarizedExperiment_1.28.0
 [89] ggrepel_0.9.3               cluster_2.1.4
 [91] magrittr_2.0.3              data.table_1.14.8
 [93] scattermore_0.8             circlize_0.4.15
 [95] lmtest_0.9-40               RANN_2.6.1
 [97] fitdistrplus_1.1-8          matrixStats_0.63.0
 [99] hms_1.1.2                   patchwork_1.1.2
[101] mime_0.12                   xtable_1.8-4
[103] jpeg_0.1-10                 IRanges_2.32.0
[105] gridExtra_2.3               shape_1.4.6
[107] compiler_4.2.2              KernSmooth_2.23-20
[109] crayon_1.5.2                htmltools_0.5.4
[111] later_1.3.0                 tzdb_0.3.0
[113] ggprism_1.0.4               Formula_1.2-4
[115] DBI_1.1.3                   MASS_7.3-58.2
[117] cli_3.6.1                   parallel_4.2.2
[119] igraph_1.4.1                GenomicRanges_1.50.2
[121] pkgconfig_2.0.3             foreign_0.8-84
[123] sp_1.6-0                    plotly_4.10.1
[125] spatstat.sparse_3.0-0       paletteer_1.5.0
[127] foreach_1.5.2               vipor_0.4.5
[129] XVector_0.38.0              snakecase_0.11.0
[131] digest_0.6.31               sctransform_0.3.5
[133] RcppAnnoy_0.0.20            janitor_2.2.0
[135] spatstat.data_3.0-0         Biostrings_2.66.0
[137] leiden_0.4.3                htmlTable_2.4.1
[139] uwot_0.1.14                 shiny_1.7.4
[141] lifecycle_1.0.3             nlme_3.1-162
[143] jsonlite_1.8.4              BiocNeighbors_1.16.0
[145] fansi_1.0.4                 pillar_1.9.0
[147] lattice_0.20-45             KEGGREST_1.38.0
[149] fastmap_1.1.0               httr_1.4.4
[151] survival_3.5-3              GO.db_3.16.0
[153] glue_1.6.2                  png_0.1-8
[155] iterators_1.0.14            bit_4.0.5
[157] stringi_1.7.12              rematch2_2.1.2
[159] blob_1.2.3                  latticeExtra_0.6-30
[161] memoise_2.0.1               irlba_2.3.5.1
[163] future.apply_1.10.0

Create release for conda-forge

I'd like to put a recipe to install ggrastr on conda-forge - for this I need a release tarball. Would you be willing to create a release? Thanks!

Cairo Dependency

Hi,

Thanks for creation and dev of this package, it’s super useful!! This issue is actually a question regarding your thoughts on package dependencies, specifically the Cairo package.

Unless I’m mistaken the only direct use of Cairo is in setting the dev param (where it is the default).

#' @param dev string Specifies the device used, which can be one of: \code{"cairo"}, \code{"ragg"} or \code{"ragg_png"} (default="cairo").

I’m wondering whether you might consider moving Cairo from Imports to Suggests and implementing a package check in the functions to set the dev param vs having a blanket default. I know Cairo is fairly common package but the number of packages with reverse imports on CRAN is actually fairly low and Cairo appears to be very common cause of installation issues (either first time installation or during upgrade of R versions). Also simplifies installation for people in locations where they may not have sudo privileges (HPC clusters, company servers etc) where it becomes more complicated to install underlying system level libraries needed by Cairo

Here is example of package check type mechanism I was thinking (in this case it’s actually checking for ggrastr which avoids taking ggrastr as direct Imports):
https://github.com/satijalab/seurat/blob/a1294c4d363780548dbf9cc4a4abb3a6078a6d64/R/visualization.R#L7243-#L7253

I totally understand if your preference is to remain a direct Import but just wondering if that is something you might consider?

Thanks again!
Sam

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.