From c6edcee63e1e7ba3d3cfaafd6f1bbffcb21c3dba Mon Sep 17 00:00:00 2001 From: samuel-marsh Date: Tue, 12 Dec 2023 16:49:14 -0500 Subject: [PATCH 1/9] add stroke size param --- R/visualization.R | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/R/visualization.R b/R/visualization.R index 73496c77e..167179acd 100644 --- a/R/visualization.R +++ b/R/visualization.R @@ -875,6 +875,7 @@ DimPlot <- function( label.box = FALSE, repel = FALSE, alpha = 1, + stroke.size = NULL, cells.highlight = NULL, cols.highlight = '#DE2D26', sizes.highlight = 1, @@ -941,6 +942,7 @@ DimPlot <- function( shape.by = shape.by, order = order, alpha = alpha, + stroke.size = stroke.size label = FALSE, cells.highlight = cells.highlight, cols.highlight = cols.highlight, @@ -8224,6 +8226,7 @@ SingleDimPlot <- function( shape.by = NULL, alpha = 1, alpha.by = NULL, + stroke.size = NULL, order = NULL, label = FALSE, repel = FALSE, @@ -8242,6 +8245,10 @@ SingleDimPlot <- function( raster <- raster %||% (nrow(x = data) > 1e5) pt.size <- pt.size %||% AutoPointSize(data = data, raster = raster) + if (is.null(x = stroke.size)) { + stroke.size <- 0.600075815011372 + } + if (!is.null(x = cells.highlight) && pt.size != AutoPointSize(data = data, raster = raster) && sizes.highlight != pt.size && isTRUE(x = raster)) { warning("When `raster = TRUE` highlighted and non-highlighted cells must be the same size. Plot will use the value provided to 'sizes.highlight'.") } @@ -8352,7 +8359,8 @@ SingleDimPlot <- function( alpha = alpha.by ), size = pt.size, - alpha = alpha + alpha = alpha, + stroke = stroke.size ) } plot <- plot + From 4611c793219c4d21f94cab18939367aa13aa19ab Mon Sep 17 00:00:00 2001 From: samuel-marsh Date: Tue, 12 Dec 2023 16:50:56 -0500 Subject: [PATCH 2/9] add param description --- R/visualization.R | 1 + 1 file changed, 1 insertion(+) diff --git a/R/visualization.R b/R/visualization.R index 167179acd..12ac3d7ec 100644 --- a/R/visualization.R +++ b/R/visualization.R @@ -814,6 +814,7 @@ ColorDimSplit <- function( #' @param label.box Whether to put a box around the label text (geom_text vs #' geom_label) #' @param alpha Alpha value for plotting (default is 1) +#' @param stroke.size Adjust stroke (outline) size of points #' @param repel Repel labels #' @param cells.highlight A list of character or numeric vectors of cells to #' highlight. If only one group of cells desired, can simply From d8013ae47214a5c2d84e0fb0c78dbc5f600203a0 Mon Sep 17 00:00:00 2001 From: samuel-marsh Date: Tue, 12 Dec 2023 16:51:14 -0500 Subject: [PATCH 3/9] missing comma --- R/visualization.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/R/visualization.R b/R/visualization.R index 12ac3d7ec..8a82fddb7 100644 --- a/R/visualization.R +++ b/R/visualization.R @@ -943,7 +943,7 @@ DimPlot <- function( shape.by = shape.by, order = order, alpha = alpha, - stroke.size = stroke.size + stroke.size = stroke.size, label = FALSE, cells.highlight = cells.highlight, cols.highlight = cols.highlight, From e692606a9dca4add92bc2f7ce26412d19c323947 Mon Sep 17 00:00:00 2001 From: samuel-marsh Date: Tue, 12 Dec 2023 16:52:27 -0500 Subject: [PATCH 4/9] add param description singledimplot --- R/visualization.R | 1 + 1 file changed, 1 insertion(+) diff --git a/R/visualization.R b/R/visualization.R index 8a82fddb7..5950d2bdc 100644 --- a/R/visualization.R +++ b/R/visualization.R @@ -8185,6 +8185,7 @@ SingleCorPlot <- function( #' allowing for both different colors and different shapes on cells. #' @param alpha Alpha value for plotting (default is 1) #' @param alpha.by Mapping variable for the point alpha value +#' @param stroke.size Adjust stroke (outline) size of points #' @param order Specify the order of plotting for the idents. This can be #' useful for crowded plots if points of interest are being buried. Provide #' either a full list of valid idents or a subset to be plotted last (on top). From f2a0f58dbd7ad4640012d41d99a6aca34521cfe3 Mon Sep 17 00:00:00 2001 From: samuel-marsh Date: Thu, 19 Dec 2024 10:23:20 -0500 Subject: [PATCH 5/9] fix ordering of param warnings --- R/visualization.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/R/visualization.R b/R/visualization.R index 5950d2bdc..64e5c9a52 100644 --- a/R/visualization.R +++ b/R/visualization.R @@ -814,8 +814,8 @@ ColorDimSplit <- function( #' @param label.box Whether to put a box around the label text (geom_text vs #' geom_label) #' @param alpha Alpha value for plotting (default is 1) -#' @param stroke.size Adjust stroke (outline) size of points #' @param repel Repel labels +#' @param stroke.size Adjust stroke (outline) size of points #' @param cells.highlight A list of character or numeric vectors of cells to #' highlight. If only one group of cells desired, can simply #' pass a vector instead of a list. If set, colors selected cells to the color(s) From 20d9945d16ae7fa732d1ee1a116a013d3be2f854 Mon Sep 17 00:00:00 2001 From: samuel-marsh Date: Thu, 19 Dec 2024 10:23:45 -0500 Subject: [PATCH 6/9] biorxiv replace url with check warnings to published URL --- R/preprocessing.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/R/preprocessing.R b/R/preprocessing.R index 6581d2e5a..b3dbae668 100644 --- a/R/preprocessing.R +++ b/R/preprocessing.R @@ -852,7 +852,7 @@ LoadCurioSeeker <- function(data.dir, assay = "Spatial") { #' @export #' @concept preprocessing #' -#' @references \url{https://www.biorxiv.org/content/10.1101/387241v1} +#' @references \url{https://doi.org/10.1038/s41592-019-0433-8} #' #' @examples #' \dontrun{ From 7b52de131dd197a1a55cd46cbce08a0c3f2b43d4 Mon Sep 17 00:00:00 2001 From: samuel-marsh Date: Thu, 19 Dec 2024 10:36:26 -0500 Subject: [PATCH 7/9] roxygenize --- man/ColorDimSplit.Rd | 1 + man/DimPlot.Rd | 3 +++ man/MULTIseqDemux.Rd | 2 +- man/SingleDimPlot.Rd | 3 +++ 4 files changed, 8 insertions(+), 1 deletion(-) diff --git a/man/ColorDimSplit.Rd b/man/ColorDimSplit.Rd index bfb9202d2..769594266 100644 --- a/man/ColorDimSplit.Rd +++ b/man/ColorDimSplit.Rd @@ -55,6 +55,7 @@ useful for crowded plots if points of interest are being buried. (default is FAL geom_label)} \item{\code{alpha}}{Alpha value for plotting (default is 1)} \item{\code{repel}}{Repel labels} + \item{\code{stroke.size}}{Adjust stroke (outline) size of points} \item{\code{cells.highlight}}{A list of character or numeric vectors of cells to highlight. If only one group of cells desired, can simply pass a vector instead of a list. If set, colors selected cells to the color(s) diff --git a/man/DimPlot.Rd b/man/DimPlot.Rd index aa2212b94..88fdc6754 100644 --- a/man/DimPlot.Rd +++ b/man/DimPlot.Rd @@ -27,6 +27,7 @@ DimPlot( label.box = FALSE, repel = FALSE, alpha = 1, + stroke.size = NULL, cells.highlight = NULL, cols.highlight = "#DE2D26", sizes.highlight = 1, @@ -91,6 +92,8 @@ geom_label)} \item{alpha}{Alpha value for plotting (default is 1)} +\item{stroke.size}{Adjust stroke (outline) size of points} + \item{cells.highlight}{A list of character or numeric vectors of cells to highlight. If only one group of cells desired, can simply pass a vector instead of a list. If set, colors selected cells to the color(s) diff --git a/man/MULTIseqDemux.Rd b/man/MULTIseqDemux.Rd index 4739af19e..d7255d008 100644 --- a/man/MULTIseqDemux.Rd +++ b/man/MULTIseqDemux.Rd @@ -42,6 +42,6 @@ object <- MULTIseqDemux(object) } \references{ -\url{https://www.biorxiv.org/content/10.1101/387241v1} +\url{https://doi.org/10.1038/s41592-019-0433-8} } \concept{preprocessing} diff --git a/man/SingleDimPlot.Rd b/man/SingleDimPlot.Rd index 413bd721a..2c7f467cd 100644 --- a/man/SingleDimPlot.Rd +++ b/man/SingleDimPlot.Rd @@ -13,6 +13,7 @@ SingleDimPlot( shape.by = NULL, alpha = 1, alpha.by = NULL, + stroke.size = NULL, order = NULL, label = FALSE, repel = FALSE, @@ -47,6 +48,8 @@ allowing for both different colors and different shapes on cells.} \item{alpha.by}{Mapping variable for the point alpha value} +\item{stroke.size}{Adjust stroke (outline) size of points} + \item{order}{Specify the order of plotting for the idents. This can be useful for crowded plots if points of interest are being buried. Provide either a full list of valid idents or a subset to be plotted last (on top).} From 48e882bff90fd320e986274b1c788cb95b2bac0c Mon Sep 17 00:00:00 2001 From: David Collins Date: Thu, 19 Dec 2024 18:03:24 -0500 Subject: [PATCH 8/9] Bump version --- DESCRIPTION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DESCRIPTION b/DESCRIPTION index 9b4bab282..907f1ea1f 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,5 +1,5 @@ Package: Seurat -Version: 5.1.0.9014 +Version: 5.1.0.9015 Title: Tools for Single Cell Genomics Description: A toolkit for quality control, analysis, and exploration of single cell RNA sequencing data. 'Seurat' aims to enable users to identify and interpret sources of heterogeneity from single cell transcriptomic measurements, and to integrate diverse types of single cell data. See Satija R, Farrell J, Gennert D, et al (2015) , Macosko E, Basu A, Satija R, et al (2015) , Stuart T, Butler A, et al (2019) , and Hao, Hao, et al (2020) for more details. Authors@R: c( From b814066d2338a8c263cc32e03632231552e1ae85 Mon Sep 17 00:00:00 2001 From: David Collins Date: Thu, 19 Dec 2024 18:05:06 -0500 Subject: [PATCH 9/9] Update changelog --- NEWS.md | 1 + 1 file changed, 1 insertion(+) diff --git a/NEWS.md b/NEWS.md index 55c05cf81..e81712cd5 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,6 +1,7 @@ # Unreleased ## Changes +- Added `stroke.size` parameter to `DimPlot` ([#8180](https://github.com/satijalab/seurat/pull/8180)) - Updated `RunLeiden` to use the `leidenbase` package instead of `leiden`; deprecated the `method` parameter for `RunLeiden` and `FindClusters`; updated `RunLeiden` to reset `random.seed` to 1 if the value is 0 or less ([#6792](https://github.com/satijalab/seurat/pull/6792)) - Updated `RunUMAP` to support `umap-learn` version >= 0.5.0 ([#9559](https://github.com/satijalab/seurat/pull/9559)) - Surfaced more fine-grained control over what parts of a Xenium experiment are loaded in `LoadXenium`