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

Seurat v4.0.3 #4608

Merged
merged 57 commits into from
Jun 11, 2021
Merged
Show file tree
Hide file tree
Changes from 11 commits
Commits
Show all changes
57 commits
Select commit Hold shift + click to select a range
47cdb22
check reference.reduction in FindTransferAnchors
yuhanH Apr 30, 2021
0091105
Bugfix to as.SingleCellExperiment
bbimber May 25, 2021
85d5ea0
add CIPR to wrappers table
andrewwbutler May 26, 2021
05edace
Merge branch 'develop' into feat/store_ref.reduction
andrewwbutler May 27, 2021
d40234c
Merge pull request #565 from satijalab/docs/add_cipr
mojaveazure May 27, 2021
78c2c94
explicitly specify reference.reduction
andrewwbutler May 27, 2021
8b32544
Merge pull request #566 from satijalab/docs/mapping_vignette_update
andrewwbutler May 27, 2021
586afba
Merge branch 'develop' into feat/store_ref.reduction
andrewwbutler May 27, 2021
c93899a
minor style changes, update NEWS, bump version
andrewwbutler May 27, 2021
469dd48
Merge pull request #558 from satijalab/feat/store_ref.reduction
andrewwbutler May 28, 2021
3a80651
Minor style fixes
mojaveazure May 28, 2021
b152aed
Skip SCE tests on CRAN
mojaveazure May 28, 2021
410f968
Bump develop version
mojaveazure May 28, 2021
b83acea
Merge pull request #4532 from bbimber/SingleCellExperiment
mojaveazure May 28, 2021
ec9dbe2
Merge branch 'develop' of github.com:satijalab/seurat-private into de…
mojaveazure May 28, 2021
2d7beb5
fix assay metadata setting error
andrewwbutler May 28, 2021
892096f
UpdateSymbolList no longer searches aliases
mojaveazure May 28, 2021
b2abc82
Merge branch 'develop' into fix/sce_convert
andrewwbutler May 28, 2021
7990019
transfer scale.data slot to assay in SCE conversion
andrewwbutler May 28, 2021
7b817c0
enable alpha parameter for SpatialDimPlot
andrewwbutler May 28, 2021
b7ad561
add doc entry
andrewwbutler May 28, 2021
2287748
fix DimReduc conversion
andrewwbutler May 31, 2021
129920b
fix seuratdata
andrewwbutler May 31, 2021
e1abe08
another seuratdata fix
andrewwbutler May 31, 2021
75417fe
forgot quotes
andrewwbutler May 31, 2021
8d45e29
altExp fix
andrewwbutler Jun 1, 2021
66cbaee
fix multiassay in both versions
andrewwbutler Jun 1, 2021
ff626fe
Merge pull request #567 from satijalab/fix/sce_convert
mojaveazure Jun 1, 2021
a5cb5ed
bump version
andrewwbutler Jun 1, 2021
5f39ee9
Merge branch 'develop' into fix/UpdateSymbolList
andrewwbutler Jun 1, 2021
5991ca0
bump version, update NEWS
andrewwbutler Jun 2, 2021
8616d90
Merge pull request #568 from satijalab/fix/UpdateSymbolList
andrewwbutler Jun 2, 2021
42d4a01
merge
andrewwbutler Jun 2, 2021
7a996cf
bump version, update NEWS
andrewwbutler Jun 2, 2021
01a8a0c
Merge pull request #569 from satijalab/feat/sce_scaledata
andrewwbutler Jun 2, 2021
7a0e25e
Merge branch 'develop' into fix/SpatialPlot_alpha
andrewwbutler Jun 2, 2021
29a6331
add jitter option to FeatureScatter + related fxns
jaisonj708 Jun 4, 2021
aa18912
docs
jaisonj708 Jun 4, 2021
2506757
fix sce conversion when reducedDim is missing names
andrewwbutler Jun 4, 2021
53cc056
bump verion, update NEWS
andrewwbutler Jun 7, 2021
8debeb1
fix colname dropping issue in feature metadata
andrewwbutler Jun 7, 2021
60230d6
Merge pull request #570 from satijalab/fix/SpatialPlot_alpha
andrewwbutler Jun 7, 2021
dfa68df
Merge branch 'develop' into fix/sce_conversion
andrewwbutler Jun 7, 2021
8482f75
fix altExp convert
andrewwbutler Jun 7, 2021
ec94c09
make roundtrip names consistent when possible
andrewwbutler Jun 7, 2021
0ca5130
update NEWS, bump version
andrewwbutler Jun 7, 2021
ae27911
Merge pull request #572 from satijalab/fix/sce_conversion
andrewwbutler Jun 8, 2021
5e4037e
Merge branch 'develop' into feat/scatterJitter
andrewwbutler Jun 8, 2021
04ba209
bump version, update NEWS
andrewwbutler Jun 8, 2021
3ccb993
Merge pull request #571 from satijalab/feat/scatterJitter
andrewwbutler Jun 8, 2021
57217d8
release prep
andrewwbutler Jun 8, 2021
c3a2583
replace v4preprint with paper
andrewwbutler Jun 8, 2021
fa10ca2
Pin latest version of SeuratObject
mojaveazure Jun 9, 2021
0714eb0
Update CRAN comments
mojaveazure Jun 9, 2021
599d8ba
Fix broken documentation
mojaveazure Jun 9, 2021
7ffd355
Update dates
mojaveazure Jun 10, 2021
d0cd778
Merge pull request #573 from satijalab/release/4.0.3
mojaveazure Jun 10, 2021
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
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: Seurat
Version: 4.0.2.9002
Date: 2021-05-28
Version: 4.0.2.9003
Date: 2021-06-01
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
34 changes: 19 additions & 15 deletions R/objects.R
Original file line number Diff line number Diff line change
Expand Up @@ -1106,15 +1106,17 @@ as.Seurat.SingleCellExperiment <- function(
DefaultAssay(object = object) <- assay
# add feature level meta data
md <- SingleCellExperiment::rowData(x = x)
# replace underscores
rownames(x = md) <- gsub(pattern = "_", replacement = "-", x = rownames(x = md))
md <- as.data.frame(x = md)
# ensure order same as data
md <- md[rownames(x = object[[assay]]), ]
object[[assay]] <- AddMetaData(
object = object[[assay]],
metadata = md
)
if (ncol(x = md) > 0) {
# replace underscores
rownames(x = md) <- gsub(pattern = "_", replacement = "-", x = rownames(x = md))
md <- as.data.frame(x = md)
# ensure order same as data
md <- md[rownames(x = object[[assay]]), ]
object[[assay]] <- AddMetaData(
object = object[[assay]],
metadata = md
)
}
Idents(object = object) <- project
# Get DimReduc information, add underscores if needed and pull from different alt EXP
if (length(x = SingleCellExperiment::reducedDimNames(x = x)) > 0) {
Expand Down Expand Up @@ -1174,17 +1176,17 @@ as.SingleCellExperiment.Seurat <- function(x, assay = NULL, ...) {
}
experiments <- list()
for (assayn in assay) {
assays = list(
counts = GetAssayData(object = x, assay = assayn, slot = "counts"),
logcounts = GetAssayData(object = x, assay = assayn, slot = "data"))
assays = list(
counts = GetAssayData(object = x, assay = assayn, slot = "counts"),
logcounts = GetAssayData(object = x, assay = assayn, slot = "data"))
assays <- assays[sapply(X = assays, FUN = nrow) != 0]
sume <- SummarizedExperiment::SummarizedExperiment(assays = assays)
experiments[[assayn]] <- sume
}
# create one single cell experiment
sce <- as(object = experiments[[1]], Class = "SingleCellExperiment")
sce <- SingleCellExperiment::SingleCellExperiment(sce, altExps = experiments)
orig.exp.name <- names(x = experiments[1])
sce <- SingleCellExperiment::SingleCellExperiment(sce, altExps = experiments)
sce <- SingleCellExperiment::swapAltExp(
x = sce,
name = orig.exp.name,
Expand All @@ -1210,13 +1212,15 @@ as.SingleCellExperiment.Seurat <- function(x, assay = NULL, ...) {
}
for (dr in FilterObjects(object = x, classes.keep = "DimReduc")) {
assay.used <- DefaultAssay(object = x[[dr]])
if (assay.used %in% SingleCellExperiment::altExpNames(x = sce)) {
if (assay.used %in% SingleCellExperiment::altExpNames(x = sce) & assay.used != orig.exp.name) {
sce <- SingleCellExperiment::swapAltExp(
x = sce,
name = assay.used,
saved = orig.exp.name
)
SingleCellExperiment::reducedDim(x = sce, type = toupper(x = dr)) <- Embeddings(object = x[[dr]])
}
SingleCellExperiment::reducedDim(x = sce, type = toupper(x = dr)) <- Embeddings(object = x[[dr]])
if (assay.used %in% SingleCellExperiment::altExpNames(x = sce) & assay.used != orig.exp.name) {
sce <- SingleCellExperiment::swapAltExp(
x = sce,
name = orig.exp.name,
Expand Down
10 changes: 7 additions & 3 deletions vignettes/conversion_vignette.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ knitr::opts_chunk$set(
)
```

```{r, include = FALSE, cache=FALSE}
options(SeuratData.repo.use = "http://satijalab04.nygenome.org")
```
In this vignette, we demonstrate the ability to convert between Seurat objects, SingleCellExperiment objects, and anndata objects.

```{r packages}
Expand All @@ -41,6 +44,7 @@ library(Seurat)
# install SeuratDisk from GitHub using the remotes package
# remotes::install_github(repo = 'mojaveazure/seurat-disk', ref = 'develop')
library(SeuratDisk)
library(SeuratData)
library(patchwork)
```

Expand All @@ -49,9 +53,9 @@ library(patchwork)
[`SingleCellExperiment`](https://bioconductor.org/packages/release/bioc/html/SingleCellExperiment.html) is a class for storing single-cell experiment data, created by Davide Risso, Aaron Lun, and Keegan Korthauer, and is used by many Bioconductor analysis packages. Here we demonstrate converting the Seurat object produced in our 3k PBMC tutorial to SingleCellExperiment for use with Davis McCarthy's [scater](https://bioconductor.org/packages/release/bioc/html/scater.html) package.

```{r seurat_singlecell}
# download from satija lab
# https://www.dropbox.com/s/kwd3kcxkmpzqg6w/pbmc3k_final.rds?dl=0
pbmc <- readRDS(file = '../data/pbmc3k_final.rds')
# Use PBMC3K from SeuratData
InstallData("pbmc3k")
pbmc <- LoadData(ds = "pbmc3k", type = "pbmc3k.final")
pbmc.sce <- as.SingleCellExperiment(pbmc)
p1 <- plotExpression(pbmc.sce, features = 'MS4A1', x = 'ident') + theme(axis.text.x = element_text(angle = 45, hjust = 1))
p2 <- plotPCA(pbmc.sce, colour_by = 'ident')
Expand Down