Skip to content

Commit 41d19a8

Browse files
committed
Merge remote-tracking branch 'private/release/5.0.1'
2 parents ca4c48b + f3fbb2b commit 41d19a8

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+1523
-726
lines changed

DESCRIPTION

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Package: Seurat
2-
Version: 5.0.0
3-
Date: 2023-10-23
2+
Version: 5.0.1
3+
Date: 2023-11-16
44
Title: Tools for Single Cell Genomics
55
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.
66
Authors@R: c(

NEWS.md

+13
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,16 @@
1+
# Seurat 5.0.1 (2023-11-16)
2+
3+
## Changes
4+
5+
- Fixed `SCTransform.StdAssay` to pass extra arguments to `sctransform::vst()`. Fixes [#875](https://github.com/satijalab/seurat/issues/7998)
6+
- Fixed PercentageFeatureSet Layer calling [(#8009)](https://github.com/satijalab/seurat/issues/8009)
7+
- Fixed cell highlighting [(#7914)](https://github.com/satijalab/seurat/pull/7914)
8+
- Updated marker sorting to be by p-value with ties broken by absolute difference in percent expression
9+
- Fixed issue with replicated barcodes in MappingScore [(#7922)](https://github.com/satijalab/seurat/issues/7922)
10+
- Improved `PseudobulkExpression` by adding 'g' to cell names that started with numeric values
11+
- Improved `PseudobulkExpression` by adding each variable specified in `group.by` as columns in the object metadata when `return.seurat=TRUE`
12+
- Fixed `DimPlot` and `FeatureScatter` which were breaking when using the `split.by` argument with a variable that contained NAs
13+
114
# Seurat 5.0.0 (2023-10-25)
215

316
## Added

R/differential_expression.R

+2-2
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ FindAllMarkers <- function(
164164
subset = (myAUC > return.thresh | myAUC < (1 - return.thresh))
165165
)
166166
} else if (is.null(x = node) || test.use %in% c('bimod', 't')) {
167-
gde <- gde[order(gde$p_val, -gde[, 2]), ]
167+
gde <- gde[order(gde$p_val, -abs(gde$pct.1-gde$pct.2)), ]
168168
gde <- subset(x = gde, subset = p_val < return.thresh)
169169
}
170170
if (nrow(x = gde) > 0) {
@@ -612,7 +612,7 @@ FindMarkers.default <- function(
612612
if (test.use %in% DEmethods_nocorrect()) {
613613
de.results <- de.results[order(-de.results$power, -de.results[, 1]), ]
614614
} else {
615-
de.results <- de.results[order(de.results$p_val, -abs(de.results[,colnames(fc.results)[1]])), ]
615+
de.results <- de.results[order(de.results$p_val, -abs(de.results$pct.1-de.results$pct.2)), ]
616616
de.results$p_val_adj = p.adjust(
617617
p = de.results$p_val,
618618
method = "bonferroni",

R/integration.R

+6-6
Original file line numberDiff line numberDiff line change
@@ -2621,19 +2621,19 @@ MappingScore.AnchorSet <- function(
26212621
combined.object <- slot(object = anchors, name = "object.list")[[1]]
26222622
combined.object <- RenameCells(
26232623
object = combined.object,
2624-
new.names = unname(obj = sapply(
2624+
new.names = unname(obj = make.unique(sapply(
26252625
X = Cells(x = combined.object),
26262626
FUN = RemoveLastField
2627-
))
2627+
)))
26282628
)
2629-
query.cells <- sapply(
2629+
query.cells <- make.unique(sapply(
26302630
X = slot(object = anchors, name = "query.cells"),
26312631
FUN = RemoveLastField
2632-
)
2633-
ref.cells <- sapply(
2632+
))
2633+
ref.cells <- make.unique(sapply(
26342634
X = slot(object = anchors, name = "reference.cells"),
26352635
FUN = RemoveLastField
2636-
)
2636+
))
26372637
query.embeddings <- Embeddings(object = subset(
26382638
x = combined.object[["pcaproject.l2"]],
26392639
cells = query.cells

R/preprocessing5.R

+2-1
Original file line numberDiff line numberDiff line change
@@ -1260,7 +1260,8 @@ SCTransform.StdAssay <- function(
12601260
conserve.memory = conserve.memory,
12611261
return.only.var.genes = return.only.var.genes,
12621262
seed.use = seed.use,
1263-
verbose = verbose)
1263+
verbose = verbose,
1264+
...)
12641265
min_var <- vst.out$arguments$min_variance
12651266
residual.type <- vst.out[['residual_type']] %||% 'pearson'
12661267
assay.out <- CreateSCTAssay(vst.out = vst.out, do.correct.umi = do.correct.umi, residual.type = residual.type,

R/utilities.R

+52-10
Original file line numberDiff line numberDiff line change
@@ -1170,7 +1170,7 @@ PercentageFeatureSet <- function(
11701170
warn(message = "Both pattern and features provided. Pattern is being ignored.")
11711171
}
11721172
percent.featureset <- list()
1173-
layers <- Layers(object = object, pattern = "counts")
1173+
layers <- Layers(object = object, search = "counts")
11741174
for (i in seq_along(along.with = layers)) {
11751175
layer <- layers[i]
11761176
features.layer <- features %||% grep(
@@ -1425,6 +1425,8 @@ PseudobulkExpression.Seurat <- function(
14251425
stop("Number of layers provided does not match number of assays")
14261426
}
14271427
data <- FetchData(object = object, vars = rev(x = group.by))
1428+
#only keep meta-data columns that are in object
1429+
group.by <- intersect(group.by, colnames(data))
14281430
data <- data[which(rowSums(x = is.na(x = data)) == 0), , drop = F]
14291431
if (nrow(x = data) < ncol(x = object)) {
14301432
inform("Removing cells with NA for 1 or more grouping variables")
@@ -1450,6 +1452,22 @@ PseudobulkExpression.Seurat <- function(
14501452
data <- data[, which(num.levels > 1), drop = F]
14511453
}
14521454
category.matrix <- CreateCategoryMatrix(labels = data, method = method)
1455+
#check if column names are numeric
1456+
col.names <- colnames(category.matrix)
1457+
if (any(!(grepl("^[a-zA-Z]|^\\.[^0-9]", col.names)))) {
1458+
col.names <- ifelse(
1459+
!(grepl("^[a-zA-Z]|^\\.[^0-9]", col.names)),
1460+
paste0("g", col.names),
1461+
col.names
1462+
)
1463+
colnames(category.matrix) <- col.names
1464+
inform(
1465+
message = paste0("First group.by variable `", group.by[1],
1466+
"` starts with a number, appending `g` to ensure valid variable names"),
1467+
.frequency = "regularly",
1468+
.frequency_id = "PseudobulkExpression"
1469+
)
1470+
}
14531471
data.return <- list()
14541472
for (i in 1:length(x = assays)) {
14551473
if (inherits(x = features, what = "list")) {
@@ -1568,16 +1586,40 @@ PseudobulkExpression.Seurat <- function(
15681586
toRet <- ScaleData(object = toRet, verbose = verbose)
15691587
}
15701588
}
1571-
if ('ident' %in% group.by) {
1572-
first.cells <- sapply(
1573-
X = 1:ncol(x = category.matrix),
1574-
FUN = function(x) {
1575-
return(category.matrix[,x, drop = FALSE ]@i[1] + 1)
1576-
}
1589+
#add meta-data based on group.by variables
1590+
cells <- Cells(toRet)
1591+
for (i in 1:length(group.by)) {
1592+
if (group.by[i] != "ident") {
1593+
v <- sapply(
1594+
strsplit(cells, "_"),
1595+
function(x) {return(x[i])}
1596+
)
1597+
names(v) <- cells
1598+
toRet <- AddMetaData(toRet,
1599+
metadata = v,
1600+
col.name = group.by[i]
1601+
)
1602+
}
1603+
}
1604+
#set idents to pseudobulk variables
1605+
Idents(toRet) <- cells
1606+
1607+
#make orig.ident variable
1608+
#orig.ident = ident if group.by includes `ident`
1609+
#if not, orig.ident is equal to pseudobulk cell names
1610+
if(any(group.by == "ident")) {
1611+
i = which(group.by == "ident")
1612+
v <- sapply(
1613+
strsplit(cells, "_"),
1614+
function(x) {return(x[i])}
1615+
)
1616+
names(v) <- cells
1617+
toRet <- AddMetaData(toRet,
1618+
metadata = v,
1619+
col.name = "orig.ident"
15771620
)
1578-
Idents(object = toRet,
1579-
cells = colnames(x = toRet)
1580-
) <- Idents(object = object)[first.cells]
1621+
} else {
1622+
toRet$orig.ident <- cells
15811623
}
15821624
return(toRet)
15831625
} else {

R/visualization.R

+8-4
Original file line numberDiff line numberDiff line change
@@ -921,7 +921,9 @@ DimPlot <- function(
921921
data[, shape.by] <- object[[shape.by, drop = TRUE]]
922922
}
923923
if (!is.null(x = split.by)) {
924-
data[, split.by] <- FetchData(object = object, vars = split.by)[split.by]
924+
split <- FetchData(object = object, vars = split.by, clean=TRUE)[split.by]
925+
data <- data[rownames(split),]
926+
data[, split.by] <- split
925927
}
926928
if (isTRUE(x = shuffle)) {
927929
set.seed(seed = seed)
@@ -2045,7 +2047,9 @@ FeatureScatter <- function(
20452047
}
20462048
}
20472049
if (!is.null(x = split.by)) {
2048-
data[, split.by] <- FetchData(object = object, vars = split.by)[split.by]
2050+
split <- FetchData(object = object, vars = split.by, clean=TRUE)[split.by]
2051+
data <- data[rownames(split),]
2052+
data[, split.by] <- split
20492053
}
20502054
plots <- lapply(
20512055
X = group.by,
@@ -7895,7 +7899,7 @@ SetHighlight <- function(
78957899

78967900
# Check for raster
78977901
if (isTRUE(x = raster)) {
7898-
size <- size[1]
7902+
size <- sizes.highlight[1]
78997903
}
79007904

79017905
plot.order <- sort(x = unique(x = highlight), na.last = TRUE)
@@ -8200,7 +8204,7 @@ SingleDimPlot <- function(
82008204
raster <- raster %||% (nrow(x = data) > 1e5)
82018205
pt.size <- pt.size %||% AutoPointSize(data = data, raster = raster)
82028206

8203-
if (!is.null(x = cells.highlight) && pt.size == AutoPointSize(data = data, raster = raster) && sizes.highlight != pt.size && isTRUE(x = raster)) {
8207+
if (!is.null(x = cells.highlight) && pt.size != AutoPointSize(data = data, raster = raster) && sizes.highlight != pt.size && isTRUE(x = raster)) {
82048208
warning("When `raster = TRUE` highlighted and non-highlighted cells must be the same size. Plot will use the value provided to 'sizes.highlight'.")
82058209
}
82068210

_pkgdown.yaml

+44-32
Original file line numberDiff line numberDiff line change
@@ -14,70 +14,72 @@ navbar:
1414
title: "Seurat"
1515
left:
1616
- text: "Install"
17-
href: articles/install.html
18-
- text: "Seurat v5"
19-
href: articles/get_started_v5.html
17+
href: articles/install_v5.html
2018
- text: "Get started"
21-
href: articles/get_started.html
19+
href: articles/get_started_v5_new.html
2220
- text: "Vignettes"
2321
menu:
2422
- text: Introductory Vignettes
2523
- text: "PBMC 3K guided tutorial"
2624
href: articles/pbmc3k_tutorial.html
25+
- text: "Data visualization vignette"
26+
href: articles/visualization_vignette.html
27+
- text: "SCTransform, v2 regularization"
28+
href: articles/sctransform_vignette.html
2729
- text: "Using Seurat with multi-modal data"
2830
href: articles/multimodal_vignette.html
31+
- text: "Seurat v5 Command Cheat Sheet"
32+
href: articles/essential_commands.html
2933
- text: -------
3034
- text: Data Integration
3135
- text: "Introduction to scRNA-seq integration"
3236
href: articles/integration_introduction.html
37+
- text: "Integrative analysis in Seurat v5"
38+
href: articles/seurat5_integration.html
3339
- text: "Mapping and annotating query datasets"
3440
href: articles/integration_mapping.html
35-
- text: "Fast integration using reciprocal PCA (RPCA)"
36-
href: articles/integration_rpca.html
37-
- text: "Tips for integrating large datasets"
38-
href: articles/integration_large_datasets.html
39-
- text: "Integrating scRNA-seq and scATAC-seq data"
40-
href: articles/atacseq_integration_vignette.html
41-
- text: "Multimodal reference mapping"
42-
href: articles/multimodal_reference_mapping.html
4341
- text: -------
44-
- text: New Statistical Methods
42+
- text: Multi-assay data
43+
- text: "Dictionary Learning for cross-modality integration"
44+
href: articles/seurat5_integration_bridge.html
4545
- text: "Weighted Nearest Neighbor Analysis"
4646
href: articles/weighted_nearest_neighbor_analysis.html
47+
- text: "Integrating scRNA-seq and scATAC-seq data"
48+
href: articles/seurat5_atacseq_integration_vignette.html
49+
- text: "Multimodal reference mapping"
50+
href: articles/multimodal_reference_mapping.html
4751
- text: "Mixscape Vignette"
4852
href: articles/mixscape_vignette.html
49-
- text: "Using sctransform in Seurat"
50-
href: articles/sctransform_vignette.html
51-
- text: "SCTransform, v2 regularization"
52-
href: articles/sctransform_v2_vignette.html
53+
- text: -------
54+
- text: Massively scalable analysis
55+
- text: "Sketch-based analysis in Seurat v5"
56+
href: articles/seurat5_sketch_analysis.html
57+
- text: "Sketch integration using a 1 million cell dataset from Parse Biosciences"
58+
href: articles/ParseBio_sketch_integration.html
59+
- text: "Map COVID PBMC datasets to a healthy reference"
60+
href: articles/COVID_SCTMapping.html
61+
- text: "BPCells Interaction"
62+
href: articles/seurat5_bpcells_interaction_vignette.html
63+
- text: -------
64+
- text: Spatial analysis
65+
- text: "Analysis of spatial datasets (Imaging-based)"
66+
href: articles/seurat5_spatial_vignette_2.html
67+
- text: "Analysis of spatial datasets (Sequencing-based)"
68+
href: articles/spatial_vignette.html
5369
- text: -------
5470
- text: Other
55-
- text: "Data visualization vignette"
56-
href: articles/visualization_vignette.html
5771
- text: "Cell-cycle scoring and regression"
5872
href: articles/cell_cycle_vignette.html
5973
- text: "Differential expression testing"
6074
href: articles/de_vignette.html
6175
- text: "Demultiplexing with hashtag oligos (HTOs)"
6276
href: articles/hashing_vignette.html
63-
- text: "Interoperability between single-cell object formats"
64-
href: articles/conversion_vignette.html
65-
- text: "Parallelization in Seurat with future"
66-
href: articles/future_vignette.html
67-
- text: "Dimensional reduction vignette"
68-
href: articles/dim_reduction_vignette.html
69-
- text: "Seurat essential commands list"
70-
href: articles/essential_commands.html
71-
- text: "Seurat interaction tips"
72-
href: articles/interaction_vignette.html
73-
- text: "Merging Seurat objects"
74-
href: articles/merge_vignette.html
7577
- text: Extensions
7678
href: articles/extensions.html
7779
- text: FAQ
7880
href: "https://github.com/satijalab/seurat/discussions"
7981
- text: "News"
80-
href: news/index.html
82+
href: articles/announcements.html
8183
- text: "Reference"
8284
href: reference/index.html
8385
- text: "Archive"
@@ -157,6 +159,16 @@ reference:
157159
- contents:
158160
- has_concept("convenience")
159161

162+
- title: "Multimodal"
163+
desc: "Functions for multimodal analysis"
164+
- contents:
165+
- has_concept("multimodal")
166+
167+
- title: "Re-exports"
168+
desc: "Functions for flexible analysis of massively scalable datasets"
169+
- contents:
170+
- has_concept("sketching")
171+
160172
- title: "Re-exports"
161173
desc: "Functions re-exported from other packages"
162174
- contents:

index.md

+13-9
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,9 @@
11
![](articles/assets/seurat_banner.jpg)
22

3-
## **Beta release of Seurat v5**
3+
## **Seurat v5**
44

5-
We are excited to release an initial beta version of Seurat v5! This update brings the following new features and functionality:
5+
We are excited to release Seurat v5! To install, please follow the instructions in our [install page](install.html). This update brings the following new features and functionality:
66

7-
* **Analysis of sequencing and imaging-based spatial datasets:** Spatially resolved datasets are redefining our understanding of cellular interactions and the organization of human tissues. Both sequencing-based(i.e. Visium, SLIDE-seq, etc.), and imaging-based (MERFISH/Vizgen, Xenium, CosMX, etc.) technologies have unique advantages, and require tailored analytical methods and software infrastructure. In Seurat v5, we introduce flexible and diverse support for a wide variety of spatially resolved data types, and support for analytical techniqiues for scRNA-seq integration, deconvolution, and niche identification.
8-
9-
- Vignette: [Analysis of spatial datasets (Sequencing-based)](articles/seurat5_spatial_vignette.html)
10-
- Vignette: [Analysis of spatial datasets (Imaging-based)](articles/seurat5_spatial_vignette_2.html)\
11-
\
127
* **Integrative multimodal analysis:** The cellular transcriptome is just one aspect of cellular identity, and recent technologies enable routine profiling of chromatin accessibility, histone modifications, and protein levels from single cells. In Seurat v5, we introduce 'bridge integration', a statistical method to integrate experiments measuring different modalities (i.e. separate scRNA-seq and scATAC-seq datasets), using a separate multiomic dataset as a molecular 'bridge'. For example, we demonstrate how to map scATAC-seq datasets onto scRNA-seq datasets, to assist users in interpreting and annotating data from new modalities.\
138
\
149
We recognize that while the goal of matching shared cell types across datasets may be important for many problems, users may also be concerned about which method to use, or that integration could result in a loss of biological resolution. In Seurat v5, we also introduce flexible and streamlined workflows for the integration of multiple scRNA-seq datasets. This makes it easier to explore the results of different integration methods, and to compare these results to a workflow that excludes integration steps.
@@ -28,15 +23,24 @@ We enable high-performance via the BPCells package, developed by Ben Parks in th
2823
- Vignette: [Interacting with BPCell matrices in Seurat v5](articles/seurat5_bpcells_interaction_vignette.html)
2924
- BPCells R Package: [Scaling Single Cell Analysis to Millions of Cells](https://bnprks.github.io/BPCells/)\
3025
\
31-
* **Backwards compatibility:** While Seurat v5 introduces new functionality, we have ensured that the software is backwards-compatible with previous versions, so that users will continue to be able to re-run existing workflows. As v5 is still in beta, the CRAN installation (`install.packages("Seurat")`) will continue to install Seurat v4, but users can opt-in to test Seurat v5 by following the instructions in our [install page](install.html).\
26+
* **Analysis of sequencing and imaging-based spatial datasets:** Spatially resolved datasets are redefining our understanding of cellular interactions and the organization of human tissues. Both sequencing-based(i.e. Visium, SLIDE-seq, etc.), and imaging-based (MERFISH/Vizgen, Xenium, CosMX, etc.) technologies have unique advantages, and require tailored analytical methods and software infrastructure. In Seurat v5, we introduce flexible and diverse support for a wide variety of spatially resolved data types, and support for analytical techniqiues for scRNA-seq integration, deconvolution, and niche identification.
27+
28+
- Vignette: [Analysis of spatial datasets (Sequencing-based)](articles/seurat5_spatial_vignette.html)
29+
- Vignette: [Analysis of spatial datasets (Imaging-based)](articles/seurat5_spatial_vignette_2.html)\
30+
\
31+
* **Backwards compatibility:** While Seurat v5 introduces new functionality, we have ensured that the software is backwards-compatible with previous versions, so that users will continue to be able to re-run existing workflows. Previous versions of Seurat, such as Seurat v4, can also be installed following the instructions in our [install page](install.html).\
32+
33+
## **Changes between v4 and v5**
34+
35+
We have documented major changes between Seurat v4 and v5 in our [News page](announcements.html) for reference.
3236

3337
## **About Seurat**
3438

3539
Seurat is an R package designed for QC, analysis, and exploration of single-cell RNA-seq 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.
3640

3741
If you use Seurat in your research, please considering citing:
3842

39-
* [Hao, et al., bioRxiv 2022](https://doi.org/10.1101/2022.02.24.481684) [Seurat v5]
43+
* [Hao, et al., Nature Biotechnology 2023](https://www.nature.com/articles/s41587-023-01767-y) [Seurat v5]
4044
* [Hao\*, Hao\*, et al., Cell 2021](https://doi.org/10.1016/j.cell.2021.04.048) [Seurat v4]
4145
* [Stuart\*, Butler\*, et al., Cell 2019](https://www.cell.com/cell/fulltext/S0092-8674(19)30559-8) [Seurat v3]
4246
* [Butler, et al., Nat Biotechnol 2018](https://doi.org/10.1038/nbt.4096) [Seurat v2]

0 commit comments

Comments
 (0)