Skip to content

Commit

Permalink
Merge pull request #35 from boyiguo1/v1.3.1
Browse files Browse the repository at this point in the history
V1.3.1
  • Loading branch information
boyiguo1 authored Nov 14, 2023
2 parents 098801a + 1c264d9 commit b713c82
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 2 deletions.
2 changes: 2 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
# escheR 1.3.1
SIGNIFICANT USER-VISIBLE CHANGES

* Add functions `add_fill_bin` and `add_ground_bin` to provide hexgon binning strategy to mitigate the overplotting of data points
* Provide an example to use `add_fill_bin` and `add_ground_bin` with `make_escheR` to create hexgon binning plot



# escheR 1.2.0
SIGNIFICANT USER-VISIBLE CHANGES

* Add generic functions to support `SingleCellExperiment` object by
providing values to the argument `dimred`, and `data.frame` object
* Modify the generic function `make_escheR.SpatialExperiment` to support
Expand Down
4 changes: 3 additions & 1 deletion R/add_fill_bin.R
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#' @param bins numeric vector giving number of bins in both vertical and
#' horizontal directions. Set to 30 by default.
#' @param fun function for summary. See more detail in \link[ggplot2]{stat_summary_hex}
#'
#' @rdname add_fill
#' @export
Expand All @@ -9,6 +10,7 @@ add_fill_bin <- function(
var,
bins = 30,
point_size = 2.8,
fun = sum,
...){
p +
stat_summary_hex(
Expand All @@ -17,7 +19,7 @@ add_fill_bin <- function(
geom = "point",
shape = 21,
size = 2.8,
fun = sum,
fun = fun,
bins = bins
) +
scale_fill_gradient(name = var)
Expand Down
4 changes: 3 additions & 1 deletion man/add_fill.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions vignettes/more_than_visium.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ make_escheR(
scale_color_discrete(name = "Spatial Domains") +
theme_minimal()
```

> Note 1: The strategy of binning to avoid overplotting is previously proposed in [`schex`](https://www.bioconductor.org/packages/release/bioc/html/schex.html). While we provide an implementation in `escheR`, we would caution our users that the binning strategy could lead to intermixing of cluster memberships. In our implementation, the majority membership of the data points belonging to a bin is selected as the label of the bin. Users should use the binning strategy under their own discretion, and interpret the visualization carefully.
> Note 2: `add_fill_bin()` shoudl be applied after `add_ground_bin()` for the better visualization outcome.
Expand Down

0 comments on commit b713c82

Please sign in to comment.