Skip to content

Commit

Permalink
minor fixes, use SeuratData when possible
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewwbutler committed Jan 26, 2021
1 parent 040536c commit d32c791
Show file tree
Hide file tree
Showing 15 changed files with 59 additions and 45 deletions.
11 changes: 7 additions & 4 deletions index.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ We are excited to release Seurat v4.0! This update brings the following new feat

* **Rapid mapping of query datasets to references.** We introduce Azimuth, a workflow to leverage high-quality reference datasets to rapidly map new scRNA-seq datasets (queries). For example, you can map any scRNA-seq dataset of human PBMC onto our reference, automating the process of visualization, clustering annotation, and differential expression. Azimuth can be run within Seurat, or using a standalone web application that requires no installation or programming experience.

- Vignette: [Mapping scRNA-seq queries onto reference datasets](articles/reference_mapping.html)
- Vignette: [Mapping scRNA-seq queries onto reference datasets](articles/multimodal_reference_mapping.html)
- Web app: [Automated mapping, visualization, and annotation of scRNA-seq datasets from human PBMC]("../azimuth/")

Additional speed and usability updates: We have made minor changes in v4, primarily to improve the performance of Seurat v4 on large datasets. These changes substantially improve the speed and memory requirements, but do not adversely impact downstream results. We provide a detailed description of key changes [here](articles/v4_changes.html). Users who wish to fully reproduce existing results can continue to do so by continuing to install Seurat v3.
Expand All @@ -27,9 +27,12 @@ Seurat is an R package designed for QC, analysis, and exploration of single-cell

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

