Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prepare for upcoming Seurat v5 release #133

Open
saketkc opened this issue Oct 3, 2023 · 1 comment
Open

Prepare for upcoming Seurat v5 release #133

saketkc opened this issue Oct 3, 2023 · 1 comment
Labels
help wanted Extra attention is needed

Comments

@saketkc
Copy link

saketkc commented Oct 3, 2023

I am opening this issue as a notification because conos is listed here as a package that relies (depends/imports/suggests) on Seurat. As you may know, we recently released Seurat v5 as a beta in March of this year, with new updates for spatial, multimodal, and massively scalable analysis. For more information on updates and improvements, check out our website https://satijalab.org/seurat/.
We are now preparing to release Seurat v5 to CRAN, and plan to submit it on October 23rd. While we have tried our best to keep things backward-compatible, it is possible that updates to Seurat and SeuratObject might break your existing functionality or tests. We wanted to reach out before the new version is on CRAN, so that there's time to report issues/incompatibilities and prepare you for any changes in your code base that might be necessary.

We apologize for any disruption or inconvenience, but hope that the improvements to Seurat v5 will benefit your users going forward.
To test the upcoming release, you can install Seurat from the seurat5 branch using the instructions available on this page: https://satijalab.org/seurat/articles/install.

Thank you!
Seurat v5 team

@evanbiederstedt evanbiederstedt added the help wanted Extra attention is needed label Oct 3, 2023
@evanbiederstedt
Copy link
Collaborator

Hi @saketkc

Thanks for the heads up.

We basically try to check for various versions of Seurat:

conos/R/integrations.R

Lines 28 to 91 in 7cc6729

#' @keywords internal
checkSeuratV3 <- function() {
if (!requireNamespace('Seurat', quietly = TRUE) || packageVersion('Seurat') < package_version(x = '3.0.0')) {
stop("Use of Seurat v3-backed Conos objects requires Seurat v3.X installed")
}
}
#' @keywords internal
seuratProcV2 <- function(count.matrix, vars.to.regress=NULL, verbose=TRUE, do.par=TRUE, n.pcs=100, cluster=TRUE, tsne=TRUE, umap=FALSE) {
if (!requireNamespace("Seurat", quietly = TRUE)) {
stop("Package \"Seurat\" is needed for this function to work. Please install it, as described here: <https://satijalab.org/seurat/articles/install.html>.", call. = FALSE)
}
if (verbose) {
message("Running Seurat v2 workflow")
}
rownames(count.matrix) <- make.unique(rownames(count.matrix))
max.n.pcs <- min(nrow(count.matrix) - 1, ncol(count.matrix) - 1, n.pcs)
so <- Seurat::CreateSeuratObject(count.matrix, display.progress=verbose) %>%
Seurat::NormalizeData(display.progress=verbose) %>%
Seurat::ScaleData(vars.to.regress=vars.to.regress, display.progress=verbose, do.par=do.par) %>%
Seurat::FindVariableFeatures(do.plot = FALSE, display.progress=verbose) %>%
Seurat::RunPCA(pcs.compute=max.n.pcs, do.print=FALSE)
if (cluster) {
so <- Seurat::FindClusters(so, n.iter=500, n.start=10, dims.use=1:n.pcs, print.output = FALSE)
}
if (tsne) {
so <- Seurat::RunTSNE(so, dims.use=1:n.pcs)
}
if (umap) {
if (packageVersion('Seurat') < package_version(x = '2.3.1')) {
warning("UMAP support in Seurat came in v2.3.1, please update to a newer version of Seurt to enable UMAP functionality", immediate. = TRUE)
} else {
so <- Seurat::RunUMAP(object = so, dims.use = 1:n.pcs)
}
}
return(so)
}
#' @keywords internal
seuratProcV3 <- function(count.matrix, vars.to.regress=NULL, verbose=TRUE, n.pcs=100, cluster=TRUE, tsne=TRUE, umap=FALSE, ...) {
if (!requireNamespace("Seurat", quietly = TRUE)) {
stop("Package \"Seurat\" needed for this function to work. Please install it, as described here: <https://satijalab.org/seurat/articles/install.html>.", call. = FALSE)
}
if (verbose) {
message("Running Seurat v3 workflow")
}
so <- Seurat::CreateSeuratObject(counts = count.matrix)
so <- Seurat::NormalizeData(object = so, verbose = verbose)
so <- Seurat::FindVariableFeatures(object = so, verbose = verbose)
so <- Seurat::ScaleData(object = so, vars.to.regress = vars.to.regress, verbose = verbose)
so <- Seurat::RunPCA(object = so, npcs = n.pcs, verbose = verbose)
if (cluster) {
so <- Seurat::FindNeighbors(object = so, dims = 1:n.pcs, verbose = verbose)
so <- Seurat::FindClusters(object = so, n.iter = 500, n.start = 10, verbose = verbose)
}
if (tsne) {
so <- Seurat::RunTSNE(object = so, dims = 1:n.pcs)
}
if (umap) {
so <- Seurat::RunUMAP(object = so, dims = 1:n.pcs, verbose = verbose)
}
return(so)
}

Given breaking changes for v5, would you be able to help out pointing out what needs to change?

If I have some pointers, I could do work here. But I don't have the bandwidth to check all edge cases right now.

Best, Evan

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants