Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/workflows/release_checks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,9 @@ jobs:
extra-packages:
any::rcmdcheck
any::pkgdown
any::testthat
# Only install hard / required dependencies
dependencies: '"hard"'
# Installed packages are cached by default - force an upgrade to the
# latest version of all dependencies.
upgrade: 'TRUE'
Expand Down
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Package: Seurat
Version: 5.3.1.9999
Version: 5.4.0
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) <doi:10.1038/nbt.3192>, Macosko E, Basu A, Satija R, et al (2015) <doi:10.1016/j.cell.2015.05.002>, Stuart T, Butler A, et al (2019) <doi:10.1016/j.cell.2019.05.031>, and Hao, Hao, et al (2020) <doi:10.1101/2020.10.12.335331> for more details.
Authors@R: c(
Expand Down Expand Up @@ -59,7 +59,6 @@ Imports:
irlba,
jsonlite,
KernSmooth,
leidenbase,
lifecycle,
lmtest,
MASS,
Expand Down Expand Up @@ -110,6 +109,7 @@ Suggests:
harmony,
hdf5r,
IRanges,
leidenbase,
limma,
magrittr,
MAST,
Expand Down
13 changes: 10 additions & 3 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,18 @@
# Unreleased
# Seurat 5.4.0

### Additions
- Added support for Space Ranger 4.0 outputs - updated `Load10X_Spatial`, `Read10X_Image`, spatial visualization functions (`SpatialPlot`, `SingleSpatialPlot`, `SpatialDimPlot`, `SpatialFeaturePlot`), added helpers (`Read10X_Segmentations`, `Read10X_HD_GeoJson`, `Format10X_GeoJson_CellID`)
- Added support for 10x Space Ranger 4.0 outputs (Visium data with segmentations)
- Updated data loading functions `Load10X_Spatial`, `Read10X_Image`,
- Updated `GetTissueCoordinates.VisiumV2`
- Updated spatial visualization functions `SpatialPlot`, `SingleSpatialPlot`, `SpatialDimPlot`, `SpatialFeaturePlot`
- Added helper functions `Read10X_Segmentations`, `Read10X_HD_GeoJson`, `Format10X_GeoJson_CellID`
- Added function `InteractiveSpatialPlot` to allow users to interactively lasso-select cells from a spatial Seurat object (Visium, SlideSeq, or Vizgen data)

### Fixes
- Reverted #10062 in favor of fetching both grouping variables and dimensionality reduction embeddings with `FetchData`; added warning to alert users when column names of metadata and dimensionality reduction embeddings conflict
- Updated loading & visualization functions (see above for list) for Visium objects -- see [#10125](https://github.com/satijalab/seurat/pull/10215) for details
- For binned Visium data, `x` now correctly corresponds to `imagecol` from tissue positions; `y` now correctly corresponds to `imagerow` from tissue positions; these are now consistent with 10X's coordinate system (with the origin being the top left).
- Reverted [#10062](https://github.com/satijalab/seurat/pull/10062) in favor of fetching both grouping variables and dimensionality reduction embeddings with `FetchData` as previously; added warning to alert users when column names of metadata and dimensionality reduction embeddings conflict
- Added color retrieval logic in `LabelClusters` for consistent cluster label coloring ([#10198](https://github.com/satijalab/seurat/pull/10198))

# Seurat 5.3.1

Expand Down
6 changes: 6 additions & 0 deletions R/clustering.R
Original file line number Diff line number Diff line change
Expand Up @@ -1802,6 +1802,12 @@ RunLeiden <- function(

# Run clustering with `leidenbase`.
if (leiden_method == "leidenbase") {
# Check if leidenbase is available
if (!requireNamespace("leidenbase", quietly = TRUE)) {
stop("Package 'leidenbase' is required for leiden_method = 'leidenbase'. ",
"Please install it with: install.packages('leidenbase')")
}

partition <- leidenbase::leiden_find_partition(
input,
partition_type = partition.type,
Expand Down
4 changes: 2 additions & 2 deletions R/data.R
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#' \item{g2m.genes}{Genes associated with G2M-phase}
#' }
#' @concept data
#' @source \url{https://www.science.org/doi/abs/10.1126/science.aad0501}
#' @source `https://doi.org/10.1126/science.aad0501`
#'
"cc.genes"

Expand Down Expand Up @@ -41,7 +41,7 @@
#' \item{g2m.genes}{Genes associated with G2M-phase}
#' }
#' @concept data
#' @source \url{https://www.science.org/doi/abs/10.1126/science.aad0501}
#' @source `https://doi.org/10.1126/science.aad0501`
#'
#' @seealso \code{\link{cc.genes}}
#'
Expand Down
47 changes: 47 additions & 0 deletions cran-comments.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# Seurat v5.4.0

## Test environments
* Ubuntu 20.04 (local) (R 4.3.2)
* macOS 15.6.1 (local) (R 4.5.1)
* Ubuntu 24.04 (GitHub Actions Runner): R-oldrelease, R-release
* [win-builder](https://win-builder.r-project.org/): R-oldrelease, R-release, R-devel

## R CMD check results
**Status: OK**

```
* checking CRAN incoming feasibility ... [42s] NOTE
Maintainer: 'Rahul Satija <seurat@nygenome.org>'

Suggests or Enhances not in mainstream repositories:
BPCells, presto
Availability using Additional_repositories specification:
BPCells yes https://bnprks.r-universe.dev
presto yes https://satijalab.r-universe.dev
```

The maintainer remains Rahul Satija and the email is correct. BPCells and presto are hosted on R-universe and used conditionally in Seurat.

```
* checking package dependencies ... NOTE
Packages suggested but not available for checking: 'BPCells', 'presto'
```

BPCells and presto are hosted on R-universe and used conditionally in Seurat.

```
* checking DESCRIPTION meta-information ... NOTE
Author field differs from that derived from Authors@R
```

There seems to be a slight difference in ORCID formatting between Author and Authors@R; the information in both is the same.

```
* checking Rd cross-references ... NOTE
Package unavailable to check Rd xrefs: 'BPCells'
```

BPCells is listed under "Suggests"; it is hosted on R-universe and used conditionally in Seurat.

## Reverse dependency check results
We checked 80 reverse dependencies (40 from CRAN + 40 from Bioconductor), comparing R CMD check results across CRAN and dev versions of this package, and saw no new problems.
2 changes: 1 addition & 1 deletion man/PrepSCTFindMarkers.Rd

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

2 changes: 1 addition & 1 deletion man/ReadAkoya.Rd

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

2 changes: 1 addition & 1 deletion man/ReadNanostring.Rd

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

2 changes: 1 addition & 1 deletion man/ReadVitessce.Rd

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

2 changes: 1 addition & 1 deletion man/ReadVizgen.Rd

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

2 changes: 1 addition & 1 deletion man/cc.genes.Rd

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

2 changes: 1 addition & 1 deletion man/cc.genes.updated.2019.Rd

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

2 changes: 1 addition & 1 deletion man/roxygen/templates/section-progressr.R
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@
#' the function call in \code{\link[progressr]{with_progress}} or run
#' \code{\link[progressr:handlers]{handlers(global = TRUE)}} before running
#' this function. For more details about \pkg{progressr}, please read
#' \href{https://progressr.futureverse.org/articles/progressr-intro.html}{\code{vignette("progressr-intro")}}
#' \href{https://progressr.futureverse.org/articles/progressr-01-intro.html}{\code{vignette("progressr-intro")}}
10 changes: 10 additions & 0 deletions tests/testthat/test_differential_expression.R
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ results.sct <- suppressWarnings(FindMarkers(object = sct.obj, ident.1 = 0, ident


test_that("Default settings work as expected with pseudocount = 1", {
skip_on_cran()
expect_error(FindMarkers(object = pbmc_small))
expect_error(FindMarkers(object = pbmc_small, ident.1 = "test"))
expect_error(FindMarkers(object = pbmc_small, ident.1 = 0, ident.2 = "test"))
Expand Down Expand Up @@ -60,6 +61,7 @@ tymp.results <- suppressWarnings(FindMarkers(object = pbmc_small, ident.1 = 0, f
vargenes.results <- suppressWarnings(FindMarkers(object = pbmc_small, ident.1 = 0, features = VariableFeatures(object = pbmc_small), verbose = FALSE, base = exp(1),pseudocount.use = 1))

test_that("features parameter behaves correctly ", {
skip_on_cran()
expect_equal(nrow(x = tymp.results), 1)
expect_equal(tymp.results[1, "p_val"], 3.227445e-07, tolerance = 1e-12)
expect_equal(tymp.results[1, "avg_logFC"], -2.188179, tolerance = 1e-6)
Expand All @@ -80,6 +82,7 @@ test_that("features parameter behaves correctly ", {

results <- suppressWarnings(FindMarkers(object = pbmc_small, ident.1 = Cells(x = pbmc_small)[1:40], ident.2 = Cells(x = pbmc_small)[41:80], verbose = FALSE, base = exp(1),pseudocount.use = 1))
test_that("passing cell names works", {
skip_on_cran()
expect_equal(nrow(x = results), 216)
expect_equal(results[1, "p_val"], 0.0001690882)
expect_equal(results[1, "avg_logFC"], -1.967123, tolerance = 1e-6)
Expand All @@ -93,6 +96,7 @@ results <- suppressWarnings(FindMarkers(object = pbmc_small, ident.1 = 0, ident.
results.clr <- suppressWarnings(FindMarkers(object = clr.obj, ident.1 = 0, ident.2 = 1, verbose = FALSE, base = exp(1), pseudocount.use = 0.1))
results.sct <- suppressWarnings(FindMarkers(object = sct.obj, ident.1 = 0, ident.2 = 1, verbose = FALSE, base = exp(1), pseudocount.use = 0.1, vst.flavor = "v1"))
test_that("setting pseudocount.use works", {
skip_on_cran()
expect_equal(nrow(x = results), 222)
expect_equal(results[1, "avg_logFC"], -2.640848, tolerance = 1e-6)
expect_equal(nrow(x = results.clr), 214)
Expand All @@ -105,6 +109,7 @@ results <- suppressWarnings(FindMarkers(object = pbmc_small, ident.1 = 0, ident.
results.clr <- suppressWarnings(FindMarkers(object = clr.obj, ident.1 = 0, ident.2 = 1, verbose = FALSE, base = exp(1), pseudocount.use = 1, mean.fxn = rowMeans))
results.sct <- suppressWarnings(FindMarkers(object = sct.obj, ident.1 = 0, ident.2 = 1, verbose = FALSE, base = exp(1), pseudocount.use = 1, mean.fxn = rowMeans, vst.flaovr = "v1"))
test_that("setting mean.fxn works", {
skip_on_cran()
expect_equal(nrow(x = results), 216)
expect_equal(results[1, "avg_logFC"], -4.204346, tolerance = 1e-6)
expect_equal(results.clr[1, "avg_logFC"], -1.353025, tolerance = 1e-6)
Expand Down Expand Up @@ -152,6 +157,7 @@ test_that("only.pos works", {

results <- suppressWarnings(FindMarkers(object = pbmc_small, ident.1 = 0, ident.2 = 1, max.cells.per.ident = 20, verbose = FALSE, base = exp(1),pseudocount.use = 1))
test_that("max.cells.per.ident works", {
skip_on_cran()
expect_equal(nrow(x = results), 222)
expect_equal(results[1, "p_val"], 3.428568e-08, tolerance = 1e-13)
expect_equal(results[1, "avg_logFC"], -2.638242, tolerance = 1e-6)
Expand Down Expand Up @@ -180,6 +186,7 @@ Idents(object = t2) <- "groups"
results2 <- suppressWarnings(FindMarkers(object = t2, ident.1 = "g1", ident.2 = "g2", verbose = FALSE, base = exp(1), pseudocount.use = 1))

test_that("group.by works", {
skip_on_cran()
expect_equal(nrow(x = results), 190)
expect_equal(results, results2)
expect_equal(results[1, "p_val"], 0.02870319)
Expand All @@ -196,6 +203,7 @@ Idents(object = t2) <- "groups"
results2 <- suppressWarnings(FindMarkers(object = t2, ident.1 = "g1", ident.2 = "g2", verbose = FALSE, base = exp(1), pseudocount.use = 1))

test_that("subset.ident works", {
skip_on_cran()
expect_equal(nrow(x = results), 183)
expect_equal(results, results2)
expect_equal(results[1, "p_val"], 0.01293720)
Expand All @@ -208,6 +216,7 @@ test_that("subset.ident works", {

results <- suppressWarnings(FindMarkers(object = pbmc_small, ident.1 = 0, ident.2 = 1, reduction = "pca", verbose = FALSE, base = exp(1), pseudocount.use = 1))
test_that("reduction works", {
skip_on_cran()
expect_equal(results[1, "p_val"], 1.664954e-10, tolerance = 1e-15)
expect_equal(results[1, "avg_diff"], -2.810453669, tolerance = 1e-6)
expect_equal(results[1, "p_val_adj"], 3.163412e-09, tolerance = 1e-14)
Expand Down Expand Up @@ -368,6 +377,7 @@ test_that("BPCells FindMarkers gives same results", {
# -------------------------------------------------------------------------------

test_that("FindAllMarkers works as expected", {
skip_on_cran()
pbmc_copy <- pbmc_small
Idents(pbmc_copy) <- "orig.ident"

Expand Down
8 changes: 6 additions & 2 deletions tests/testthat/test_find_clusters.R
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,12 @@ test_that("Smoke test for `FindClusters`", {
expect_no_error(FindClusters(test_case, algorithm = 3))
# The leiden algorithm requires that `random.seed` be greater than 0,
# which is the default for `FindClusters` so a warning should be raised.
expect_warning(FindClusters(test_case, algorithm = 4))
expect_no_warning(FindClusters(test_case, algorithm = 4, random.seed = 1))
# Test with igraph method
expect_warning(FindClusters(test_case, algorithm = 4, leiden_method = "igraph"))
expect_no_warning(FindClusters(test_case, algorithm = 4, leiden_method = "igraph", random.seed = 1))

# Test leidenbase method if available
skip_if_not_installed("leidenbase")
expect_warning(FindClusters(test_case, algorithm = 4, leiden_method = "leidenbase"))
expect_no_warning(FindClusters(test_case, algorithm = 4, leiden_method = "leidenbase", random.seed = 1))
})
1 change: 1 addition & 0 deletions tests/testthat/test_preprocessing.R
Original file line number Diff line number Diff line change
Expand Up @@ -557,6 +557,7 @@ object2 <- CreateSeuratObject(counts = pbmc.test,
meta.data = fake.meta.data2)

test_that("`SCTransform` is consistent for multi-layer inputs", {
skip_on_cran()
clip.range = c(-1.632993, 1.632993)

test_case_v3 <- SplitObject(object2, split.by = "Condition")
Expand Down
Loading