* [Stuart\*, Butler\*, et al., Cell 2019](https://www.cell.com/cell/fulltext/S0092-8674(19)30559-8)
* [Hao\*, Hao\*, et al., bioRxiv 2020](https://www.biorxiv.org/content/10.1101/2020.10.12.335331v1)
* [Hao\*, Hao\*, et al., bioRxiv 2020](https://www.biorxiv.org/content/10.1101/2020.10.12.335331v1) [Seurat V4]
* [Stuart\*, Butler\*, et al., Cell 2019](https://www.cell.com/cell/fulltext/S0092-8674(19)30559-8) [Seurat V3]
* [Butler\* et al., Nat Biotechnol 2018](https://doi.org/10.1038/nbt.4096) [Seurat V2]
* [Satija\*, Farrel\*, et al., Nat Biotechnol 2015](https://doi.org/10.1038/nbt.3192) [Seurat V1]


All methods emphasize clear, attractive, and interpretable visualizations, and were designed to be [easily used](articles/vignettes_overview.html) by both dry-lab and wet-lab researchers.

Seurat is developed and maintained by the Satija lab, in particular by [Andrew Butler](mailto:[email protected]), [Paul Hoffman](mailto:[email protected]), [Tim Stuart](mailto:[email protected]), [Christoph Hafemeister](mailto:[email protected]), and [Shiwei Zheng](mailto:[email protected]), and is released under the GNU Public License (GPL 3.0). We are also grateful for significant ideas and code from [Jeff Farrell](mailto:[email protected]), [Karthik Shekhar](mailto:[email protected]), and other generous contributors.
Seurat is developed and maintained by the [Satija lab](authors.html) and is released under the GNU Public License (GPL 3.0).
11 changes: 8 additions & 3 deletions vignettes/de_vignette.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,18 @@ knitr::opts_chunk$set(
)
```

```{r, include = FALSE}
options(SeuratData.repo.use = "http://satijalab04.nygenome.org")
```

# Load in the data

This vignette highlights some example workflows for performing differential expression in Seurat. For demonstration purposes, we will be using the 2,700 PBMC object that is created in the first guided tutorial. You can download the pre-computed object [here](https://www.dropbox.com/s/63gnlw45jf7cje8/pbmc3k_final.rds?dl=1).
This vignette highlights some example workflows for performing differential expression in Seurat. For demonstration purposes, we will be using the 2,700 PBMC object that is available via the [SeuratData](https://github.com/satijalab/seurat-data) package).

```{r load_data}
library(Seurat)
pbmc <- readRDS(file = "../data/pbmc3k_final.rds")
library(SeuratData)
pbmc <- LoadData("pbmc3k", type = "pbmc3k.final")
```

# Perform default differential expression tests
Expand All @@ -55,7 +60,7 @@ head(monocyte.de.markers)
The results data frame has the following columns :

* p_val : p_val (unadjusted)
* avg_logFC : log fold-change of the average expression between the two groups. Positive values indicate that the feature is more highly expressed in the first group.
* avg_log2FC : log fold-change of the average expression between the two groups. Positive values indicate that the feature is more highly expressed in the first group.
* pct.1 : The percentage of cells where the feature is detected in the first group
* pct.2 : The percentage of cells where the feature is detected in the second group
* p_val_adj : Adjusted p-value, based on Bonferroni correction using all features in the dataset.
Expand Down
5 changes: 3 additions & 2 deletions vignettes/dim_reduction_vignette.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,12 @@ knitr::opts_chunk$set(

# Load in the data

This vignette demonstrates how to store and interact with dimensional reduction information (such as the output from `RunPCA()`) in Seurat v3.0. For demonstration purposes, we will be using the 2,700 PBMC object that is created in the first guided tutorial. You can download the pre-computed object [here](https://www.dropbox.com/s/kwd3kcxkmpzqg6w/pbmc3k_final.rds?dl=1).
This vignette demonstrates how to store and interact with dimensional reduction information (such as the output from `RunPCA()`) in Seurat. For demonstration purposes, we will be using the 2,700 PBMC object that is available via the [SeuratData](https://github.com/satijalab/seurat-data) package.

```{r load_data}
library(Seurat)
pbmc <- readRDS(file = "../data/pbmc3k_final.rds")
library(SeuratData)
pbmc <- LoadData("pbmc3k", type = "pbmc3k.final")
```

# Explore the new dimensional reduction structure
Expand Down
8 changes: 4 additions & 4 deletions vignettes/essential_commands.Rmd
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
title: "Seurat v3.0 Command List"
title: "Seurat Command List"
output:
html_document:
theme: united
Expand Down Expand Up @@ -59,7 +59,7 @@ DimPlot(object = pbmc, reduction = 'tsne')

# `Seurat` Object Interaction

With Seurat v3.0, we’ve made improvements to the Seurat object, and added new methods for user interaction. We also introduce simple functions for common tasks, like subsetting and merging, that mirror standard R functions.
Since Seurat v3.0, we’ve made improvements to the Seurat object, and added new methods for user interaction. We also introduce simple functions for common tasks, like subsetting and merging, that mirror standard R functions.

<!--With Seurat v3.0, the `Seurat` object has changed considerably. Interacting with the object has also changed, with new accessor and setter functions taking over the role of manually adding data by chaining `@` and `$` symbols. In addition, many former Seurat-specific functions have been deprecated in favor of using standard R generics, yielding a more native R experience when using Seurat.-->

Expand Down Expand Up @@ -154,7 +154,7 @@ Loadings(object = pbmc, reduction = 'pca', projected = TRUE)
FetchData(object = pbmc, vars = c('PC_1', 'percent.mito', 'MS4A1'))
```

# Visualization in Seurat v3.0
# Visualization in Seurat

Seurat has a vast, ggplot2-based plotting library. All plotting functions will return a ggplot2 plot by default, allowing easy customization with ggplot2.

Expand Down Expand Up @@ -222,7 +222,7 @@ LabelPoints(plot = plot, points = TopCells(object = pbmc[["pca"]]), repel = TRUE

# Multi-Assay Features

With Seurat v3.0, you can easily switch between different assays at the single cell level (such as ADT counts from CITE-seq, or integrated/batch-corrected data). Most functions now take an assay parameter, but you can set a Default Assay to aviod repetitive statements.
With Seurat, you can easily switch between different assays at the single cell level (such as ADT counts from CITE-seq, or integrated/batch-corrected data). Most functions now take an assay parameter, but you can set a Default Assay to avoid repetitive statements.

```{r multi-assay}
cbmc <- CreateSeuratObject(counts = cbmc.rna)
Expand Down
2 changes: 1 addition & 1 deletion vignettes/hashing_vignette.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ DimPlot(pbmc.singlet, group.by = "HTO_classification")
<li> Each cell line was further split into three samples (12 samples in total). </li>
<li> Each sample was labeled with a hashing antibody mixture (CD29 and CD45), pooled, and run on a single lane of 10X. </li>
<li> Based on this design, we should be able to detect doublets both across and within cell types</li>
<li> You can download the count matrices for RNA and HTO [here](https://www.dropbox.com/sh/c5gcjm35nglmvcv/AABGz9VO6gX9bVr5R2qahTZha?dl=0), and we are currently uploading data to GEO</li>
<li> You can download the count matrices for RNA and HTO [here](https://www.dropbox.com/sh/c5gcjm35nglmvcv/AABGz9VO6gX9bVr5R2qahTZha?dl=0), and are available on GEO [here](https://www.ncbi.nlm.nih.gov/geo/query/acc.cgi?acc=GSE108313)</li>
</ul></div>
</div>

Expand Down
12 changes: 9 additions & 3 deletions vignettes/install.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,19 @@ Do you want to attempt to install these from sources?
y/n:
```

The CRAN release of Seurat is currently version 3.2.3. If you have installed version 3.2.3 and want to switch back to the last version 2, please see the "Previous Versions" section below

# Install previous versions of Seurat

## Install any version 3 release

Any of the Seurat version 3 releases can be installed with the following command:

```{r eval = FALSE}
remotes::install_version("Seurat", version = "3.X.X")
```

## Install the last version 2 release (2.3.4)

To facilitate easy reinstallation of the last version 2 release, we are hosting the binaries on our website. These can be installed with the following command:
To facilitate easy re-installation of the last version 2 release, we are hosting the binaries on our website. These can be installed with the following command:

```{r eval = FALSE}
source("https://z.umn.edu/archived-seurat")
Expand Down
2 changes: 1 addition & 1 deletion vignettes/integration_introduction.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ knitr::opts_chunk$set(

The joint analysis of two or more single-cell datasets poses unique challenges. In particular, identifying cell populations that are present across multiple datasets can be problematic under standard workflows. Seurat v4 includes a set of methods to match (or ‘align’) shared cell populations across datasets. These methods first identify cross-dataset pairs of cells that are in a matched biological state (‘anchors’), can be used both to correct for technical differences between datasets (i.e. batch effect correction), and to perform comparative scRNA-seq analysis of across experimental conditions.

Below, we demonstrate methods for scRNA-seq integration as described in [Stuart*, Butler* et al, 2019](https://www.cell.com/cell/fulltext/S0092-8674(19)30559-8) to perform a comparative analysis of human immune cells (PBMC) in either a [resting or interferon-stimulated state]((https://www.nature.com/articles/nbt.4042).
Below, we demonstrate methods for scRNA-seq integration as described in [Stuart\*, Butler\* et al, 2019](https://www.cell.com/cell/fulltext/S0092-8674(19)30559-8) to perform a comparative analysis of human immune cells (PBMC) in either a [resting or interferon-stimulated state](https://www.nature.com/articles/nbt.4042).

## Integration goals

Expand Down
6 changes: 3 additions & 3 deletions vignettes/integration_mapping.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ pancreas.list <- SplitObject(panc8, split.by = "tech")
pancreas.list <- pancreas.list[c("celseq", "celseq2", "fluidigmc1", "smartseq2")]
```

Prior to finding anchors, we perform standard preprocessing (log-normalization), and identify variable features individually for each. Note that Seurat v3 implements an improved method for variable feature selection based on a variance stabilizing transformation (`"vst"`)
Prior to finding anchors, we perform standard preprocessing (log-normalization), and identify variable features individually for each. Note that Seurat implements an improved method for variable feature selection based on a variance stabilizing transformation (`"vst"`)

```{r preprocessing3}
for (i in 1:length(pancreas.list)) {
Expand Down Expand Up @@ -117,7 +117,7 @@ ggsave(filename = "pancreas_integrated_umap.png", height = 7, width = 12, plot =

# Cell type classification using an integrated reference

Seurat v3 also supports the projection of reference data (or meta data) onto a query object. While many of the methods are conserved (both procedures begin by identifying anchors), there are two important distinctions between data transfer and integration:
Seurat also supports the projection of reference data (or meta data) onto a query object. While many of the methods are conserved (both procedures begin by identifying anchors), there are two important distinctions between data transfer and integration:

1. In data transfer, Seurat does not correct or modify the query expression data.
2. In data transfer, Seurat has an option (set by default) to project the PCA structure of a reference onto the query, instead of learning a joint structure with CCA. We generally suggest using this option when projecting data between scRNA-seq datasets.
Expand All @@ -131,7 +131,7 @@ predictions <- TransferData(anchorset = pancreas.anchors, refdata = pancreas.int
pancreas.query <- AddMetaData(pancreas.query, metadata = predictions)
```

Because we have the original label annotations from our full integrated analysis, we can evaluate how well our predicted cell type annotations match the full reference. In this example, we find that there is a high agreement in cell type classification, with over 97% of cells being labeled correctly.
Because we have the original label annotations from our full integrated analysis, we can evaluate how well our predicted cell type annotations match the full reference. In this example, we find that there is a high agreement in cell type classification, with over 96% of cells being labeled correctly.

```{r analysis2}
pancreas.query$prediction.match <- pancreas.query$predicted.id == pancreas.query$celltype
Expand Down
2 changes: 1 addition & 1 deletion vignettes/merge_vignette.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ To merge more than two `Seurat` objects, simply pass a vector of multiple `Seura
```{r merge_three}
library(SeuratData)
InstallData("pbmc3k")
pbmc <- LoadData("pbmc3k", type = "pbmc3k.final")
pbmc3k <- LoadData("pbmc3k", type = "pbmc3k.final")
pbmc3k
pbmc.big <- merge(pbmc3k, y = c(pbmc4k, pbmc8k), add.cell.ids = c('3K', '4K', '8K'), project = 'PBMC15K')
Expand Down
7 changes: 3 additions & 4 deletions vignettes/multimodal_reference_mapping.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,10 @@ In this vignette, we demonstrate how to use a previously established reference t
* Project each query cell onto a previously computed UMAP visualization
* Impute the predicted levels of surface proteins that were measured in the CITE-seq reference

To run this vignette please install Seurat v4, available as a beta release on our github page. Additionally, you will need to install the latest version of the `uwot` package and the `SeuratDisk` package.
To run this vignette please install Seurat v4, available on CRAN. Additionally, you will need to install the `SeuratDisk` package.

```{r install, eval = FALSE}
remotes::install_github("satijalab/seurat", ref = "release/4.0.0")
remotes::install_github("jlmelville/uwot")
install.packages("Seurat")
remotes::install_github("mojaveazure/seurat-disk")
```

Expand Down Expand Up @@ -211,7 +210,7 @@ pbmc3k$id <- 'query'
refquery <- merge(reference, pbmc3k)
refquery[["spca"]] <- merge(reference[["spca"]], pbmc3k[["ref.spca"]])
refquery <- RunUMAP(refquery, reduction = 'spca', dims = 1:50)
DimPlot(refquery, group.by = 'id')
DimPlot(refquery, group.by = 'id', shuffle = TRUE)
```

# BMNC
Expand Down
Loading

0 comments on commit d32c791

Please sign in to comment.