Skip to content

Commit 9788970

Browse files
authored
Merge pull request #123 from mojaveazure/release/4.1.4
Release 4.1.4
2 parents 3c9e3df + 8ca9ab5 commit 9788970

File tree

8 files changed

+85
-34
lines changed

8 files changed

+85
-34
lines changed

DESCRIPTION

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
Package: SeuratObject
22
Type: Package
33
Title: Data Structures for Single Cell Data
4-
Version: 4.1.3
5-
Date: 2022-11-07
4+
Version: 4.1.4
65
Authors@R: c(
76
person(given = 'Rahul', family = 'Satija', email = 'rsatija@nygenome.org', role = 'aut', comment = c(ORCID = '0000-0001-9448-8833')),
87
person(given = 'Andrew', family = 'Butler', email = 'abutler@nygenome.org', role = 'aut', comment = c(ORCID = '0000-0003-3608-0463')),
@@ -29,7 +28,7 @@ BugReports:
2928
License: MIT + file LICENSE
3029
Encoding: UTF-8
3130
LazyData: true
32-
RoxygenNote: 7.2.1
31+
RoxygenNote: 7.2.3
3332
Depends:
3433
R (>= 4.0.0),
3534
sp (>= 1.5.0)
@@ -38,7 +37,7 @@ Imports:
3837
future.apply,
3938
grDevices,
4039
grid,
41-
Matrix (>= 1.5.0),
40+
Matrix (>= 1.6.1),
4241
methods,
4342
progressr,
4443
Rcpp (>= 1.0.5),
@@ -48,7 +47,7 @@ Imports:
4847
utils
4948
Suggests:
5049
ggplot2,
51-
rgeos,
50+
sf,
5251
testthat
5352
Collate:
5453
'RcppExports.R'

NEWS.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
1+
# SeuratObject 4.1.4
2+
## Changes
3+
- Fixes for `CellsByIdentities` (#80)
4+
- Remove {rgeos} from Suggests and replace with {sf} due to {rgeos} package retirement
5+
- New check for potential binary breaks between dependencies and SeuratObject
6+
17
# SeuratObject 4.1.3
28
## Changes
3-
- Move {rgeos} to Suggests; segmentation simplification now requires {regos} to be installed manually
9+
- Move {rgeos} to Suggests; segmentation simplification now requires {rgeos} to be installed manually
410
- Move {sp} to Depends
511

612
## Added

R/generics.R

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1064,7 +1064,6 @@ SetIdent <- function(object, ...) {
10641064

10651065
#' Simplify Geometry
10661066
#'
1067-
#' @inheritParams rgeos::gSimplify
10681067
#' @param coords ...
10691068
#'
10701069
#' @return ...

R/seurat.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ CellsByIdentities <- function(
232232
USE.NAMES = TRUE
233233
)
234234
if (any(is.na(x = Idents(object = object)[cells]))) {
235-
cells.idents["NA"] <- names(x = which(x = is.na(x = Idents(object = object)[cells])))
235+
cells.idents[["NA"]] <- names(x = which(x = is.na(x = Idents(object = object)[cells])))
236236
}
237237
return(cells.idents)
238238
}

R/utils.R

Lines changed: 28 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -708,35 +708,43 @@ S4ToList.list <- function(object) {
708708
return(object)
709709
}
710710

711+
#' Simplify segmentations by reducing the number of vertices
712+
#'
713+
#' @param coords A `Segmentation` object
714+
#' @param tol Numerical tolerance value to be used by the Douglas-Peuker algorithm
715+
#' @param topologyPreserve Logical determining if the algorithm should attempt to preserve the topology of the original geometry
716+
#'
717+
#' @return A `Segmentation` object with simplified segmentation vertices
718+
#'
711719
#' @rdname Simplify
712720
#' @method Simplify Spatial
713721
#' @export
714722
#'
715723
Simplify.Spatial <- function(coords, tol, topologyPreserve = TRUE) {
716-
if (!PackageCheck('rgeos', error = FALSE)) {
717-
stop("'Simplify' requires rgeos to be installed", call. = FALSE)
724+
if (!PackageCheck("sf", error = FALSE)) {
725+
stop("'Simplify' requires sf to be installed", call. = FALSE)
718726
}
719727
class.orig <- class(x = coords)
728+
coords.orig <- coords
720729
dest <- ifelse(
721-
test = grepl(pattern = '^Spatial', x = class.orig),
730+
test = grepl(pattern = "^Spatial", x = class.orig),
722731
yes = class.orig,
723-
no = grep(
724-
pattern = '^Spatial',
725-
x = .Contains(object = coords),
726-
value = TRUE
727-
)[1L]
728-
)
729-
coords <- rgeos::gSimplify(
730-
spgeom = as(object = coords, Class = dest),
731-
tol = as.numeric(x = tol),
732-
topologyPreserve = isTRUE(x = topologyPreserve)
733-
)
734-
coords <- tryCatch(
735-
expr = as(object = coords, Class = class.orig),
736-
error = function(...) {
737-
return(coords)
738-
}
739-
)
732+
no = grep(pattern = "^Spatial", x = .Contains(object = coords), value = TRUE)[1L])
733+
x <- sf::st_as_sfc(as(object = coords, Class = dest))
734+
coords <- sf::st_simplify(
735+
x = x,
736+
dTolerance = as.numeric(x = tol),
737+
preserveTopology = isTRUE(x = topologyPreserve))
738+
coords <- sf::st_sf(geometry = coords)
739+
coords <- as(coords, Class = "Spatial")
740+
coords <- as(coords, Class = "Segmentation")
741+
slot(object = coords, name = "polygons") <- mapply(
742+
FUN = function(x, y) {
743+
slot(object = x, name = "ID") <- y
744+
return(x)
745+
},
746+
slot(object = coords, name = "polygons"),
747+
Cells(coords.orig))
740748
return(coords)
741749
}
742750

R/zzz.R

Lines changed: 36 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#' @importFrom sp bbox over
22
#' @importFrom Rcpp evalCpp
3-
#' @importFrom utils head tail
3+
#' @importFrom utils head tail packageVersion
44
#' @importFrom methods new setClass setClassUnion setMethod setOldClass
55
#' setValidity slot slot<- validObject
66
#' @importClassesFrom Matrix dgCMatrix
@@ -24,6 +24,15 @@ Seurat.options <- list(
2424
progressr.clear = FALSE
2525
)
2626

27+
#%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
28+
# Built With
29+
#%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
30+
31+
.BuiltWith <- c(
32+
R = format(x = getRversion()),
33+
Matrix = format(x = packageVersion(pkg = "Matrix"))
34+
)
35+
2736
#%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2837
# Reexports
2938
#%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -460,6 +469,32 @@ NameIndex <- function(x, names, MARGIN) {
460469
# Hooks
461470
#%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
462471

472+
.onAttach <- function(libname, pkgname) {
473+
for (i in names(x = .BuiltWith)) {
474+
current <- switch(EXPR = i, R = getRversion(), packageVersion(pkg = i))
475+
if (current > .BuiltWith[i]) {
476+
msg <- paste(
477+
sQuote(x = pkgname),
478+
"was built",
479+
switch(
480+
EXPR = i,
481+
R = "under R",
482+
paste("with package", sQuote(x = i))
483+
),
484+
.BuiltWith[i],
485+
"but the current version is",
486+
paste0(current, ';'),
487+
"it is recomended that you reinstall ",
488+
sQuote(x = pkgname),
489+
" as the ABI for",
490+
switch(EXPR = i, R = i, sQuote(x = i)),
491+
"may have changed"
492+
)
493+
packageStartupMessage(paste(strwrap(x = msg), collapse = '\n'))
494+
}
495+
}
496+
}
497+
463498
.onLoad <- function(libname, pkgname) {
464499
toset <- setdiff(x = names(x = Seurat.options), y = names(x = options()))
465500
if (length(x = toset)) {

cran-comments.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
# SeuratObject v4.1.3
1+
# SeuratObject v4.1.4
22

33
## Test environments
4-
* local ubuntu 20.04 install, R 4.2.0
4+
* local ubuntu 22.04 install, R 4.2.3
55
* win-builder (oldrelease, release, devel)
66

77
## R CMD check results
@@ -12,6 +12,6 @@ There were no ERRORs, WARNINGs, or NOTEs
1212

1313
There is one package that depends on SeuratObject: tidyseurat; this update does not impact its functionality
1414

15-
There are six packages that import SeuratObject: bbknnR, CAMML, Platypus, scpoisson, Seurat, and Signac; this update does not impact their functionality
15+
There are six packages that import SeuratObject: bbknnR, CAMML, scCustomize, scpoisson, Seurat, and Signac; this update does not impact their functionality
1616

17-
There are five packages that suggest SeuratObject: cellpypes, scOntoMatch, singleCellHaystack, SPECK, and VAM; this update does not impact their functionality
17+
There are seven packages that suggest SeuratObject: cellpypes, RESET, scOntoMatch, SCpubr, singleCellHaystack, SPECK, and VAM; this update does not impact their functionality

man/Simplify.Rd

Lines changed: 5 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)