Skip to content

Commit a1294c4

Browse files
authored
Merge pull request #5905 from satijalab/develop
Seurat v4.1.1
2 parents eaaf675 + 31866cc commit a1294c4

15 files changed

+116
-51
lines changed

DESCRIPTION

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Package: Seurat
2-
Version: 4.1.0
3-
Date: 2022-01-14
2+
Version: 4.1.1
3+
Date: 2022-05-01
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(
@@ -66,7 +66,7 @@ Imports:
6666
scales,
6767
scattermore (>= 0.7),
6868
sctransform (>= 0.3.3),
69-
SeuratObject (>= 4.0.4),
69+
SeuratObject (>= 4.1.0),
7070
shiny,
7171
spatstat.core,
7272
spatstat.geom,

NEWS.md

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,19 @@
1+
# Seurat 4.1.1 (2022-05-01)
2+
3+
## Changes
4+
- Fix `giveCsparse` related warnings in `Read10X_h5`
5+
- Fix ident labeling for `SpatialPlot` ([#5774](https://github.com/satijalab/seurat/issues/5774))
6+
- Fix `ReadMtx` on Windows ([#5687](https://github.com/satijalab/seurat/issues/5687))
7+
- Fix `VlnPlot` to switch on rasterization only when required ([#5846](https://github.com/satijalab/seurat/pull/5846))
8+
- Fix `ncol` behavior in `SpatialPlot` ([#5774](https://github.com/satijalab/seurat/issues/5774))
9+
- Set `jitter` to FALSE in `FeatureScatter` ([#5876](https://github.com/satijalab/seurat/pull/5876))
10+
- Update `Cells` methods to new signature (`x, ...`)
11+
- Replace use of `default.stringsAsFactors()` with `getOption("stringsAsFactors")`
12+
113
# Seurat 4.1.0 (2022-01-14)
214
## Added
315
- Add `raster.dpi` parameter to `DimPlot/FeaturePlot` to optionally rasterize individual points ([#5392](https://github.com/satijalab/seurat/pull/5392))
4-
- Add support for sctransform v2, differential expression on with SCT
16+
- Add support for sctransform v2, differential expression with SCT assay
517

618
## Changes
719
- Update `ReadParseBio` to support split-pipe 0.9.6p ([#5446](https://github.com/satijalab/seurat/pull/5446))

R/generics.R

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -444,15 +444,15 @@ RunPCA <- function(object, ...) {
444444
#' Run Supervised Latent Semantic Indexing
445445
#'
446446
#' Run a supervised LSI (SLSI) dimensionality reduction supervised by a
447-
#' cell-cell kernel. SLSI is used to capture a linear transformation of peaks
447+
#' cell-cell kernel. SLSI is used to capture a linear transformation of peaks
448448
#' that maximizes its dependency to the given cell-cell kernel.
449449
#'
450450
#' @param object An object
451451
#' @param ... Arguments passed to IRLBA irlba
452452
#'
453453
#' @return Returns Seurat object with the SLSI calculation stored in the
454454
#' reductions slot
455-
#'
455+
#'
456456
#' @export
457457
#'
458458
#' @rdname RunSLSI
@@ -506,8 +506,9 @@ RunTSNE <- function(object, ...) {
506506
#' Run UMAP
507507
#'
508508
#' Runs the Uniform Manifold Approximation and Projection (UMAP) dimensional
509-
#' reduction technique. To run, you must first install the umap-learn python
510-
#' package (e.g. via \code{pip install umap-learn}). Details on this package can be
509+
#' reduction technique. To run using \code{umap.method="umap-learn"}, you must
510+
#' first install the umap-learn python package (e.g. via
511+
#' \code{pip install umap-learn}). Details on this package can be
511512
#' found here: \url{https://github.com/lmcinnes/umap}. For a more in depth
512513
#' discussion of the mathematics underlying UMAP, see the ArXiv paper here:
513514
#' \url{https://arxiv.org/abs/1802.03426}.

R/objects.R

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -454,6 +454,7 @@ CreateSCTAssayObject <- function(
454454
#' remove all DimReducs)
455455
#' @param graphs Only keep a subset of Graphs specified here (if NULL, remove
456456
#' all Graphs)
457+
#' @param misc Preserve the \code{misc} slot; default is \code{TRUE}
457458
#'
458459
#' @export
459460
#' @concept objects
@@ -466,7 +467,8 @@ DietSeurat <- function(
466467
features = NULL,
467468
assays = NULL,
468469
dimreducs = NULL,
469-
graphs = NULL
470+
graphs = NULL,
471+
misc = TRUE
470472
) {
471473
object <- UpdateSlots(object = object)
472474
assays <- assays %||% FilterObjects(object = object, classes.keep = "Assay")
@@ -508,6 +510,11 @@ DietSeurat <- function(
508510
}
509511
}
510512
}
513+
# remove misc when desired
514+
if (!isTRUE(x = misc)) {
515+
slot(object = object, name = "misc") <- list()
516+
}
517+
511518
# remove unspecified DimReducs and Graphs
512519
all.objects <- FilterObjects(object = object, classes.keep = c('DimReduc', 'Graph'))
513520
objects.to.remove <- all.objects[!all.objects %in% c(dimreducs, graphs)]
@@ -1301,7 +1308,7 @@ as.sparse.H5Group <- function(x, ...) {
13011308
#' @method Cells SCTModel
13021309
#' @export
13031310
#'
1304-
Cells.SCTModel <- function(x) {
1311+
Cells.SCTModel <- function(x, ...) {
13051312
return(rownames(x = slot(object = x, name = "cell.attributes")))
13061313
}
13071314

@@ -1313,7 +1320,7 @@ Cells.SCTModel <- function(x) {
13131320
#'
13141321
#' @seealso \code{\link[SeuratObject:Cells]{SeuratObject::Cells}}
13151322
#'
1316-
Cells.SlideSeq <- function(x) {
1323+
Cells.SlideSeq <- function(x, ...) {
13171324
return(rownames(x = GetTissueCoordinates(object = x)))
13181325
}
13191326

@@ -1323,7 +1330,7 @@ Cells.SlideSeq <- function(x) {
13231330
#' @method Cells STARmap
13241331
#' @export
13251332
#'
1326-
Cells.STARmap <- function(x) {
1333+
Cells.STARmap <- function(x, ...) {
13271334
return(rownames(x = GetTissueCoordinates(object = x)))
13281335
}
13291336

@@ -1332,7 +1339,7 @@ Cells.STARmap <- function(x) {
13321339
#' @method Cells VisiumV1
13331340
#' @export
13341341
#'
1335-
Cells.VisiumV1 <- function(x) {
1342+
Cells.VisiumV1 <- function(x, ...) {
13361343
return(rownames(x = GetTissueCoordinates(object = x, scale = NULL)))
13371344
}
13381345

@@ -2274,7 +2281,7 @@ setMethod(
22742281
definition = function(object) {
22752282
cat('An AnchorSet object containing', nrow(x = slot(object = object, name = "anchors")),
22762283
"anchors between the reference and query Seurat objects. \n",
2277-
"This can be used as input to TransferData.")
2284+
"This can be used as input to TransferData.\n")
22782285
}
22792286
)
22802287

@@ -2284,7 +2291,7 @@ setMethod(
22842291
definition = function(object) {
22852292
cat('An AnchorSet object containing', nrow(x = slot(object = object, name = "anchors")),
22862293
"anchors between", length(x = slot(object = object, name = "object.list")), "Seurat objects \n",
2287-
"This can be used as input to IntegrateData.")
2294+
"This can be used as input to IntegrateData.\n")
22882295
}
22892296
)
22902297

@@ -2295,7 +2302,7 @@ setMethod(
22952302
cat(
22962303
'A ModalityWeights object containing modality weights between',
22972304
paste(slot(object = object, name = "modality.assay"), collapse = " and "),
2298-
"assays \n", "This can be used as input to FindMultiModelNeighbors.")
2305+
"assays \n", "This can be used as input to FindMultiModelNeighbors.\n")
22992306
}
23002307
)
23012308

@@ -2307,7 +2314,7 @@ setMethod(
23072314
"An sctransform model.\n",
23082315
" Model formula: ", slot(object = object, name = "model"),
23092316
"\n Parameters stored for", nrow(x = SCTResults(object = object, slot = "feature.attributes")), "features,",
2310-
nrow(x = SCTResults(object = object, slot = "cell.attributes")), "cells")
2317+
nrow(x = SCTResults(object = object, slot = "cell.attributes")), "cells.\n")
23112318
}
23122319
)
23132320

R/preprocessing.R

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -954,7 +954,7 @@ Read10X_h5 <- function(filename, use.names = TRUE, unique.features = TRUE) {
954954
p = indptr[],
955955
x = as.numeric(x = counts[]),
956956
dims = shp[],
957-
giveCsparse = FALSE
957+
repr = "T"
958958
)
959959
if (unique.features) {
960960
features <- make.unique(names = features)
@@ -967,7 +967,11 @@ Read10X_h5 <- function(filename, use.names = TRUE, unique.features = TRUE) {
967967
types <- infile[[paste0(genome, '/features/feature_type')]][]
968968
types.unique <- unique(x = types)
969969
if (length(x = types.unique) > 1) {
970-
message("Genome ", genome, " has multiple modalities, returning a list of matrices for this genome")
970+
message(
971+
"Genome ",
972+
genome,
973+
" has multiple modalities, returning a list of matrices for this genome"
974+
)
971975
sparse.mat <- sapply(
972976
X = types.unique,
973977
FUN = function(x) {
@@ -1103,10 +1107,19 @@ ReadMtx <- function(
11031107
"feature list" = features
11041108
)
11051109
for (i in seq_along(along.with = all.files)) {
1106-
uri <- normalizePath(all.files[[i]], mustWork = FALSE)
1110+
uri <- tryCatch(
1111+
expr = {
1112+
con <- url(description = all.files[[i]])
1113+
close(con = con)
1114+
all.files[[i]]
1115+
},
1116+
error = function(...) {
1117+
return(normalizePath(path = all.files[[i]], winslash = '/'))
1118+
}
1119+
)
11071120
err <- paste("Cannot find", names(x = all.files)[i], "at", uri)
11081121
uri <- build_url(url = parse_url(url = uri))
1109-
if (grepl(pattern = '^:///', x = uri)) {
1122+
if (grepl(pattern = '^[A-Z]?:///', x = uri)) {
11101123
uri <- gsub(pattern = '^://', replacement = '', x = uri)
11111124
if (!file.exists(uri)) {
11121125
stop(err, call. = FALSE)

R/utilities.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1610,7 +1610,7 @@ as.data.frame.Matrix <- function(
16101610
row.names = NULL,
16111611
optional = FALSE,
16121612
...,
1613-
stringsAsFactors = default.stringsAsFactors()
1613+
stringsAsFactors = getOption(x = "stringsAsFactors", default = FALSE)
16141614
) {
16151615
return(as.data.frame(
16161616
x = as.matrix(x = x),

R/visualization.R

Lines changed: 25 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1890,7 +1890,7 @@ CellScatter <- function(
18901890
#' 100,000
18911891
#' @param raster.dpi Pixel resolution for rasterized plots, passed to geom_scattermore().
18921892
#' Default is c(512, 512).
1893-
#' @param jitter Jitter for easier visualization of crowded points
1893+
#' @param jitter Jitter for easier visualization of crowded points (default is FALSE)
18941894
#'
18951895
#' @return A ggplot object
18961896
#'
@@ -1924,7 +1924,7 @@ FeatureScatter <- function(
19241924
plot.cor = TRUE,
19251925
raster = NULL,
19261926
raster.dpi = c(512, 512),
1927-
jitter = TRUE
1927+
jitter = FALSE
19281928
) {
19291929
cells <- cells %||% colnames(x = object)
19301930
if (isTRUE(x = shuffle)) {
@@ -2418,7 +2418,7 @@ LinkedDimPlot <- function(
24182418
dims = dims,
24192419
col.by = group.by,
24202420
alpha.by = plot.env$alpha.by
2421-
) + scale_alpha_ordinal(range = alpha) + guides(alpha = FALSE)
2421+
) + scale_alpha_ordinal(range = alpha) + guides(alpha = "none")
24222422
plot.env$dimplot
24232423
}
24242424
)
@@ -2555,7 +2555,7 @@ LinkedFeaturePlot <- function(
25552555
scale_fill_gradientn(name = feature, colours = cols) +
25562556
theme(legend.position = 'top') +
25572557
scale_alpha(range = alpha) +
2558-
guides(alpha = FALSE)
2558+
guides(alpha = "none")
25592559
plot.env$spatialplot
25602560
}
25612561
)
@@ -2914,7 +2914,7 @@ ISpatialFeaturePlot <- function(
29142914
scale_fill_gradientn(name = plot.env$feature, colours = FeaturePalettes[[plot.env$palette]]) +
29152915
theme(legend.position = 'top') +
29162916
scale_alpha(range = c(input$alpha, 1)) +
2917-
guides(alpha = FALSE)
2917+
guides(alpha = "none")
29182918
plot.env$plot
29192919
})
29202920
}
@@ -3232,7 +3232,7 @@ SpatialPlot <- function(
32323232
) +
32333233
theme(legend.position = 'top') +
32343234
scale_alpha(range = alpha) +
3235-
guides(alpha = FALSE)
3235+
guides(alpha = "none")
32363236
} else if (label) {
32373237
plot <- LabelClusters(
32383238
plot = plot,
@@ -3286,10 +3286,14 @@ SpatialPlot <- function(
32863286
# images = GetImage(object = object, mode = 'plotly', image = images)
32873287
# ))
32883288
# }
3289-
if (length(x = images) > 1 && combine) {
3290-
plots <- wrap_plots(plots = plots, ncol = length(x = images))
3291-
} else if (length(x = images == 1) && combine) {
3292-
plots <- wrap_plots(plots = plots, ncol = ncol)
3289+
if (combine) {
3290+
if (!is.null(x = ncol)) {
3291+
return(wrap_plots(plots = plots, ncol = ncol))
3292+
}
3293+
if (length(x = images) > 1) {
3294+
return(wrap_plots(plots = plots, ncol = length(x = images)))
3295+
}
3296+
return(wrap_plots(plots = plots))
32933297
}
32943298
return(plots)
32953299
}
@@ -3542,13 +3546,20 @@ DotPlot <- function(
35423546
if (!is.null(x = id.levels)) {
35433547
data.plot$id <- factor(x = data.plot$id, levels = id.levels)
35443548
}
3545-
if (length(x = levels(x = data.plot$id)) == 1) {
3549+
ngroup <- length(x = levels(x = data.plot$id))
3550+
if (ngroup == 1) {
35463551
scale <- FALSE
35473552
warning(
35483553
"Only one identity present, the expression values will be not scaled",
35493554
call. = FALSE,
35503555
immediate. = TRUE
35513556
)
3557+
} else if (ngroup < 5 & scale) {
3558+
warning(
3559+
"Scaling data with a low number of groups may produce misleading results",
3560+
call. = FALSE,
3561+
immediate. = TRUE
3562+
)
35523563
}
35533564
avg.exp.scaled <- sapply(
35543565
X = unique(x = data.plot$features.plot),
@@ -7240,8 +7251,9 @@ SingleExIPlot <- function(
72407251
if ((nrow(x = data) > 1e5) & !isFALSE(raster)){
72417252
message("Rasterizing points since number of points exceeds 100,000.",
72427253
"\nTo disable this behavior set `raster=FALSE`")
7254+
# change raster to TRUE
7255+
raster <- TRUE
72437256
}
7244-
raster <- TRUE
72457257
}
72467258
if (!is.null(x = seed.use)) {
72477259
set.seed(seed = seed.use)
@@ -7666,6 +7678,7 @@ SingleSpatialPlot <- function(
76667678
colors <- DiscretePalette(length(unique(data[[col.by]])), palette = cols)
76677679
scale <- scale_fill_manual(values = colors, na.value = na.value)
76687680
} else {
7681+
cols <- cols[names(x = cols) %in% data$ident]
76697682
scale <- scale_fill_manual(values = cols, na.value = na.value)
76707683
}
76717684
plot <- plot + scale

cran-comments.md

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,33 @@
1-
# Seurat v4.1.0
1+
# Seurat v4.1.1
22

33
## Test environments
4-
* local Ubuntu 20.04 install, R 4.1.2
4+
* local Ubuntu 20.04 install, R 4.1.3
55
* Ubuntu 16.04.6 (on travis-ci), R 4.0.0, R devel
66
* macOS 10.13.6 (on travis-ci), R 4.0.2
77
* Windows Server 2012 R2 (on AppVeyor), R 4.1.0 Patched
88
* win-builder (release, devel)
99

1010
## R CMD check results
11-
There were no ERRORs, WARNINGs, or NOTEs
11+
There were no ERRORs or WARNINGs
12+
13+
There was one NOTE:
14+
15+
* checking CRAN incoming feasibility ... NOTE
16+
Maintainer: 'Paul Hoffman <seurat@nygenome.org>'
17+
18+
Found the following (possibly) invalid URLs:
19+
URL: https://www.science.org/doi/abs/10.1126/science.aad0501
20+
From: man/cc.genes.Rd
21+
man/cc.genes.updated.2019.Rd
22+
Status: 503
23+
Message: Service Unavailable
24+
25+
This URL is valid and the service still exists. When navigating to the URL either via the documentation or directly, you are taken to the correct article
1226

1327
## Downstream dependencies
1428

1529
There no packages that depend on Seurat
1630

17-
There are sixteen packages that import Seurat: CAMML, CDSeq, CIDER, DR.SC, DUBStepR, PhitestR, Platypus, rPanglaoDB, scDiffCom, scMappR, SCRIP, scRNAstat, Signac, SignacX, SoupX, and tidyseurat; this update does not impact their functionality
31+
There are sixteen packages that import Seurat: CAMML, CIDER, DR.SC, DUBStepR, maple, Platypus, rPanglaoDB, scDiffCom, scMappR, SCRIP, scRNAstat, Signac, SignacX, SoupX, spruce, and tidyseurat; this update does not impact their functionality
1832

19-
There are ten packages that suggest Seurat: BisqueRNA, ClustAssess, clustree, conos, DIscBIO, dyngen, harmony, rliger, Rmagic, and VAM; this update does not impact their functionality.
33+
There are twelve packages that suggest Seurat: BisqueRNA, CIARA, ClustAssess, clustree, conos, DIscBIO, dyngen, harmony, rliger, Rmagic, treefit, and VAM; this update does not impact their functionality.

man/Cells.Rd

Lines changed: 6 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)