# Seurat-Local - Reference

**Pages:** 431

---

## Transfer data from sketch data to full data — TransferSketchLabels • Seurat

**URL:** http://127.0.0.1:9173/reference_transfersketchlabels.html

**Contents:**
- Transfer data from sketch data to full data
- Arguments
- Value
- Contents

This function transfers cell type labels from a sketched dataset to a full dataset based on the similarities in the lower dimensional space.

Sketched assay name. Default is 'sketch'.

Dimensional reduction name to use for label transfer.

An integer vector indicating which dimensions to use for label transfer.

A list of character strings indicating the metadata columns containing labels to transfer. Default is NULL. Similar to refdata in `MapQuery`

Number of neighbors to use for label transfer. Default is 50.

Dimensional reduction model to use for label transfer. Default is NULL.

An object storing the neighbors found during the sketching process. Default is NULL.

Whether to recompute the neighbors for label transfer. Default is FALSE.

Whether to recompute the weights for label transfer. Default is FALSE.

Print progress and diagnostic messages

A Seurat object with transferred labels stored in the metadata. If a UMAP model is provided, the full data are also projected onto the UMAP space, with the results stored in a new reduction, full.`reduction.model`

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/sketching.R
```

Example 2 (unknown):
```unknown
TransferSketchLabels.Rd
```

Example 3 (unknown):
```unknown
TransferSketchLabels(
  object,
  sketched.assay = "sketch",
  reduction,
  dims,
  refdata = NULL,
  k = 50,
  reduction.model = NULL,
  neighbors = NULL,
  recompute.neighbors = FALSE,
  recompute.weights = FALSE,
  verbose = TRUE
)
```

Example 4 (r):
```r
TransferSketchLabels(
  object,
  sketched.assay = "sketch",
  reduction,
  dims,
  refdata = NULL,
  k = 50,
  reduction.model = NULL,
  neighbors = NULL,
  recompute.neighbors = FALSE,
  recompute.weights = FALSE,
  verbose = TRUE
)
```

Example 5 (r):
```r
TransferSketchLabels(
  object,
  sketched.assay = "sketch",
  reduction,
  dims,
  refdata = NULL,
  k = 50,
  reduction.model = NULL,
  neighbors = NULL,
  recompute.neighbors = FALSE,
  recompute.weights = FALSE,
  verbose = TRUE
)
```

---

## Find spatially variable features — FindSpatiallyVariableFeatures • Seurat

**URL:** http://127.0.0.1:9173/reference_findspatiallyvariablefeatures.html

**Contents:**
- Find spatially variable features
- Arguments
- Contents

Identify features whose variability in expression can be explained to some degree by spatial location.

A Seurat object, assay, or expression matrix

Arguments passed to other methods

Coordinates for each cell/spot/bead

Method for selecting spatially variable features.

markvariogram: See RunMarkVario for details

moransi: See RunMoransI for details.

r value at which to report the "trans" value of the mark variogram

Number of divisions to make in the x direction, helps define the grid over which binning is performed

Number of divisions to make in the y direction, helps define the grid over which binning is performed

Print messages and progress

Slot in the Assay to pull data from

If provided, only compute on given features. Otherwise, compute for all features.

Number of features to mark as the top spatially variable.

Assay to pull the features (marks) from

Name of image to pull the coordinates from

Layer in the Assay5 to pull data from

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/generics.R
```

Example 2 (unknown):
```unknown
R/preprocessing.R
```

Example 3 (unknown):
```unknown
R/preprocessing5.R
```

Example 4 (unknown):
```unknown
FindSpatiallyVariableFeatures.Rd
```

Example 5 (python):
```python
FindSpatiallyVariableFeatures(object, ...)

# Default S3 method
FindSpatiallyVariableFeatures(
  object,
  spatial.location,
  selection.method = c("markvariogram", "moransi"),
  r.metric = 5,
  x.cuts = NULL,
  y.cuts = NULL,
  verbose = TRUE,
  ...
)

# S3 method for class 'Assay'
FindSpatiallyVariableFeatures(
  object,
  slot = "scale.data",
  spatial.location,
  selection.method = c("markvariogram", "moransi"),
  features = NULL,
  r.metric = 5,
  x.cuts = NULL,
  y.cuts = NULL,
  nfeatures = nfeatures,
  verbose = TRUE,
  ...
)

# S3 method for class 'Seurat'
FindSpatiallyVariableFeatures(
  object,
  assay = NULL,
  slot = "scale.data",
  features = NULL,
  image = NULL,
  selection.method = c("markvariogram", "moransi"),
  r.metric = 5,
  x.cuts = NULL,
  y.cuts = NULL,
  nfeatures = 2000,
  verbose = TRUE,
  ...
)

# S3 method for class 'StdAssay'
FindSpatiallyVariableFeatures(
  object,
  layer = "scale.data",
  spatial.location,
  selection.method = c("markvariogram", "moransi"),
  features = NULL,
  r.metric = 5,
  x.cuts = NULL,
  y.cuts = NULL,
  nfeatures = nfeatures,
  verbose = TRUE,
  ...
)
```

Example 6 (r):
```r
FindSpatiallyVariableFeatures(object, ...)

# Default S3 method
FindSpatiallyVariableFeatures(
  object,
  spatial.location,
  selection.method = c("markvariogram", "moransi"),
  r.metric = 5,
  x.cuts = NULL,
  y.cuts = NULL,
  verbose = TRUE,
  ...
)

# S3 method for class 'Assay'
FindSpatiallyVariableFeatures(
  object,
  slot = "scale.data",
  spatial.location,
  selection.method = c("markvariogram", "moransi"),
  features = NULL,
  r.metric = 5,
  x.cuts = NULL,
  y.cuts = NULL,
  nfeatures = nfeatures,
  verbose = TRUE,
  ...
)

# S3 method for class 'Seurat'
FindSpatiallyVariableFeatures(
  object,
  assay = NULL,
  slot = "scale.data",
  features = NULL,
  image = NULL,
  selection.method = c("markvariogram", "moransi"),
  r.metric = 5,
  x.cuts = NULL,
  y.cuts = NULL,
  nfeatures = 2000,
  verbose = TRUE,
  ...
)

# S3 method for class 'StdAssay'
FindSpatiallyVariableFeatures(
  object,
  layer = "scale.data",
  spatial.location,
  selection.method = c("markvariogram", "moransi"),
  features = NULL,
  r.metric = 5,
  x.cuts = NULL,
  y.cuts = NULL,
  nfeatures = nfeatures,
  verbose = TRUE,
  ...
)
```

Example 7 (r):
```r
FindSpatiallyVariableFeatures(object, ...)

# Default S3 method
FindSpatiallyVariableFeatures(
  object,
  spatial.location,
  selection.method = c("markvariogram", "moransi"),
  r.metric = 5,
  x.cuts = NULL,
  y.cuts = NULL,
  verbose = TRUE,
  ...
)

# S3 method for class 'Assay'
FindSpatiallyVariableFeatures(
  object,
  slot = "scale.data",
  spatial.location,
  selection.method = c("markvariogram", "moransi"),
  features = NULL,
  r.metric = 5,
  x.cuts = NULL,
  y.cuts = NULL,
  nfeatures = nfeatures,
  verbose = TRUE,
  ...
)

# S3 method for class 'Seurat'
FindSpatiallyVariableFeatures(
  object,
  assay = NULL,
  slot = "scale.data",
  features = NULL,
  image = NULL,
  selection.method = c("markvariogram", "moransi"),
  r.metric = 5,
  x.cuts = NULL,
  y.cuts = NULL,
  nfeatures = 2000,
  verbose = TRUE,
  ...
)

# S3 method for class 'StdAssay'
FindSpatiallyVariableFeatures(
  object,
  layer = "scale.data",
  spatial.location,
  selection.method = c("markvariogram", "moransi"),
  features = NULL,
  r.metric = 5,
  x.cuts = NULL,
  y.cuts = NULL,
  nfeatures = nfeatures,
  verbose = TRUE,
  ...
)
```

Example 8 (unknown):
```unknown
markvariogram
```

Example 9 (unknown):
```unknown
RunMarkVario
```

---

## The TransferAnchorSet Class — TransferAnchorSet-class • Seurat

**URL:** http://127.0.0.1:9173/seurat/reference/transferanchorset-class/index.html

**Contents:**
- The TransferAnchorSet Class
- Contents

Inherits from the Anchorset class. Implemented mainly for method dispatch purposes. See AnchorSet for slot details.

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/objects.R
```

Example 2 (unknown):
```unknown
TransferAnchorSet-class.Rd
```

---

## Polygon FeaturePlot — PolyFeaturePlot • Seurat

**URL:** http://127.0.0.1:9173/reference_polyfeatureplot.html

**Contents:**
- Polygon FeaturePlot
- Arguments
- Value
- Contents

Plot cells as polygons, rather than single points. Color cells by any value accessible by FetchData.

Vector of features to plot. Features can come from:

An Assay feature (e.g. a gene name - "MS4A1")

A column name from meta.data (e.g. mitochondrial percentage - "percent.mito")

A column name from a DimReduc object corresponding to the cell embedding values (e.g. the PC 1 scores - "PC_1")

Vector of cells to plot (default is all cells)

Name of the polygon dataframe in the misc slot

Number of columns to split the plot into

Vector of minimum and maximum cutoff values for each feature, may specify quantile in the form of 'q##' where '##' is the quantile (eg, 'q1', 'q10')

Flip x and y coordinates

Returns a ggplot object

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/visualization.R
```

Example 2 (unknown):
```unknown
PolyFeaturePlot.Rd
```

Example 3 (unknown):
```unknown
PolyFeaturePlot(
  object,
  features,
  cells = NULL,
  poly.data = "spatial",
  ncol = ceiling(x = length(x = features)/2),
  min.cutoff = 0,
  max.cutoff = NA,
  common.scale = TRUE,
  flip.coords = FALSE
)
```

Example 4 (r):
```r
PolyFeaturePlot(
  object,
  features,
  cells = NULL,
  poly.data = "spatial",
  ncol = ceiling(x = length(x = features)/2),
  min.cutoff = 0,
  max.cutoff = NA,
  common.scale = TRUE,
  flip.coords = FALSE
)
```

Example 5 (r):
```r
PolyFeaturePlot(
  object,
  features,
  cells = NULL,
  poly.data = "spatial",
  ncol = ceiling(x = length(x = features)/2),
  min.cutoff = 0,
  max.cutoff = NA,
  common.scale = TRUE,
  flip.coords = FALSE
)
```

---

## Calculate the variance of logged values — ExpVar • Seurat

**URL:** http://127.0.0.1:9173/seurat/reference/expvar/index.html

**Contents:**
- Calculate the variance of logged values
- Arguments
- Value
- Examples
- Contents

Calculate variance of logged values in non-log space (return answer in log-space)

Returns the variance in log-space

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/utilities.R
```

Example 2 (unknown):
```unknown
ExpVar(x = c(1, 2, 3))
#> [1] 4.403948
```

Example 3 (r):
```r
ExpVar(x = c(1, 2, 3))
#> [1] 4.403948
```

Example 4 (r):
```r
ExpVar(x = c(1, 2, 3))
#> [1] 4.403948
```

---

## Cell cycle genes: 2019 update — cc.genes.updated.2019 • Seurat

**URL:** http://127.0.0.1:9173/reference_cc.genes.updated.2019.html

**Contents:**
- Cell cycle genes: 2019 update
- Format
- Source
- Updated symbols
- See also
- Examples
- Contents

A list of genes used in cell-cycle regression, updated with 2019 symbols

A list of two vectors

Genes associated with S-phase

Genes associated with G2M-phase

https://www.science.org/doi/abs/10.1126/science.aad0501

The following symbols were updated from cc.genes

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
cc.genes.updated.2019.Rd
```

Example 2 (unknown):
```unknown
cc.genes.updated.2019
```

Example 3 (r):
```r
cc.genes.updated.2019
```

Example 4 (r):
```r
cc.genes.updated.2019
```

Example 5 (unknown):
```unknown
if (FALSE) { # \dontrun{
cc.genes.updated.2019 <- cc.genes
cc.genes.updated.2019$s.genes <- UpdateSymbolList(symbols = cc.genes.updated.2019$s.genes)
cc.genes.updated.2019$g2m.genes <- UpdateSymbolList(symbols = cc.genes.updated.2019$g2m.genes)
} # }
```

Example 6 (r):
```r
if (FALSE) { # \dontrun{
cc.genes.updated.2019 <- cc.genes
cc.genes.updated.2019$s.genes <- UpdateSymbolList(symbols = cc.genes.updated.2019$s.genes)
cc.genes.updated.2019$g2m.genes <- UpdateSymbolList(symbols = cc.genes.updated.2019$g2m.genes)
} # }
```

Example 7 (r):
```r
if (FALSE) { # \dontrun{
cc.genes.updated.2019 <- cc.genes
cc.genes.updated.2019$s.genes <- UpdateSymbolList(symbols = cc.genes.updated.2019$s.genes)
cc.genes.updated.2019$g2m.genes <- UpdateSymbolList(symbols = cc.genes.updated.2019$g2m.genes)
} # }
```

---

## Load a 10X Genomics Visium Image — Read10X_Image • Seurat

**URL:** http://127.0.0.1:9173/reference_read10x_image.html

**Contents:**
- Load a 10X Genomics Visium Image
- Arguments
- Value
- See also
- Contents

Load a 10X Genomics Visium Image

Path to directory with 10X Genomics visium image data; should include files tissue_lowres_image.png, scalefactors_json.json and tissue_positions_list.csv

Name of associated assay

Name for the image, used to populate the instance's key

Filter spot/feature matrix to only include spots that have been determined to be over tissue

Image type to return, one of: "VisiumV1" or "VisiumV2"

VisiumV2 Load10X_Spatial

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/preprocessing.R
```

Example 2 (unknown):
```unknown
Read10X_Image.Rd
```

Example 3 (unknown):
```unknown
Read10X_Image(
  image.dir,
  image.name = "tissue_lowres_image.png",
  assay = "Spatial",
  slice = "slice1",
  filter.matrix = TRUE,
  image.type = "VisiumV2"
)
```

Example 4 (r):
```r
Read10X_Image(
  image.dir,
  image.name = "tissue_lowres_image.png",
  assay = "Spatial",
  slice = "slice1",
  filter.matrix = TRUE,
  image.type = "VisiumV2"
)
```

Example 5 (r):
```r
Read10X_Image(
  image.dir,
  image.name = "tissue_lowres_image.png",
  assay = "Spatial",
  slice = "slice1",
  filter.matrix = TRUE,
  image.type = "VisiumV2"
)
```

Example 6 (unknown):
```unknown
tissue_lowres_image.png
```

Example 7 (unknown):
```unknown
scalefactors_json.json
```

Example 8 (unknown):
```unknown
tissue_positions_list.csv
```

Example 9 (unknown):
```unknown
Load10X_Spatial
```

---

## Prepare the bridge and reference datasets — PrepareBridgeReference • Seurat

**URL:** http://127.0.0.1:9173/reference_preparebridgereference.html

**Contents:**
- Prepare the bridge and reference datasets
- Arguments
- Value
- Contents

Preprocess the multi-omic bridge and unimodal reference datasets into an extended reference. This function performs the following three steps: 1. Performs within-modality harmonization between bridge and reference 2. Performs dimensional reduction on the SNN graph of bridge datasets via Laplacian Eigendecomposition 3. Constructs a bridge dictionary representation for unimodal reference cells

A reference Seurat object

A multi-omic bridge Seurat object

Name of dimensional reduction of the reference object (default is 'pca')

Number of dimensions used for the reference.reduction (default is 50)

Name of normalization method used: LogNormalize or SCT

Assay name for reference (default is DefaultAssay)

Assay name for bridge used for reference mapping. RNA by default

Assay name for bridge used for query mapping. ATAC by default

Type of supervised dimensional reduction to be performed for integrating the bridge and query. Options are:

slsi: Perform supervised LSI as the dimensional reduction for the bridge-query integration

spca: Perform supervised PCA as the dimensional reduction for the bridge-query integration

NULL: no supervised dimensional reduction will be calculated. bridge.query.reduction is used for the bridge-query integration

Name of dimensions used for the bridge-query harmonization. 'bridge.query.reduction' and 'supervised.reduction' cannot be NULL together.

Features used for bridge query dimensional reduction (default is NULL which uses VariableFeatures from the bridge object)

Name of dimensional reduction name of graph laplacian eigenspace (default is 'lap')

Dimensional reduction key (default is 'lap_')

Number of dimensions used for graph laplacian eigenspace (default is 50)

Print progress and message (default is TRUE)

Returns a BridgeReferenceSet that can be used as input to FindBridgeTransferAnchors. The parameters used are stored in the BridgeReferenceSet as well

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/integration.R
```

Example 2 (unknown):
```unknown
PrepareBridgeReference.Rd
```

Example 3 (unknown):
```unknown
PrepareBridgeReference(
  reference,
  bridge,
  reference.reduction = "pca",
  reference.dims = 1:50,
  normalization.method = c("SCT", "LogNormalize"),
  reference.assay = NULL,
  bridge.ref.assay = "RNA",
  bridge.query.assay = "ATAC",
  supervised.reduction = c("slsi", "spca", NULL),
  bridge.query.reduction = NULL,
  bridge.query.features = NULL,
  laplacian.reduction.name = "lap",
  laplacian.reduction.key = "lap_",
  laplacian.reduction.dims = 1:50,
  verbose = TRUE
)
```

Example 4 (r):
```r
PrepareBridgeReference(
  reference,
  bridge,
  reference.reduction = "pca",
  reference.dims = 1:50,
  normalization.method = c("SCT", "LogNormalize"),
  reference.assay = NULL,
  bridge.ref.assay = "RNA",
  bridge.query.assay = "ATAC",
  supervised.reduction = c("slsi", "spca", NULL),
  bridge.query.reduction = NULL,
  bridge.query.features = NULL,
  laplacian.reduction.name = "lap",
  laplacian.reduction.key = "lap_",
  laplacian.reduction.dims = 1:50,
  verbose = TRUE
)
```

Example 5 (r):
```r
PrepareBridgeReference(
  reference,
  bridge,
  reference.reduction = "pca",
  reference.dims = 1:50,
  normalization.method = c("SCT", "LogNormalize"),
  reference.assay = NULL,
  bridge.ref.assay = "RNA",
  bridge.query.assay = "ATAC",
  supervised.reduction = c("slsi", "spca", NULL),
  bridge.query.reduction = NULL,
  bridge.query.features = NULL,
  laplacian.reduction.name = "lap",
  laplacian.reduction.key = "lap_",
  laplacian.reduction.dims = 1:50,
  verbose = TRUE
)
```

Example 6 (unknown):
```unknown
DefaultAssay
```

Example 7 (unknown):
```unknown
BridgeReferenceSet
```

Example 8 (unknown):
```unknown
FindBridgeTransferAnchors
```

Example 9 (unknown):
```unknown
BridgeReferenceSet
```

---

## Run Leiden clustering algorithm — RunLeiden • Seurat

**URL:** http://127.0.0.1:9173/reference_runleiden.html

**Contents:**
- Run Leiden clustering algorithm
- Arguments
- Contents

Returns a vector of partition indices.

An adjacency matrix or adjacency list.

Type of partition to use for Leiden algorithm. Defaults to "RBConfigurationVertexPartition", see https://cran.rstudio.com/web/packages/leidenbase/leidenbase.pdf for more options.

Passed to the `initial_membership` parameter of `leidenbase::leiden_find_partition`.

Passed to the `node_sizes` parameter of `leidenbase::leiden_find_partition`.

A parameter controlling the coarseness of the clusters for Leiden algorithm. Higher values lead to more clusters. (defaults to 1.0 for partition types that accept a resolution parameter)

Seed of the random number generator, must be greater than 0.

Maximal number of iterations per random start

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/clustering.R
```

Example 2 (unknown):
```unknown
RunLeiden.Rd
```

Example 3 (unknown):
```unknown
RunLeiden(
  object,
  method = deprecated(),
  partition.type = c("RBConfigurationVertexPartition", "ModularityVertexPartition",
    "RBERVertexPartition", "CPMVertexPartition", "MutableVertexPartition",
    "SignificanceVertexPartition", "SurpriseVertexPartition"),
  initial.membership = NULL,
  node.sizes = NULL,
  resolution.parameter = 1,
  random.seed = 1,
  n.iter = 10
)
```

Example 4 (r):
```r
RunLeiden(
  object,
  method = deprecated(),
  partition.type = c("RBConfigurationVertexPartition", "ModularityVertexPartition",
    "RBERVertexPartition", "CPMVertexPartition", "MutableVertexPartition",
    "SignificanceVertexPartition", "SurpriseVertexPartition"),
  initial.membership = NULL,
  node.sizes = NULL,
  resolution.parameter = 1,
  random.seed = 1,
  n.iter = 10
)
```

Example 5 (r):
```r
RunLeiden(
  object,
  method = deprecated(),
  partition.type = c("RBConfigurationVertexPartition", "ModularityVertexPartition",
    "RBERVertexPartition", "CPMVertexPartition", "MutableVertexPartition",
    "SignificanceVertexPartition", "SurpriseVertexPartition"),
  initial.membership = NULL,
  node.sizes = NULL,
  resolution.parameter = 1,
  random.seed = 1,
  n.iter = 10
)
```

---

## The VisiumV1 class — VisiumV1-class • Seurat

**URL:** http://127.0.0.1:9173/seurat/reference/visiumv1-class/index.html

**Contents:**
- The VisiumV1 class
- Slots
- Contents

The VisiumV1 class represents spatial information from the 10X Genomics Visium platform

A three-dimensional array with PNG image data, see readPNG for more details

An object of class scalefactors; see scalefactors for more information

A data frame with tissue coordinate information

Single numeric value giving the radius of the spots

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/objects.R
```

Example 2 (unknown):
```unknown
VisiumV1-class.Rd
```

Example 3 (unknown):
```unknown
scale.factors
```

Example 4 (unknown):
```unknown
scalefactors
```

Example 5 (unknown):
```unknown
scalefactors
```

Example 6 (unknown):
```unknown
coordinates
```

Example 7 (unknown):
```unknown
spot.radius
```

---

## Combine ggplot2-based plots into a single plot — CombinePlots • Seurat

**URL:** http://127.0.0.1:9173/seurat/reference/combineplots/index.html

**Contents:**
- Combine ggplot2-based plots into a single plot
- Arguments
- Value
- Examples
- Contents

Combine ggplot2-based plots into a single plot

Combine legends into a single legend choose from 'right' or 'bottom'; pass 'none' to remove legends, or NULL to leave legends as they are

Extra parameters passed to plot_grid

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/visualization.R
```

Example 2 (unknown):
```unknown
CombinePlots.Rd
```

Example 3 (unknown):
```unknown
CombinePlots(plots, ncol = NULL, legend = NULL, ...)
```

Example 4 (r):
```r
CombinePlots(plots, ncol = NULL, legend = NULL, ...)
```

Example 5 (r):
```r
CombinePlots(plots, ncol = NULL, legend = NULL, ...)
```

Example 6 (unknown):
```unknown
data("pbmc_small")
pbmc_small[['group']] <- sample(
  x = c('g1', 'g2'),
  size = ncol(x = pbmc_small),
  replace = TRUE
)
plot1 <- FeaturePlot(
  object = pbmc_small,
  features = 'MS4A1',
  split.by = 'group'
)
plot2 <- FeaturePlot(
  object = pbmc_small,
  features = 'FCN1',
  split.by = 'group'
)
CombinePlots(
  plots = list(plot1, plot2),
  legend = 'none',
  nrow = length(x = unique(x = pbmc_small[['group', drop = TRUE]]))
)
#> Warning: CombinePlots is being deprecated. Plots should now be combined using the patchwork system.
```

Example 7 (r):
```r
data("pbmc_small")
pbmc_small[['group']] <- sample(
  x = c('g1', 'g2'),
  size = ncol(x = pbmc_small),
  replace = TRUE
)
plot1 <- FeaturePlot(
  object = pbmc_small,
  features = 'MS4A1',
  split.by = 'group'
)
plot2 <- FeaturePlot(
  object = pbmc_small,
  features = 'FCN1',
  split.by = 'group'
)
CombinePlots(
  plots = list(plot1, plot2),
  legend = 'none',
  nrow = length(x = unique(x = pbmc_small[['group', drop = TRUE]]))
)
#> Warning: CombinePlots is being deprecated. Plots should now be combined using the patchwork system.
```

Example 8 (r):
```r
data("pbmc_small")
pbmc_small[['group']] <- sample(
  x = c('g1', 'g2'),
  size = ncol(x = pbmc_small),
  replace = TRUE
)
plot1 <- FeaturePlot(
  object = pbmc_small,
  features = 'MS4A1',
  split.by = 'group'
)
plot2 <- FeaturePlot(
  object = pbmc_small,
  features = 'FCN1',
  split.by = 'group'
)
CombinePlots(
  plots = list(plot1, plot2),
  legend = 'none',
  nrow = length(x = unique(x = pbmc_small[['group', drop = TRUE]]))
)
#> Warning: CombinePlots is being deprecated. Plots should now be combined using the patchwork system.
```

---

## Label clusters on a ggplot2-based scatter plot — LabelClusters • Seurat

**URL:** http://127.0.0.1:9173/reference_labelclusters.html

**Contents:**
- Label clusters on a ggplot2-based scatter plot
- Arguments
- Value
- See also
- Examples
- Contents

Label clusters on a ggplot2-based scatter plot

A ggplot2-based scatter plot

Name of variable used for coloring scatter plot

Vector of cluster ids to label

Custom labels for the clusters

Split labels by some grouping label, useful when using facet_wrap or facet_grid

Use geom_text_repel to create nicely-repelled labels

Use geom_label/geom_label_repel (includes a box around the text labels)

Name of geom to get X/Y aesthetic names for

How to place the label if repel = FALSE. If "median", place the label at the median position. If "nearest" place the label at the position of the nearest data point to the median.

Extra parameters to geom_text_repel, such as size

A ggplot2-based scatter plot with cluster labels

geom_text_repel geom_text

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/visualization.R
```

Example 2 (unknown):
```unknown
LabelClusters.Rd
```

Example 3 (unknown):
```unknown
LabelClusters(
  plot,
  id,
  clusters = NULL,
  labels = NULL,
  split.by = NULL,
  repel = TRUE,
  box = FALSE,
  geom = "GeomPoint",
  position = "median",
  ...
)
```

Example 4 (r):
```r
LabelClusters(
  plot,
  id,
  clusters = NULL,
  labels = NULL,
  split.by = NULL,
  repel = TRUE,
  box = FALSE,
  geom = "GeomPoint",
  position = "median",
  ...
)
```

Example 5 (r):
```r
LabelClusters(
  plot,
  id,
  clusters = NULL,
  labels = NULL,
  split.by = NULL,
  repel = TRUE,
  box = FALSE,
  geom = "GeomPoint",
  position = "median",
  ...
)
```

Example 6 (unknown):
```unknown
geom_text_repel
```

Example 7 (unknown):
```unknown
geom_text_repel
```

Example 8 (unknown):
```unknown
geom_text_repel
```

Example 9 (unknown):
```unknown
data("pbmc_small")
plot <- DimPlot(object = pbmc_small)
LabelClusters(plot = plot, id = 'ident')
```

Example 10 (r):
```r
data("pbmc_small")
plot <- DimPlot(object = pbmc_small)
LabelClusters(plot = plot, id = 'ident')
```

Example 11 (r):
```r
data("pbmc_small")
plot <- DimPlot(object = pbmc_small)
LabelClusters(plot = plot, id = 'ident')
```

---

## Find bridge anchors between query and extended bridge-reference — FindBridgeTransferAnchors • Seurat

**URL:** http://127.0.0.1:9173/seurat/reference/findbridgetransferanchors/index.html

**Contents:**
- Find bridge anchors between query and extended bridge-reference
- Arguments
- Value
- Contents

Find a set of anchors between unimodal query and the other unimodal reference using a pre-computed BridgeReferenceSet. This function performs three steps: 1. Harmonize the bridge and query cells in the bridge query reduction space 2. Construct the bridge dictionary representations for query cells 3. Find a set of anchors between query and reference in the bridge graph laplacian eigenspace These anchors can later be used to integrate embeddings or transfer data from the reference to query object using the MapQuery object.

BridgeReferenceSet object generated from PrepareBridgeReference

A query Seurat object

Assay name for query-bridge integration

Number of dimensions for query-bridge integration

Determine if scale the query data for projection

Dimensional reduction to perform when finding anchors. Options are:

pcaproject: Project the PCA from the bridge onto the query. We recommend using PCA when bridge and query datasets are from scRNA-seq

lsiproject: Project the LSI from the bridge onto the query. We recommend using LSI when bridge and query datasets are from scATAC-seq or scCUT&TAG data. This requires that LSI or supervised LSI has been computed for the bridge dataset, and the same features (eg, peaks or genome bins) are present in both the bridge and query.

Dimensional reduction to perform when finding anchors. Can be one of:

cca: Canonical correlation analysis

direct: Use assay data as a dimensional reduction

Print messages and progress

Returns an AnchorSet object that can be used as input to TransferData, IntegrateEmbeddings and MapQuery.

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/integration.R
```

Example 2 (unknown):
```unknown
FindBridgeTransferAnchors.Rd
```

Example 3 (unknown):
```unknown
BridgeReferenceSet
```

Example 4 (unknown):
```unknown
FindBridgeTransferAnchors(
  extended.reference,
  query,
  query.assay = NULL,
  dims = 1:30,
  scale = FALSE,
  reduction = c("lsiproject", "pcaproject"),
  bridge.reduction = c("direct", "cca"),
  verbose = TRUE
)
```

Example 5 (r):
```r
FindBridgeTransferAnchors(
  extended.reference,
  query,
  query.assay = NULL,
  dims = 1:30,
  scale = FALSE,
  reduction = c("lsiproject", "pcaproject"),
  bridge.reduction = c("direct", "cca"),
  verbose = TRUE
)
```

Example 6 (r):
```r
FindBridgeTransferAnchors(
  extended.reference,
  query,
  query.assay = NULL,
  dims = 1:30,
  scale = FALSE,
  reduction = c("lsiproject", "pcaproject"),
  bridge.reduction = c("direct", "cca"),
  verbose = TRUE
)
```

Example 7 (unknown):
```unknown
PrepareBridgeReference
```

Example 8 (unknown):
```unknown
TransferData
```

Example 9 (unknown):
```unknown
IntegrateEmbeddings
```

---

## Seurat Themes — SeuratTheme • Seurat

**URL:** http://127.0.0.1:9173/seurat/reference/seurattheme/index.html

**Contents:**
- Seurat Themes
- Arguments
- Value
- See also
- Examples
- Contents

Various themes to be applied to ggplot2-based plots

The curated Seurat theme, consists of ...

A dark theme, axes and text turn to white, the background becomes black

Removes axis lines, text, and ticks

Sets axis and title font sizes

Set Seurat-style axes

A theme designed for spatial visualizations (eg PolyFeaturePlot, PolyDimPlot)

Restore a legend after removal

Rotate X axis text 45 degrees

Enlarges and emphasizes the title

Extra parameters to be passed to theme

X and Y axis text sizes

X and Y axis title sizes

A position to restore the legend to

A ggplot2 theme object

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/visualization.R
```

Example 2 (unknown):
```unknown
SeuratTheme.Rd
```

Example 3 (unknown):
```unknown
SeuratTheme
```

Example 4 (unknown):
```unknown
SpatialTheme
```

Example 5 (unknown):
```unknown
PolyFeaturePlot
```

Example 6 (unknown):
```unknown
PolyDimPlot
```

Example 7 (unknown):
```unknown
RestoreLegend
```

Example 8 (unknown):
```unknown
RotatedAxis
```

Example 9 (unknown):
```unknown
SeuratTheme()

CenterTitle(...)

DarkTheme(...)

FontSize(
  x.text = NULL,
  y.text = NULL,
  x.title = NULL,
  y.title = NULL,
  main = NULL,
  ...
)

NoAxes(..., keep.text = FALSE, keep.ticks = FALSE)

NoLegend(...)

NoGrid(...)

SeuratAxes(...)

SpatialTheme(...)

RestoreLegend(..., position = "right")

RotatedAxis(...)

BoldTitle(...)

WhiteBackground(...)
```

Example 10 (r):
```r
SeuratTheme()

CenterTitle(...)

DarkTheme(...)

FontSize(
  x.text = NULL,
  y.text = NULL,
  x.title = NULL,
  y.title = NULL,
  main = NULL,
  ...
)

NoAxes(..., keep.text = FALSE, keep.ticks = FALSE)

NoLegend(...)

NoGrid(...)

SeuratAxes(...)

SpatialTheme(...)

RestoreLegend(..., position = "right")

RotatedAxis(...)

BoldTitle(...)

WhiteBackground(...)
```

Example 11 (r):
```r
SeuratTheme()

CenterTitle(...)

DarkTheme(...)

FontSize(
  x.text = NULL,
  y.text = NULL,
  x.title = NULL,
  y.title = NULL,
  main = NULL,
  ...
)

NoAxes(..., keep.text = FALSE, keep.ticks = FALSE)

NoLegend(...)

NoGrid(...)

SeuratAxes(...)

SpatialTheme(...)

RestoreLegend(..., position = "right")

RotatedAxis(...)

BoldTitle(...)

WhiteBackground(...)
```

Example 12 (unknown):
```unknown
# Generate a plot with a dark theme
library(ggplot2)
df <- data.frame(x = rnorm(n = 100, mean = 20, sd = 2), y = rbinom(n = 100, size = 100, prob = 0.2))
p <- ggplot(data = df, mapping = aes(x = x, y = y)) + geom_point(mapping = aes(color = 'red'))
p + DarkTheme(legend.position = 'none')


# Generate a plot with no axes
library(ggplot2)
df <- data.frame(x = rnorm(n = 100, mean = 20, sd = 2), y = rbinom(n = 100, size = 100, prob = 0.2))
p <- ggplot(data = df, mapping = aes(x = x, y = y)) + geom_point(mapping = aes(color = 'red'))
p + NoAxes()


# Generate a plot with no legend
library(ggplot2)
df <- data.frame(x = rnorm(n = 100, mean = 20, sd = 2), y = rbinom(n = 100, size = 100, prob = 0.2))
p <- ggplot(data = df, mapping = aes(x = x, y = y)) + geom_point(mapping = aes(color = 'red'))
p + NoLegend()


# Generate a plot with no grid lines
library(ggplot2)
df <- data.frame(x = rnorm(n = 100, mean = 20, sd = 2), y = rbinom(n = 100, size = 100, prob = 0.2))
p <- ggplot(data = df, mapping = aes(x = x, y = y)) + geom_point(mapping = aes(color = 'red'))
p + NoGrid()
```

Example 13 (r):
```r
# Generate a plot with a dark theme
library(ggplot2)
df <- data.frame(x = rnorm(n = 100, mean = 20, sd = 2), y = rbinom(n = 100, size = 100, prob = 0.2))
p <- ggplot(data = df, mapping = aes(x = x, y = y)) + geom_point(mapping = aes(color = 'red'))
p + DarkTheme(legend.position = 'none')


# Generate a plot with no axes
library(ggplot2)
df <- data.frame(x = rnorm(n = 100, mean = 20, sd = 2), y = rbinom(n = 100, size = 100, prob = 0.2))
p <- ggplot(data = df, mapping = aes(x = x, y = y)) + geom_point(mapping = aes(color = 'red'))
p + NoAxes()


# Generate a plot with no legend
library(ggplot2)
df <- data.frame(x = rnorm(n = 100, mean = 20, sd = 2), y = rbinom(n = 100, size = 100, prob = 0.2))
p <- ggplot(data = df, mapping = aes(x = x, y = y)) + geom_point(mapping = aes(color = 'red'))
p + NoLegend()


# Generate a plot with no grid lines
library(ggplot2)
df <- data.frame(x = rnorm(n = 100, mean = 20, sd = 2), y = rbinom(n = 100, size = 100, prob = 0.2))
p <- ggplot(data = df, mapping = aes(x = x, y = y)) + geom_point(mapping = aes(color = 'red'))
p + NoGrid()
```

Example 14 (r):
```r
# Generate a plot with a dark theme
library(ggplot2)
df <- data.frame(x = rnorm(n = 100, mean = 20, sd = 2), y = rbinom(n = 100, size = 100, prob = 0.2))
p <- ggplot(data = df, mapping = aes(x = x, y = y)) + geom_point(mapping = aes(color = 'red'))
p + DarkTheme(legend.position = 'none')


# Generate a plot with no axes
library(ggplot2)
df <- data.frame(x = rnorm(n = 100, mean = 20, sd = 2), y = rbinom(n = 100, size = 100, prob = 0.2))
p <- ggplot(data = df, mapping = aes(x = x, y = y)) + geom_point(mapping = aes(color = 'red'))
p + NoAxes()


# Generate a plot with no legend
library(ggplot2)
df <- data.frame(x = rnorm(n = 100, mean = 20, sd = 2), y = rbinom(n = 100, size = 100, prob = 0.2))
p <- ggplot(data = df, mapping = aes(x = x, y = y)) + geom_point(mapping = aes(color = 'red'))
p + NoLegend()


# Generate a plot with no grid lines
library(ggplot2)
df <- data.frame(x = rnorm(n = 100, mean = 20, sd = 2), y = rbinom(n = 100, size = 100, prob = 0.2))
p <- ggplot(data = df, mapping = aes(x = x, y = y)) + geom_point(mapping = aes(color = 'red'))
p + NoGrid()
```

---

## Run Leiden clustering algorithm — RunLeiden • Seurat

**URL:** http://127.0.0.1:9173/seurat/reference/runleiden/index.html

**Contents:**
- Run Leiden clustering algorithm
- Arguments
- Contents

Returns a vector of partition indices.

An adjacency matrix or adjacency list.

Type of partition to use for Leiden algorithm. Defaults to "RBConfigurationVertexPartition", see https://cran.rstudio.com/web/packages/leidenbase/leidenbase.pdf for more options.

Passed to the `initial_membership` parameter of `leidenbase::leiden_find_partition`.

Passed to the `node_sizes` parameter of `leidenbase::leiden_find_partition`.

A parameter controlling the coarseness of the clusters for Leiden algorithm. Higher values lead to more clusters. (defaults to 1.0 for partition types that accept a resolution parameter)

Seed of the random number generator, must be greater than 0.

Maximal number of iterations per random start

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/clustering.R
```

Example 2 (unknown):
```unknown
RunLeiden.Rd
```

Example 3 (unknown):
```unknown
RunLeiden(
  object,
  method = deprecated(),
  partition.type = c("RBConfigurationVertexPartition", "ModularityVertexPartition",
    "RBERVertexPartition", "CPMVertexPartition", "MutableVertexPartition",
    "SignificanceVertexPartition", "SurpriseVertexPartition"),
  initial.membership = NULL,
  node.sizes = NULL,
  resolution.parameter = 1,
  random.seed = 1,
  n.iter = 10
)
```

Example 4 (r):
```r
RunLeiden(
  object,
  method = deprecated(),
  partition.type = c("RBConfigurationVertexPartition", "ModularityVertexPartition",
    "RBERVertexPartition", "CPMVertexPartition", "MutableVertexPartition",
    "SignificanceVertexPartition", "SurpriseVertexPartition"),
  initial.membership = NULL,
  node.sizes = NULL,
  resolution.parameter = 1,
  random.seed = 1,
  n.iter = 10
)
```

Example 5 (r):
```r
RunLeiden(
  object,
  method = deprecated(),
  partition.type = c("RBConfigurationVertexPartition", "ModularityVertexPartition",
    "RBERVertexPartition", "CPMVertexPartition", "MutableVertexPartition",
    "SignificanceVertexPartition", "SurpriseVertexPartition"),
  initial.membership = NULL,
  node.sizes = NULL,
  resolution.parameter = 1,
  random.seed = 1,
  n.iter = 10
)
```

---

## Calculate pearson residuals of features not in the scale.data — FetchResiduals • Seurat

**URL:** http://127.0.0.1:9173/seurat/reference/fetchresiduals/index.html

**Contents:**
- Calculate pearson residuals of features not in the scale.data
- Arguments
- Value
- See also
- Contents

This function calls sctransform::get_residuals.

Name of features to add into the scale.data

Name of the assay of the seurat object generated by SCTransform

Name of the assay of the seurat object containing UMI matrix and the default is RNA

Name (prefix) of the layer to pull counts from

Numeric of length two specifying the min and max values the Pearson residual will be clipped to

reference.SCT.model If a reference SCT model should be used for calculating the residuals. When set to not NULL, ignores the `SCTModel` paramater.

Recalculate residuals for all features, even if they are already present. Useful if you want to change the clip.range.

For features where there is no feature model stored, return NA for residual value in scale.data when na.rm = FALSE. When na.rm is TRUE, only return residuals for features with a model stored for all cells.

Whether to print messages and progress bars

Returns a Seurat object containing Pearson residuals of added features in its scale.data

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/preprocessing5.R
```

Example 2 (unknown):
```unknown
FetchResiduals.Rd
```

Example 3 (unknown):
```unknown
FetchResiduals(
  object,
  features,
  assay = NULL,
  umi.assay = "RNA",
  layer = "counts",
  clip.range = NULL,
  reference.SCT.model = NULL,
  replace.value = FALSE,
  na.rm = TRUE,
  verbose = TRUE
)
```

Example 4 (r):
```r
FetchResiduals(
  object,
  features,
  assay = NULL,
  umi.assay = "RNA",
  layer = "counts",
  clip.range = NULL,
  reference.SCT.model = NULL,
  replace.value = FALSE,
  na.rm = TRUE,
  verbose = TRUE
)
```

Example 5 (r):
```r
FetchResiduals(
  object,
  features,
  assay = NULL,
  umi.assay = "RNA",
  layer = "counts",
  clip.range = NULL,
  reference.SCT.model = NULL,
  replace.value = FALSE,
  na.rm = TRUE,
  verbose = TRUE
)
```

Example 6 (unknown):
```unknown
get_residuals
```

---

## Sketch Data — SketchData • Seurat

**URL:** http://127.0.0.1:9173/seurat/reference/sketchdata/index.html

**Contents:**
- Sketch Data
- Arguments
- Value
- Contents

This function uses sketching methods to downsample high-dimensional single-cell RNA expression data, which can help with scalability for large datasets.

Assay name. Default is NULL, in which case the default assay of the object is used.

A positive integer or a named vector/list specifying the number of cells to sample per layer. If a single integer is provided, the same number of cells will be sampled from each layer. Default is 5000.

Sketched assay name. A sketch assay is created or overwrite with the sketch data. Default is 'sketch'.

Sketching method to use. Can be 'LeverageScore' or 'Uniform'. Default is 'LeverageScore'.

A metadata column name to store the leverage scores. Default is 'leverage.score'.

whether to overwrite existing column in the metadata. Default is FALSE.

A positive integer for the seed of the random number generator. Default is 123.

The type to cast the resulting assay to. Default is 'dgCMatrix'.

Print progress and diagnostic messages

A character vector of feature names to include in the sketched assay.

Arguments passed to other methods

A Seurat object with the sketched data added as a new assay.

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/sketching.R
```

Example 2 (unknown):
```unknown
SketchData.Rd
```

Example 3 (unknown):
```unknown
SketchData(
  object,
  assay = NULL,
  ncells = 5000L,
  sketched.assay = "sketch",
  method = c("LeverageScore", "Uniform"),
  var.name = "leverage.score",
  over.write = FALSE,
  seed = 123L,
  cast = "dgCMatrix",
  verbose = TRUE,
  features = NULL,
  ...
)
```

Example 4 (r):
```r
SketchData(
  object,
  assay = NULL,
  ncells = 5000L,
  sketched.assay = "sketch",
  method = c("LeverageScore", "Uniform"),
  var.name = "leverage.score",
  over.write = FALSE,
  seed = 123L,
  cast = "dgCMatrix",
  verbose = TRUE,
  features = NULL,
  ...
)
```

Example 5 (r):
```r
SketchData(
  object,
  assay = NULL,
  ncells = 5000L,
  sketched.assay = "sketch",
  method = c("LeverageScore", "Uniform"),
  var.name = "leverage.score",
  over.write = FALSE,
  seed = 123L,
  cast = "dgCMatrix",
  verbose = TRUE,
  features = NULL,
  ...
)
```

---

## Transfer embeddings from sketched cells to the full data — UnSketchEmbeddings • Seurat

**URL:** http://127.0.0.1:9173/seurat/reference/unsketchembeddings/index.html

**Contents:**
- Transfer embeddings from sketched cells to the full data
- Arguments
- Contents

Transfer embeddings from sketched cells to the full data

Embeddings of atom cells

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/integration.R
```

Example 2 (unknown):
```unknown
UnSketchEmbeddings.Rd
```

Example 3 (unknown):
```unknown
UnSketchEmbeddings(
  atom.data,
  atom.cells = NULL,
  orig.data,
  embeddings,
  sketch.matrix = NULL
)
```

Example 4 (r):
```r
UnSketchEmbeddings(
  atom.data,
  atom.cells = NULL,
  orig.data,
  embeddings,
  sketch.matrix = NULL
)
```

Example 5 (r):
```r
UnSketchEmbeddings(
  atom.data,
  atom.cells = NULL,
  orig.data,
  embeddings,
  sketch.matrix = NULL
)
```

---

## The VisiumV2 class — VisiumV2-class • Seurat

**URL:** http://127.0.0.1:9173/seurat/reference/visiumv2-class/index.html

**Contents:**
- The VisiumV2 class
- Slots
- Contents

The VisiumV2 class represents spatial information from the 10X Genomics Visium HD platform - it can also accomodate data from the standard Visium platform

A three-dimensional array with PNG image data, see readPNG for more details

An object of class scalefactors; see scalefactors for more information

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/objects.R
```

Example 2 (unknown):
```unknown
VisiumV2-class.Rd
```

Example 3 (unknown):
```unknown
scale.factors
```

Example 4 (unknown):
```unknown
scalefactors
```

Example 5 (unknown):
```unknown
scalefactors
```

---

## Create a custom color palette — BlackAndWhite • Seurat

**URL:** http://127.0.0.1:9173/reference_custompalette.html

**Contents:**
- Create a custom color palette
- Arguments
- Value
- Examples
- Contents

Creates a custom color palette based on low, middle, and high color values

middle color. Optional.

number of steps (colors levels) to include between low and high values

A color palette for plotting

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/visualization.R
```

Example 2 (unknown):
```unknown
CustomPalette.Rd
```

Example 3 (unknown):
```unknown
BlackAndWhite(mid = NULL, k = 50)

BlueAndRed(k = 50)

CustomPalette(low = "white", high = "red", mid = NULL, k = 50)

PurpleAndYellow(k = 50)
```

Example 4 (r):
```r
BlackAndWhite(mid = NULL, k = 50)

BlueAndRed(k = 50)

CustomPalette(low = "white", high = "red", mid = NULL, k = 50)

PurpleAndYellow(k = 50)
```

Example 5 (r):
```r
BlackAndWhite(mid = NULL, k = 50)

BlueAndRed(k = 50)

CustomPalette(low = "white", high = "red", mid = NULL, k = 50)

PurpleAndYellow(k = 50)
```

Example 6 (unknown):
```unknown
df <- data.frame(x = rnorm(n = 100, mean = 20, sd = 2), y = rbinom(n = 100, size = 100, prob = 0.2))
plot(df, col = BlackAndWhite())


df <- data.frame(x = rnorm(n = 100, mean = 20, sd = 2), y = rbinom(n = 100, size = 100, prob = 0.2))
plot(df, col = BlueAndRed())


myPalette <- CustomPalette()
myPalette
#>  [1] "#FFFFFF" "#FFFAFA" "#FFF5F5" "#FFEFEF" "#FFEAEA" "#FFE5E5" "#FFE0E0"
#>  [8] "#FFDBDB" "#FFD5D5" "#FFD0D0" "#FFCBCB" "#FFC6C6" "#FFC1C1" "#FFBBBB"
#> [15] "#FFB6B6" "#FFB1B1" "#FFACAC" "#FFA7A7" "#FFA1A1" "#FF9C9C" "#FF9797"
#> [22] "#FF9292" "#FF8D8D" "#FF8787" "#FF8282" "#FF7D7D" "#FF7878" "#FF7272"
#> [29] "#FF6D6D" "#FF6868" "#FF6363" "#FF5E5E" "#FF5858" "#FF5353" "#FF4E4E"
#> [36] "#FF4949" "#FF4444" "#FF3E3E" "#FF3939" "#FF3434" "#FF2F2F" "#FF2A2A"
#> [43] "#FF2424" "#FF1F1F" "#FF1A1A" "#FF1515" "#FF1010" "#FF0A0A" "#FF0505"
#> [50] "#FF0000"

df <- data.frame(x = rnorm(n = 100, mean = 20, sd = 2), y = rbinom(n = 100, size = 100, prob = 0.2))
plot(df, col = PurpleAndYellow())
```

Example 7 (r):
```r
df <- data.frame(x = rnorm(n = 100, mean = 20, sd = 2), y = rbinom(n = 100, size = 100, prob = 0.2))
plot(df, col = BlackAndWhite())


df <- data.frame(x = rnorm(n = 100, mean = 20, sd = 2), y = rbinom(n = 100, size = 100, prob = 0.2))
plot(df, col = BlueAndRed())


myPalette <- CustomPalette()
myPalette
#>  [1] "#FFFFFF" "#FFFAFA" "#FFF5F5" "#FFEFEF" "#FFEAEA" "#FFE5E5" "#FFE0E0"
#>  [8] "#FFDBDB" "#FFD5D5" "#FFD0D0" "#FFCBCB" "#FFC6C6" "#FFC1C1" "#FFBBBB"
#> [15] "#FFB6B6" "#FFB1B1" "#FFACAC" "#FFA7A7" "#FFA1A1" "#FF9C9C" "#FF9797"
#> [22] "#FF9292" "#FF8D8D" "#FF8787" "#FF8282" "#FF7D7D" "#FF7878" "#FF7272"
#> [29] "#FF6D6D" "#FF6868" "#FF6363" "#FF5E5E" "#FF5858" "#FF5353" "#FF4E4E"
#> [36] "#FF4949" "#FF4444" "#FF3E3E" "#FF3939" "#FF3434" "#FF2F2F" "#FF2A2A"
#> [43] "#FF2424" "#FF1F1F" "#FF1A1A" "#FF1515" "#FF1010" "#FF0A0A" "#FF0505"
#> [50] "#FF0000"

df <- data.frame(x = rnorm(n = 100, mean = 20, sd = 2), y = rbinom(n = 100, size = 100, prob = 0.2))
plot(df, col = PurpleAndYellow())
```

Example 8 (r):
```r
df <- data.frame(x = rnorm(n = 100, mean = 20, sd = 2), y = rbinom(n = 100, size = 100, prob = 0.2))
plot(df, col = BlackAndWhite())


df <- data.frame(x = rnorm(n = 100, mean = 20, sd = 2), y = rbinom(n = 100, size = 100, prob = 0.2))
plot(df, col = BlueAndRed())


myPalette <- CustomPalette()
myPalette
#>  [1] "#FFFFFF" "#FFFAFA" "#FFF5F5" "#FFEFEF" "#FFEAEA" "#FFE5E5" "#FFE0E0"
#>  [8] "#FFDBDB" "#FFD5D5" "#FFD0D0" "#FFCBCB" "#FFC6C6" "#FFC1C1" "#FFBBBB"
#> [15] "#FFB6B6" "#FFB1B1" "#FFACAC" "#FFA7A7" "#FFA1A1" "#FF9C9C" "#FF9797"
#> [22] "#FF9292" "#FF8D8D" "#FF8787" "#FF8282" "#FF7D7D" "#FF7878" "#FF7272"
#> [29] "#FF6D6D" "#FF6868" "#FF6363" "#FF5E5E" "#FF5858" "#FF5353" "#FF4E4E"
#> [36] "#FF4949" "#FF4444" "#FF3E3E" "#FF3939" "#FF3434" "#FF2F2F" "#FF2A2A"
#> [43] "#FF2424" "#FF1F1F" "#FF1A1A" "#FF1515" "#FF1010" "#FF0A0A" "#FF0505"
#> [50] "#FF0000"

df <- data.frame(x = rnorm(n = 100, mean = 20, sd = 2), y = rbinom(n = 100, size = 100, prob = 0.2))
plot(df, col = PurpleAndYellow())
```

---

## Harmony Integration — HarmonyIntegration • Seurat

**URL:** http://127.0.0.1:9173/reference_harmonyintegration.html

**Contents:**
- Harmony Integration
- Arguments
- Value
- Note
- See also
- Examples
- Contents

A dimensional reduction to correct

Name of new integrated dimensional reduction

If doing PCA on input matrix, number of PCs to compute

Key for Harmony dimensional reduction

Diversity clustering penalty parameter

Ridge regression penalty parameter

Width of soft kmeans clusters

Number of clusters in model

Protection against overclustering small datasets with large ones

What proportion of cells to update during clustering

Maximum number of rounds to run Harmony

Maximum number of rounds to run clustering at each round of Harmony

Convergence tolerance for clustering round of Harmony

Convergence tolerance for Harmony

Whether to print progress messages. TRUE to print, FALSE to suppress

This function requires the harmony package to be installed

harmony::HarmonyMatrix()

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/integration5.R
```

Example 2 (unknown):
```unknown
HarmonyIntegration.Rd
```

Example 3 (unknown):
```unknown
HarmonyIntegration(
  object,
  orig,
  features = NULL,
  scale.layer = "scale.data",
  new.reduction = "harmony",
  layers = NULL,
  npcs = 50L,
  key = "harmony_",
  theta = NULL,
  lambda = NULL,
  sigma = 0.1,
  nclust = NULL,
  tau = 0,
  block.size = 0.05,
  max.iter.harmony = 10L,
  max.iter.cluster = 20L,
  epsilon.cluster = 1e-05,
  epsilon.harmony = 1e-04,
  verbose = TRUE,
  ...
)
```

Example 4 (r):
```r
HarmonyIntegration(
  object,
  orig,
  features = NULL,
  scale.layer = "scale.data",
  new.reduction = "harmony",
  layers = NULL,
  npcs = 50L,
  key = "harmony_",
  theta = NULL,
  lambda = NULL,
  sigma = 0.1,
  nclust = NULL,
  tau = 0,
  block.size = 0.05,
  max.iter.harmony = 10L,
  max.iter.cluster = 20L,
  epsilon.cluster = 1e-05,
  epsilon.harmony = 1e-04,
  verbose = TRUE,
  ...
)
```

Example 5 (r):
```r
HarmonyIntegration(
  object,
  orig,
  features = NULL,
  scale.layer = "scale.data",
  new.reduction = "harmony",
  layers = NULL,
  npcs = 50L,
  key = "harmony_",
  theta = NULL,
  lambda = NULL,
  sigma = 0.1,
  nclust = NULL,
  tau = 0,
  block.size = 0.05,
  max.iter.harmony = 10L,
  max.iter.cluster = 20L,
  epsilon.cluster = 1e-05,
  epsilon.harmony = 1e-04,
  verbose = TRUE,
  ...
)
```

Example 6 (unknown):
```unknown
harmony::HarmonyMatrix()
```

Example 7 (unknown):
```unknown
if (FALSE) { # \dontrun{
# Preprocessing
obj <- SeuratData::LoadData("pbmcsca")
obj[["RNA"]] <- split(obj[["RNA"]], f = obj$Method)
obj <- NormalizeData(obj)
obj <- FindVariableFeatures(obj)
obj <- ScaleData(obj)
obj <- RunPCA(obj)

# After preprocessing, we integrate layers with added parameters specific to Harmony:
obj <- IntegrateLayers(object = obj, method = HarmonyIntegration, orig.reduction = "pca",
  new.reduction = 'harmony', verbose = FALSE)

# Modifying Parameters
# We can also add arguments specific to Harmony such as theta, to give more diverse clusters
obj <- IntegrateLayers(object = obj, method = HarmonyIntegration, orig.reduction = "pca",
  new.reduction = 'harmony', verbose = FALSE, theta = 3)
# Integrating SCTransformed data
obj <- SCTransform(object = obj)
obj <- IntegrateLayers(object = obj, method = HarmonyIntegration,
  orig.reduction = "pca", new.reduction = 'harmony',
  assay = "SCT", verbose = FALSE)
} # }
```

Example 8 (r):
```r
if (FALSE) { # \dontrun{
# Preprocessing
obj <- SeuratData::LoadData("pbmcsca")
obj[["RNA"]] <- split(obj[["RNA"]], f = obj$Method)
obj <- NormalizeData(obj)
obj <- FindVariableFeatures(obj)
obj <- ScaleData(obj)
obj <- RunPCA(obj)

# After preprocessing, we integrate layers with added parameters specific to Harmony:
obj <- IntegrateLayers(object = obj, method = HarmonyIntegration, orig.reduction = "pca",
  new.reduction = 'harmony', verbose = FALSE)

# Modifying Parameters
# We can also add arguments specific to Harmony such as theta, to give more diverse clusters
obj <- IntegrateLayers(object = obj, method = HarmonyIntegration, orig.reduction = "pca",
  new.reduction = 'harmony', verbose = FALSE, theta = 3)
# Integrating SCTransformed data
obj <- SCTransform(object = obj)
obj <- IntegrateLayers(object = obj, method = HarmonyIntegration,
  orig.reduction = "pca", new.reduction = 'harmony',
  assay = "SCT", verbose = FALSE)
} # }
```

Example 9 (r):
```r
if (FALSE) { # \dontrun{
# Preprocessing
obj <- SeuratData::LoadData("pbmcsca")
obj[["RNA"]] <- split(obj[["RNA"]], f = obj$Method)
obj <- NormalizeData(obj)
obj <- FindVariableFeatures(obj)
obj <- ScaleData(obj)
obj <- RunPCA(obj)

# After preprocessing, we integrate layers with added parameters specific to Harmony:
obj <- IntegrateLayers(object = obj, method = HarmonyIntegration, orig.reduction = "pca",
  new.reduction = 'harmony', verbose = FALSE)

# Modifying Parameters
# We can also add arguments specific to Harmony such as theta, to give more diverse clusters
obj <- IntegrateLayers(object = obj, method = HarmonyIntegration, orig.reduction = "pca",
  new.reduction = 'harmony', verbose = FALSE, theta = 3)
# Integrating SCTransformed data
obj <- SCTransform(object = obj)
obj <- IntegrateLayers(object = obj, method = HarmonyIntegration,
  orig.reduction = "pca", new.reduction = 'harmony',
  assay = "SCT", verbose = FALSE)
} # }
```

---

## Objects exported from other packages — components • Seurat

**URL:** http://127.0.0.1:9173/seurat/reference/reexports/index.html

**Contents:**
- Objects exported from other packages
- Contents

These objects are imported from other packages. Follow the links below to see their documentation.

AddMetaData, as.Graph, as.Neighbor, as.Seurat, as.sparse, Assays, Cells, CellsByIdentities, Command, CreateAssayObject, CreateDimReducObject, CreateSeuratObject, DefaultAssay, DefaultAssay<-, Distances, Embeddings, FetchData, GetAssayData, GetImage, GetTissueCoordinates, HVFInfo, Idents, Idents<-, Images, Index, Index<-, Indices, IsGlobal, JS, JS<-, Key, Key<-, Loadings, Loadings<-, LogSeuratCommand, Misc, Misc<-, Neighbors, Project, Project<-, Radius, Reductions, RenameCells, RenameIdents, ReorderIdent, RowMergeSparseMatrices, SetAssayData, SetIdent, SpatiallyVariableFeatures, StashIdent, Stdev, SVFInfo, Tool, Tool<-, UpdateSeuratObject, VariableFeatures, VariableFeatures<-, WhichCells

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/reexports.R
```

Example 2 (unknown):
```unknown
reexports.Rd
```

Example 3 (unknown):
```unknown
AddMetaData
```

Example 4 (unknown):
```unknown
as.Neighbor
```

Example 5 (unknown):
```unknown
CellsByIdentities
```

Example 6 (unknown):
```unknown
CreateAssayObject
```

Example 7 (unknown):
```unknown
CreateDimReducObject
```

Example 8 (unknown):
```unknown
CreateSeuratObject
```

Example 9 (unknown):
```unknown
DefaultAssay
```

Example 10 (unknown):
```unknown
DefaultAssay<-
```

Example 11 (unknown):
```unknown
GetAssayData
```

Example 12 (unknown):
```unknown
GetTissueCoordinates
```

Example 13 (unknown):
```unknown
LogSeuratCommand
```

Example 14 (unknown):
```unknown
RenameCells
```

Example 15 (unknown):
```unknown
RenameIdents
```

Example 16 (unknown):
```unknown
ReorderIdent
```

Example 17 (unknown):
```unknown
RowMergeSparseMatrices
```

Example 18 (unknown):
```unknown
SetAssayData
```

Example 19 (unknown):
```unknown
SpatiallyVariableFeatures
```

Example 20 (unknown):
```unknown
UpdateSeuratObject
```

Example 21 (unknown):
```unknown
VariableFeatures
```

Example 22 (unknown):
```unknown
VariableFeatures<-
```

Example 23 (unknown):
```unknown
components(object, ...)

x %||% y

x %iff% y
```

Example 24 (r):
```r
components(object, ...)

x %||% y

x %iff% y
```

Example 25 (r):
```r
components(object, ...)

x %||% y

x %iff% y
```

---

## Find integration anchors — FindIntegrationAnchors • Seurat

**URL:** http://127.0.0.1:9173/reference_findintegrationanchors.html

**Contents:**
- Find integration anchors
- Arguments
- Value
- Details
- References
- Examples
- Contents

Find a set of anchors between a list of Seurat objects. These anchors can later be used to integrate the objects using the IntegrateData function.

A list of Seurat objects between which to find anchors for downstream integration.

A vector of assay names specifying which assay to use when constructing anchors. If NULL, the current default assay for each object is used.

A vector specifying the object/s to be used as a reference during integration. If NULL (default), all pairwise anchors are found (no reference/s). If not NULL, the corresponding objects in object.list will be used as references. When using a set of specified references, anchors are first found between each query and each reference. The references are then integrated through pairwise integration. Each query is then mapped to the integrated reference.

A numeric value. This will call SelectIntegrationFeatures to select the provided number of features to be used in anchor finding

A vector of features to be used as input to the anchor finding process

Whether or not to scale the features provided. Only set to FALSE if you have previously scaled the features you want to use for each object in the object.list

Name of normalization method used: LogNormalize or SCT

Numeric of length two specifying the min and max values the Pearson residual will be clipped to

Dimensional reduction to perform when finding anchors. Can be one of:

cca: Canonical correlation analysis

Perform L2 normalization on the CCA cell embeddings after dimensional reduction

Which dimensions to use from the CCA to specify the neighbor search space

How many neighbors (k) to use when picking anchors

How many neighbors (k) to use when filtering anchors

How many neighbors (k) to use when scoring anchors

The maximum number of features to use when specifying the neighborhood search space in the anchor filtering

Method for nearest neighbor finding. Options include: rann, annoy

More trees gives higher precision when using annoy approximate nearest neighbor search

Error bound on the neighbor finding algorithm (from RANN/Annoy)

Print progress bars and output

Returns an AnchorSet object that can be used as input to IntegrateData.

The main steps of this procedure are outlined below. For a more detailed description of the methodology, please see Stuart, Butler, et al Cell 2019: doi:10.1016/j.cell.2019.05.031 ; doi:10.1101/460147

First, determine anchor.features if not explicitly specified using SelectIntegrationFeatures. Then for all pairwise combinations of reference and query datasets:

Perform dimensional reduction on the dataset pair as specified via the reduction parameter. If l2.norm is set to TRUE, perform L2 normalization of the embedding vectors.

Identify anchors - pairs of cells from each dataset that are contained within each other's neighborhoods (also known as mutual nearest neighbors).

Filter low confidence anchors to ensure anchors in the low dimension space are in broad agreement with the high dimensional measurements. This is done by looking at the neighbors of each query cell in the reference dataset using max.features to define this space. If the reference cell isn't found within the first k.filter neighbors, remove the anchor.

Assign each remaining anchor a score. For each anchor cell, determine the nearest k.score anchors within its own dataset and within its pair's dataset. Based on these neighborhoods, construct an overall neighbor graph and then compute the shared neighbor overlap between anchor and query cells (analogous to an SNN graph). We use the 0.01 and 0.90 quantiles on these scores to dampen outlier effects and rescale to range between 0-1.

Stuart T, Butler A, et al. Comprehensive Integration of Single-Cell Data. Cell. 2019;177:1888-1902 doi:10.1016/j.cell.2019.05.031

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/integration.R
```

Example 2 (unknown):
```unknown
FindIntegrationAnchors.Rd
```

Example 3 (unknown):
```unknown
IntegrateData
```

Example 4 (unknown):
```unknown
FindIntegrationAnchors(
  object.list = NULL,
  assay = NULL,
  reference = NULL,
  anchor.features = 2000,
  scale = TRUE,
  normalization.method = c("LogNormalize", "SCT"),
  sct.clip.range = NULL,
  reduction = c("cca", "rpca", "jpca", "rlsi"),
  l2.norm = TRUE,
  dims = 1:30,
  k.anchor = 5,
  k.filter = 200,
  k.score = 30,
  max.features = 200,
  nn.method = "annoy",
  n.trees = 50,
  eps = 0,
  verbose = TRUE
)
```

Example 5 (r):
```r
FindIntegrationAnchors(
  object.list = NULL,
  assay = NULL,
  reference = NULL,
  anchor.features = 2000,
  scale = TRUE,
  normalization.method = c("LogNormalize", "SCT"),
  sct.clip.range = NULL,
  reduction = c("cca", "rpca", "jpca", "rlsi"),
  l2.norm = TRUE,
  dims = 1:30,
  k.anchor = 5,
  k.filter = 200,
  k.score = 30,
  max.features = 200,
  nn.method = "annoy",
  n.trees = 50,
  eps = 0,
  verbose = TRUE
)
```

Example 6 (r):
```r
FindIntegrationAnchors(
  object.list = NULL,
  assay = NULL,
  reference = NULL,
  anchor.features = 2000,
  scale = TRUE,
  normalization.method = c("LogNormalize", "SCT"),
  sct.clip.range = NULL,
  reduction = c("cca", "rpca", "jpca", "rlsi"),
  l2.norm = TRUE,
  dims = 1:30,
  k.anchor = 5,
  k.filter = 200,
  k.score = 30,
  max.features = 200,
  nn.method = "annoy",
  n.trees = 50,
  eps = 0,
  verbose = TRUE
)
```

Example 7 (unknown):
```unknown
object.list
```

Example 8 (unknown):
```unknown
SelectIntegrationFeatures
```

Example 9 (unknown):
```unknown
IntegrateData
```

Example 10 (unknown):
```unknown
SelectIntegrationFeatures
```

Example 11 (unknown):
```unknown
max.features
```

Example 12 (unknown):
```unknown
if (FALSE) { # \dontrun{
# to install the SeuratData package see https://github.com/satijalab/seurat-data
library(SeuratData)
data("panc8")

# panc8 is a merged Seurat object containing 8 separate pancreas datasets
# split the object by dataset
pancreas.list <- SplitObject(panc8, split.by = "tech")

# perform standard preprocessing on each object
for (i in 1:length(pancreas.list)) {
  pancreas.list[[i]] <- NormalizeData(pancreas.list[[i]], verbose = FALSE)
  pancreas.list[[i]] <- FindVariableFeatures(
    pancreas.list[[i]], selection.method = "vst",
    nfeatures = 2000, verbose = FALSE
  )
}

# find anchors
anchors <- FindIntegrationAnchors(object.list = pancreas.list)

# integrate data
integrated <- IntegrateData(anchorset = anchors)
} # }
```

Example 13 (r):
```r
if (FALSE) { # \dontrun{
# to install the SeuratData package see https://github.com/satijalab/seurat-data
library(SeuratData)
data("panc8")

# panc8 is a merged Seurat object containing 8 separate pancreas datasets
# split the object by dataset
pancreas.list <- SplitObject(panc8, split.by = "tech")

# perform standard preprocessing on each object
for (i in 1:length(pancreas.list)) {
  pancreas.list[[i]] <- NormalizeData(pancreas.list[[i]], verbose = FALSE)
  pancreas.list[[i]] <- FindVariableFeatures(
    pancreas.list[[i]], selection.method = "vst",
    nfeatures = 2000, verbose = FALSE
  )
}

# find anchors
anchors <- FindIntegrationAnchors(object.list = pancreas.list)

# integrate data
integrated <- IntegrateData(anchorset = anchors)
} # }
```

Example 14 (r):
```r
if (FALSE) { # \dontrun{
# to install the SeuratData package see https://github.com/satijalab/seurat-data
library(SeuratData)
data("panc8")

# panc8 is a merged Seurat object containing 8 separate pancreas datasets
# split the object by dataset
pancreas.list <- SplitObject(panc8, split.by = "tech")

# perform standard preprocessing on each object
for (i in 1:length(pancreas.list)) {
  pancreas.list[[i]] <- NormalizeData(pancreas.list[[i]], verbose = FALSE)
  pancreas.list[[i]] <- FindVariableFeatures(
    pancreas.list[[i]], selection.method = "vst",
    nfeatures = 2000, verbose = FALSE
  )
}

# find anchors
anchors <- FindIntegrationAnchors(object.list = pancreas.list)

# integrate data
integrated <- IntegrateData(anchorset = anchors)
} # }
```

---

## Seurat-Joint PCA Integration — JointPCAIntegration • Seurat

**URL:** http://127.0.0.1:9173/seurat/reference/jointpcaintegration/index.html

**Contents:**
- Seurat-Joint PCA Integration
- Arguments
- Contents

Seurat-Joint PCA Integration

Name of Assay in the Seurat object

Names of layers in assay

A DimReduc to correct

Name of new integrated dimensional reduction

A reference Seurat object

A vector of features to use for integration

Name of normalization method used: LogNormalize or SCT

Dimensions of dimensional reduction to use for integration

How many neighbors (k) to use when picking anchors

Name of scaled layer in Assay

Number of dimensions to return integrated values for

Number of neighbors to consider when weighting anchors

Dimension reduction to use when calculating anchor weights. This can be one of:

A string, specifying the name of a dimension reduction present in all objects to be integrated

A vector of strings, specifying the name of a dimension reduction to use for each object to be integrated

A vector of DimReduc objects, specifying the object to use for each object in the integration

NULL, in which case the full corrected space is used for computing anchor weights.

Controls the bandwidth of the Gaussian kernel for weighting

Specify the order of integration. Order of integration should be encoded in a matrix, where each row represents one of the pairwise integration steps. Negative numbers specify a dataset, positive numbers specify the integration results from a given row (the format of the merge matrix included in the hclust function output). For example: matrix(c(-2, 1, -3, -1), ncol = 2) gives:

Which would cause dataset 2 and 3 to be integrated first, then the resulting object integrated with dataset 1.

If NULL, the sample tree will be computed automatically.

Do not reorder objects based on size for each pairwise integration.

Arguments passed on to FindIntegrationAnchors

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/integration5.R
```

Example 2 (unknown):
```unknown
JointPCAIntegration.Rd
```

Example 3 (unknown):
```unknown
JointPCAIntegration(
  object = NULL,
  assay = NULL,
  layers = NULL,
  orig = NULL,
  new.reduction = "integrated.dr",
  reference = NULL,
  features = NULL,
  normalization.method = c("LogNormalize", "SCT"),
  dims = 1:30,
  k.anchor = 20,
  scale.layer = "scale.data",
  dims.to.integrate = NULL,
  k.weight = 100,
  weight.reduction = NULL,
  sd.weight = 1,
  sample.tree = NULL,
  preserve.order = FALSE,
  verbose = TRUE,
  ...
)
```

Example 4 (r):
```r
JointPCAIntegration(
  object = NULL,
  assay = NULL,
  layers = NULL,
  orig = NULL,
  new.reduction = "integrated.dr",
  reference = NULL,
  features = NULL,
  normalization.method = c("LogNormalize", "SCT"),
  dims = 1:30,
  k.anchor = 20,
  scale.layer = "scale.data",
  dims.to.integrate = NULL,
  k.weight = 100,
  weight.reduction = NULL,
  sd.weight = 1,
  sample.tree = NULL,
  preserve.order = FALSE,
  verbose = TRUE,
  ...
)
```

Example 5 (r):
```r
JointPCAIntegration(
  object = NULL,
  assay = NULL,
  layers = NULL,
  orig = NULL,
  new.reduction = "integrated.dr",
  reference = NULL,
  features = NULL,
  normalization.method = c("LogNormalize", "SCT"),
  dims = 1:30,
  k.anchor = 20,
  scale.layer = "scale.data",
  dims.to.integrate = NULL,
  k.weight = 100,
  weight.reduction = NULL,
  sd.weight = 1,
  sample.tree = NULL,
  preserve.order = FALSE,
  verbose = TRUE,
  ...
)
```

Example 6 (unknown):
```unknown
matrix(c(-2, 1, -3, -1), ncol = 2)
```

Example 7 (unknown):
```unknown
[,1]  [,2]
       [1,]   -2   -3
       [2,]    1   -1
```

Example 8 (unknown):
```unknown
[,1]  [,2]
       [1,]   -2   -3
       [2,]    1   -1
```

Example 9 (unknown):
```unknown
[,1]  [,2]
       [1,]   -2   -3
       [2,]    1   -1
```

Example 10 (unknown):
```unknown
FindIntegrationAnchors
```

---

## Spatial Feature Plots — ImageFeaturePlot • Seurat

**URL:** http://127.0.0.1:9173/reference_imagefeatureplot.html

**Contents:**
- Spatial Feature Plots
- Arguments
- Value
- Contents

Visualize expression in a spatial context

Vector of features to plot. Features can come from:

An Assay feature (e.g. a gene name - "MS4A1")

A column name from meta.data (e.g. mitochondrial percentage - "percent.mito")

A column name from a DimReduc object corresponding to the cell embedding values (e.g. the PC 1 scores - "PC_1")

A vector of segmentation boundaries per image to plot; can be a character vector, a named character vector, or a named list. Names should be the names of FOVs and values should be the names of segmentation boundaries

The two colors to form the gradient over. Provide as string vector with the first color corresponding to low values, the second to high. Also accepts a Brewer color scale or vector of colors. Note: this will bin the data into number of colors provided. When blend is TRUE, takes anywhere from 1-3 colors:

Treated as color for double-negatives, will use default colors 2 and 3 for per-feature expression

Treated as colors for per-feature expression, will use default color 1 for double-negatives

First color used for double-negatives, colors 2 and 3 used for per-feature expression, all others ignored

Point size for cells when plotting centroids

Vector of minimum and maximum cutoff values for each feature, may specify quantile in the form of 'q##' where '##' is the quantile (eg, 'q1', 'q10')

A factor in object metadata to split the plot by, pass 'ident' to split by cell identity

A vector of molecules to plot

Point size for molecules

A vector of color for molecules. The "Set1" palette from RColorBrewer is used by default.

Max number of each molecule specified in `molecules` to plot

Alpha value for plotting (default is 1)

Color of cell segmentation border; pass NA to suppress borders for segmentation-based plots

Thickness of cell segmentation borders; pass NA to suppress borders for centroid-based plots

Set plot background to black

Scale and blend expression values to visualize coexpression of two features

The color cutoff from weak signal to strong signal; ranges from 0 to 1.

Crop the plots to area with cells only

Vector of cells to plot (default is all cells)

Set color scaling across multiple plots; choose from:

“feature”: Plots per-feature are scaled across splits

“all”: Plots per-feature are scaled across all features

“none”: Plots are not scaled; note: setting scale to “none” will result in color scales that are not comparable between plots

Ignored if blend = TRUE

Overlay boundaries from a single image to create a single plot; if TRUE, then boundaries are stacked in the order they're given (first is lowest)

Keep axes and panel background

Combine plots into a single patchworked ggplot object. If FALSE, return a list of ggplot objects

Plot cartesian coordinates with fixed aspect ratio

If combine = TRUE, a patchwork ggplot object; otherwise, a list of ggplot objects

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/visualization.R
```

Example 2 (unknown):
```unknown
ImageFeaturePlot.Rd
```

Example 3 (unknown):
```unknown
ImageFeaturePlot(
  object,
  features,
  fov = NULL,
  boundaries = NULL,
  cols = if (isTRUE(x = blend)) {
     c("lightgrey", "#ff0000", "#00ff00")
 } else {
   
     c("lightgrey", "firebrick1")
 },
  size = 0.5,
  min.cutoff = NA,
  max.cutoff = NA,
  split.by = NULL,
  molecules = NULL,
  mols.size = 0.1,
  mols.cols = NULL,
  nmols = 1000,
  alpha = 1,
  border.color = "white",
  border.size = NULL,
  dark.background = TRUE,
  blend = FALSE,
  blend.threshold = 0.5,
  crop = FALSE,
  cells = NULL,
  scale = c("feature", "all", "none"),
  overlap = FALSE,
  axes = FALSE,
  combine = TRUE,
  coord.fixed = TRUE
)
```

Example 4 (r):
```r
ImageFeaturePlot(
  object,
  features,
  fov = NULL,
  boundaries = NULL,
  cols = if (isTRUE(x = blend)) {
     c("lightgrey", "#ff0000", "#00ff00")
 } else {
   
     c("lightgrey", "firebrick1")
 },
  size = 0.5,
  min.cutoff = NA,
  max.cutoff = NA,
  split.by = NULL,
  molecules = NULL,
  mols.size = 0.1,
  mols.cols = NULL,
  nmols = 1000,
  alpha = 1,
  border.color = "white",
  border.size = NULL,
  dark.background = TRUE,
  blend = FALSE,
  blend.threshold = 0.5,
  crop = FALSE,
  cells = NULL,
  scale = c("feature", "all", "none"),
  overlap = FALSE,
  axes = FALSE,
  combine = TRUE,
  coord.fixed = TRUE
)
```

Example 5 (r):
```r
ImageFeaturePlot(
  object,
  features,
  fov = NULL,
  boundaries = NULL,
  cols = if (isTRUE(x = blend)) {
     c("lightgrey", "#ff0000", "#00ff00")
 } else {
   
     c("lightgrey", "firebrick1")
 },
  size = 0.5,
  min.cutoff = NA,
  max.cutoff = NA,
  split.by = NULL,
  molecules = NULL,
  mols.size = 0.1,
  mols.cols = NULL,
  nmols = 1000,
  alpha = 1,
  border.color = "white",
  border.size = NULL,
  dark.background = TRUE,
  blend = FALSE,
  blend.threshold = 0.5,
  crop = FALSE,
  cells = NULL,
  scale = c("feature", "all", "none"),
  overlap = FALSE,
  axes = FALSE,
  combine = TRUE,
  coord.fixed = TRUE
)
```

Example 6 (unknown):
```unknown
blend = TRUE
```

Example 7 (unknown):
```unknown
patchworked
```

Example 8 (unknown):
```unknown
combine = TRUE
```

---

## Dimensional reduction heatmap — DimHeatmap • Seurat

**URL:** http://127.0.0.1:9173/reference_dimheatmap.html

**Contents:**
- Dimensional reduction heatmap
- Arguments
- Value
- See also
- Examples
- Contents

Draws a heatmap focusing on a principal component. Both cells and genes are sorted by their principal component scores. Allows for nice visualization of sources of heterogeneity in the dataset.

Number of genes to plot

A list of cells to plot. If numeric, just plots the top cells.

Which dimensional reduction to use

Minimum display value (all values below are clipped)

Maximum display value (all values above are clipped); defaults to 2.5 if slot is 'scale.data', 6 otherwise

Plot an equal number of genes with both + and - scores.

Use the full projected dimensional reduction

Number of columns to plot

If true, use image to generate plots; faster than using ggplot2, but not customizable

If true, plot with geom_raster, else use geom_tile. geom_raster may look blurry on some viewing applications such as Preview due to how the raster is interpolated. Set this to FALSE if you are encountering that issue (note that plots may take longer to produce/render).

Data slot to use, choose from 'raw.data', 'data', or 'scale.data'

A vector of assays to pull data from

Combine plots into a single patchworked ggplot object. If FALSE, return a list of ggplot objects

Extra parameters passed to DimHeatmap

No return value by default. If using fast = FALSE, will return a patchworked ggplot object if combine = TRUE, otherwise returns a list of ggplot objects

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/visualization.R
```

Example 2 (unknown):
```unknown
R/convenience.R
```

Example 3 (unknown):
```unknown
DimHeatmap.Rd
```

Example 4 (unknown):
```unknown
DimHeatmap(
  object,
  dims = 1,
  nfeatures = 30,
  cells = NULL,
  reduction = "pca",
  disp.min = -2.5,
  disp.max = NULL,
  balanced = TRUE,
  projected = FALSE,
  ncol = NULL,
  fast = TRUE,
  raster = TRUE,
  slot = "scale.data",
  assays = NULL,
  combine = TRUE
)

PCHeatmap(object, ...)
```

Example 5 (r):
```r
DimHeatmap(
  object,
  dims = 1,
  nfeatures = 30,
  cells = NULL,
  reduction = "pca",
  disp.min = -2.5,
  disp.max = NULL,
  balanced = TRUE,
  projected = FALSE,
  ncol = NULL,
  fast = TRUE,
  raster = TRUE,
  slot = "scale.data",
  assays = NULL,
  combine = TRUE
)

PCHeatmap(object, ...)
```

Example 6 (r):
```r
DimHeatmap(
  object,
  dims = 1,
  nfeatures = 30,
  cells = NULL,
  reduction = "pca",
  disp.min = -2.5,
  disp.max = NULL,
  balanced = TRUE,
  projected = FALSE,
  ncol = NULL,
  fast = TRUE,
  raster = TRUE,
  slot = "scale.data",
  assays = NULL,
  combine = TRUE
)

PCHeatmap(object, ...)
```

Example 7 (unknown):
```unknown
patchworked
```

Example 8 (unknown):
```unknown
patchworked
```

Example 9 (unknown):
```unknown
geom_raster
```

Example 10 (unknown):
```unknown
data("pbmc_small")
DimHeatmap(object = pbmc_small)
#> Warning: Requested number is larger than the number of available items (20). Setting to 20.
```

Example 11 (r):
```r
data("pbmc_small")
DimHeatmap(object = pbmc_small)
#> Warning: Requested number is larger than the number of available items (20). Setting to 20.
```

Example 12 (r):
```r
data("pbmc_small")
DimHeatmap(object = pbmc_small)
#> Warning: Requested number is larger than the number of available items (20). Setting to 20.
```

---

## Get Tissue Coordinates — GetTissueCoordinates.SlideSeq • Seurat

**URL:** http://127.0.0.1:9173/seurat/reference/gettissuecoordinates/index.html

**Contents:**
- Get Tissue Coordinates
- Arguments
- See also
- Contents

Get Tissue Coordinates

Arguments passed to other methods

return qhulls instead of centroids

A factor to scale the coordinates by; choose from: 'tissue', 'fiducial', 'hires', 'lowres', or NULL for no scaling

Columns of tissue coordinates data.frame to pull

SeuratObject::GetTissueCoordinates

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/objects.R
```

Example 2 (unknown):
```unknown
GetTissueCoordinates.Rd
```

Example 3 (python):
```python
# S3 method for class 'SlideSeq'
GetTissueCoordinates(object, ...)

# S3 method for class 'STARmap'
GetTissueCoordinates(object, qhulls = FALSE, ...)

# S3 method for class 'VisiumV1'
GetTissueCoordinates(
  object,
  scale = "lowres",
  cols = c("imagerow", "imagecol"),
  ...
)

# S3 method for class 'VisiumV2'
GetTissueCoordinates(object, scale = NULL, ...)
```

Example 4 (r):
```r
# S3 method for class 'SlideSeq'
GetTissueCoordinates(object, ...)

# S3 method for class 'STARmap'
GetTissueCoordinates(object, qhulls = FALSE, ...)

# S3 method for class 'VisiumV1'
GetTissueCoordinates(
  object,
  scale = "lowres",
  cols = c("imagerow", "imagecol"),
  ...
)

# S3 method for class 'VisiumV2'
GetTissueCoordinates(object, scale = NULL, ...)
```

Example 5 (r):
```r
# S3 method for class 'SlideSeq'
GetTissueCoordinates(object, ...)

# S3 method for class 'STARmap'
GetTissueCoordinates(object, qhulls = FALSE, ...)

# S3 method for class 'VisiumV1'
GetTissueCoordinates(
  object,
  scale = "lowres",
  cols = c("imagerow", "imagecol"),
  ...
)

# S3 method for class 'VisiumV2'
GetTissueCoordinates(object, scale = NULL, ...)
```

Example 6 (unknown):
```unknown
SeuratObject::GetTissueCoordinates
```

---

## Scale and/or center matrix rowwise — FastRowScale • Seurat

**URL:** http://127.0.0.1:9173/seurat/reference/fastrowscale/index.html

**Contents:**
- Scale and/or center matrix rowwise
- Arguments
- Value
- Contents

Performs row scaling and/or centering. Equivalent to using t(scale(t(mat))) in R except in the case of NA values.

a logical value indicating whether to center the rows

a logical value indicating whether to scale the rows

clip all values greater than scale_max to scale_max. Don't clip if Inf.

Returns the center/scaled matrix

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/utilities.R
```

Example 2 (unknown):
```unknown
FastRowScale.Rd
```

Example 3 (unknown):
```unknown
FastRowScale(mat, center = TRUE, scale = TRUE, scale_max = 10)
```

Example 4 (r):
```r
FastRowScale(mat, center = TRUE, scale = TRUE, scale_max = 10)
```

Example 5 (r):
```r
FastRowScale(mat, center = TRUE, scale = TRUE, scale_max = 10)
```

---

## Cell Selector — CellSelector • Seurat

**URL:** http://127.0.0.1:9173/seurat/reference/cellselector/index.html

**Contents:**
- Cell Selector
- Arguments
- Value
- See also
- Examples
- Contents

Select points on a scatterplot and get information about them

An optional Seurat object; if passes, will return an object with the identities of selected cells set to ident

An optional new identity class to assign the selected cells

If object is NULL, the names of the points selected; otherwise, a Seurat object with the selected cells identity classes set to ident

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/visualization.R
```

Example 2 (unknown):
```unknown
CellSelector.Rd
```

Example 3 (unknown):
```unknown
CellSelector(plot, object = NULL, ident = "SelectedCells", ...)

FeatureLocator(plot, ...)
```

Example 4 (r):
```r
CellSelector(plot, object = NULL, ident = "SelectedCells", ...)

FeatureLocator(plot, ...)
```

Example 5 (r):
```r
CellSelector(plot, object = NULL, ident = "SelectedCells", ...)

FeatureLocator(plot, ...)
```

Example 6 (unknown):
```unknown
FeaturePlot
```

Example 7 (python):
```python
if (FALSE) { # \dontrun{
data("pbmc_small")
plot <- DimPlot(object = pbmc_small)
# Follow instructions in the terminal to select points
cells.located <- CellSelector(plot = plot)
cells.located
# Automatically set the identity class of selected cells and return a new Seurat object
pbmc_small <- CellSelector(plot = plot, object = pbmc_small, ident = 'SelectedCells')
} # }
```

Example 8 (r):
```r
if (FALSE) { # \dontrun{
data("pbmc_small")
plot <- DimPlot(object = pbmc_small)
# Follow instructions in the terminal to select points
cells.located <- CellSelector(plot = plot)
cells.located
# Automatically set the identity class of selected cells and return a new Seurat object
pbmc_small <- CellSelector(plot = plot, object = pbmc_small, ident = 'SelectedCells')
} # }
```

Example 9 (r):
```r
if (FALSE) { # \dontrun{
data("pbmc_small")
plot <- DimPlot(object = pbmc_small)
# Follow instructions in the terminal to select points
cells.located <- CellSelector(plot = plot)
cells.located
# Automatically set the identity class of selected cells and return a new Seurat object
pbmc_small <- CellSelector(plot = plot, object = pbmc_small, ident = 'SelectedCells')
} # }
```

---

## Read and Load 10x Genomics Xenium in-situ data — LoadXenium • Seurat

**URL:** http://127.0.0.1:9173/seurat/reference/readxenium/index.html

**Contents:**
- Read and Load 10x Genomics Xenium in-situ data
- Arguments
- Value
- Contents

Read and Load 10x Genomics Xenium in-situ data

Directory containing all Xenium output files with default filenames

Remove transcript molecules with a QV less than this threshold. QV >= 20 is the standard threshold used to construct the cell x gene count matrix.

Whether or not to load cell centroids

Whether or not to load molecule pixel coordinates

One of "cell", "nucleus" or NULL (to load either cell segmentations, nucleus segmentations or neither)

Whether or not to flip the x/y coordinates of the Xenium outputs to match what is displayed in Xenium Explorer, or fit on your screen better.

Types of molecular outputs to read; choose one or more of:

“matrix”: the counts matrix

“microns”: molecule coordinates

“segmentation_method”: cell segmentation method (for runs which use multi-modal segmentation)

Type of cell spatial coordinate matrices to read; choose one or more of:

“centroids”: cell centroids in pixel coordinate space

“segmentations”: cell segmentations in pixel coordinate space

“nucleus_segmentations”: nucleus segmentations in pixel coordinate space

LoadXenium: A Seurat object

ReadXenium: A list with some combination of the following values:

“matrix”: a sparse matrix with expression data; cells are columns and features are rows

“centroids”: a data frame with cell centroid coordinates in three columns: “x”, “y”, and “cell”

“pixels”: a data frame with molecule pixel coordinates in three columns: “x”, “y”, and “gene”

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/convenience.R
```

Example 2 (unknown):
```unknown
R/preprocessing.R
```

Example 3 (unknown):
```unknown
ReadXenium.Rd
```

Example 4 (unknown):
```unknown
LoadXenium(
  data.dir,
  fov = "fov",
  assay = "Xenium",
  mols.qv.threshold = 20,
  cell.centroids = TRUE,
  molecule.coordinates = TRUE,
  segmentations = NULL,
  flip.xy = FALSE
)

ReadXenium(
  data.dir,
  outs = c("segmentation_method", "matrix", "microns"),
  type = "centroids",
  mols.qv.threshold = 20,
  flip.xy = F
)
```

Example 5 (r):
```r
LoadXenium(
  data.dir,
  fov = "fov",
  assay = "Xenium",
  mols.qv.threshold = 20,
  cell.centroids = TRUE,
  molecule.coordinates = TRUE,
  segmentations = NULL,
  flip.xy = FALSE
)

ReadXenium(
  data.dir,
  outs = c("segmentation_method", "matrix", "microns"),
  type = "centroids",
  mols.qv.threshold = 20,
  flip.xy = F
)
```

Example 6 (r):
```r
LoadXenium(
  data.dir,
  fov = "fov",
  assay = "Xenium",
  mols.qv.threshold = 20,
  cell.centroids = TRUE,
  molecule.coordinates = TRUE,
  segmentations = NULL,
  flip.xy = FALSE
)

ReadXenium(
  data.dir,
  outs = c("segmentation_method", "matrix", "microns"),
  type = "centroids",
  mols.qv.threshold = 20,
  flip.xy = F
)
```

---

## Project query into UMAP coordinates of a reference — ProjectUMAP • Seurat

**URL:** http://127.0.0.1:9173/reference_projectumap.html

**Contents:**
- Project query into UMAP coordinates of a reference
- Arguments
- Contents

This function will take a query dataset and project it into the coordinates of a provided reference UMAP. This is essentially a wrapper around two steps:

FindNeighbors - Find the nearest reference cell neighbors and their distances for each query cell.

RunUMAP - Perform umap projection by providing the neighbor set calculated above and the umap model previously computed in the reference.

Additional parameters to RunUMAP

Dimensions (columns) to use from query

Dimensions (columns) to use from reference

Defines k for the k-nearest neighbor algorithm

Method for nearest neighbor finding. Options include: rann, annoy

More trees gives higher precision when using annoy approximate nearest neighbor search

Distance metric for annoy. Options include: euclidean, cosine, manhattan, and hamming

Take L2Norm of the data

Include cached index in returned Neighbor object (only relevant if return.neighbor = TRUE)

Precomputed index. Useful if querying new data against existing index to avoid recomputing.

Name to store neighbor information in the query

DimReduc object that contains the umap model

Name of reduction to use from the query for neighbor finding

Name of reduction to use from the reference for neighbor finding

Name of projected UMAP to store in the query

Value for the projected UMAP key

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/generics.R
```

Example 2 (unknown):
```unknown
R/dimensional_reduction.R
```

Example 3 (unknown):
```unknown
ProjectUMAP.Rd
```

Example 4 (python):
```python
ProjectUMAP(query, ...)

# Default S3 method
ProjectUMAP(
  query,
  query.dims = NULL,
  reference,
  reference.dims = NULL,
  k.param = 30,
  nn.method = "annoy",
  n.trees = 50,
  annoy.metric = "cosine",
  l2.norm = FALSE,
  cache.index = TRUE,
  index = NULL,
  neighbor.name = "query_ref.nn",
  reduction.model,
  ...
)

# S3 method for class 'DimReduc'
ProjectUMAP(
  query,
  query.dims = NULL,
  reference,
  reference.dims = NULL,
  k.param = 30,
  nn.method = "annoy",
  n.trees = 50,
  annoy.metric = "cosine",
  l2.norm = FALSE,
  cache.index = TRUE,
  index = NULL,
  neighbor.name = "query_ref.nn",
  reduction.model,
  ...
)

# S3 method for class 'Seurat'
ProjectUMAP(
  query,
  query.reduction,
  query.dims = NULL,
  reference,
  reference.reduction,
  reference.dims = NULL,
  k.param = 30,
  nn.method = "annoy",
  n.trees = 50,
  annoy.metric = "cosine",
  l2.norm = FALSE,
  cache.index = TRUE,
  index = NULL,
  neighbor.name = "query_ref.nn",
  reduction.model,
  reduction.name = "ref.umap",
  reduction.key = "refUMAP_",
  ...
)
```

Example 5 (r):
```r
ProjectUMAP(query, ...)

# Default S3 method
ProjectUMAP(
  query,
  query.dims = NULL,
  reference,
  reference.dims = NULL,
  k.param = 30,
  nn.method = "annoy",
  n.trees = 50,
  annoy.metric = "cosine",
  l2.norm = FALSE,
  cache.index = TRUE,
  index = NULL,
  neighbor.name = "query_ref.nn",
  reduction.model,
  ...
)

# S3 method for class 'DimReduc'
ProjectUMAP(
  query,
  query.dims = NULL,
  reference,
  reference.dims = NULL,
  k.param = 30,
  nn.method = "annoy",
  n.trees = 50,
  annoy.metric = "cosine",
  l2.norm = FALSE,
  cache.index = TRUE,
  index = NULL,
  neighbor.name = "query_ref.nn",
  reduction.model,
  ...
)

# S3 method for class 'Seurat'
ProjectUMAP(
  query,
  query.reduction,
  query.dims = NULL,
  reference,
  reference.reduction,
  reference.dims = NULL,
  k.param = 30,
  nn.method = "annoy",
  n.trees = 50,
  annoy.metric = "cosine",
  l2.norm = FALSE,
  cache.index = TRUE,
  index = NULL,
  neighbor.name = "query_ref.nn",
  reduction.model,
  reduction.name = "ref.umap",
  reduction.key = "refUMAP_",
  ...
)
```

Example 6 (r):
```r
ProjectUMAP(query, ...)

# Default S3 method
ProjectUMAP(
  query,
  query.dims = NULL,
  reference,
  reference.dims = NULL,
  k.param = 30,
  nn.method = "annoy",
  n.trees = 50,
  annoy.metric = "cosine",
  l2.norm = FALSE,
  cache.index = TRUE,
  index = NULL,
  neighbor.name = "query_ref.nn",
  reduction.model,
  ...
)

# S3 method for class 'DimReduc'
ProjectUMAP(
  query,
  query.dims = NULL,
  reference,
  reference.dims = NULL,
  k.param = 30,
  nn.method = "annoy",
  n.trees = 50,
  annoy.metric = "cosine",
  l2.norm = FALSE,
  cache.index = TRUE,
  index = NULL,
  neighbor.name = "query_ref.nn",
  reduction.model,
  ...
)

# S3 method for class 'Seurat'
ProjectUMAP(
  query,
  query.reduction,
  query.dims = NULL,
  reference,
  reference.reduction,
  reference.dims = NULL,
  k.param = 30,
  nn.method = "annoy",
  n.trees = 50,
  annoy.metric = "cosine",
  l2.norm = FALSE,
  cache.index = TRUE,
  index = NULL,
  neighbor.name = "query_ref.nn",
  reduction.model,
  reduction.name = "ref.umap",
  reduction.key = "refUMAP_",
  ...
)
```

---

## Harmony Integration — HarmonyIntegration • Seurat

**URL:** http://127.0.0.1:9173/seurat/reference/harmonyintegration/index.html

**Contents:**
- Harmony Integration
- Arguments
- Value
- Note
- See also
- Examples
- Contents

A dimensional reduction to correct

Name of new integrated dimensional reduction

If doing PCA on input matrix, number of PCs to compute

Key for Harmony dimensional reduction

Diversity clustering penalty parameter

Ridge regression penalty parameter

Width of soft kmeans clusters

Number of clusters in model

Protection against overclustering small datasets with large ones

What proportion of cells to update during clustering

Maximum number of rounds to run Harmony

Maximum number of rounds to run clustering at each round of Harmony

Convergence tolerance for clustering round of Harmony

Convergence tolerance for Harmony

Whether to print progress messages. TRUE to print, FALSE to suppress

This function requires the harmony package to be installed

harmony::HarmonyMatrix()

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/integration5.R
```

Example 2 (unknown):
```unknown
HarmonyIntegration.Rd
```

Example 3 (unknown):
```unknown
HarmonyIntegration(
  object,
  orig,
  features = NULL,
  scale.layer = "scale.data",
  new.reduction = "harmony",
  layers = NULL,
  npcs = 50L,
  key = "harmony_",
  theta = NULL,
  lambda = NULL,
  sigma = 0.1,
  nclust = NULL,
  tau = 0,
  block.size = 0.05,
  max.iter.harmony = 10L,
  max.iter.cluster = 20L,
  epsilon.cluster = 1e-05,
  epsilon.harmony = 1e-04,
  verbose = TRUE,
  ...
)
```

Example 4 (r):
```r
HarmonyIntegration(
  object,
  orig,
  features = NULL,
  scale.layer = "scale.data",
  new.reduction = "harmony",
  layers = NULL,
  npcs = 50L,
  key = "harmony_",
  theta = NULL,
  lambda = NULL,
  sigma = 0.1,
  nclust = NULL,
  tau = 0,
  block.size = 0.05,
  max.iter.harmony = 10L,
  max.iter.cluster = 20L,
  epsilon.cluster = 1e-05,
  epsilon.harmony = 1e-04,
  verbose = TRUE,
  ...
)
```

Example 5 (r):
```r
HarmonyIntegration(
  object,
  orig,
  features = NULL,
  scale.layer = "scale.data",
  new.reduction = "harmony",
  layers = NULL,
  npcs = 50L,
  key = "harmony_",
  theta = NULL,
  lambda = NULL,
  sigma = 0.1,
  nclust = NULL,
  tau = 0,
  block.size = 0.05,
  max.iter.harmony = 10L,
  max.iter.cluster = 20L,
  epsilon.cluster = 1e-05,
  epsilon.harmony = 1e-04,
  verbose = TRUE,
  ...
)
```

Example 6 (unknown):
```unknown
harmony::HarmonyMatrix()
```

Example 7 (unknown):
```unknown
if (FALSE) { # \dontrun{
# Preprocessing
obj <- SeuratData::LoadData("pbmcsca")
obj[["RNA"]] <- split(obj[["RNA"]], f = obj$Method)
obj <- NormalizeData(obj)
obj <- FindVariableFeatures(obj)
obj <- ScaleData(obj)
obj <- RunPCA(obj)

# After preprocessing, we integrate layers with added parameters specific to Harmony:
obj <- IntegrateLayers(object = obj, method = HarmonyIntegration, orig.reduction = "pca",
  new.reduction = 'harmony', verbose = FALSE)

# Modifying Parameters
# We can also add arguments specific to Harmony such as theta, to give more diverse clusters
obj <- IntegrateLayers(object = obj, method = HarmonyIntegration, orig.reduction = "pca",
  new.reduction = 'harmony', verbose = FALSE, theta = 3)
# Integrating SCTransformed data
obj <- SCTransform(object = obj)
obj <- IntegrateLayers(object = obj, method = HarmonyIntegration,
  orig.reduction = "pca", new.reduction = 'harmony',
  assay = "SCT", verbose = FALSE)
} # }
```

Example 8 (r):
```r
if (FALSE) { # \dontrun{
# Preprocessing
obj <- SeuratData::LoadData("pbmcsca")
obj[["RNA"]] <- split(obj[["RNA"]], f = obj$Method)
obj <- NormalizeData(obj)
obj <- FindVariableFeatures(obj)
obj <- ScaleData(obj)
obj <- RunPCA(obj)

# After preprocessing, we integrate layers with added parameters specific to Harmony:
obj <- IntegrateLayers(object = obj, method = HarmonyIntegration, orig.reduction = "pca",
  new.reduction = 'harmony', verbose = FALSE)

# Modifying Parameters
# We can also add arguments specific to Harmony such as theta, to give more diverse clusters
obj <- IntegrateLayers(object = obj, method = HarmonyIntegration, orig.reduction = "pca",
  new.reduction = 'harmony', verbose = FALSE, theta = 3)
# Integrating SCTransformed data
obj <- SCTransform(object = obj)
obj <- IntegrateLayers(object = obj, method = HarmonyIntegration,
  orig.reduction = "pca", new.reduction = 'harmony',
  assay = "SCT", verbose = FALSE)
} # }
```

Example 9 (r):
```r
if (FALSE) { # \dontrun{
# Preprocessing
obj <- SeuratData::LoadData("pbmcsca")
obj[["RNA"]] <- split(obj[["RNA"]], f = obj$Method)
obj <- NormalizeData(obj)
obj <- FindVariableFeatures(obj)
obj <- ScaleData(obj)
obj <- RunPCA(obj)

# After preprocessing, we integrate layers with added parameters specific to Harmony:
obj <- IntegrateLayers(object = obj, method = HarmonyIntegration, orig.reduction = "pca",
  new.reduction = 'harmony', verbose = FALSE)

# Modifying Parameters
# We can also add arguments specific to Harmony such as theta, to give more diverse clusters
obj <- IntegrateLayers(object = obj, method = HarmonyIntegration, orig.reduction = "pca",
  new.reduction = 'harmony', verbose = FALSE, theta = 3)
# Integrating SCTransformed data
obj <- SCTransform(object = obj)
obj <- IntegrateLayers(object = obj, method = HarmonyIntegration,
  orig.reduction = "pca", new.reduction = 'harmony',
  assay = "SCT", verbose = FALSE)
} # }
```

---

## Visualize Dimensional Reduction genes — VizDimLoadings • Seurat

**URL:** http://127.0.0.1:9173/reference_vizdimloadings.html

**Contents:**
- Visualize Dimensional Reduction genes
- Arguments
- Value
- Examples
- Contents

Visualize top genes associated with reduction components

Number of dimensions to display

Number of genes to display

Color of points to use

Reduction technique to visualize results for

Use reduction values for full dataset (i.e. projected dimensional reduction values)

Return an equal number of genes with + and - scores. If FALSE (default), returns the top genes ranked by the scores absolute values

Number of columns to display

Combine plots into a single patchwork ggplot object. If FALSE, return a list of ggplot objects

A patchwork ggplot object if combine = TRUE; otherwise, a list of ggplot objects

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/visualization.R
```

Example 2 (unknown):
```unknown
VizDimLoadings.Rd
```

Example 3 (unknown):
```unknown
VizDimLoadings(
  object,
  dims = 1:5,
  nfeatures = 30,
  col = "blue",
  reduction = "pca",
  projected = FALSE,
  balanced = FALSE,
  ncol = NULL,
  combine = TRUE
)
```

Example 4 (r):
```r
VizDimLoadings(
  object,
  dims = 1:5,
  nfeatures = 30,
  col = "blue",
  reduction = "pca",
  projected = FALSE,
  balanced = FALSE,
  ncol = NULL,
  combine = TRUE
)
```

Example 5 (r):
```r
VizDimLoadings(
  object,
  dims = 1:5,
  nfeatures = 30,
  col = "blue",
  reduction = "pca",
  projected = FALSE,
  balanced = FALSE,
  ncol = NULL,
  combine = TRUE
)
```

Example 6 (unknown):
```unknown
combine = TRUE
```

Example 7 (unknown):
```unknown
data("pbmc_small")
VizDimLoadings(object = pbmc_small)
#> Warning: Requested number is larger than the number of available items (20). Setting to 20.
#> Warning: Requested number is larger than the number of available items (20). Setting to 20.
#> Warning: Requested number is larger than the number of available items (20). Setting to 20.
#> Warning: Requested number is larger than the number of available items (20). Setting to 20.
#> Warning: Requested number is larger than the number of available items (20). Setting to 20.
```

Example 8 (r):
```r
data("pbmc_small")
VizDimLoadings(object = pbmc_small)
#> Warning: Requested number is larger than the number of available items (20). Setting to 20.
#> Warning: Requested number is larger than the number of available items (20). Setting to 20.
#> Warning: Requested number is larger than the number of available items (20). Setting to 20.
#> Warning: Requested number is larger than the number of available items (20). Setting to 20.
#> Warning: Requested number is larger than the number of available items (20). Setting to 20.
```

Example 9 (r):
```r
data("pbmc_small")
VizDimLoadings(object = pbmc_small)
#> Warning: Requested number is larger than the number of available items (20). Setting to 20.
#> Warning: Requested number is larger than the number of available items (20). Setting to 20.
#> Warning: Requested number is larger than the number of available items (20). Setting to 20.
#> Warning: Requested number is larger than the number of available items (20). Setting to 20.
#> Warning: Requested number is larger than the number of available items (20). Setting to 20.
```

---

## Project query data to reference dimensional reduction — ProjectDimReduc • Seurat

**URL:** http://127.0.0.1:9173/seurat/reference/projectdimreduc/index.html

**Contents:**
- Project query data to reference dimensional reduction
- Arguments
- Value
- Contents

Project query data to reference dimensional reduction

Projection mode name for projection

pcaproject: PCA projection

lsiproject: LSI projection

Name of dimensional reduction in the reference object

Determine if query and reference objects are combined

Assay used for query object

Assay used for reference object

Features used for projection

Determine if scale expression matrix in the pcaproject mode

dimensional reduction name, reference.reduction is used by default

dimensional reduction key, the key in reference.reduction is used by default

Print progress and message

Returns a query-only or query-reference combined seurat object

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/integration.R
```

Example 2 (unknown):
```unknown
ProjectDimReduc.Rd
```

Example 3 (unknown):
```unknown
ProjectDimReduc(
  query,
  reference,
  mode = c("pcaproject", "lsiproject"),
  reference.reduction,
  combine = FALSE,
  query.assay = NULL,
  reference.assay = NULL,
  features = NULL,
  do.scale = TRUE,
  reduction.name = NULL,
  reduction.key = NULL,
  verbose = TRUE
)
```

Example 4 (r):
```r
ProjectDimReduc(
  query,
  reference,
  mode = c("pcaproject", "lsiproject"),
  reference.reduction,
  combine = FALSE,
  query.assay = NULL,
  reference.assay = NULL,
  features = NULL,
  do.scale = TRUE,
  reduction.name = NULL,
  reduction.key = NULL,
  verbose = TRUE
)
```

Example 5 (r):
```r
ProjectDimReduc(
  query,
  reference,
  mode = c("pcaproject", "lsiproject"),
  reference.reduction,
  combine = FALSE,
  query.assay = NULL,
  reference.assay = NULL,
  features = NULL,
  do.scale = TRUE,
  reduction.name = NULL,
  reduction.key = NULL,
  verbose = TRUE
)
```

---

## Construct weighted nearest neighbor graph — FindMultiModalNeighbors • Seurat

**URL:** http://127.0.0.1:9173/reference_findmultimodalneighbors.html

**Contents:**
- Construct weighted nearest neighbor graph
- Arguments
- Value
- Contents

This function will construct a weighted nearest neighbor (WNN) graph. For each cell, we identify the nearest neighbors based on a weighted combination of two modalities. Takes as input two dimensional reductions, one computed for each modality.Other parameters are listed for debugging, but can be left as default values.

A list of two dimensional reductions, one for each of the modalities to be integrated

A list containing the dimensions for each reduction to use

the number of multimodal neighbors to compute. 20 by default

Perform L2 normalization on the cell embeddings after dimensional reduction. TRUE by default.

Multimodal knn graph name

Multimodal snn graph name

Multimodal neighbor object name

Variable name to store modality weight in object meta data

The number of approximate neighbors to compute

Cutoff not to discard edge in SNN graph

The scaling factor for kernel width. 1 by default

Constant used to avoid divide-by-zero errors. 1e-4 by default

Smoothing modality score across each individual modality neighbors. FALSE by default

Store intermediate results in misc

A ModalityWeights object generated by FindModalityWeights

Print progress bars and output

Seurat object containing a nearest-neighbor object, KNN graph, and SNN graph - each based on a weighted combination of modalities.

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/clustering.R
```

Example 2 (unknown):
```unknown
FindMultiModalNeighbors.Rd
```

Example 3 (unknown):
```unknown
FindMultiModalNeighbors(
  object,
  reduction.list,
  dims.list,
  k.nn = 20,
  l2.norm = TRUE,
  knn.graph.name = "wknn",
  snn.graph.name = "wsnn",
  weighted.nn.name = "weighted.nn",
  modality.weight.name = NULL,
  knn.range = 200,
  prune.SNN = 1/15,
  sd.scale = 1,
  cross.contant.list = NULL,
  smooth = FALSE,
  return.intermediate = FALSE,
  modality.weight = NULL,
  verbose = TRUE
)
```

Example 4 (r):
```r
FindMultiModalNeighbors(
  object,
  reduction.list,
  dims.list,
  k.nn = 20,
  l2.norm = TRUE,
  knn.graph.name = "wknn",
  snn.graph.name = "wsnn",
  weighted.nn.name = "weighted.nn",
  modality.weight.name = NULL,
  knn.range = 200,
  prune.SNN = 1/15,
  sd.scale = 1,
  cross.contant.list = NULL,
  smooth = FALSE,
  return.intermediate = FALSE,
  modality.weight = NULL,
  verbose = TRUE
)
```

Example 5 (r):
```r
FindMultiModalNeighbors(
  object,
  reduction.list,
  dims.list,
  k.nn = 20,
  l2.norm = TRUE,
  knn.graph.name = "wknn",
  snn.graph.name = "wsnn",
  weighted.nn.name = "weighted.nn",
  modality.weight.name = NULL,
  knn.range = 200,
  prune.SNN = 1/15,
  sd.scale = 1,
  cross.contant.list = NULL,
  smooth = FALSE,
  return.intermediate = FALSE,
  modality.weight = NULL,
  verbose = TRUE
)
```

Example 6 (unknown):
```unknown
ModalityWeights
```

Example 7 (unknown):
```unknown
FindModalityWeights
```

---

## Transfer data — TransferData • Seurat

**URL:** http://127.0.0.1:9173/reference_transferdata.html

**Contents:**
- Transfer data
- Arguments
- Value
- Details
- References
- Examples
- Contents

Transfer categorical or continuous data across single-cell datasets. For transferring categorical information, pass a vector from the reference dataset (e.g. refdata = reference$celltype). For transferring continuous information, pass a matrix from the reference dataset (e.g. refdata = GetAssayData(reference[['RNA']])).

An AnchorSet object generated by FindTransferAnchors

Data to transfer. This can be specified in one of two ways:

The reference data itself as either a vector where the names correspond to the reference cells, or a matrix, where the column names correspond to the reference cells.

The name of the metadata field or assay from the reference object provided. This requires the reference parameter to be specified. If pulling assay data in this manner, it will pull the data from the data slot. To transfer data from other slots, please pull the data explicitly with GetAssayData and provide that matrix here.

Reference object from which to pull data to transfer

Query object into which the data will be transferred.

Name of the Assay to use from query

Dimensional reduction to use for the weighting anchors. Options are:

pcaproject: Use the projected PCA used for anchor building

lsiproject: Use the projected LSI used for anchor building

pca: Use an internal PCA on the query only

cca: Use the CCA used for anchor building

custom DimReduc: User provided \[SeuratObject]{DimReduc} object computed on the query cells

Perform L2 normalization on the cell embeddings after dimensional reduction

Set of dimensions to use in the anchor weighting procedure. If NULL, the same dimensions that were used to find anchors will be used for weighting.

Number of neighbors to consider when weighting anchors

Controls the bandwidth of the Gaussian kernel for weighting

Error bound on the neighbor finding algorithm (from RANN)

More trees gives higher precision when using annoy approximate nearest neighbor search

Print progress bars and output

Slot to store the imputed data. Must be either "data" (default) or "counts"

Return an Assay object with the prediction scores for each class stored in the data slot.

Only return weights matrix

Optionally store the weights matrix used for predictions in the returned query object.

If query is not provided, for the categorical data in refdata, returns a data.frame with label predictions. If refdata is a matrix, returns an Assay object where the imputed data has been stored in the provided slot.

If query is provided, a modified query object is returned. For the categorical data in refdata, prediction scores are stored as Assays (prediction.score.NAME) and two additional metadata fields: predicted.NAME and predicted.NAME.score which contain the class prediction and the score for that predicted class. For continuous data, an Assay called NAME is returned. NAME here corresponds to the name of the element in the refdata list.

The main steps of this procedure are outlined below. For a more detailed description of the methodology, please see Stuart, Butler, et al Cell 2019. doi:10.1016/j.cell.2019.05.031 ; doi:10.1101/460147

For both transferring discrete labels and also feature imputation, we first compute the weights matrix.

Construct a weights matrix that defines the association between each query cell and each anchor. These weights are computed as 1 - the distance between the query cell and the anchor divided by the distance of the query cell to the k.weightth anchor multiplied by the anchor score computed in FindIntegrationAnchors. We then apply a Gaussian kernel width a bandwidth defined by sd.weight and normalize across all k.weight anchors.

The main difference between label transfer (classification) and feature imputation is what gets multiplied by the weights matrix. For label transfer, we perform the following steps:

Create a binary classification matrix, the rows corresponding to each possible class and the columns corresponding to the anchors. If the reference cell in the anchor pair is a member of a certain class, that matrix entry is filled with a 1, otherwise 0.

Multiply this classification matrix by the transpose of weights matrix to compute a prediction score for each class for each cell in the query dataset.

For feature imputation, we perform the following step:

Multiply the expression matrix for the reference anchor cells by the weights matrix. This returns a predicted expression matrix for the specified features for each cell in the query dataset.

Stuart T, Butler A, et al. Comprehensive Integration of Single-Cell Data. Cell. 2019;177:1888-1902 doi:10.1016/j.cell.2019.05.031

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/integration.R
```

Example 2 (unknown):
```unknown
TransferData.Rd
```

Example 3 (unknown):
```unknown
refdata = reference$celltype
```

Example 4 (unknown):
```unknown
refdata = GetAssayData(reference[['RNA']])
```

Example 5 (unknown):
```unknown
TransferData(
  anchorset,
  refdata,
  reference = NULL,
  query = NULL,
  query.assay = NULL,
  weight.reduction = "pcaproject",
  l2.norm = FALSE,
  dims = NULL,
  k.weight = 50,
  sd.weight = 1,
  eps = 0,
  n.trees = 50,
  verbose = TRUE,
  slot = "data",
  prediction.assay = FALSE,
  only.weights = FALSE,
  store.weights = TRUE
)
```

Example 6 (r):
```r
TransferData(
  anchorset,
  refdata,
  reference = NULL,
  query = NULL,
  query.assay = NULL,
  weight.reduction = "pcaproject",
  l2.norm = FALSE,
  dims = NULL,
  k.weight = 50,
  sd.weight = 1,
  eps = 0,
  n.trees = 50,
  verbose = TRUE,
  slot = "data",
  prediction.assay = FALSE,
  only.weights = FALSE,
  store.weights = TRUE
)
```

Example 7 (r):
```r
TransferData(
  anchorset,
  refdata,
  reference = NULL,
  query = NULL,
  query.assay = NULL,
  weight.reduction = "pcaproject",
  l2.norm = FALSE,
  dims = NULL,
  k.weight = 50,
  sd.weight = 1,
  eps = 0,
  n.trees = 50,
  verbose = TRUE,
  slot = "data",
  prediction.assay = FALSE,
  only.weights = FALSE,
  store.weights = TRUE
)
```

Example 8 (unknown):
```unknown
FindTransferAnchors
```

Example 9 (unknown):
```unknown
GetAssayData
```

Example 10 (unknown):
```unknown
\[SeuratObject]{DimReduc}
```

Example 11 (unknown):
```unknown
FindIntegrationAnchors
```

Example 12 (python):
```python
if (FALSE) { # \dontrun{
# to install the SeuratData package see https://github.com/satijalab/seurat-data
library(SeuratData)
data("pbmc3k")

# for demonstration, split the object into reference and query
pbmc.reference <- pbmc3k[, 1:1350]
pbmc.query <- pbmc3k[, 1351:2700]

# perform standard preprocessing on each object
pbmc.reference <- NormalizeData(pbmc.reference)
pbmc.reference <- FindVariableFeatures(pbmc.reference)
pbmc.reference <- ScaleData(pbmc.reference)

pbmc.query <- NormalizeData(pbmc.query)
pbmc.query <- FindVariableFeatures(pbmc.query)
pbmc.query <- ScaleData(pbmc.query)

# find anchors
anchors <- FindTransferAnchors(reference = pbmc.reference, query = pbmc.query)

# transfer labels
predictions <- TransferData(anchorset = anchors, refdata = pbmc.reference$seurat_annotations)
pbmc.query <- AddMetaData(object = pbmc.query, metadata = predictions)
} # }
```

Example 13 (r):
```r
if (FALSE) { # \dontrun{
# to install the SeuratData package see https://github.com/satijalab/seurat-data
library(SeuratData)
data("pbmc3k")

# for demonstration, split the object into reference and query
pbmc.reference <- pbmc3k[, 1:1350]
pbmc.query <- pbmc3k[, 1351:2700]

# perform standard preprocessing on each object
pbmc.reference <- NormalizeData(pbmc.reference)
pbmc.reference <- FindVariableFeatures(pbmc.reference)
pbmc.reference <- ScaleData(pbmc.reference)

pbmc.query <- NormalizeData(pbmc.query)
pbmc.query <- FindVariableFeatures(pbmc.query)
pbmc.query <- ScaleData(pbmc.query)

# find anchors
anchors <- FindTransferAnchors(reference = pbmc.reference, query = pbmc.query)

# transfer labels
predictions <- TransferData(anchorset = anchors, refdata = pbmc.reference$seurat_annotations)
pbmc.query <- AddMetaData(object = pbmc.query, metadata = predictions)
} # }
```

Example 14 (r):
```r
if (FALSE) { # \dontrun{
# to install the SeuratData package see https://github.com/satijalab/seurat-data
library(SeuratData)
data("pbmc3k")

# for demonstration, split the object into reference and query
pbmc.reference <- pbmc3k[, 1:1350]
pbmc.query <- pbmc3k[, 1351:2700]

# perform standard preprocessing on each object
pbmc.reference <- NormalizeData(pbmc.reference)
pbmc.reference <- FindVariableFeatures(pbmc.reference)
pbmc.reference <- ScaleData(pbmc.reference)

pbmc.query <- NormalizeData(pbmc.query)
pbmc.query <- FindVariableFeatures(pbmc.query)
pbmc.query <- ScaleData(pbmc.query)

# find anchors
anchors <- FindTransferAnchors(reference = pbmc.reference, query = pbmc.query)

# transfer labels
predictions <- TransferData(anchorset = anchors, refdata = pbmc.reference$seurat_annotations)
pbmc.query <- AddMetaData(object = pbmc.query, metadata = predictions)
} # }
```

---

## Scatter plot of single cell data — FeatureScatter • Seurat

**URL:** http://127.0.0.1:9173/reference_featurescatter.html

**Contents:**
- Scatter plot of single cell data
- Arguments
- Value
- Examples
- Contents

Creates a scatter plot of two features (typically feature expression), across a set of single cells. Cells are colored by their identity class. Pearson correlation between the two features is displayed above the plot.

First feature to plot. Typically feature expression but can also be metrics, PC scores, etc. - anything that can be retreived with FetchData

Second feature to plot.

Cells to include on the scatter plot.

Whether to randomly shuffle the order of points. This can be useful for crowded plots if points of interest are being buried. (default is FALSE)

Sets the seed if randomly shuffling the order of points.

Name of one or more metadata columns to group (color) cells by (for example, orig.ident); pass 'ident' to group by identity class

A factor in object metadata to split the feature plot by, pass 'ident' to split by cell identity

Colors to use for identity class plotting.

Size of the points on the plot

Spline span in loess function call, if NULL, no spline added

Smooth the graph (similar to smoothScatter)

Combine plots into a single patchworked

Slot to pull data from, should be one of 'counts', 'data', or 'scale.data'

Display correlation in plot title

Number of columns if plotting multiple plots

Convert points to raster format, default is NULL which will automatically use raster if the number of points plotted is greater than 100,000

Pixel resolution for rasterized plots, passed to geom_scattermore(). Default is c(512, 512).

Jitter for easier visualization of crowded points (default is FALSE)

Plot features on the log scale (default is FALSE)

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/visualization.R
```

Example 2 (unknown):
```unknown
FeatureScatter.Rd
```

Example 3 (unknown):
```unknown
FeatureScatter(
  object,
  feature1,
  feature2,
  cells = NULL,
  shuffle = FALSE,
  seed = 1,
  group.by = NULL,
  split.by = NULL,
  cols = NULL,
  pt.size = 1,
  shape.by = NULL,
  span = NULL,
  smooth = FALSE,
  combine = TRUE,
  slot = "data",
  plot.cor = TRUE,
  ncol = NULL,
  raster = NULL,
  raster.dpi = c(512, 512),
  jitter = FALSE,
  log = FALSE
)
```

Example 4 (r):
```r
FeatureScatter(
  object,
  feature1,
  feature2,
  cells = NULL,
  shuffle = FALSE,
  seed = 1,
  group.by = NULL,
  split.by = NULL,
  cols = NULL,
  pt.size = 1,
  shape.by = NULL,
  span = NULL,
  smooth = FALSE,
  combine = TRUE,
  slot = "data",
  plot.cor = TRUE,
  ncol = NULL,
  raster = NULL,
  raster.dpi = c(512, 512),
  jitter = FALSE,
  log = FALSE
)
```

Example 5 (r):
```r
FeatureScatter(
  object,
  feature1,
  feature2,
  cells = NULL,
  shuffle = FALSE,
  seed = 1,
  group.by = NULL,
  split.by = NULL,
  cols = NULL,
  pt.size = 1,
  shape.by = NULL,
  span = NULL,
  smooth = FALSE,
  combine = TRUE,
  slot = "data",
  plot.cor = TRUE,
  ncol = NULL,
  raster = NULL,
  raster.dpi = c(512, 512),
  jitter = FALSE,
  log = FALSE
)
```

Example 6 (unknown):
```unknown
patchworked
```

Example 7 (unknown):
```unknown
data("pbmc_small")
FeatureScatter(object = pbmc_small, feature1 = 'CD9', feature2 = 'CD3E')
```

Example 8 (r):
```r
data("pbmc_small")
FeatureScatter(object = pbmc_small, feature1 = 'CD9', feature2 = 'CD3E')
```

Example 9 (r):
```r
data("pbmc_small")
FeatureScatter(object = pbmc_small, feature1 = 'CD9', feature2 = 'CD3E')
```

---

## Slim down a multi-species expression matrix, when only one species is primarily of interenst. — CollapseSpeciesExpressionMatrix • Seurat

**URL:** http://127.0.0.1:9173/reference_collapsespeciesexpressionmatrix.html

**Contents:**
- Slim down a multi-species expression matrix, when only one species is primarily of interenst.
- Arguments
- Value
- Examples
- Contents

Valuable for CITE-seq analyses, where we typically spike in rare populations of 'negative control' cells from a different species.

A UMI count matrix. Should contain rownames that start with the ensuing arguments prefix.1 or prefix.2

The prefix denoting rownames for the species of interest. Default is "HUMAN_". These rownames will have this prefix removed in the returned matrix.

The prefix denoting rownames for the species of 'negative control' cells. Default is "MOUSE_".

How many of the most highly expressed (average) negative control features (by default, 100 mouse genes), should be kept? All other rownames starting with prefix.2 are discarded.

A UMI count matrix. Rownames that started with prefix have this prefix discarded. For rownames starting with controls, only the ncontrols most highly expressed features are kept, and the prefix is kept. All other rows are retained.

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/utilities.R
```

Example 2 (unknown):
```unknown
CollapseSpeciesExpressionMatrix.Rd
```

Example 3 (unknown):
```unknown
CollapseSpeciesExpressionMatrix(
  object,
  prefix = "HUMAN_",
  controls = "MOUSE_",
  ncontrols = 100
)
```

Example 4 (r):
```r
CollapseSpeciesExpressionMatrix(
  object,
  prefix = "HUMAN_",
  controls = "MOUSE_",
  ncontrols = 100
)
```

Example 5 (r):
```r
CollapseSpeciesExpressionMatrix(
  object,
  prefix = "HUMAN_",
  controls = "MOUSE_",
  ncontrols = 100
)
```

Example 6 (unknown):
```unknown
if (FALSE) { # \dontrun{
cbmc.rna.collapsed <- CollapseSpeciesExpressionMatrix(cbmc.rna)
} # }
```

Example 7 (r):
```r
if (FALSE) { # \dontrun{
cbmc.rna.collapsed <- CollapseSpeciesExpressionMatrix(cbmc.rna)
} # }
```

Example 8 (r):
```r
if (FALSE) { # \dontrun{
cbmc.rna.collapsed <- CollapseSpeciesExpressionMatrix(cbmc.rna)
} # }
```

---

## Load 10X Genomics Visium Scale Factors — Read10X_ScaleFactors • Seurat

**URL:** http://127.0.0.1:9173/seurat/reference/read10x_scalefactors/index.html

**Contents:**
- Load 10X Genomics Visium Scale Factors
- Arguments
- Value
- Contents

Load 10X Genomics Visium Scale Factors

Path to a scalefactors_json.json file

A scalefactors object

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/preprocessing.R
```

Example 2 (unknown):
```unknown
Read10X_ScaleFactors.Rd
```

Example 3 (unknown):
```unknown
Read10X_ScaleFactors(filename)
```

Example 4 (r):
```r
Read10X_ScaleFactors(filename)
```

Example 5 (r):
```r
Read10X_ScaleFactors(filename)
```

Example 6 (unknown):
```unknown
scalefactors_json.json
```

---

## Save the Annoy index — SaveAnnoyIndex • Seurat

**URL:** http://127.0.0.1:9173/seurat/reference/saveannoyindex/index.html

**Contents:**
- Save the Annoy index
- Arguments
- Contents

A Neighbor object with the annoy index stored

Path to file to write index to

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/utilities.R
```

Example 2 (unknown):
```unknown
SaveAnnoyIndex.Rd
```

Example 3 (unknown):
```unknown
SaveAnnoyIndex(object, file)
```

Example 4 (r):
```r
SaveAnnoyIndex(object, file)
```

Example 5 (r):
```r
SaveAnnoyIndex(object, file)
```

---

## Calculate the variance of logged values — ExpVar • Seurat

**URL:** http://127.0.0.1:9173/reference_expvar.html

**Contents:**
- Calculate the variance of logged values
- Arguments
- Value
- Examples
- Contents

Calculate variance of logged values in non-log space (return answer in log-space)

Returns the variance in log-space

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/utilities.R
```

Example 2 (unknown):
```unknown
ExpVar(x = c(1, 2, 3))
#> [1] 4.403948
```

Example 3 (r):
```r
ExpVar(x = c(1, 2, 3))
#> [1] 4.403948
```

Example 4 (r):
```r
ExpVar(x = c(1, 2, 3))
#> [1] 4.403948
```

---

## Perform integration on the joint PCA cell embeddings. — FastRPCAIntegration • Seurat

**URL:** http://127.0.0.1:9173/seurat/reference/fastrpcaintegration/index.html

**Contents:**
- Perform integration on the joint PCA cell embeddings.
- Arguments
- Value
- Contents

This is a convenience wrapper function around the following three functions that are often run together when perform integration. FindIntegrationAnchors, RunPCA, IntegrateEmbeddings.

A list of Seurat objects between which to find anchors for downstream integration.

A vector specifying the object/s to be used as a reference during integration. If NULL (default), all pairwise anchors are found (no reference/s). If not NULL, the corresponding objects in object.list will be used as references. When using a set of specified references, anchors are first found between each query and each reference. The references are then integrated through pairwise integration. Each query is then mapped to the integrated reference.

A numeric value. This will call SelectIntegrationFeatures to select the provided number of features to be used in anchor finding

A vector of features to be used as input to the anchor finding process

How many neighbors (k) to use when picking anchors

Which dimensions to use from the CCA to specify the neighbor search space

Whether or not to scale the features provided. Only set to FALSE if you have previously scaled the features you want to use for each object in the object.list

Name of normalization method used: LogNormalize or SCT

Name of integrated dimensional reduction

Total Number of PCs to compute and store (50 by default)

A named list of additional arguments to FindIntegrationAnchors

Print messages and progress

Returns a Seurat object with integrated dimensional reduction

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/integration.R
```

Example 2 (unknown):
```unknown
FastRPCAIntegration.Rd
```

Example 3 (unknown):
```unknown
FindIntegrationAnchors
```

Example 4 (unknown):
```unknown
IntegrateEmbeddings
```

Example 5 (unknown):
```unknown
FastRPCAIntegration(
  object.list,
  reference = NULL,
  anchor.features = 2000,
  k.anchor = 20,
  dims = 1:30,
  scale = TRUE,
  normalization.method = c("LogNormalize", "SCT"),
  new.reduction.name = "integrated_dr",
  npcs = 50,
  findintegrationanchors.args = list(),
  verbose = TRUE
)
```

Example 6 (r):
```r
FastRPCAIntegration(
  object.list,
  reference = NULL,
  anchor.features = 2000,
  k.anchor = 20,
  dims = 1:30,
  scale = TRUE,
  normalization.method = c("LogNormalize", "SCT"),
  new.reduction.name = "integrated_dr",
  npcs = 50,
  findintegrationanchors.args = list(),
  verbose = TRUE
)
```

Example 7 (r):
```r
FastRPCAIntegration(
  object.list,
  reference = NULL,
  anchor.features = 2000,
  k.anchor = 20,
  dims = 1:30,
  scale = TRUE,
  normalization.method = c("LogNormalize", "SCT"),
  new.reduction.name = "integrated_dr",
  npcs = 50,
  findintegrationanchors.args = list(),
  verbose = TRUE
)
```

Example 8 (unknown):
```unknown
object.list
```

Example 9 (unknown):
```unknown
SelectIntegrationFeatures
```

Example 10 (unknown):
```unknown
FindIntegrationAnchors
```

---

## Augments ggplot2-based plot with a PNG image. — AugmentPlot • Seurat

**URL:** http://127.0.0.1:9173/reference_augmentplot.html

**Contents:**
- Augments ggplot2-based plot with a PNG image.
- Arguments
- Value
- Examples
- Contents

Creates "vector-friendly" plots. Does this by saving a copy of the plot as a PNG file, then adding the PNG image with annotation_raster to a blank plot of the same dimensions as plot. Please note: original legends and axes will be lost during augmentation.

Width and height of PNG version of plot

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/visualization.R
```

Example 2 (unknown):
```unknown
AugmentPlot.Rd
```

Example 3 (unknown):
```unknown
annotation_raster
```

Example 4 (unknown):
```unknown
AugmentPlot(plot, width = 10, height = 10, dpi = 100)
```

Example 5 (r):
```r
AugmentPlot(plot, width = 10, height = 10, dpi = 100)
```

Example 6 (r):
```r
AugmentPlot(plot, width = 10, height = 10, dpi = 100)
```

Example 7 (unknown):
```unknown
if (FALSE) { # \dontrun{
data("pbmc_small")
plot <- DimPlot(object = pbmc_small)
AugmentPlot(plot = plot)
} # }
```

Example 8 (r):
```r
if (FALSE) { # \dontrun{
data("pbmc_small")
plot <- DimPlot(object = pbmc_small)
AugmentPlot(plot = plot)
} # }
```

Example 9 (r):
```r
if (FALSE) { # \dontrun{
data("pbmc_small")
plot <- DimPlot(object = pbmc_small)
AugmentPlot(plot = plot)
} # }
```

---

## Demultiplex samples based on classification method from MULTI-seq (McGinnis et al., bioRxiv 2018) — MULTIseqDemux • Seurat

**URL:** http://127.0.0.1:9173/reference_multiseqdemux.html

**Contents:**
- Demultiplex samples based on classification method from MULTI-seq (McGinnis et al., bioRxiv 2018)
- Arguments
- Value
- References
- Examples
- Contents

Identify singlets, doublets and negative cells from multiplexing experiments. Annotate singlets by tags.

Seurat object. Assumes that the specified assay data has been added

Name of the multiplexing assay (HTO by default)

The quantile to use for classification

Whether to perform automated threshold finding to define the best quantile. Default is FALSE

Maximum number of iterations if autoThresh = TRUE. Default is 5

A range of possible quantile values to try if autoThresh = TRUE

A Seurat object with demultiplexing results stored at object$MULTI_ID

doi:10.1038/s41592-019-0433-8

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/preprocessing.R
```

Example 2 (unknown):
```unknown
MULTIseqDemux.Rd
```

Example 3 (python):
```python
MULTIseqDemux(
  object,
  assay = "HTO",
  quantile = 0.7,
  autoThresh = FALSE,
  maxiter = 5,
  qrange = seq(from = 0.1, to = 0.9, by = 0.05),
  verbose = TRUE
)
```

Example 4 (r):
```r
MULTIseqDemux(
  object,
  assay = "HTO",
  quantile = 0.7,
  autoThresh = FALSE,
  maxiter = 5,
  qrange = seq(from = 0.1, to = 0.9, by = 0.05),
  verbose = TRUE
)
```

Example 5 (r):
```r
MULTIseqDemux(
  object,
  assay = "HTO",
  quantile = 0.7,
  autoThresh = FALSE,
  maxiter = 5,
  qrange = seq(from = 0.1, to = 0.9, by = 0.05),
  verbose = TRUE
)
```

Example 6 (unknown):
```unknown
object$MULTI_ID
```

Example 7 (unknown):
```unknown
if (FALSE) { # \dontrun{
object <- MULTIseqDemux(object)
} # }
```

Example 8 (r):
```r
if (FALSE) { # \dontrun{
object <- MULTIseqDemux(object)
} # }
```

Example 9 (r):
```r
if (FALSE) { # \dontrun{
object <- MULTIseqDemux(object)
} # }
```

---

## Project Dimensional reduction onto full dataset — ProjectDim • Seurat

**URL:** http://127.0.0.1:9173/seurat/reference/projectdim/index.html

**Contents:**
- Project Dimensional reduction onto full dataset
- Arguments
- Value
- Examples
- Contents

Takes a pre-computed dimensional reduction (typically calculated on a subset of genes) and projects this onto the entire dataset (all genes). Note that the cell loadings will remain unchanged, but now there are gene loadings for all genes.

Number of dims to print features for

Number of features with highest/lowest loadings to print for each dimension

Replace the existing data in feature.loadings

Center the dataset prior to projection (should be set to TRUE)

Print top genes associated with the projected dimensions

Returns Seurat object with the projected values

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/dimensional_reduction.R
```

Example 2 (unknown):
```unknown
ProjectDim.Rd
```

Example 3 (unknown):
```unknown
ProjectDim(
  object,
  reduction = "pca",
  assay = NULL,
  dims.print = 1:5,
  nfeatures.print = 20,
  overwrite = FALSE,
  do.center = FALSE,
  verbose = TRUE
)
```

Example 4 (r):
```r
ProjectDim(
  object,
  reduction = "pca",
  assay = NULL,
  dims.print = 1:5,
  nfeatures.print = 20,
  overwrite = FALSE,
  do.center = FALSE,
  verbose = TRUE
)
```

Example 5 (r):
```r
ProjectDim(
  object,
  reduction = "pca",
  assay = NULL,
  dims.print = 1:5,
  nfeatures.print = 20,
  overwrite = FALSE,
  do.center = FALSE,
  verbose = TRUE
)
```

Example 6 (python):
```python
data("pbmc_small")
pbmc_small
#> An object of class Seurat 
#> 230 features across 80 samples within 1 assay 
#> Active assay: RNA (230 features, 20 variable features)
#>  3 layers present: counts, data, scale.data
#>  2 dimensional reductions calculated: pca, tsne
pbmc_small <- ProjectDim(object = pbmc_small, reduction = "pca")
#> Warning: Requested number is larger than the number of available items (20). Setting to 20.
#> PC_ 1 
#> Positive:  SDPR, PF4, PPBP, TUBB1, CA2, TREML1, MYL9, PGRMC1, RUFY1, PARVB 
#> Negative:  HLA-DPB1, HLA-DQA1, S100A9, S100A8, GNLY, RP11-290F20.3, CD1C, AKR1C3, IGLL5, VDAC3 
#> Warning: Requested number is larger than the number of available items (20). Setting to 20.
#> PC_ 2 
#> Positive:  HLA-DPB1, HLA-DQA1, S100A8, S100A9, CD1C, RP11-290F20.3, PARVB, IGLL5, MYL9, SDPR 
#> Negative:  GNLY, AKR1C3, VDAC3, PGRMC1, TUBB1, PF4, TREML1, RUFY1, CA2, PPBP 
#> Warning: Requested number is larger than the number of available items (20). Setting to 20.
#> PC_ 3 
#> Positive:  S100A9, S100A8, RP11-290F20.3, AKR1C3, PARVB, GNLY, PPBP, PGRMC1, MYL9, TUBB1 
#> Negative:  HLA-DQA1, CD1C, IGLL5, HLA-DPB1, RUFY1, PF4, VDAC3, SDPR, TREML1, CA2 
#> Warning: Requested number is larger than the number of available items (20). Setting to 20.
#> PC_ 4 
#> Positive:  IGLL5, RP11-290F20.3, VDAC3, PPBP, TUBB1, TREML1, PF4, CA2, PARVB, MYL9 
#> Negative:  CD1C, AKR1C3, S100A8, GNLY, HLA-DPB1, HLA-DQA1, S100A9, PGRMC1, RUFY1, SDPR 
#> Warning: Requested number is larger than the number of available items (20). Setting to 20.
#> PC_ 5 
#> Positive:  MYL9, PARVB, IGLL5, TREML1, AKR1C3, PGRMC1, HLA-DPB1, S100A9, TUBB1, PF4 
#> Negative:  VDAC3, RP11-290F20.3, RUFY1, CD1C, HLA-DQA1, CA2, S100A8, PPBP, GNLY, SDPR 
# Visualize top projected genes in heatmap
DimHeatmap(object = pbmc_small, reduction = "pca", dims = 1, balanced = TRUE)
#> Warning: Requested number is larger than the number of available items (20). Setting to 20.
```

Example 7 (r):
```r
data("pbmc_small")
pbmc_small
#> An object of class Seurat 
#> 230 features across 80 samples within 1 assay 
#> Active assay: RNA (230 features, 20 variable features)
#>  3 layers present: counts, data, scale.data
#>  2 dimensional reductions calculated: pca, tsne
pbmc_small <- ProjectDim(object = pbmc_small, reduction = "pca")
#> Warning: Requested number is larger than the number of available items (20). Setting to 20.
#> PC_ 1 
#> Positive:  SDPR, PF4, PPBP, TUBB1, CA2, TREML1, MYL9, PGRMC1, RUFY1, PARVB 
#> Negative:  HLA-DPB1, HLA-DQA1, S100A9, S100A8, GNLY, RP11-290F20.3, CD1C, AKR1C3, IGLL5, VDAC3 
#> Warning: Requested number is larger than the number of available items (20). Setting to 20.
#> PC_ 2 
#> Positive:  HLA-DPB1, HLA-DQA1, S100A8, S100A9, CD1C, RP11-290F20.3, PARVB, IGLL5, MYL9, SDPR 
#> Negative:  GNLY, AKR1C3, VDAC3, PGRMC1, TUBB1, PF4, TREML1, RUFY1, CA2, PPBP 
#> Warning: Requested number is larger than the number of available items (20). Setting to 20.
#> PC_ 3 
#> Positive:  S100A9, S100A8, RP11-290F20.3, AKR1C3, PARVB, GNLY, PPBP, PGRMC1, MYL9, TUBB1 
#> Negative:  HLA-DQA1, CD1C, IGLL5, HLA-DPB1, RUFY1, PF4, VDAC3, SDPR, TREML1, CA2 
#> Warning: Requested number is larger than the number of available items (20). Setting to 20.
#> PC_ 4 
#> Positive:  IGLL5, RP11-290F20.3, VDAC3, PPBP, TUBB1, TREML1, PF4, CA2, PARVB, MYL9 
#> Negative:  CD1C, AKR1C3, S100A8, GNLY, HLA-DPB1, HLA-DQA1, S100A9, PGRMC1, RUFY1, SDPR 
#> Warning: Requested number is larger than the number of available items (20). Setting to 20.
#> PC_ 5 
#> Positive:  MYL9, PARVB, IGLL5, TREML1, AKR1C3, PGRMC1, HLA-DPB1, S100A9, TUBB1, PF4 
#> Negative:  VDAC3, RP11-290F20.3, RUFY1, CD1C, HLA-DQA1, CA2, S100A8, PPBP, GNLY, SDPR 
# Visualize top projected genes in heatmap
DimHeatmap(object = pbmc_small, reduction = "pca", dims = 1, balanced = TRUE)
#> Warning: Requested number is larger than the number of available items (20). Setting to 20.
```

Example 8 (r):
```r
data("pbmc_small")
pbmc_small
#> An object of class Seurat 
#> 230 features across 80 samples within 1 assay 
#> Active assay: RNA (230 features, 20 variable features)
#>  3 layers present: counts, data, scale.data
#>  2 dimensional reductions calculated: pca, tsne
pbmc_small <- ProjectDim(object = pbmc_small, reduction = "pca")
#> Warning: Requested number is larger than the number of available items (20). Setting to 20.
#> PC_ 1 
#> Positive:  SDPR, PF4, PPBP, TUBB1, CA2, TREML1, MYL9, PGRMC1, RUFY1, PARVB 
#> Negative:  HLA-DPB1, HLA-DQA1, S100A9, S100A8, GNLY, RP11-290F20.3, CD1C, AKR1C3, IGLL5, VDAC3 
#> Warning: Requested number is larger than the number of available items (20). Setting to 20.
#> PC_ 2 
#> Positive:  HLA-DPB1, HLA-DQA1, S100A8, S100A9, CD1C, RP11-290F20.3, PARVB, IGLL5, MYL9, SDPR 
#> Negative:  GNLY, AKR1C3, VDAC3, PGRMC1, TUBB1, PF4, TREML1, RUFY1, CA2, PPBP 
#> Warning: Requested number is larger than the number of available items (20). Setting to 20.
#> PC_ 3 
#> Positive:  S100A9, S100A8, RP11-290F20.3, AKR1C3, PARVB, GNLY, PPBP, PGRMC1, MYL9, TUBB1 
#> Negative:  HLA-DQA1, CD1C, IGLL5, HLA-DPB1, RUFY1, PF4, VDAC3, SDPR, TREML1, CA2 
#> Warning: Requested number is larger than the number of available items (20). Setting to 20.
#> PC_ 4 
#> Positive:  IGLL5, RP11-290F20.3, VDAC3, PPBP, TUBB1, TREML1, PF4, CA2, PARVB, MYL9 
#> Negative:  CD1C, AKR1C3, S100A8, GNLY, HLA-DPB1, HLA-DQA1, S100A9, PGRMC1, RUFY1, SDPR 
#> Warning: Requested number is larger than the number of available items (20). Setting to 20.
#> PC_ 5 
#> Positive:  MYL9, PARVB, IGLL5, TREML1, AKR1C3, PGRMC1, HLA-DPB1, S100A9, TUBB1, PF4 
#> Negative:  VDAC3, RP11-290F20.3, RUFY1, CD1C, HLA-DQA1, CA2, S100A8, PPBP, GNLY, SDPR 
# Visualize top projected genes in heatmap
DimHeatmap(object = pbmc_small, reduction = "pca", dims = 1, balanced = TRUE)
#> Warning: Requested number is larger than the number of available items (20). Setting to 20.
```

---

## Aggregated feature expression by identity class — AggregateExpression • Seurat

**URL:** http://127.0.0.1:9173/seurat/reference/aggregateexpression/index.html

**Contents:**
- Aggregated feature expression by identity class
- Arguments
- Value
- Details
- Examples
- Contents

Returns summed counts ("pseudobulk") for each identity class.

Which assays to use. Default is all assays

Features to analyze. Default is all features in the assay

Whether to return the data as a Seurat object. Default is FALSE

Category (or vector of categories) for grouping (e.g, ident, replicate, celltype); 'ident' by default To use multiple categories, specify a vector, such as c('ident', 'replicate', 'celltype')

(Deprecated). Place an additional label on each cell prior to pseudobulking

Method for normalization, see NormalizeData

Scale factor for normalization, see NormalizeData

Margin to perform CLR normalization, see NormalizeData

Print messages and show progress bar

Arguments to be passed to methods such as CreateSeuratObject

Returns a matrix with genes as rows, identity classes as columns. If return.seurat is TRUE, returns an object of class Seurat.

If return.seurat = TRUE, aggregated values are placed in the 'counts' layer of the returned object. The data is then normalized by running NormalizeData on the aggregated counts. ScaleData is then run on the default assay before returning the object.

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/utilities.R
```

Example 2 (unknown):
```unknown
AggregateExpression.Rd
```

Example 3 (unknown):
```unknown
AggregateExpression(
  object,
  assays = NULL,
  features = NULL,
  return.seurat = FALSE,
  group.by = "ident",
  add.ident = NULL,
  normalization.method = "LogNormalize",
  scale.factor = 10000,
  margin = 1,
  verbose = TRUE,
  ...
)
```

Example 4 (r):
```r
AggregateExpression(
  object,
  assays = NULL,
  features = NULL,
  return.seurat = FALSE,
  group.by = "ident",
  add.ident = NULL,
  normalization.method = "LogNormalize",
  scale.factor = 10000,
  margin = 1,
  verbose = TRUE,
  ...
)
```

Example 5 (r):
```r
AggregateExpression(
  object,
  assays = NULL,
  features = NULL,
  return.seurat = FALSE,
  group.by = "ident",
  add.ident = NULL,
  normalization.method = "LogNormalize",
  scale.factor = 10000,
  margin = 1,
  verbose = TRUE,
  ...
)
```

Example 6 (unknown):
```unknown
NormalizeData
```

Example 7 (unknown):
```unknown
NormalizeData
```

Example 8 (unknown):
```unknown
NormalizeData
```

Example 9 (unknown):
```unknown
CreateSeuratObject
```

Example 10 (unknown):
```unknown
return.seurat = TRUE
```

Example 11 (unknown):
```unknown
NormalizeData
```

Example 12 (unknown):
```unknown
if (FALSE) { # \dontrun{
data("pbmc_small")
head(AggregateExpression(object = pbmc_small)$RNA)
head(AggregateExpression(object = pbmc_small, group.by = c('ident', 'groups'))$RNA)
} # }
```

Example 13 (r):
```r
if (FALSE) { # \dontrun{
data("pbmc_small")
head(AggregateExpression(object = pbmc_small)$RNA)
head(AggregateExpression(object = pbmc_small, group.by = c('ident', 'groups'))$RNA)
} # }
```

Example 14 (r):
```r
if (FALSE) { # \dontrun{
data("pbmc_small")
head(AggregateExpression(object = pbmc_small)$RNA)
head(AggregateExpression(object = pbmc_small, group.by = c('ident', 'groups'))$RNA)
} # }
```

---

## Run Graph Laplacian Eigendecomposition — RunGraphLaplacian • Seurat

**URL:** http://127.0.0.1:9173/reference_rungraphlaplacian.html

**Contents:**
- Run Graph Laplacian Eigendecomposition
- Arguments
- Value
- Contents

Run a graph laplacian dimensionality reduction. It is used as a low dimensional representation for a cell-cell graph. The input graph should be symmetric

Arguments passed to eigs_sym

dimensional reduction name, lap by default

dimensional reduction key, specifies the string before the number for the dimension names. LAP by default

Total Number of Eigenvectors to compute and store (50 by default)

Print message and process

Returns Seurat object with the Graph laplacian eigenvector calculation stored in the reductions slot

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/generics.R
```

Example 2 (unknown):
```unknown
R/integration.R
```

Example 3 (unknown):
```unknown
RunGraphLaplacian.Rd
```

Example 4 (python):
```python
RunGraphLaplacian(object, ...)

# S3 method for class 'Seurat'
RunGraphLaplacian(
  object,
  graph,
  reduction.name = "lap",
  reduction.key = "LAP_",
  n = 50,
  verbose = TRUE,
  ...
)

# Default S3 method
RunGraphLaplacian(object, n = 50, reduction.key = "LAP_", verbose = TRUE, ...)
```

Example 5 (r):
```r
RunGraphLaplacian(object, ...)

# S3 method for class 'Seurat'
RunGraphLaplacian(
  object,
  graph,
  reduction.name = "lap",
  reduction.key = "LAP_",
  n = 50,
  verbose = TRUE,
  ...
)

# Default S3 method
RunGraphLaplacian(object, n = 50, reduction.key = "LAP_", verbose = TRUE, ...)
```

Example 6 (r):
```r
RunGraphLaplacian(object, ...)

# S3 method for class 'Seurat'
RunGraphLaplacian(
  object,
  graph,
  reduction.name = "lap",
  reduction.key = "LAP_",
  n = 50,
  verbose = TRUE,
  ...
)

# Default S3 method
RunGraphLaplacian(object, n = 50, reduction.key = "LAP_", verbose = TRUE, ...)
```

---

## Compute Jackstraw scores significance. — ScoreJackStraw • Seurat

**URL:** http://127.0.0.1:9173/seurat/reference/scorejackstraw/index.html

**Contents:**
- Compute Jackstraw scores significance.
- Arguments
- Value
- See also
- Author
- Contents

Significant PCs should show a p-value distribution that is strongly skewed to the left compared to the null distribution. The p-value for each PC is based on a proportion test comparing the number of features with a p-value below a particular threshold (score.thresh), compared with the proportion of features expected under a uniform distribution of p-values.

Arguments passed to other methods

Which dimensions to examine

Threshold to use for the proportion test of PC significance (see Details)

Reduction associated with JackStraw to score

Show plot. To return ggplot object, use JackStrawPlot after running ScoreJackStraw.

Returns a Seurat object

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/generics.R
```

Example 2 (unknown):
```unknown
R/dimensional_reduction.R
```

Example 3 (unknown):
```unknown
ScoreJackStraw.Rd
```

Example 4 (python):
```python
ScoreJackStraw(object, ...)

# S3 method for class 'JackStrawData'
ScoreJackStraw(object, dims = 1:5, score.thresh = 1e-05, ...)

# S3 method for class 'DimReduc'
ScoreJackStraw(object, dims = 1:5, score.thresh = 1e-05, ...)

# S3 method for class 'Seurat'
ScoreJackStraw(
  object,
  reduction = "pca",
  dims = 1:5,
  score.thresh = 1e-05,
  do.plot = FALSE,
  ...
)
```

Example 5 (r):
```r
ScoreJackStraw(object, ...)

# S3 method for class 'JackStrawData'
ScoreJackStraw(object, dims = 1:5, score.thresh = 1e-05, ...)

# S3 method for class 'DimReduc'
ScoreJackStraw(object, dims = 1:5, score.thresh = 1e-05, ...)

# S3 method for class 'Seurat'
ScoreJackStraw(
  object,
  reduction = "pca",
  dims = 1:5,
  score.thresh = 1e-05,
  do.plot = FALSE,
  ...
)
```

Example 6 (r):
```r
ScoreJackStraw(object, ...)

# S3 method for class 'JackStrawData'
ScoreJackStraw(object, dims = 1:5, score.thresh = 1e-05, ...)

# S3 method for class 'DimReduc'
ScoreJackStraw(object, dims = 1:5, score.thresh = 1e-05, ...)

# S3 method for class 'Seurat'
ScoreJackStraw(
  object,
  reduction = "pca",
  dims = 1:5,
  score.thresh = 1e-05,
  do.plot = FALSE,
  ...
)
```

Example 7 (unknown):
```unknown
JackStrawPlot
```

Example 8 (unknown):
```unknown
JackStrawPlot
```

Example 9 (unknown):
```unknown
JackStrawPlot
```

---

## The Graph Class — Graph-class • Seurat

**URL:** http://127.0.0.1:9173/reference_graph-class.html

**Contents:**
- The Graph Class
- See also
- Contents

For more details, please see the documentation in SeuratObject

SeuratObject::Graph-class

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/reexports.R
```

Example 2 (unknown):
```unknown
Graph-class.Rd
```

Example 3 (unknown):
```unknown
SeuratObject
```

Example 4 (unknown):
```unknown
SeuratObject::Graph-class
```

---

## Perform Canonical Correlation Analysis — RunCCA • Seurat

**URL:** http://127.0.0.1:9173/seurat/reference/runcca/index.html

**Contents:**
- Perform Canonical Correlation Analysis
- Arguments
- Value
- See also
- Examples
- Contents

Runs a canonical correlation analysis using a diagonal implementation of CCA. For details about stored CCA calculation parameters, see PrintCCAParams.

Second Seurat object.

Extra parameters (passed onto MergeSeurat in case with two objects passed, passed onto ScaleData in case with single object and rescale.groups set to TRUE)

Standardize matrices - scales columns to have unit variance and mean 0

Number of canonical vectors to calculate

Random seed to set. If NULL, does not set a seed

Show progress messages

Assays to pull from in the first and second objects, respectively

Set of genes to use in CCA. Default is the union of both the variable features sets present in both objects.

Renormalize raw data after merging the objects. If FALSE, merge the data matrices also.

Rescale the datasets prior to CCA. If FALSE, uses existing data in the scale data slots.

Also compute the gene loadings. NOTE - this will scale every gene in the dataset which may impose a high memory cost.

Returns a combined Seurat object with the CCA results stored.

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/generics.R
```

Example 2 (unknown):
```unknown
R/dimensional_reduction.R
```

Example 3 (unknown):
```unknown
PrintCCAParams
```

Example 4 (python):
```python
RunCCA(object1, object2, ...)

# Default S3 method
RunCCA(
  object1,
  object2,
  standardize = TRUE,
  num.cc = 20,
  seed.use = 42,
  verbose = FALSE,
  ...
)

# S3 method for class 'Seurat'
RunCCA(
  object1,
  object2,
  assay1 = NULL,
  assay2 = NULL,
  num.cc = 20,
  features = NULL,
  renormalize = FALSE,
  rescale = FALSE,
  compute.gene.loadings = TRUE,
  add.cell.id1 = NULL,
  add.cell.id2 = NULL,
  verbose = TRUE,
  ...
)
```

Example 5 (r):
```r
RunCCA(object1, object2, ...)

# Default S3 method
RunCCA(
  object1,
  object2,
  standardize = TRUE,
  num.cc = 20,
  seed.use = 42,
  verbose = FALSE,
  ...
)

# S3 method for class 'Seurat'
RunCCA(
  object1,
  object2,
  assay1 = NULL,
  assay2 = NULL,
  num.cc = 20,
  features = NULL,
  renormalize = FALSE,
  rescale = FALSE,
  compute.gene.loadings = TRUE,
  add.cell.id1 = NULL,
  add.cell.id2 = NULL,
  verbose = TRUE,
  ...
)
```

Example 6 (r):
```r
RunCCA(object1, object2, ...)

# Default S3 method
RunCCA(
  object1,
  object2,
  standardize = TRUE,
  num.cc = 20,
  seed.use = 42,
  verbose = FALSE,
  ...
)

# S3 method for class 'Seurat'
RunCCA(
  object1,
  object2,
  assay1 = NULL,
  assay2 = NULL,
  num.cc = 20,
  features = NULL,
  renormalize = FALSE,
  rescale = FALSE,
  compute.gene.loadings = TRUE,
  add.cell.id1 = NULL,
  add.cell.id2 = NULL,
  verbose = TRUE,
  ...
)
```

Example 7 (unknown):
```unknown
merge.Seurat
```

Example 8 (python):
```python
if (FALSE) { # \dontrun{
data("pbmc_small")
pbmc_small
# As CCA requires two datasets, we will split our test object into two just for this example
pbmc1 <- subset(pbmc_small, cells = colnames(pbmc_small)[1:40])
pbmc2 <- subset(pbmc_small, cells = colnames(x = pbmc_small)[41:80])
pbmc1[["group"]] <- "group1"
pbmc2[["group"]] <- "group2"
pbmc_cca <- RunCCA(object1 = pbmc1, object2 = pbmc2)
# Print results
print(x = pbmc_cca[["cca"]])
} # }
```

Example 9 (r):
```r
if (FALSE) { # \dontrun{
data("pbmc_small")
pbmc_small
# As CCA requires two datasets, we will split our test object into two just for this example
pbmc1 <- subset(pbmc_small, cells = colnames(pbmc_small)[1:40])
pbmc2 <- subset(pbmc_small, cells = colnames(x = pbmc_small)[41:80])
pbmc1[["group"]] <- "group1"
pbmc2[["group"]] <- "group2"
pbmc_cca <- RunCCA(object1 = pbmc1, object2 = pbmc2)
# Print results
print(x = pbmc_cca[["cca"]])
} # }
```

Example 10 (r):
```r
if (FALSE) { # \dontrun{
data("pbmc_small")
pbmc_small
# As CCA requires two datasets, we will split our test object into two just for this example
pbmc1 <- subset(pbmc_small, cells = colnames(pbmc_small)[1:40])
pbmc2 <- subset(pbmc_small, cells = colnames(x = pbmc_small)[41:80])
pbmc1[["group"]] <- "group1"
pbmc2[["group"]] <- "group2"
pbmc_cca <- RunCCA(object1 = pbmc1, object2 = pbmc2)
# Print results
print(x = pbmc_cca[["cca"]])
} # }
```

---

## Normalize Data — NormalizeData • Seurat

**URL:** http://127.0.0.1:9173/seurat/reference/normalizedata/index.html

**Contents:**
- Normalize Data
- Arguments
- Value
- Examples
- Contents

Normalize the count data present in a given assay.

Arguments passed to other methods

Method for normalization.

“LogNormalize”: Feature counts for each cell are divided by the total counts for that cell and multiplied by the scale.factor. This is then natural-log transformed using log1p

“CLR”: Applies a centered log ratio transformation

“RC”: Relative counts. Feature counts for each cell are divided by the total counts for that cell and multiplied by the scale.factor. No log-transformation is applied. For counts per million (CPM) set scale.factor = 1e6

Sets the scale factor for cell-level normalization

If performing CLR normalization, normalize across features (1) or cells (2)

How many cells should be run in each chunk, will try to split evenly across threads

display progress bar for normalization procedure

Returns object after normalization

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/generics.R
```

Example 2 (unknown):
```unknown
R/preprocessing.R
```

Example 3 (unknown):
```unknown
NormalizeData.Rd
```

Example 4 (python):
```python
NormalizeData(object, ...)

# S3 method for class 'V3Matrix'
NormalizeData(
  object,
  normalization.method = "LogNormalize",
  scale.factor = 10000,
  margin = 1,
  block.size = NULL,
  verbose = TRUE,
  ...
)

# S3 method for class 'Assay'
NormalizeData(
  object,
  normalization.method = "LogNormalize",
  scale.factor = 10000,
  margin = 1,
  verbose = TRUE,
  ...
)

# S3 method for class 'Seurat'
NormalizeData(
  object,
  assay = NULL,
  normalization.method = "LogNormalize",
  scale.factor = 10000,
  margin = 1,
  verbose = TRUE,
  ...
)
```

Example 5 (r):
```r
NormalizeData(object, ...)

# S3 method for class 'V3Matrix'
NormalizeData(
  object,
  normalization.method = "LogNormalize",
  scale.factor = 10000,
  margin = 1,
  block.size = NULL,
  verbose = TRUE,
  ...
)

# S3 method for class 'Assay'
NormalizeData(
  object,
  normalization.method = "LogNormalize",
  scale.factor = 10000,
  margin = 1,
  verbose = TRUE,
  ...
)

# S3 method for class 'Seurat'
NormalizeData(
  object,
  assay = NULL,
  normalization.method = "LogNormalize",
  scale.factor = 10000,
  margin = 1,
  verbose = TRUE,
  ...
)
```

Example 6 (r):
```r
NormalizeData(object, ...)

# S3 method for class 'V3Matrix'
NormalizeData(
  object,
  normalization.method = "LogNormalize",
  scale.factor = 10000,
  margin = 1,
  block.size = NULL,
  verbose = TRUE,
  ...
)

# S3 method for class 'Assay'
NormalizeData(
  object,
  normalization.method = "LogNormalize",
  scale.factor = 10000,
  margin = 1,
  verbose = TRUE,
  ...
)

# S3 method for class 'Seurat'
NormalizeData(
  object,
  assay = NULL,
  normalization.method = "LogNormalize",
  scale.factor = 10000,
  margin = 1,
  verbose = TRUE,
  ...
)
```

Example 7 (unknown):
```unknown
LogNormalize
```

Example 8 (unknown):
```unknown
scale.factor
```

Example 9 (unknown):
```unknown
scale.factor
```

Example 10 (unknown):
```unknown
scale.factor = 1e6
```

Example 11 (unknown):
```unknown
if (FALSE) { # \dontrun{
data("pbmc_small")
pbmc_small
pmbc_small <- NormalizeData(object = pbmc_small)
} # }
```

Example 12 (r):
```r
if (FALSE) { # \dontrun{
data("pbmc_small")
pbmc_small
pmbc_small <- NormalizeData(object = pbmc_small)
} # }
```

Example 13 (r):
```r
if (FALSE) { # \dontrun{
data("pbmc_small")
pbmc_small
pmbc_small <- NormalizeData(object = pbmc_small)
} # }
```

---

## Label clusters on a ggplot2-based scatter plot — LabelClusters • Seurat

**URL:** http://127.0.0.1:9173/seurat/reference/labelclusters/index.html

**Contents:**
- Label clusters on a ggplot2-based scatter plot
- Arguments
- Value
- See also
- Examples
- Contents

Label clusters on a ggplot2-based scatter plot

A ggplot2-based scatter plot

Name of variable used for coloring scatter plot

Vector of cluster ids to label

Custom labels for the clusters

Split labels by some grouping label, useful when using facet_wrap or facet_grid

Use geom_text_repel to create nicely-repelled labels

Use geom_label/geom_label_repel (includes a box around the text labels)

Name of geom to get X/Y aesthetic names for

How to place the label if repel = FALSE. If "median", place the label at the median position. If "nearest" place the label at the position of the nearest data point to the median.

Extra parameters to geom_text_repel, such as size

A ggplot2-based scatter plot with cluster labels

geom_text_repel geom_text

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/visualization.R
```

Example 2 (unknown):
```unknown
LabelClusters.Rd
```

Example 3 (unknown):
```unknown
LabelClusters(
  plot,
  id,
  clusters = NULL,
  labels = NULL,
  split.by = NULL,
  repel = TRUE,
  box = FALSE,
  geom = "GeomPoint",
  position = "median",
  ...
)
```

Example 4 (r):
```r
LabelClusters(
  plot,
  id,
  clusters = NULL,
  labels = NULL,
  split.by = NULL,
  repel = TRUE,
  box = FALSE,
  geom = "GeomPoint",
  position = "median",
  ...
)
```

Example 5 (r):
```r
LabelClusters(
  plot,
  id,
  clusters = NULL,
  labels = NULL,
  split.by = NULL,
  repel = TRUE,
  box = FALSE,
  geom = "GeomPoint",
  position = "median",
  ...
)
```

Example 6 (unknown):
```unknown
geom_text_repel
```

Example 7 (unknown):
```unknown
geom_text_repel
```

Example 8 (unknown):
```unknown
geom_text_repel
```

Example 9 (unknown):
```unknown
data("pbmc_small")
plot <- DimPlot(object = pbmc_small)
LabelClusters(plot = plot, id = 'ident')
```

Example 10 (r):
```r
data("pbmc_small")
plot <- DimPlot(object = pbmc_small)
LabelClusters(plot = plot, id = 'ident')
```

Example 11 (r):
```r
data("pbmc_small")
plot <- DimPlot(object = pbmc_small)
LabelClusters(plot = plot, id = 'ident')
```

---

## Get the intensity and/or luminance of a color — contrast-theory • Seurat

**URL:** http://127.0.0.1:9173/reference_contrast-theory.html

**Contents:**
- Get the intensity and/or luminance of a color
- Source
- Arguments
- Value
- Examples
- Contents

Get the intensity and/or luminance of a color

https://stackoverflow.com/questions/3942878/how-to-decide-font-color-in-white-or-black-depending-on-background-color

A vector of intensities/luminances for each color

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/visualization.R
```

Example 2 (unknown):
```unknown
contrast-theory.Rd
```

Example 3 (unknown):
```unknown
Intensity(color)

Luminance(color)
```

Example 4 (r):
```r
Intensity(color)

Luminance(color)
```

Example 5 (r):
```r
Intensity(color)

Luminance(color)
```

Example 6 (unknown):
```unknown
Intensity(color = c('black', 'white', '#E76BF3'))
#>   black   white #E76BF3 
#>    0.00  255.00  159.58 

Luminance(color = c('black', 'white', '#E76BF3'))
#>     black     white   #E76BF3 
#> 0.0000000 1.0000000 0.3397538
```

Example 7 (r):
```r
Intensity(color = c('black', 'white', '#E76BF3'))
#>   black   white #E76BF3 
#>    0.00  255.00  159.58 

Luminance(color = c('black', 'white', '#E76BF3'))
#>     black     white   #E76BF3 
#> 0.0000000 1.0000000 0.3397538
```

Example 8 (r):
```r
Intensity(color = c('black', 'white', '#E76BF3'))
#>   black   white #E76BF3 
#>    0.00  255.00  159.58 

Luminance(color = c('black', 'white', '#E76BF3'))
#>     black     white   #E76BF3 
#> 0.0000000 1.0000000 0.3397538
```

---

## Polygon DimPlot — PolyDimPlot • Seurat

**URL:** http://127.0.0.1:9173/reference_polydimplot.html

**Contents:**
- Polygon DimPlot
- Arguments
- Value
- Contents

Plot cells as polygons, rather than single points. Color cells by identity, or a categorical variable in metadata

A grouping variable present in the metadata. Default is to use the groupings present in the current cell identities (Idents(object = object))

Vector of cells to plot (default is all cells)

Name of the polygon dataframe in the misc slot

Flip x and y coordinates

Returns a ggplot object

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/visualization.R
```

Example 2 (unknown):
```unknown
PolyDimPlot.Rd
```

Example 3 (unknown):
```unknown
PolyDimPlot(
  object,
  group.by = NULL,
  cells = NULL,
  poly.data = "spatial",
  flip.coords = FALSE
)
```

Example 4 (r):
```r
PolyDimPlot(
  object,
  group.by = NULL,
  cells = NULL,
  poly.data = "spatial",
  flip.coords = FALSE
)
```

Example 5 (r):
```r
PolyDimPlot(
  object,
  group.by = NULL,
  cells = NULL,
  poly.data = "spatial",
  flip.coords = FALSE
)
```

Example 6 (unknown):
```unknown
Idents(object = object)
```

---

## Combine ggplot2-based plots into a single plot — CombinePlots • Seurat

**URL:** http://127.0.0.1:9173/reference_combineplots.html

**Contents:**
- Combine ggplot2-based plots into a single plot
- Arguments
- Value
- Examples
- Contents

Combine ggplot2-based plots into a single plot

Combine legends into a single legend choose from 'right' or 'bottom'; pass 'none' to remove legends, or NULL to leave legends as they are

Extra parameters passed to plot_grid

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/visualization.R
```

Example 2 (unknown):
```unknown
CombinePlots.Rd
```

Example 3 (unknown):
```unknown
CombinePlots(plots, ncol = NULL, legend = NULL, ...)
```

Example 4 (r):
```r
CombinePlots(plots, ncol = NULL, legend = NULL, ...)
```

Example 5 (r):
```r
CombinePlots(plots, ncol = NULL, legend = NULL, ...)
```

Example 6 (unknown):
```unknown
data("pbmc_small")
pbmc_small[['group']] <- sample(
  x = c('g1', 'g2'),
  size = ncol(x = pbmc_small),
  replace = TRUE
)
plot1 <- FeaturePlot(
  object = pbmc_small,
  features = 'MS4A1',
  split.by = 'group'
)
plot2 <- FeaturePlot(
  object = pbmc_small,
  features = 'FCN1',
  split.by = 'group'
)
CombinePlots(
  plots = list(plot1, plot2),
  legend = 'none',
  nrow = length(x = unique(x = pbmc_small[['group', drop = TRUE]]))
)
#> Warning: CombinePlots is being deprecated. Plots should now be combined using the patchwork system.
```

Example 7 (r):
```r
data("pbmc_small")
pbmc_small[['group']] <- sample(
  x = c('g1', 'g2'),
  size = ncol(x = pbmc_small),
  replace = TRUE
)
plot1 <- FeaturePlot(
  object = pbmc_small,
  features = 'MS4A1',
  split.by = 'group'
)
plot2 <- FeaturePlot(
  object = pbmc_small,
  features = 'FCN1',
  split.by = 'group'
)
CombinePlots(
  plots = list(plot1, plot2),
  legend = 'none',
  nrow = length(x = unique(x = pbmc_small[['group', drop = TRUE]]))
)
#> Warning: CombinePlots is being deprecated. Plots should now be combined using the patchwork system.
```

Example 8 (r):
```r
data("pbmc_small")
pbmc_small[['group']] <- sample(
  x = c('g1', 'g2'),
  size = ncol(x = pbmc_small),
  replace = TRUE
)
plot1 <- FeaturePlot(
  object = pbmc_small,
  features = 'MS4A1',
  split.by = 'group'
)
plot2 <- FeaturePlot(
  object = pbmc_small,
  features = 'FCN1',
  split.by = 'group'
)
CombinePlots(
  plots = list(plot1, plot2),
  legend = 'none',
  nrow = length(x = unique(x = pbmc_small[['group', drop = TRUE]]))
)
#> Warning: CombinePlots is being deprecated. Plots should now be combined using the patchwork system.
```

---

## Phylogenetic Analysis of Identity Classes — BuildClusterTree • Seurat

**URL:** http://127.0.0.1:9173/reference_buildclustertree.html

**Contents:**
- Phylogenetic Analysis of Identity Classes
- Arguments
- Value
- Details
- Examples
- Contents

Constructs a phylogenetic tree relating the 'aggregate' cell from each identity class. Tree is estimated based on a distance matrix constructed in either gene expression space or PCA space.

Assay to use for the analysis.

Genes to use for the analysis. Default is the set of variable genes (VariableFeatures(object = object))

If set, tree is calculated in dimension reduction space; overrides features

Name of dimension reduction to use. Only used if dims is not NULL.

If graph is passed, build tree based on graph connectivity between clusters; overrides dims and features

Re-order identity classes (factor ordering), according to position on the tree. This groups similar classes together which can be helpful, for example, when drawing violin plots.

Re-order identity classes according to position on the tree, assigning a numeric value ('1' is the leftmost node)

Show progress updates

A Seurat object where the cluster tree can be accessed with Tool

Note that the tree is calculated for an 'aggregate' cell, so gene expression or PC scores are summed across all cells in an identity class before the tree is constructed.

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
BuildClusterTree.Rd
```

Example 2 (unknown):
```unknown
BuildClusterTree(
  object,
  assay = NULL,
  features = NULL,
  dims = NULL,
  reduction = "pca",
  graph = NULL,
  slot = "data",
  reorder = FALSE,
  reorder.numeric = FALSE,
  verbose = TRUE
)
```

Example 3 (r):
```r
BuildClusterTree(
  object,
  assay = NULL,
  features = NULL,
  dims = NULL,
  reduction = "pca",
  graph = NULL,
  slot = "data",
  reorder = FALSE,
  reorder.numeric = FALSE,
  verbose = TRUE
)
```

Example 4 (r):
```r
BuildClusterTree(
  object,
  assay = NULL,
  features = NULL,
  dims = NULL,
  reduction = "pca",
  graph = NULL,
  slot = "data",
  reorder = FALSE,
  reorder.numeric = FALSE,
  verbose = TRUE
)
```

Example 5 (unknown):
```unknown
VariableFeatures(object = object)
```

Example 6 (unknown):
```unknown
if (FALSE) { # \dontrun{
if (requireNamespace("ape", quietly = TRUE)) {
  data("pbmc_small")
  pbmc_small
  pbmc_small <- BuildClusterTree(object = pbmc_small)
  Tool(object = pbmc_small, slot = 'BuildClusterTree')
}
} # }
```

Example 7 (r):
```r
if (FALSE) { # \dontrun{
if (requireNamespace("ape", quietly = TRUE)) {
  data("pbmc_small")
  pbmc_small
  pbmc_small <- BuildClusterTree(object = pbmc_small)
  Tool(object = pbmc_small, slot = 'BuildClusterTree')
}
} # }
```

Example 8 (r):
```r
if (FALSE) { # \dontrun{
if (requireNamespace("ape", quietly = TRUE)) {
  data("pbmc_small")
  pbmc_small
  pbmc_small <- BuildClusterTree(object = pbmc_small)
  Tool(object = pbmc_small, slot = 'BuildClusterTree')
}
} # }
```

---

## Visualize Dimensional Reduction genes — VizDimLoadings • Seurat

**URL:** http://127.0.0.1:9173/seurat/reference/vizdimloadings/index.html

**Contents:**
- Visualize Dimensional Reduction genes
- Arguments
- Value
- Examples
- Contents

Visualize top genes associated with reduction components

Number of dimensions to display

Number of genes to display

Color of points to use

Reduction technique to visualize results for

Use reduction values for full dataset (i.e. projected dimensional reduction values)

Return an equal number of genes with + and - scores. If FALSE (default), returns the top genes ranked by the scores absolute values

Number of columns to display

Combine plots into a single patchwork ggplot object. If FALSE, return a list of ggplot objects

A patchwork ggplot object if combine = TRUE; otherwise, a list of ggplot objects

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/visualization.R
```

Example 2 (unknown):
```unknown
VizDimLoadings.Rd
```

Example 3 (unknown):
```unknown
VizDimLoadings(
  object,
  dims = 1:5,
  nfeatures = 30,
  col = "blue",
  reduction = "pca",
  projected = FALSE,
  balanced = FALSE,
  ncol = NULL,
  combine = TRUE
)
```

Example 4 (r):
```r
VizDimLoadings(
  object,
  dims = 1:5,
  nfeatures = 30,
  col = "blue",
  reduction = "pca",
  projected = FALSE,
  balanced = FALSE,
  ncol = NULL,
  combine = TRUE
)
```

Example 5 (r):
```r
VizDimLoadings(
  object,
  dims = 1:5,
  nfeatures = 30,
  col = "blue",
  reduction = "pca",
  projected = FALSE,
  balanced = FALSE,
  ncol = NULL,
  combine = TRUE
)
```

Example 6 (unknown):
```unknown
combine = TRUE
```

Example 7 (unknown):
```unknown
data("pbmc_small")
VizDimLoadings(object = pbmc_small)
#> Warning: Requested number is larger than the number of available items (20). Setting to 20.
#> Warning: Requested number is larger than the number of available items (20). Setting to 20.
#> Warning: Requested number is larger than the number of available items (20). Setting to 20.
#> Warning: Requested number is larger than the number of available items (20). Setting to 20.
#> Warning: Requested number is larger than the number of available items (20). Setting to 20.
```

Example 8 (r):
```r
data("pbmc_small")
VizDimLoadings(object = pbmc_small)
#> Warning: Requested number is larger than the number of available items (20). Setting to 20.
#> Warning: Requested number is larger than the number of available items (20). Setting to 20.
#> Warning: Requested number is larger than the number of available items (20). Setting to 20.
#> Warning: Requested number is larger than the number of available items (20). Setting to 20.
#> Warning: Requested number is larger than the number of available items (20). Setting to 20.
```

Example 9 (r):
```r
data("pbmc_small")
VizDimLoadings(object = pbmc_small)
#> Warning: Requested number is larger than the number of available items (20). Setting to 20.
#> Warning: Requested number is larger than the number of available items (20). Setting to 20.
#> Warning: Requested number is larger than the number of available items (20). Setting to 20.
#> Warning: Requested number is larger than the number of available items (20). Setting to 20.
#> Warning: Requested number is larger than the number of available items (20). Setting to 20.
```

---

## Integrate data — IntegrateData • Seurat

**URL:** http://127.0.0.1:9173/reference_integratedata.html

**Contents:**
- Integrate data
- Arguments
- Value
- Details
- References
- Examples
- Contents

Perform dataset integration using a pre-computed AnchorSet.

An AnchorSet object generated by FindIntegrationAnchors

Name for the new assay containing the integrated data

Name of normalization method used: LogNormalize or SCT

Vector of features to use when computing the PCA to determine the weights. Only set if you want a different set from those used in the anchor finding process

Vector of features to integrate. By default, will use the features used in anchor finding.

Number of dimensions to use in the anchor weighting procedure

Number of neighbors to consider when weighting anchors

Dimension reduction to use when calculating anchor weights. This can be one of:

A string, specifying the name of a dimension reduction present in all objects to be integrated

A vector of strings, specifying the name of a dimension reduction to use for each object to be integrated

A vector of DimReduc objects, specifying the object to use for each object in the integration

NULL, in which case a new PCA will be calculated and used to calculate anchor weights

Note that, if specified, the requested dimension reduction will only be used for calculating anchor weights in the first merge between reference and query, as the merged object will subsequently contain more cells than was in query, and weights will need to be calculated for all cells in the object.

Controls the bandwidth of the Gaussian kernel for weighting

Specify the order of integration. Order of integration should be encoded in a matrix, where each row represents one of the pairwise integration steps. Negative numbers specify a dataset, positive numbers specify the integration results from a given row (the format of the merge matrix included in the hclust function output). For example: matrix(c(-2, 1, -3, -1), ncol = 2) gives:

Which would cause dataset 2 and 3 to be integrated first, then the resulting object integrated with dataset 1.

If NULL, the sample tree will be computed automatically.

Do not reorder objects based on size for each pairwise integration.

Error bound on the neighbor finding algorithm (from RANN)

Print progress bars and output

Returns a Seurat object with a new integrated Assay. If normalization.method = "LogNormalize", the integrated data is returned to the data slot and can be treated as log-normalized, corrected data. If normalization.method = "SCT", the integrated data is returned to the scale.data slot and can be treated as centered, corrected Pearson residuals.

The main steps of this procedure are outlined below. For a more detailed description of the methodology, please see Stuart, Butler, et al Cell 2019. doi:10.1016/j.cell.2019.05.031 ; doi:10.1101/460147

For pairwise integration:

Construct a weights matrix that defines the association between each query cell and each anchor. These weights are computed as 1 - the distance between the query cell and the anchor divided by the distance of the query cell to the k.weightth anchor multiplied by the anchor score computed in FindIntegrationAnchors. We then apply a Gaussian kernel width a bandwidth defined by sd.weight and normalize across all k.weight anchors.

Compute the anchor integration matrix as the difference between the two expression matrices for every pair of anchor cells

Compute the transformation matrix as the product of the integration matrix and the weights matrix.

Subtract the transformation matrix from the original expression matrix.

For multiple dataset integration, we perform iterative pairwise integration. To determine the order of integration (if not specified via sample.tree), we

Define a distance between datasets as the total number of cells in the smaller dataset divided by the total number of anchors between the two datasets.

Compute all pairwise distances between datasets

Cluster this distance matrix to determine a guide tree

Stuart T, Butler A, et al. Comprehensive Integration of Single-Cell Data. Cell. 2019;177:1888-1902 doi:10.1016/j.cell.2019.05.031

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/integration.R
```

Example 2 (unknown):
```unknown
IntegrateData.Rd
```

Example 3 (unknown):
```unknown
IntegrateData(
  anchorset,
  new.assay.name = "integrated",
  normalization.method = c("LogNormalize", "SCT"),
  features = NULL,
  features.to.integrate = NULL,
  dims = 1:30,
  k.weight = 100,
  weight.reduction = NULL,
  sd.weight = 1,
  sample.tree = NULL,
  preserve.order = FALSE,
  eps = 0,
  verbose = TRUE
)
```

Example 4 (r):
```r
IntegrateData(
  anchorset,
  new.assay.name = "integrated",
  normalization.method = c("LogNormalize", "SCT"),
  features = NULL,
  features.to.integrate = NULL,
  dims = 1:30,
  k.weight = 100,
  weight.reduction = NULL,
  sd.weight = 1,
  sample.tree = NULL,
  preserve.order = FALSE,
  eps = 0,
  verbose = TRUE
)
```

Example 5 (r):
```r
IntegrateData(
  anchorset,
  new.assay.name = "integrated",
  normalization.method = c("LogNormalize", "SCT"),
  features = NULL,
  features.to.integrate = NULL,
  dims = 1:30,
  k.weight = 100,
  weight.reduction = NULL,
  sd.weight = 1,
  sample.tree = NULL,
  preserve.order = FALSE,
  eps = 0,
  verbose = TRUE
)
```

Example 6 (unknown):
```unknown
FindIntegrationAnchors
```

Example 7 (unknown):
```unknown
matrix(c(-2, 1, -3, -1), ncol = 2)
```

Example 8 (unknown):
```unknown
[,1]  [,2]
       [1,]   -2   -3
       [2,]    1   -1
```

Example 9 (unknown):
```unknown
[,1]  [,2]
       [1,]   -2   -3
       [2,]    1   -1
```

Example 10 (unknown):
```unknown
[,1]  [,2]
       [1,]   -2   -3
       [2,]    1   -1
```

Example 11 (unknown):
```unknown
normalization.method = "LogNormalize"
```

Example 12 (unknown):
```unknown
normalization.method = "SCT"
```

Example 13 (unknown):
```unknown
FindIntegrationAnchors
```

Example 14 (unknown):
```unknown
sample.tree
```

Example 15 (unknown):
```unknown
if (FALSE) { # \dontrun{
# to install the SeuratData package see https://github.com/satijalab/seurat-data
library(SeuratData)
data("panc8")

# panc8 is a merged Seurat object containing 8 separate pancreas datasets
# split the object by dataset
pancreas.list <- SplitObject(panc8, split.by = "tech")

# perform standard preprocessing on each object
for (i in 1:length(pancreas.list)) {
  pancreas.list[[i]] <- NormalizeData(pancreas.list[[i]], verbose = FALSE)
  pancreas.list[[i]] <- FindVariableFeatures(
    pancreas.list[[i]], selection.method = "vst",
    nfeatures = 2000, verbose = FALSE
  )
}

# find anchors
anchors <- FindIntegrationAnchors(object.list = pancreas.list)

# integrate data
integrated <- IntegrateData(anchorset = anchors)
} # }
```

Example 16 (r):
```r
if (FALSE) { # \dontrun{
# to install the SeuratData package see https://github.com/satijalab/seurat-data
library(SeuratData)
data("panc8")

# panc8 is a merged Seurat object containing 8 separate pancreas datasets
# split the object by dataset
pancreas.list <- SplitObject(panc8, split.by = "tech")

# perform standard preprocessing on each object
for (i in 1:length(pancreas.list)) {
  pancreas.list[[i]] <- NormalizeData(pancreas.list[[i]], verbose = FALSE)
  pancreas.list[[i]] <- FindVariableFeatures(
    pancreas.list[[i]], selection.method = "vst",
    nfeatures = 2000, verbose = FALSE
  )
}

# find anchors
anchors <- FindIntegrationAnchors(object.list = pancreas.list)

# integrate data
integrated <- IntegrateData(anchorset = anchors)
} # }
```

Example 17 (r):
```r
if (FALSE) { # \dontrun{
# to install the SeuratData package see https://github.com/satijalab/seurat-data
library(SeuratData)
data("panc8")

# panc8 is a merged Seurat object containing 8 separate pancreas datasets
# split the object by dataset
pancreas.list <- SplitObject(panc8, split.by = "tech")

# perform standard preprocessing on each object
for (i in 1:length(pancreas.list)) {
  pancreas.list[[i]] <- NormalizeData(pancreas.list[[i]], verbose = FALSE)
  pancreas.list[[i]] <- FindVariableFeatures(
    pancreas.list[[i]], selection.method = "vst",
    nfeatures = 2000, verbose = FALSE
  )
}

# find anchors
anchors <- FindIntegrationAnchors(object.list = pancreas.list)

# integrate data
integrated <- IntegrateData(anchorset = anchors)
} # }
```

---

## Get Image Data — GetImage.SlideSeq • Seurat

**URL:** http://127.0.0.1:9173/reference_getimage.html

**Contents:**
- Get Image Data
- Arguments
- See also
- Contents

How to return the image; should accept one of “grob”, “raster”, “plotly”, or “raw”

Arguments passed to other methods

SeuratObject::GetImage

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/objects.R
```

Example 2 (unknown):
```unknown
GetImage.Rd
```

Example 3 (python):
```python
# S3 method for class 'SlideSeq'
GetImage(object, mode = c("grob", "raster", "plotly", "raw"), ...)

# S3 method for class 'STARmap'
GetImage(object, mode = c("grob", "raster", "plotly", "raw"), ...)

# S3 method for class 'VisiumV1'
GetImage(object, mode = c("grob", "raster", "plotly", "raw"), ...)

# S3 method for class 'VisiumV2'
GetImage(object, mode = c("grob", "raster", "plotly", "raw"), ...)
```

Example 4 (r):
```r
# S3 method for class 'SlideSeq'
GetImage(object, mode = c("grob", "raster", "plotly", "raw"), ...)

# S3 method for class 'STARmap'
GetImage(object, mode = c("grob", "raster", "plotly", "raw"), ...)

# S3 method for class 'VisiumV1'
GetImage(object, mode = c("grob", "raster", "plotly", "raw"), ...)

# S3 method for class 'VisiumV2'
GetImage(object, mode = c("grob", "raster", "plotly", "raw"), ...)
```

Example 5 (r):
```r
# S3 method for class 'SlideSeq'
GetImage(object, mode = c("grob", "raster", "plotly", "raw"), ...)

# S3 method for class 'STARmap'
GetImage(object, mode = c("grob", "raster", "plotly", "raw"), ...)

# S3 method for class 'VisiumV1'
GetImage(object, mode = c("grob", "raster", "plotly", "raw"), ...)

# S3 method for class 'VisiumV2'
GetImage(object, mode = c("grob", "raster", "plotly", "raw"), ...)
```

Example 6 (unknown):
```unknown
SeuratObject::GetImage
```

---

## Visualize features spatially and interactively — ISpatialFeaturePlot • Seurat

**URL:** http://127.0.0.1:9173/reference_ispatialfeatureplot.html

**Contents:**
- Visualize features spatially and interactively
- Arguments
- Value
- Contents

Visualize features spatially and interactively

Name of the image to use in the plot

Choose the scale factor ("lowres"/"hires") to apply in order to matchthe plot with the specified `image` - defaults to "lowres"

If plotting a feature, which data slot to pull from (counts, data, or scale.data)

Controls opacity of spots. Provide as a vector specifying the min and max for SpatialFeaturePlot. For SpatialDimPlot, provide a single alpha value for each plot.

Returns final plot as a ggplot object

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/visualization.R
```

Example 2 (unknown):
```unknown
ISpatialFeaturePlot.Rd
```

Example 3 (unknown):
```unknown
ISpatialFeaturePlot(
  object,
  feature,
  image = NULL,
  image.scale = "lowres",
  slot = "data",
  alpha = c(0.1, 1)
)
```

Example 4 (r):
```r
ISpatialFeaturePlot(
  object,
  feature,
  image = NULL,
  image.scale = "lowres",
  slot = "data",
  alpha = c(0.1, 1)
)
```

Example 5 (r):
```r
ISpatialFeaturePlot(
  object,
  feature,
  image = NULL,
  image.scale = "lowres",
  slot = "data",
  alpha = c(0.1, 1)
)
```

---

## Get updated synonyms for gene symbols — UpdateSymbolList • Seurat

**URL:** http://127.0.0.1:9173/reference_updatesymbollist.html

**Contents:**
- Get updated synonyms for gene symbols
- Source
- Arguments
- Value
- Details
- Note
- See also
- Examples
- Contents

Find current gene symbols based on old or alias symbols using the gene names database from the HUGO Gene Nomenclature Committee (HGNC)

https://www.genenames.org/ https://www.genenames.org/help/rest/

A vector of gene symbols

Time to wait before canceling query in seconds

Allow several current gene symbols for each provided symbol

Type of query to perform:

Find alternate symbols for the genes described by symbols

Find new new symbols for the genes described by symbols

This parameter accepts multiple options and short-hand options (eg. “prev” for “prev_symbol”)

Show a progress bar depicting search progress

Extra parameters passed to GET

GeneSymbolThesarus:, if several.ok, a named list where each entry is the current symbol found for each symbol provided and the names are the provided symbols. Otherwise, a named vector with the same information.

UpdateSymbolList: symbols with updated symbols from HGNC's gene names database

For each symbol passed, we query the HGNC gene names database for current symbols that have the provided symbol as either an alias (alias_symbol) or old (prev_symbol) symbol. All other queries are not supported.

This function requires internet access

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/utilities.R
```

Example 2 (unknown):
```unknown
UpdateSymbolList.Rd
```

Example 3 (unknown):
```unknown
GeneSymbolThesarus(
  symbols,
  timeout = 10,
  several.ok = FALSE,
  search.types = c("alias_symbol", "prev_symbol"),
  verbose = TRUE,
  ...
)

UpdateSymbolList(
  symbols,
  timeout = 10,
  several.ok = FALSE,
  verbose = TRUE,
  ...
)
```

Example 4 (r):
```r
GeneSymbolThesarus(
  symbols,
  timeout = 10,
  several.ok = FALSE,
  search.types = c("alias_symbol", "prev_symbol"),
  verbose = TRUE,
  ...
)

UpdateSymbolList(
  symbols,
  timeout = 10,
  several.ok = FALSE,
  verbose = TRUE,
  ...
)
```

Example 5 (r):
```r
GeneSymbolThesarus(
  symbols,
  timeout = 10,
  several.ok = FALSE,
  search.types = c("alias_symbol", "prev_symbol"),
  verbose = TRUE,
  ...
)

UpdateSymbolList(
  symbols,
  timeout = 10,
  several.ok = FALSE,
  verbose = TRUE,
  ...
)
```

Example 6 (unknown):
```unknown
alias_symbol
```

Example 7 (unknown):
```unknown
prev_symbol
```

Example 8 (unknown):
```unknown
prev_symbol
```

Example 9 (unknown):
```unknown
GeneSymbolThesarus
```

Example 10 (unknown):
```unknown
UpdateSymbolList
```

Example 11 (unknown):
```unknown
alias_symbol
```

Example 12 (unknown):
```unknown
prev_symbol
```

Example 13 (unknown):
```unknown
if (FALSE) { # \dontrun{
GeneSybmolThesarus(symbols = c("FAM64A"))
} # }

if (FALSE) { # \dontrun{
UpdateSymbolList(symbols = cc.genes$s.genes)
} # }
```

Example 14 (r):
```r
if (FALSE) { # \dontrun{
GeneSybmolThesarus(symbols = c("FAM64A"))
} # }

if (FALSE) { # \dontrun{
UpdateSymbolList(symbols = cc.genes$s.genes)
} # }
```

Example 15 (r):
```r
if (FALSE) { # \dontrun{
GeneSybmolThesarus(symbols = c("FAM64A"))
} # }

if (FALSE) { # \dontrun{
UpdateSymbolList(symbols = cc.genes$s.genes)
} # }
```

---

## Calculate the percentage of all counts that belong to a given set of features — PercentageFeatureSet • Seurat

**URL:** http://127.0.0.1:9173/reference_percentagefeatureset.html

**Contents:**
- Calculate the percentage of all counts that belong to a given set of features
- Arguments
- Value
- Examples
- Contents

This function enables you to easily calculate the percentage of all the counts belonging to a subset of the possible features for each cell. This is useful when trying to compute the percentage of transcripts that map to mitochondrial genes for example. The calculation here is simply the column sum of the matrix present in the counts slot for features belonging to the set divided by the column sum for all features times 100.

A regex pattern to match features against

A defined feature set. If features provided, will ignore the pattern matching

Name in meta.data column to assign. If this is not null, returns a Seurat object with the proportion of the feature set stored in metadata.

Returns a vector with the proportion of the feature set or if md.name is set, returns a Seurat object with the proportion of the feature set stored in metadata.

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/utilities.R
```

Example 2 (unknown):
```unknown
PercentageFeatureSet.Rd
```

Example 3 (unknown):
```unknown
PercentageFeatureSet(
  object,
  pattern = NULL,
  features = NULL,
  col.name = NULL,
  assay = NULL
)
```

Example 4 (r):
```r
PercentageFeatureSet(
  object,
  pattern = NULL,
  features = NULL,
  col.name = NULL,
  assay = NULL
)
```

Example 5 (r):
```r
PercentageFeatureSet(
  object,
  pattern = NULL,
  features = NULL,
  col.name = NULL,
  assay = NULL
)
```

Example 6 (unknown):
```unknown
data("pbmc_small")
# Calculate the proportion of transcripts mapping to mitochondrial genes
# NOTE: The pattern provided works for human gene names. You may need to adjust depending on your
# system of interest
pbmc_small[["percent.mt"]] <- PercentageFeatureSet(object = pbmc_small, pattern = "^MT-")
```

Example 7 (r):
```r
data("pbmc_small")
# Calculate the proportion of transcripts mapping to mitochondrial genes
# NOTE: The pattern provided works for human gene names. You may need to adjust depending on your
# system of interest
pbmc_small[["percent.mt"]] <- PercentageFeatureSet(object = pbmc_small, pattern = "^MT-")
```

Example 8 (r):
```r
data("pbmc_small")
# Calculate the proportion of transcripts mapping to mitochondrial genes
# NOTE: The pattern provided works for human gene names. You may need to adjust depending on your
# system of interest
pbmc_small[["percent.mt"]] <- PercentageFeatureSet(object = pbmc_small, pattern = "^MT-")
```

---

## Find the Quantile of Data — SetQuantile • Seurat

**URL:** http://127.0.0.1:9173/reference_setquantile.html

**Contents:**
- Find the Quantile of Data
- Arguments
- Value
- Examples
- Contents

Converts a quantile in character form to a number regarding some data. String form for a quantile is represented as a number prefixed with “q”; for example, 10th quantile is “q10” while 2nd quantile is “q2”. Will only take a quantile of non-zero data values

The cutoff to turn into a quantile

The data to turn find the quantile of

The numerical representation of the quantile

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/utilities.R
```

Example 2 (unknown):
```unknown
SetQuantile.Rd
```

Example 3 (unknown):
```unknown
SetQuantile(cutoff, data)
```

Example 4 (r):
```r
SetQuantile(cutoff, data)
```

Example 5 (r):
```r
SetQuantile(cutoff, data)
```

Example 6 (unknown):
```unknown
set.seed(42)
SetQuantile('q10', sample(1:100, 10))
#> [1] 23.4
```

Example 7 (r):
```r
set.seed(42)
SetQuantile('q10', sample(1:100, 10))
#> [1] 23.4
```

Example 8 (r):
```r
set.seed(42)
SetQuantile('q10', sample(1:100, 10))
#> [1] 23.4
```

---

## Visualize features in dimensional reduction space interactively — IFeaturePlot • Seurat

**URL:** http://127.0.0.1:9173/reference_ifeatureplot.html

**Contents:**
- Visualize features in dimensional reduction space interactively
- Arguments
- Value
- Contents

Visualize features in dimensional reduction space interactively

Dimensions to plot, must be a two-length numeric vector specifying x- and y-dimensions

Which dimensionality reduction to use. If not specified, first searches for umap, then tsne, then pca

Which slot to pull expression data from?

Returns the final plot as a ggplot object

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/visualization.R
```

Example 2 (unknown):
```unknown
IFeaturePlot.Rd
```

Example 3 (unknown):
```unknown
IFeaturePlot(object, feature, dims = c(1, 2), reduction = NULL, slot = "data")
```

Example 4 (r):
```r
IFeaturePlot(object, feature, dims = c(1, 2), reduction = NULL, slot = "data")
```

Example 5 (r):
```r
IFeaturePlot(object, feature, dims = c(1, 2), reduction = NULL, slot = "data")
```

---

## Seurat: Tools for Single Cell Genomics — Seurat-package • Seurat

**URL:** http://127.0.0.1:9173/reference_seurat-package.html

**Contents:**
- Seurat: Tools for Single Cell Genomics
- Package options
- See also
- Author
- Contents

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.

Seurat uses the following [options()] to configure behaviour:

global option to call gc() after many operations. This can be helpful in cleaning up the memory status of the R session and prevent use of swap space. However, it does add to the computational overhead and setting to FALSE can speed things up if you're working in an environment where RAM availability is not a concern.

Show warning about the default backend for RunUMAP changing from Python UMAP via reticulate to UWOT

For functions that have ... as a parameter, this controls the behavior when an item isn't used. Can be one of warn, stop, or silent.

Show message about more efficient Wilcoxon Rank Sum test available via the limma package

Show message about more efficient Moran's I function available via the Rfast2 package

Show message about changes to default behavior of split/multi violin plots

https://satijalab.org/seurat

https://github.com/satijalab/seurat

Report bugs at https://github.com/satijalab/seurat/issues

Maintainer: Rahul Satija seurat@nygenome.org (ORCID)

Andrew Butler abutler@nygenome.org (ORCID) [contributor]

Saket Choudhary schoudhary@nygenome.org (ORCID) [contributor]

David Collins dcollins@nygenome.org (ORCID) [contributor]

Charlotte Darby cdarby@nygenome.org (ORCID) [contributor]

Jeff Farrell jfarrell@g.harvard.edu [contributor]

Isabella Grabski igrabski@nygenome.org (ORCID) [contributor]

Christoph Hafemeister chafemeister@nygenome.org (ORCID) [contributor]

Yuhan Hao yhao@nygenome.org (ORCID) [contributor]

Austin Hartman ahartman@nygenome.org (ORCID) [contributor]

Paul Hoffman hoff0792@umn.edu (ORCID) [contributor]

Jaison Jain jjain@nygenome.org (ORCID) [contributor]

Longda Jiang ljiang@nygenome.org (ORCID) [contributor]

Madeline Kowalski mkowalski@nygenome.org (ORCID) [contributor]

Skylar Li sli@nygenome.org [contributor]

Gesmira Molla gmolla@nygenome.org (ORCID) [contributor]

Efthymia Papalexi epapalexi@nygenome.org (ORCID) [contributor]

Patrick Roelli proelli@nygenome.org [contributor]

Karthik Shekhar kshekhar@berkeley.edu [contributor]

Avi Srivastava asrivastava@nygenome.org (ORCID) [contributor]

Tim Stuart tstuart@nygenome.org (ORCID) [contributor]

Kristof Torkenczy (ORCID) [contributor]

Shiwei Zheng szheng@nygenome.org (ORCID) [contributor]

Satija Lab and Collaborators [funder]

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
Seurat-package.Rd
```

Example 2 (unknown):
```unknown
Seurat.memsafe
```

Example 3 (unknown):
```unknown
Seurat.warn.umap.uwot
```

Example 4 (unknown):
```unknown
Seurat.checkdots
```

Example 5 (unknown):
```unknown
Seurat.limma.wilcox.msg
```

Example 6 (unknown):
```unknown
Seurat.Rfast2.msg
```

Example 7 (unknown):
```unknown
Seurat.warn.vlnplot.split
```

---

## Create one hot matrix for a given label — CreateCategoryMatrix • Seurat

**URL:** http://127.0.0.1:9173/reference_createcategorymatrix.html

**Contents:**
- Create one hot matrix for a given label
- Arguments
- Contents

Create one hot matrix for a given label

Method to aggregate cells with the same label. Either 'aggregate' or 'average'

A vector of cell names

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/utilities.R
```

Example 2 (unknown):
```unknown
CreateCategoryMatrix.Rd
```

Example 3 (unknown):
```unknown
CreateCategoryMatrix(
  labels,
  method = c("aggregate", "average"),
  cells.name = NULL
)
```

Example 4 (r):
```r
CreateCategoryMatrix(
  labels,
  method = c("aggregate", "average"),
  cells.name = NULL
)
```

Example 5 (r):
```r
CreateCategoryMatrix(
  labels,
  method = c("aggregate", "average"),
  cells.name = NULL
)
```

---

## Calculate the standard deviation of logged values — ExpSD • Seurat

**URL:** http://127.0.0.1:9173/reference_expsd.html

**Contents:**
- Calculate the standard deviation of logged values
- Arguments
- Value
- Examples
- Contents

Calculate SD of logged values in non-log space (return answer in log-space)

Returns the standard deviation in log-space

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/utilities.R
```

Example 2 (unknown):
```unknown
ExpSD(x = c(1, 2, 3))
#> [1] 2.301323
```

Example 3 (r):
```r
ExpSD(x = c(1, 2, 3))
#> [1] 2.301323
```

Example 4 (r):
```r
ExpSD(x = c(1, 2, 3))
#> [1] 2.301323
```

---

## Averaged feature expression by identity class — AverageExpression • Seurat

**URL:** http://127.0.0.1:9173/reference_averageexpression.html

**Contents:**
- Averaged feature expression by identity class
- Arguments
- Value
- Details
- Examples
- Contents

Returns averaged expression values for each identity class.

Which assays to use. Default is all assays

Features to analyze. Default is all features in the assay

Whether to return the data as a Seurat object. Default is FALSE

Category (or vector of categories) for grouping (e.g, ident, replicate, celltype); 'ident' by default To use multiple categories, specify a vector, such as c('ident', 'replicate', 'celltype')

(Deprecated). Place an additional label on each cell prior to pseudobulking

Layer(s) to use; if multiple layers are given, assumed to follow the order of 'assays' (if specified) or object's assays

(Deprecated). Slots(s) to use

Print messages and show progress bar

Arguments to be passed to methods such as CreateSeuratObject

Returns a matrix with genes as rows, identity classes as columns. If return.seurat is TRUE, returns an object of class Seurat.

If layer is set to 'data', this function assumes that the data has been log normalized and therefore feature values are exponentiated prior to averaging so that averaging is done in non-log space. Otherwise, if layer is set to either 'counts' or 'scale.data', no exponentiation is performed prior to averaging. If return.seurat = TRUE and layer is not 'scale.data', averaged values are placed in the 'counts' layer of the returned object and 'log1p' is run on the averaged counts and placed in the 'data' layer ScaleData is then run on the default assay before returning the object. If return.seurat = TRUE and layer is 'scale.data', the 'counts' layer contains average counts and 'scale.data' is set to the averaged values of 'scale.data'.

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/utilities.R
```

Example 2 (unknown):
```unknown
AverageExpression.Rd
```

Example 3 (unknown):
```unknown
AverageExpression(
  object,
  assays = NULL,
  features = NULL,
  return.seurat = FALSE,
  group.by = "ident",
  add.ident = NULL,
  layer = "data",
  slot = deprecated(),
  verbose = TRUE,
  ...
)
```

Example 4 (r):
```r
AverageExpression(
  object,
  assays = NULL,
  features = NULL,
  return.seurat = FALSE,
  group.by = "ident",
  add.ident = NULL,
  layer = "data",
  slot = deprecated(),
  verbose = TRUE,
  ...
)
```

Example 5 (r):
```r
AverageExpression(
  object,
  assays = NULL,
  features = NULL,
  return.seurat = FALSE,
  group.by = "ident",
  add.ident = NULL,
  layer = "data",
  slot = deprecated(),
  verbose = TRUE,
  ...
)
```

Example 6 (unknown):
```unknown
CreateSeuratObject
```

Example 7 (unknown):
```unknown
return.seurat = TRUE
```

Example 8 (unknown):
```unknown
return.seurat = TRUE
```

Example 9 (python):
```python
data("pbmc_small")
head(AverageExpression(object = pbmc_small)$RNA)
#> As of Seurat v5, we recommend using AggregateExpression to perform pseudo-bulk analysis.
#> This message is displayed once per session.
#> First group.by variable `ident` starts with a number, appending `g` to ensure valid variable names
#> This message is displayed once every 8 hours.
#> 6 x 3 sparse Matrix of class "dgCMatrix"
#>                 g0         g1        g2
#> MS4A1     .          2.083443  171.6152
#> CD79B    10.814657  17.548842  152.1344
#> CD79A     .         11.618333  215.0869
#> HLA-DRA  37.105857 405.850522 1158.0852
#> TCL1A     .          3.463203  142.0748
#> HLA-DQB1  3.968254  45.353183  169.2762
head(AverageExpression(object = pbmc_small, group.by = c('ident', 'groups'))$RNA)
#> 6 x 6 sparse Matrix of class "dgCMatrix"
#>             g0_g1     g0_g2      g1_g1      g1_g2      g2_g1     g2_g2
#> MS4A1     .        .          3.720434   .          83.27443  269.7716
#> CD79B    12.32353  8.928571  16.783660  18.522712   80.07761  232.1975
#> CD79A     .        .         14.204794   8.326474  174.12523  260.5998
#> HLA-DRA  44.81837 27.465213 473.313733 319.988254 1217.90859 1091.6148
#> TCL1A     .        .          6.184292   .          60.19691  233.0502
#> HLA-DQB1  .        8.928571  51.863218  37.067684  170.88236  167.4915
```

Example 10 (r):
```r
data("pbmc_small")
head(AverageExpression(object = pbmc_small)$RNA)
#> As of Seurat v5, we recommend using AggregateExpression to perform pseudo-bulk analysis.
#> This message is displayed once per session.
#> First group.by variable `ident` starts with a number, appending `g` to ensure valid variable names
#> This message is displayed once every 8 hours.
#> 6 x 3 sparse Matrix of class "dgCMatrix"
#>                 g0         g1        g2
#> MS4A1     .          2.083443  171.6152
#> CD79B    10.814657  17.548842  152.1344
#> CD79A     .         11.618333  215.0869
#> HLA-DRA  37.105857 405.850522 1158.0852
#> TCL1A     .          3.463203  142.0748
#> HLA-DQB1  3.968254  45.353183  169.2762
head(AverageExpression(object = pbmc_small, group.by = c('ident', 'groups'))$RNA)
#> 6 x 6 sparse Matrix of class "dgCMatrix"
#>             g0_g1     g0_g2      g1_g1      g1_g2      g2_g1     g2_g2
#> MS4A1     .        .          3.720434   .          83.27443  269.7716
#> CD79B    12.32353  8.928571  16.783660  18.522712   80.07761  232.1975
#> CD79A     .        .         14.204794   8.326474  174.12523  260.5998
#> HLA-DRA  44.81837 27.465213 473.313733 319.988254 1217.90859 1091.6148
#> TCL1A     .        .          6.184292   .          60.19691  233.0502
#> HLA-DQB1  .        8.928571  51.863218  37.067684  170.88236  167.4915
```

Example 11 (r):
```r
data("pbmc_small")
head(AverageExpression(object = pbmc_small)$RNA)
#> As of Seurat v5, we recommend using AggregateExpression to perform pseudo-bulk analysis.
#> This message is displayed once per session.
#> First group.by variable `ident` starts with a number, appending `g` to ensure valid variable names
#> This message is displayed once every 8 hours.
#> 6 x 3 sparse Matrix of class "dgCMatrix"
#>                 g0         g1        g2
#> MS4A1     .          2.083443  171.6152
#> CD79B    10.814657  17.548842  152.1344
#> CD79A     .         11.618333  215.0869
#> HLA-DRA  37.105857 405.850522 1158.0852
#> TCL1A     .          3.463203  142.0748
#> HLA-DQB1  3.968254  45.353183  169.2762
head(AverageExpression(object = pbmc_small, group.by = c('ident', 'groups'))$RNA)
#> 6 x 6 sparse Matrix of class "dgCMatrix"
#>             g0_g1     g0_g2      g1_g1      g1_g2      g2_g1     g2_g2
#> MS4A1     .        .          3.720434   .          83.27443  269.7716
#> CD79B    12.32353  8.928571  16.783660  18.522712   80.07761  232.1975
#> CD79A     .        .         14.204794   8.326474  174.12523  260.5998
#> HLA-DRA  44.81837 27.465213 473.313733 319.988254 1217.90859 1091.6148
#> TCL1A     .        .          6.184292   .          60.19691  233.0502
#> HLA-DQB1  .        8.928571  51.863218  37.067684  170.88236  167.4915
```

---

## Read output from STARsolo — ReadSTARsolo • Seurat

**URL:** http://127.0.0.1:9173/seurat/reference/readstarsolo/index.html

**Contents:**
- Read output from STARsolo
- Arguments
- Contents

Read output from STARsolo

Directory containing the data files

Extra parameters passed to ReadMtx

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/convenience.R
```

Example 2 (unknown):
```unknown
ReadSTARsolo.Rd
```

Example 3 (unknown):
```unknown
ReadSTARsolo(data.dir, ...)
```

Example 4 (r):
```r
ReadSTARsolo(data.dir, ...)
```

Example 5 (r):
```r
ReadSTARsolo(data.dir, ...)
```

---

## Convert objects to CellDataSet objects — as.CellDataSet • Seurat

**URL:** http://127.0.0.1:9173/reference_as.celldataset.html

**Contents:**
- Convert objects to CellDataSet objects
- Arguments
- Contents

Convert objects to CellDataSet objects

An object to convert to class CellDataSet

Arguments passed to other methods

Name of DimReduc to set to main reducedDim in cds

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/generics.R
```

Example 2 (unknown):
```unknown
R/objects.R
```

Example 3 (unknown):
```unknown
as.CellDataSet.Rd
```

Example 4 (python):
```python
as.CellDataSet(x, ...)

# S3 method for class 'Seurat'
as.CellDataSet(x, assay = NULL, reduction = NULL, ...)
```

Example 5 (r):
```r
as.CellDataSet(x, ...)

# S3 method for class 'Seurat'
as.CellDataSet(x, assay = NULL, reduction = NULL, ...)
```

Example 6 (r):
```r
as.CellDataSet(x, ...)

# S3 method for class 'Seurat'
as.CellDataSet(x, assay = NULL, reduction = NULL, ...)
```

Example 7 (unknown):
```unknown
CellDataSet
```

---

## Get an Assay object from a given Seurat object. — GetAssay • Seurat

**URL:** http://127.0.0.1:9173/seurat/reference/getassay/index.html

**Contents:**
- Get an Assay object from a given Seurat object.
- Arguments
- Value
- Examples
- Contents

Get an Assay object from a given Seurat object.

Arguments passed to other methods

Returns an Assay object

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/generics.R
```

Example 2 (unknown):
```unknown
R/objects.R
```

Example 3 (unknown):
```unknown
GetAssay.Rd
```

Example 4 (python):
```python
GetAssay(object, ...)

# S3 method for class 'Seurat'
GetAssay(object, assay = NULL, ...)
```

Example 5 (r):
```r
GetAssay(object, ...)

# S3 method for class 'Seurat'
GetAssay(object, assay = NULL, ...)
```

Example 6 (r):
```r
GetAssay(object, ...)

# S3 method for class 'Seurat'
GetAssay(object, assay = NULL, ...)
```

Example 7 (unknown):
```unknown
data("pbmc_small")
GetAssay(object = pbmc_small, assay = "RNA")
#> Assay data with 230 features for 80 cells
#> Top 10 variable features:
#>  PPBP, IGLL5, VDAC3, CD1C, AKR1C3, PF4, MYL9, GNLY, TREML1, CA2
```

Example 8 (r):
```r
data("pbmc_small")
GetAssay(object = pbmc_small, assay = "RNA")
#> Assay data with 230 features for 80 cells
#> Top 10 variable features:
#>  PPBP, IGLL5, VDAC3, CD1C, AKR1C3, PF4, MYL9, GNLY, TREML1, CA2
```

Example 9 (r):
```r
data("pbmc_small")
GetAssay(object = pbmc_small, assay = "RNA")
#> Assay data with 230 features for 80 cells
#> Top 10 variable features:
#>  PPBP, IGLL5, VDAC3, CD1C, AKR1C3, PF4, MYL9, GNLY, TREML1, CA2
```

---

## Project Dimensional reduction onto full dataset — ProjectDim • Seurat

**URL:** http://127.0.0.1:9173/reference_projectdim.html

**Contents:**
- Project Dimensional reduction onto full dataset
- Arguments
- Value
- Examples
- Contents

Takes a pre-computed dimensional reduction (typically calculated on a subset of genes) and projects this onto the entire dataset (all genes). Note that the cell loadings will remain unchanged, but now there are gene loadings for all genes.

Number of dims to print features for

Number of features with highest/lowest loadings to print for each dimension

Replace the existing data in feature.loadings

Center the dataset prior to projection (should be set to TRUE)

Print top genes associated with the projected dimensions

Returns Seurat object with the projected values

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/dimensional_reduction.R
```

Example 2 (unknown):
```unknown
ProjectDim.Rd
```

Example 3 (unknown):
```unknown
ProjectDim(
  object,
  reduction = "pca",
  assay = NULL,
  dims.print = 1:5,
  nfeatures.print = 20,
  overwrite = FALSE,
  do.center = FALSE,
  verbose = TRUE
)
```

Example 4 (r):
```r
ProjectDim(
  object,
  reduction = "pca",
  assay = NULL,
  dims.print = 1:5,
  nfeatures.print = 20,
  overwrite = FALSE,
  do.center = FALSE,
  verbose = TRUE
)
```

Example 5 (r):
```r
ProjectDim(
  object,
  reduction = "pca",
  assay = NULL,
  dims.print = 1:5,
  nfeatures.print = 20,
  overwrite = FALSE,
  do.center = FALSE,
  verbose = TRUE
)
```

Example 6 (python):
```python
data("pbmc_small")
pbmc_small
#> An object of class Seurat 
#> 230 features across 80 samples within 1 assay 
#> Active assay: RNA (230 features, 20 variable features)
#>  3 layers present: counts, data, scale.data
#>  2 dimensional reductions calculated: pca, tsne
pbmc_small <- ProjectDim(object = pbmc_small, reduction = "pca")
#> Warning: Requested number is larger than the number of available items (20). Setting to 20.
#> PC_ 1 
#> Positive:  SDPR, PF4, PPBP, TUBB1, CA2, TREML1, MYL9, PGRMC1, RUFY1, PARVB 
#> Negative:  HLA-DPB1, HLA-DQA1, S100A9, S100A8, GNLY, RP11-290F20.3, CD1C, AKR1C3, IGLL5, VDAC3 
#> Warning: Requested number is larger than the number of available items (20). Setting to 20.
#> PC_ 2 
#> Positive:  HLA-DPB1, HLA-DQA1, S100A8, S100A9, CD1C, RP11-290F20.3, PARVB, IGLL5, MYL9, SDPR 
#> Negative:  GNLY, AKR1C3, VDAC3, PGRMC1, TUBB1, PF4, TREML1, RUFY1, CA2, PPBP 
#> Warning: Requested number is larger than the number of available items (20). Setting to 20.
#> PC_ 3 
#> Positive:  S100A9, S100A8, RP11-290F20.3, AKR1C3, PARVB, GNLY, PPBP, PGRMC1, MYL9, TUBB1 
#> Negative:  HLA-DQA1, CD1C, IGLL5, HLA-DPB1, RUFY1, PF4, VDAC3, SDPR, TREML1, CA2 
#> Warning: Requested number is larger than the number of available items (20). Setting to 20.
#> PC_ 4 
#> Positive:  IGLL5, RP11-290F20.3, VDAC3, PPBP, TUBB1, TREML1, PF4, CA2, PARVB, MYL9 
#> Negative:  CD1C, AKR1C3, S100A8, GNLY, HLA-DPB1, HLA-DQA1, S100A9, PGRMC1, RUFY1, SDPR 
#> Warning: Requested number is larger than the number of available items (20). Setting to 20.
#> PC_ 5 
#> Positive:  MYL9, PARVB, IGLL5, TREML1, AKR1C3, PGRMC1, HLA-DPB1, S100A9, TUBB1, PF4 
#> Negative:  VDAC3, RP11-290F20.3, RUFY1, CD1C, HLA-DQA1, CA2, S100A8, PPBP, GNLY, SDPR 
# Visualize top projected genes in heatmap
DimHeatmap(object = pbmc_small, reduction = "pca", dims = 1, balanced = TRUE)
#> Warning: Requested number is larger than the number of available items (20). Setting to 20.
```

Example 7 (r):
```r
data("pbmc_small")
pbmc_small
#> An object of class Seurat 
#> 230 features across 80 samples within 1 assay 
#> Active assay: RNA (230 features, 20 variable features)
#>  3 layers present: counts, data, scale.data
#>  2 dimensional reductions calculated: pca, tsne
pbmc_small <- ProjectDim(object = pbmc_small, reduction = "pca")
#> Warning: Requested number is larger than the number of available items (20). Setting to 20.
#> PC_ 1 
#> Positive:  SDPR, PF4, PPBP, TUBB1, CA2, TREML1, MYL9, PGRMC1, RUFY1, PARVB 
#> Negative:  HLA-DPB1, HLA-DQA1, S100A9, S100A8, GNLY, RP11-290F20.3, CD1C, AKR1C3, IGLL5, VDAC3 
#> Warning: Requested number is larger than the number of available items (20). Setting to 20.
#> PC_ 2 
#> Positive:  HLA-DPB1, HLA-DQA1, S100A8, S100A9, CD1C, RP11-290F20.3, PARVB, IGLL5, MYL9, SDPR 
#> Negative:  GNLY, AKR1C3, VDAC3, PGRMC1, TUBB1, PF4, TREML1, RUFY1, CA2, PPBP 
#> Warning: Requested number is larger than the number of available items (20). Setting to 20.
#> PC_ 3 
#> Positive:  S100A9, S100A8, RP11-290F20.3, AKR1C3, PARVB, GNLY, PPBP, PGRMC1, MYL9, TUBB1 
#> Negative:  HLA-DQA1, CD1C, IGLL5, HLA-DPB1, RUFY1, PF4, VDAC3, SDPR, TREML1, CA2 
#> Warning: Requested number is larger than the number of available items (20). Setting to 20.
#> PC_ 4 
#> Positive:  IGLL5, RP11-290F20.3, VDAC3, PPBP, TUBB1, TREML1, PF4, CA2, PARVB, MYL9 
#> Negative:  CD1C, AKR1C3, S100A8, GNLY, HLA-DPB1, HLA-DQA1, S100A9, PGRMC1, RUFY1, SDPR 
#> Warning: Requested number is larger than the number of available items (20). Setting to 20.
#> PC_ 5 
#> Positive:  MYL9, PARVB, IGLL5, TREML1, AKR1C3, PGRMC1, HLA-DPB1, S100A9, TUBB1, PF4 
#> Negative:  VDAC3, RP11-290F20.3, RUFY1, CD1C, HLA-DQA1, CA2, S100A8, PPBP, GNLY, SDPR 
# Visualize top projected genes in heatmap
DimHeatmap(object = pbmc_small, reduction = "pca", dims = 1, balanced = TRUE)
#> Warning: Requested number is larger than the number of available items (20). Setting to 20.
```

Example 8 (r):
```r
data("pbmc_small")
pbmc_small
#> An object of class Seurat 
#> 230 features across 80 samples within 1 assay 
#> Active assay: RNA (230 features, 20 variable features)
#>  3 layers present: counts, data, scale.data
#>  2 dimensional reductions calculated: pca, tsne
pbmc_small <- ProjectDim(object = pbmc_small, reduction = "pca")
#> Warning: Requested number is larger than the number of available items (20). Setting to 20.
#> PC_ 1 
#> Positive:  SDPR, PF4, PPBP, TUBB1, CA2, TREML1, MYL9, PGRMC1, RUFY1, PARVB 
#> Negative:  HLA-DPB1, HLA-DQA1, S100A9, S100A8, GNLY, RP11-290F20.3, CD1C, AKR1C3, IGLL5, VDAC3 
#> Warning: Requested number is larger than the number of available items (20). Setting to 20.
#> PC_ 2 
#> Positive:  HLA-DPB1, HLA-DQA1, S100A8, S100A9, CD1C, RP11-290F20.3, PARVB, IGLL5, MYL9, SDPR 
#> Negative:  GNLY, AKR1C3, VDAC3, PGRMC1, TUBB1, PF4, TREML1, RUFY1, CA2, PPBP 
#> Warning: Requested number is larger than the number of available items (20). Setting to 20.
#> PC_ 3 
#> Positive:  S100A9, S100A8, RP11-290F20.3, AKR1C3, PARVB, GNLY, PPBP, PGRMC1, MYL9, TUBB1 
#> Negative:  HLA-DQA1, CD1C, IGLL5, HLA-DPB1, RUFY1, PF4, VDAC3, SDPR, TREML1, CA2 
#> Warning: Requested number is larger than the number of available items (20). Setting to 20.
#> PC_ 4 
#> Positive:  IGLL5, RP11-290F20.3, VDAC3, PPBP, TUBB1, TREML1, PF4, CA2, PARVB, MYL9 
#> Negative:  CD1C, AKR1C3, S100A8, GNLY, HLA-DPB1, HLA-DQA1, S100A9, PGRMC1, RUFY1, SDPR 
#> Warning: Requested number is larger than the number of available items (20). Setting to 20.
#> PC_ 5 
#> Positive:  MYL9, PARVB, IGLL5, TREML1, AKR1C3, PGRMC1, HLA-DPB1, S100A9, TUBB1, PF4 
#> Negative:  VDAC3, RP11-290F20.3, RUFY1, CD1C, HLA-DQA1, CA2, S100A8, PPBP, GNLY, SDPR 
# Visualize top projected genes in heatmap
DimHeatmap(object = pbmc_small, reduction = "pca", dims = 1, balanced = TRUE)
#> Warning: Requested number is larger than the number of available items (20). Setting to 20.
```

---

## Augments ggplot2-based plot with a PNG image. — AugmentPlot • Seurat

**URL:** http://127.0.0.1:9173/seurat/reference/augmentplot/index.html

**Contents:**
- Augments ggplot2-based plot with a PNG image.
- Arguments
- Value
- Examples
- Contents

Creates "vector-friendly" plots. Does this by saving a copy of the plot as a PNG file, then adding the PNG image with annotation_raster to a blank plot of the same dimensions as plot. Please note: original legends and axes will be lost during augmentation.

Width and height of PNG version of plot

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/visualization.R
```

Example 2 (unknown):
```unknown
AugmentPlot.Rd
```

Example 3 (unknown):
```unknown
annotation_raster
```

Example 4 (unknown):
```unknown
AugmentPlot(plot, width = 10, height = 10, dpi = 100)
```

Example 5 (r):
```r
AugmentPlot(plot, width = 10, height = 10, dpi = 100)
```

Example 6 (r):
```r
AugmentPlot(plot, width = 10, height = 10, dpi = 100)
```

Example 7 (unknown):
```unknown
if (FALSE) { # \dontrun{
data("pbmc_small")
plot <- DimPlot(object = pbmc_small)
AugmentPlot(plot = plot)
} # }
```

Example 8 (r):
```r
if (FALSE) { # \dontrun{
data("pbmc_small")
plot <- DimPlot(object = pbmc_small)
AugmentPlot(plot = plot)
} # }
```

Example 9 (r):
```r
if (FALSE) { # \dontrun{
data("pbmc_small")
plot <- DimPlot(object = pbmc_small)
AugmentPlot(plot = plot)
} # }
```

---

## Splits object into a list of subsetted objects. — SplitObject • Seurat

**URL:** http://127.0.0.1:9173/reference_splitobject.html

**Contents:**
- Splits object into a list of subsetted objects.
- Arguments
- Value
- Examples
- Contents

Splits object based on a single attribute into a list of subsetted objects, one for each level of the attribute. For example, useful for taking an object that contains cells from many patients, and subdividing it into patient-specific objects.

Attribute for splitting. Default is "ident". Currently only supported for class-level (i.e. non-quantitative) attributes.

A named list of Seurat objects, each containing a subset of cells from the original object.

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/objects.R
```

Example 2 (unknown):
```unknown
SplitObject.Rd
```

Example 3 (unknown):
```unknown
SplitObject(object, split.by = "ident")
```

Example 4 (r):
```r
SplitObject(object, split.by = "ident")
```

Example 5 (r):
```r
SplitObject(object, split.by = "ident")
```

Example 6 (python):
```python
data("pbmc_small")
# Assign the test object a three level attribute
groups <- sample(c("group1", "group2", "group3"), size = 80, replace = TRUE)
names(groups) <- colnames(pbmc_small)
pbmc_small <- AddMetaData(object = pbmc_small, metadata = groups, col.name = "group")
obj.list <- SplitObject(pbmc_small, split.by = "group")
```

Example 7 (r):
```r
data("pbmc_small")
# Assign the test object a three level attribute
groups <- sample(c("group1", "group2", "group3"), size = 80, replace = TRUE)
names(groups) <- colnames(pbmc_small)
pbmc_small <- AddMetaData(object = pbmc_small, metadata = groups, col.name = "group")
obj.list <- SplitObject(pbmc_small, split.by = "group")
```

Example 8 (r):
```r
data("pbmc_small")
# Assign the test object a three level attribute
groups <- sample(c("group1", "group2", "group3"), size = 80, replace = TRUE)
names(groups) <- colnames(pbmc_small)
pbmc_small <- AddMetaData(object = pbmc_small, metadata = groups, col.name = "group")
obj.list <- SplitObject(pbmc_small, split.by = "group")
```

---

## Calculate a perturbation Signature — CalcPerturbSig • Seurat

**URL:** http://127.0.0.1:9173/reference_calcperturbsig.html

**Contents:**
- Calculate a perturbation Signature
- Arguments
- Value
- Contents

Function to calculate perturbation signature for pooled CRISPR screen datasets. For each target cell (expressing one target gRNA), we identified 20 cells from the control pool (non-targeting cells) with the most similar mRNA expression profiles. The perturbation signature is calculated by subtracting the averaged mRNA expression profile of the non-targeting neighbors from the mRNA expression profile of the target cell.

An object of class Seurat.

Name of Assay PRTB signature is being calculated on.

Features to compute PRTB signature for. Defaults to the variable features set in the assay specified.

Data slot to use for PRTB signature calculation.

Metadata column containing target gene classification.

Non-targeting gRNA cell classification identity.

Provide metadata column if multiple biological replicates exist to calculate PRTB signature for every replicate separately.

Number of nearest neighbors to consider.

Reduction method used to calculate nearest neighbors.

Number of dimensions to use from dimensionality reduction method.

Name for the new assay.

Display progress + messages

Returns a Seurat object with a new assay added containing the perturbation signature for all cells in the data slot.

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/mixscape.R
```

Example 2 (unknown):
```unknown
CalcPerturbSig.Rd
```

Example 3 (python):
```python
CalcPerturbSig(
  object,
  assay = NULL,
  features = NULL,
  slot = "data",
  gd.class = "guide_ID",
  nt.cell.class = "NT",
  split.by = NULL,
  num.neighbors = NULL,
  reduction = "pca",
  ndims = 15,
  new.assay.name = "PRTB",
  verbose = TRUE
)
```

Example 4 (r):
```r
CalcPerturbSig(
  object,
  assay = NULL,
  features = NULL,
  slot = "data",
  gd.class = "guide_ID",
  nt.cell.class = "NT",
  split.by = NULL,
  num.neighbors = NULL,
  reduction = "pca",
  ndims = 15,
  new.assay.name = "PRTB",
  verbose = TRUE
)
```

Example 5 (r):
```r
CalcPerturbSig(
  object,
  assay = NULL,
  features = NULL,
  slot = "data",
  gd.class = "guide_ID",
  nt.cell.class = "NT",
  split.by = NULL,
  num.neighbors = NULL,
  reduction = "pca",
  ndims = 15,
  new.assay.name = "PRTB",
  verbose = TRUE
)
```

---

## Move outliers towards center on dimension reduction plot — CollapseEmbeddingOutliers • Seurat

**URL:** http://127.0.0.1:9173/reference_collapseembeddingoutliers.html

**Contents:**
- Move outliers towards center on dimension reduction plot
- Arguments
- Value
- Examples
- Contents

Move outliers towards center on dimension reduction plot

Name of DimReduc to adjust

Dimensions to visualize

Group (color) cells in different ways (for example, orig.ident)

Controls the outlier distance

Key for DimReduc that is returned

Returns a DimReduc object with the modified embeddings

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/visualization.R
```

Example 2 (unknown):
```unknown
CollapseEmbeddingOutliers.Rd
```

Example 3 (unknown):
```unknown
CollapseEmbeddingOutliers(
  object,
  reduction = "umap",
  dims = 1:2,
  group.by = "ident",
  outlier.sd = 2,
  reduction.key = "UMAP_"
)
```

Example 4 (r):
```r
CollapseEmbeddingOutliers(
  object,
  reduction = "umap",
  dims = 1:2,
  group.by = "ident",
  outlier.sd = 2,
  reduction.key = "UMAP_"
)
```

Example 5 (r):
```r
CollapseEmbeddingOutliers(
  object,
  reduction = "umap",
  dims = 1:2,
  group.by = "ident",
  outlier.sd = 2,
  reduction.key = "UMAP_"
)
```

Example 6 (unknown):
```unknown
if (FALSE) { # \dontrun{
data("pbmc_small")
pbmc_small <- FindClusters(pbmc_small, resolution = 1.1)
pbmc_small <- RunUMAP(pbmc_small, dims = 1:5)
DimPlot(pbmc_small, reduction = "umap")
pbmc_small[["umap_new"]] <- CollapseEmbeddingOutliers(pbmc_small,
    reduction = "umap", reduction.key = 'umap_', outlier.sd = 0.5)
DimPlot(pbmc_small, reduction = "umap_new")
} # }
```

Example 7 (r):
```r
if (FALSE) { # \dontrun{
data("pbmc_small")
pbmc_small <- FindClusters(pbmc_small, resolution = 1.1)
pbmc_small <- RunUMAP(pbmc_small, dims = 1:5)
DimPlot(pbmc_small, reduction = "umap")
pbmc_small[["umap_new"]] <- CollapseEmbeddingOutliers(pbmc_small,
    reduction = "umap", reduction.key = 'umap_', outlier.sd = 0.5)
DimPlot(pbmc_small, reduction = "umap_new")
} # }
```

Example 8 (r):
```r
if (FALSE) { # \dontrun{
data("pbmc_small")
pbmc_small <- FindClusters(pbmc_small, resolution = 1.1)
pbmc_small <- RunUMAP(pbmc_small, dims = 1:5)
DimPlot(pbmc_small, reduction = "umap")
pbmc_small[["umap_new"]] <- CollapseEmbeddingOutliers(pbmc_small,
    reduction = "umap", reduction.key = 'umap_', outlier.sd = 0.5)
DimPlot(pbmc_small, reduction = "umap_new")
} # }
```

---

## Prepare an object list normalized with sctransform for integration. — PrepSCTIntegration • Seurat

**URL:** http://127.0.0.1:9173/reference_prepsctintegration.html

**Contents:**
- Prepare an object list normalized with sctransform for integration.
- Arguments
- Value
- Examples
- Contents

This function takes in a list of objects that have been normalized with the SCTransform method and performs the following steps:

If anchor.features is a numeric value, calls SelectIntegrationFeatures to determine the features to use in the downstream integration procedure.

Ensures that the sctransform residuals for the features specified to anchor.features are present in each object in the list. This is necessary because the default behavior of SCTransform is to only store the residuals for the features determined to be variable. Residuals are recomputed for missing features using the stored model parameters via the GetResidual function.

Subsets the scale.data slot to only contain the residuals for anchor.features for efficiency in downstream processing.

A list of Seurat objects to prepare for integration

The name of the Assay to use for integration. This can be a single name if all the assays to be integrated have the same name, or a character vector containing the name of each Assay in each object to be integrated. The specified assays must have been normalized using SCTransform. If NULL (default), the current default assay for each object is used.

A numeric value. This will call SelectIntegrationFeatures to select the provided number of features to be used in anchor finding

A vector of features to be used as input to the anchor finding process

Numeric of length two specifying the min and max values the Pearson residual will be clipped to

Display output/messages

A list of Seurat objects with the appropriate scale.data slots containing only the required anchor.features.

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/integration.R
```

Example 2 (unknown):
```unknown
PrepSCTIntegration.Rd
```

Example 3 (unknown):
```unknown
SCTransform
```

Example 4 (unknown):
```unknown
SelectIntegrationFeatures
```

Example 5 (unknown):
```unknown
SCTransform
```

Example 6 (unknown):
```unknown
GetResidual
```

Example 7 (unknown):
```unknown
PrepSCTIntegration(
  object.list,
  assay = NULL,
  anchor.features = 2000,
  sct.clip.range = NULL,
  verbose = TRUE
)
```

Example 8 (r):
```r
PrepSCTIntegration(
  object.list,
  assay = NULL,
  anchor.features = 2000,
  sct.clip.range = NULL,
  verbose = TRUE
)
```

Example 9 (r):
```r
PrepSCTIntegration(
  object.list,
  assay = NULL,
  anchor.features = 2000,
  sct.clip.range = NULL,
  verbose = TRUE
)
```

Example 10 (unknown):
```unknown
SCTransform
```

Example 11 (unknown):
```unknown
SelectIntegrationFeatures
```

Example 12 (unknown):
```unknown
anchor.features
```

Example 13 (unknown):
```unknown
if (FALSE) { # \dontrun{
# to install the SeuratData package see https://github.com/satijalab/seurat-data
library(SeuratData)
data("panc8")

# panc8 is a merged Seurat object containing 8 separate pancreas datasets
# split the object by dataset and take the first 2 to integrate
pancreas.list <- SplitObject(panc8, split.by = "tech")[1:2]

# perform SCTransform normalization
pancreas.list <- lapply(X = pancreas.list, FUN = SCTransform)

# select integration features and prep step
features <- SelectIntegrationFeatures(pancreas.list)
pancreas.list <- PrepSCTIntegration(
  pancreas.list,
  anchor.features = features
)

# downstream integration steps
anchors <- FindIntegrationAnchors(
  pancreas.list,
  normalization.method = "SCT",
  anchor.features = features
)
pancreas.integrated <- IntegrateData(anchors, normalization.method = "SCT")
} # }
```

Example 14 (r):
```r
if (FALSE) { # \dontrun{
# to install the SeuratData package see https://github.com/satijalab/seurat-data
library(SeuratData)
data("panc8")

# panc8 is a merged Seurat object containing 8 separate pancreas datasets
# split the object by dataset and take the first 2 to integrate
pancreas.list <- SplitObject(panc8, split.by = "tech")[1:2]

# perform SCTransform normalization
pancreas.list <- lapply(X = pancreas.list, FUN = SCTransform)

# select integration features and prep step
features <- SelectIntegrationFeatures(pancreas.list)
pancreas.list <- PrepSCTIntegration(
  pancreas.list,
  anchor.features = features
)

# downstream integration steps
anchors <- FindIntegrationAnchors(
  pancreas.list,
  normalization.method = "SCT",
  anchor.features = features
)
pancreas.integrated <- IntegrateData(anchors, normalization.method = "SCT")
} # }
```

Example 15 (r):
```r
if (FALSE) { # \dontrun{
# to install the SeuratData package see https://github.com/satijalab/seurat-data
library(SeuratData)
data("panc8")

# panc8 is a merged Seurat object containing 8 separate pancreas datasets
# split the object by dataset and take the first 2 to integrate
pancreas.list <- SplitObject(panc8, split.by = "tech")[1:2]

# perform SCTransform normalization
pancreas.list <- lapply(X = pancreas.list, FUN = SCTransform)

# select integration features and prep step
features <- SelectIntegrationFeatures(pancreas.list)
pancreas.list <- PrepSCTIntegration(
  pancreas.list,
  anchor.features = features
)

# downstream integration steps
anchors <- FindIntegrationAnchors(
  pancreas.list,
  normalization.method = "SCT",
  anchor.features = features
)
pancreas.integrated <- IntegrateData(anchors, normalization.method = "SCT")
} # }
```

---

## Calculate the standard deviation of logged values — ExpSD • Seurat

**URL:** http://127.0.0.1:9173/seurat/reference/expsd/index.html

**Contents:**
- Calculate the standard deviation of logged values
- Arguments
- Value
- Examples
- Contents

Calculate SD of logged values in non-log space (return answer in log-space)

Returns the standard deviation in log-space

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/utilities.R
```

Example 2 (unknown):
```unknown
ExpSD(x = c(1, 2, 3))
#> [1] 2.301323
```

Example 3 (r):
```r
ExpSD(x = c(1, 2, 3))
#> [1] 2.301323
```

Example 4 (r):
```r
ExpSD(x = c(1, 2, 3))
#> [1] 2.301323
```

---

## The Graph Class — Graph-class • Seurat

**URL:** http://127.0.0.1:9173/seurat/reference/graph-class/index.html

**Contents:**
- The Graph Class
- See also
- Contents

For more details, please see the documentation in SeuratObject

SeuratObject::Graph-class

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/reexports.R
```

Example 2 (unknown):
```unknown
Graph-class.Rd
```

Example 3 (unknown):
```unknown
SeuratObject
```

Example 4 (unknown):
```unknown
SeuratObject::Graph-class
```

---

## Get Tissue Coordinates — GetTissueCoordinates.SlideSeq • Seurat

**URL:** http://127.0.0.1:9173/reference_gettissuecoordinates.html

**Contents:**
- Get Tissue Coordinates
- Arguments
- See also
- Contents

Get Tissue Coordinates

Arguments passed to other methods

return qhulls instead of centroids

A factor to scale the coordinates by; choose from: 'tissue', 'fiducial', 'hires', 'lowres', or NULL for no scaling

Columns of tissue coordinates data.frame to pull

SeuratObject::GetTissueCoordinates

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/objects.R
```

Example 2 (unknown):
```unknown
GetTissueCoordinates.Rd
```

Example 3 (python):
```python
# S3 method for class 'SlideSeq'
GetTissueCoordinates(object, ...)

# S3 method for class 'STARmap'
GetTissueCoordinates(object, qhulls = FALSE, ...)

# S3 method for class 'VisiumV1'
GetTissueCoordinates(
  object,
  scale = "lowres",
  cols = c("imagerow", "imagecol"),
  ...
)

# S3 method for class 'VisiumV2'
GetTissueCoordinates(object, scale = NULL, ...)
```

Example 4 (r):
```r
# S3 method for class 'SlideSeq'
GetTissueCoordinates(object, ...)

# S3 method for class 'STARmap'
GetTissueCoordinates(object, qhulls = FALSE, ...)

# S3 method for class 'VisiumV1'
GetTissueCoordinates(
  object,
  scale = "lowres",
  cols = c("imagerow", "imagecol"),
  ...
)

# S3 method for class 'VisiumV2'
GetTissueCoordinates(object, scale = NULL, ...)
```

Example 5 (r):
```r
# S3 method for class 'SlideSeq'
GetTissueCoordinates(object, ...)

# S3 method for class 'STARmap'
GetTissueCoordinates(object, qhulls = FALSE, ...)

# S3 method for class 'VisiumV1'
GetTissueCoordinates(
  object,
  scale = "lowres",
  cols = c("imagerow", "imagecol"),
  ...
)

# S3 method for class 'VisiumV2'
GetTissueCoordinates(object, scale = NULL, ...)
```

Example 6 (unknown):
```unknown
SeuratObject::GetTissueCoordinates
```

---

## The DimReduc Class — DimReduc-class • Seurat

**URL:** http://127.0.0.1:9173/reference_dimreduc-class.html

**Contents:**
- The DimReduc Class
- See also
- Contents

The DimReduc object stores a dimensionality reduction taken out in Seurat; for more details, please see the documentation in SeuratObject

SeuratObject::DimReduc-class

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/reexports.R
```

Example 2 (unknown):
```unknown
DimReduc-class.Rd
```

Example 3 (unknown):
```unknown
SeuratObject
```

Example 4 (unknown):
```unknown
SeuratObject::DimReduc-class
```

---

## Find transfer anchors — FindTransferAnchors • Seurat

**URL:** http://127.0.0.1:9173/reference_findtransferanchors.html

**Contents:**
- Find transfer anchors
- Arguments
- Value
- Details
- References
- Examples
- Contents

Find a set of anchors between a reference and query object. These anchors can later be used to transfer data from the reference to query object using the TransferData object.

Seurat object to use as the reference

Seurat object to use as the query

Name of normalization method used: LogNormalize or SCT.

If using SCT as a normalization method, compute query Pearson residuals using the reference SCT model parameters.

Name of the Assay to use from reference

Name of the Neighbor to use from the reference. Optionally enables reuse of precomputed neighbors.

Name of the Assay to use from query

Dimensional reduction to perform when finding anchors. Options are:

pcaproject: Project the PCA from the reference onto the query. We recommend using PCA when reference and query datasets are from scRNA-seq

lsiproject: Project the LSI from the reference onto the query. We recommend using LSI when reference and query datasets are from scATAC-seq. This requires that LSI has been computed for the reference dataset, and the same features (eg, peaks or genome bins) are present in both the reference and query. See RunTFIDF and RunSVD

rpca: Project the PCA from the reference onto the query, and the PCA from the query onto the reference (reciprocal PCA projection).

cca: Run a CCA on the reference and query

Name of dimensional reduction to use from the reference if running the pcaproject workflow. Optionally enables reuse of precomputed reference dimensional reduction. If NULL (default), use a PCA computed on the reference object.

Project the PCA from the query dataset onto the reference. Use only in rare cases where the query dataset has a much larger cell number, but the reference dataset has a unique assay for transfer. In this case, the default features will be set to the variable features of the query object that are alos present in the reference.

Features to use for dimensional reduction. If not specified, set as variable features of the reference object which are also present in the query.

Number of PCs to compute on reference if reference.reduction is not provided.

Perform L2 normalization on the cell embeddings after dimensional reduction

Which dimensions to use from the reduction to specify the neighbor search space

How many neighbors (k) to use when finding anchors

How many neighbors (k) to use when filtering anchors. Set to NA to turn off filtering.

How many neighbors (k) to use when scoring anchors

The maximum number of features to use when specifying the neighborhood search space in the anchor filtering

Method for nearest neighbor finding. Options include: rann, annoy

More trees gives higher precision when using annoy approximate nearest neighbor search

Error bound on the neighbor finding algorithm (from RANN or RcppAnnoy)

Use truncated singular value decomposition to approximate PCA

Compute and store nearest k query neighbors in the AnchorSet object that is returned. You can optionally set this if you plan on computing the mapping score and want to enable reuse of some downstream neighbor calculations to make the mapping score function more efficient.

Print progress bars and output

Returns an AnchorSet object that can be used as input to TransferData, IntegrateEmbeddings and MapQuery. The dimension reduction used for finding anchors is stored in the AnchorSet object and can be used for computing anchor weights in downstream functions. Note that only the requested dimensions are stored in the dimension reduction object in the AnchorSet. This means that if dims=2:20 is used, for example, the dimension of the stored reduction is 1:19.

The main steps of this procedure are outlined below. For a more detailed description of the methodology, please see Stuart, Butler, et al Cell 2019. doi:10.1016/j.cell.2019.05.031 ; doi:10.1101/460147

Perform dimensional reduction. Exactly what is done here depends on the values set for the reduction and project.query parameters. If reduction = "pcaproject", a PCA is performed on either the reference (if project.query = FALSE) or the query (if project.query = TRUE), using the features specified. The data from the other dataset is then projected onto this learned PCA structure. If reduction = "cca", then CCA is performed on the reference and query for this dimensional reduction step. If reduction = "lsiproject", the stored LSI dimension reduction in the reference object is used to project the query dataset onto the reference. If l2.norm is set to TRUE, perform L2 normalization of the embedding vectors.

Identify anchors between the reference and query - pairs of cells from each dataset that are contained within each other's neighborhoods (also known as mutual nearest neighbors).

Filter low confidence anchors to ensure anchors in the low dimension space are in broad agreement with the high dimensional measurements. This is done by looking at the neighbors of each query cell in the reference dataset using max.features to define this space. If the reference cell isn't found within the first k.filter neighbors, remove the anchor.

Assign each remaining anchor a score. For each anchor cell, determine the nearest k.score anchors within its own dataset and within its pair's dataset. Based on these neighborhoods, construct an overall neighbor graph and then compute the shared neighbor overlap between anchor and query cells (analogous to an SNN graph). We use the 0.01 and 0.90 quantiles on these scores to dampen outlier effects and rescale to range between 0-1.

Stuart T, Butler A, et al. Comprehensive Integration of Single-Cell Data. Cell. 2019;177:1888-1902 doi:10.1016/j.cell.2019.05.031 ;

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/integration.R
```

Example 2 (unknown):
```unknown
FindTransferAnchors.Rd
```

Example 3 (unknown):
```unknown
TransferData
```

Example 4 (unknown):
```unknown
FindTransferAnchors(
  reference,
  query,
  normalization.method = "LogNormalize",
  recompute.residuals = TRUE,
  reference.assay = NULL,
  reference.neighbors = NULL,
  query.assay = NULL,
  reduction = "pcaproject",
  reference.reduction = NULL,
  project.query = FALSE,
  features = NULL,
  scale = TRUE,
  npcs = 30,
  l2.norm = TRUE,
  dims = 1:30,
  k.anchor = 5,
  k.filter = NA,
  k.score = 30,
  max.features = 200,
  nn.method = "annoy",
  n.trees = 50,
  eps = 0,
  approx.pca = TRUE,
  mapping.score.k = NULL,
  verbose = TRUE
)
```

Example 5 (r):
```r
FindTransferAnchors(
  reference,
  query,
  normalization.method = "LogNormalize",
  recompute.residuals = TRUE,
  reference.assay = NULL,
  reference.neighbors = NULL,
  query.assay = NULL,
  reduction = "pcaproject",
  reference.reduction = NULL,
  project.query = FALSE,
  features = NULL,
  scale = TRUE,
  npcs = 30,
  l2.norm = TRUE,
  dims = 1:30,
  k.anchor = 5,
  k.filter = NA,
  k.score = 30,
  max.features = 200,
  nn.method = "annoy",
  n.trees = 50,
  eps = 0,
  approx.pca = TRUE,
  mapping.score.k = NULL,
  verbose = TRUE
)
```

Example 6 (r):
```r
FindTransferAnchors(
  reference,
  query,
  normalization.method = "LogNormalize",
  recompute.residuals = TRUE,
  reference.assay = NULL,
  reference.neighbors = NULL,
  query.assay = NULL,
  reduction = "pcaproject",
  reference.reduction = NULL,
  project.query = FALSE,
  features = NULL,
  scale = TRUE,
  npcs = 30,
  l2.norm = TRUE,
  dims = 1:30,
  k.anchor = 5,
  k.filter = NA,
  k.score = 30,
  max.features = 200,
  nn.method = "annoy",
  n.trees = 50,
  eps = 0,
  approx.pca = TRUE,
  mapping.score.k = NULL,
  verbose = TRUE
)
```

Example 7 (unknown):
```unknown
TransferData
```

Example 8 (unknown):
```unknown
IntegrateEmbeddings
```

Example 9 (unknown):
```unknown
project.query
```

Example 10 (unknown):
```unknown
reduction = "pcaproject"
```

Example 11 (unknown):
```unknown
project.query = FALSE
```

Example 12 (unknown):
```unknown
project.query = TRUE
```

Example 13 (unknown):
```unknown
reduction = "cca"
```

Example 14 (unknown):
```unknown
reduction = "lsiproject"
```

Example 15 (unknown):
```unknown
max.features
```

Example 16 (python):
```python
if (FALSE) { # \dontrun{
# to install the SeuratData package see https://github.com/satijalab/seurat-data
library(SeuratData)
data("pbmc3k")

# for demonstration, split the object into reference and query
pbmc.reference <- pbmc3k[, 1:1350]
pbmc.query <- pbmc3k[, 1351:2700]

# perform standard preprocessing on each object
pbmc.reference <- NormalizeData(pbmc.reference)
pbmc.reference <- FindVariableFeatures(pbmc.reference)
pbmc.reference <- ScaleData(pbmc.reference)

pbmc.query <- NormalizeData(pbmc.query)
pbmc.query <- FindVariableFeatures(pbmc.query)
pbmc.query <- ScaleData(pbmc.query)

# find anchors
anchors <- FindTransferAnchors(reference = pbmc.reference, query = pbmc.query)

# transfer labels
predictions <- TransferData(
  anchorset = anchors,
  refdata = pbmc.reference$seurat_annotations
)
pbmc.query <- AddMetaData(object = pbmc.query, metadata = predictions)
} # }
```

Example 17 (r):
```r
if (FALSE) { # \dontrun{
# to install the SeuratData package see https://github.com/satijalab/seurat-data
library(SeuratData)
data("pbmc3k")

# for demonstration, split the object into reference and query
pbmc.reference <- pbmc3k[, 1:1350]
pbmc.query <- pbmc3k[, 1351:2700]

# perform standard preprocessing on each object
pbmc.reference <- NormalizeData(pbmc.reference)
pbmc.reference <- FindVariableFeatures(pbmc.reference)
pbmc.reference <- ScaleData(pbmc.reference)

pbmc.query <- NormalizeData(pbmc.query)
pbmc.query <- FindVariableFeatures(pbmc.query)
pbmc.query <- ScaleData(pbmc.query)

# find anchors
anchors <- FindTransferAnchors(reference = pbmc.reference, query = pbmc.query)

# transfer labels
predictions <- TransferData(
  anchorset = anchors,
  refdata = pbmc.reference$seurat_annotations
)
pbmc.query <- AddMetaData(object = pbmc.query, metadata = predictions)
} # }
```

Example 18 (r):
```r
if (FALSE) { # \dontrun{
# to install the SeuratData package see https://github.com/satijalab/seurat-data
library(SeuratData)
data("pbmc3k")

# for demonstration, split the object into reference and query
pbmc.reference <- pbmc3k[, 1:1350]
pbmc.query <- pbmc3k[, 1351:2700]

# perform standard preprocessing on each object
pbmc.reference <- NormalizeData(pbmc.reference)
pbmc.reference <- FindVariableFeatures(pbmc.reference)
pbmc.reference <- ScaleData(pbmc.reference)

pbmc.query <- NormalizeData(pbmc.query)
pbmc.query <- FindVariableFeatures(pbmc.query)
pbmc.query <- ScaleData(pbmc.query)

# find anchors
anchors <- FindTransferAnchors(reference = pbmc.reference, query = pbmc.query)

# transfer labels
predictions <- TransferData(
  anchorset = anchors,
  refdata = pbmc.reference$seurat_annotations
)
pbmc.query <- AddMetaData(object = pbmc.query, metadata = predictions)
} # }
```

---

## Integrate data — IntegrateData • Seurat

**URL:** http://127.0.0.1:9173/seurat/reference/integratedata/index.html

**Contents:**
- Integrate data
- Arguments
- Value
- Details
- References
- Examples
- Contents

Perform dataset integration using a pre-computed AnchorSet.

An AnchorSet object generated by FindIntegrationAnchors

Name for the new assay containing the integrated data

Name of normalization method used: LogNormalize or SCT

Vector of features to use when computing the PCA to determine the weights. Only set if you want a different set from those used in the anchor finding process

Vector of features to integrate. By default, will use the features used in anchor finding.

Number of dimensions to use in the anchor weighting procedure

Number of neighbors to consider when weighting anchors

Dimension reduction to use when calculating anchor weights. This can be one of:

A string, specifying the name of a dimension reduction present in all objects to be integrated

A vector of strings, specifying the name of a dimension reduction to use for each object to be integrated

A vector of DimReduc objects, specifying the object to use for each object in the integration

NULL, in which case a new PCA will be calculated and used to calculate anchor weights

Note that, if specified, the requested dimension reduction will only be used for calculating anchor weights in the first merge between reference and query, as the merged object will subsequently contain more cells than was in query, and weights will need to be calculated for all cells in the object.

Controls the bandwidth of the Gaussian kernel for weighting

Specify the order of integration. Order of integration should be encoded in a matrix, where each row represents one of the pairwise integration steps. Negative numbers specify a dataset, positive numbers specify the integration results from a given row (the format of the merge matrix included in the hclust function output). For example: matrix(c(-2, 1, -3, -1), ncol = 2) gives:

Which would cause dataset 2 and 3 to be integrated first, then the resulting object integrated with dataset 1.

If NULL, the sample tree will be computed automatically.

Do not reorder objects based on size for each pairwise integration.

Error bound on the neighbor finding algorithm (from RANN)

Print progress bars and output

Returns a Seurat object with a new integrated Assay. If normalization.method = "LogNormalize", the integrated data is returned to the data slot and can be treated as log-normalized, corrected data. If normalization.method = "SCT", the integrated data is returned to the scale.data slot and can be treated as centered, corrected Pearson residuals.

The main steps of this procedure are outlined below. For a more detailed description of the methodology, please see Stuart, Butler, et al Cell 2019. doi:10.1016/j.cell.2019.05.031 ; doi:10.1101/460147

For pairwise integration:

Construct a weights matrix that defines the association between each query cell and each anchor. These weights are computed as 1 - the distance between the query cell and the anchor divided by the distance of the query cell to the k.weightth anchor multiplied by the anchor score computed in FindIntegrationAnchors. We then apply a Gaussian kernel width a bandwidth defined by sd.weight and normalize across all k.weight anchors.

Compute the anchor integration matrix as the difference between the two expression matrices for every pair of anchor cells

Compute the transformation matrix as the product of the integration matrix and the weights matrix.

Subtract the transformation matrix from the original expression matrix.

For multiple dataset integration, we perform iterative pairwise integration. To determine the order of integration (if not specified via sample.tree), we

Define a distance between datasets as the total number of cells in the smaller dataset divided by the total number of anchors between the two datasets.

Compute all pairwise distances between datasets

Cluster this distance matrix to determine a guide tree

Stuart T, Butler A, et al. Comprehensive Integration of Single-Cell Data. Cell. 2019;177:1888-1902 doi:10.1016/j.cell.2019.05.031

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/integration.R
```

Example 2 (unknown):
```unknown
IntegrateData.Rd
```

Example 3 (unknown):
```unknown
IntegrateData(
  anchorset,
  new.assay.name = "integrated",
  normalization.method = c("LogNormalize", "SCT"),
  features = NULL,
  features.to.integrate = NULL,
  dims = 1:30,
  k.weight = 100,
  weight.reduction = NULL,
  sd.weight = 1,
  sample.tree = NULL,
  preserve.order = FALSE,
  eps = 0,
  verbose = TRUE
)
```

Example 4 (r):
```r
IntegrateData(
  anchorset,
  new.assay.name = "integrated",
  normalization.method = c("LogNormalize", "SCT"),
  features = NULL,
  features.to.integrate = NULL,
  dims = 1:30,
  k.weight = 100,
  weight.reduction = NULL,
  sd.weight = 1,
  sample.tree = NULL,
  preserve.order = FALSE,
  eps = 0,
  verbose = TRUE
)
```

Example 5 (r):
```r
IntegrateData(
  anchorset,
  new.assay.name = "integrated",
  normalization.method = c("LogNormalize", "SCT"),
  features = NULL,
  features.to.integrate = NULL,
  dims = 1:30,
  k.weight = 100,
  weight.reduction = NULL,
  sd.weight = 1,
  sample.tree = NULL,
  preserve.order = FALSE,
  eps = 0,
  verbose = TRUE
)
```

Example 6 (unknown):
```unknown
FindIntegrationAnchors
```

Example 7 (unknown):
```unknown
matrix(c(-2, 1, -3, -1), ncol = 2)
```

Example 8 (unknown):
```unknown
[,1]  [,2]
       [1,]   -2   -3
       [2,]    1   -1
```

Example 9 (unknown):
```unknown
[,1]  [,2]
       [1,]   -2   -3
       [2,]    1   -1
```

Example 10 (unknown):
```unknown
[,1]  [,2]
       [1,]   -2   -3
       [2,]    1   -1
```

Example 11 (unknown):
```unknown
normalization.method = "LogNormalize"
```

Example 12 (unknown):
```unknown
normalization.method = "SCT"
```

Example 13 (unknown):
```unknown
FindIntegrationAnchors
```

Example 14 (unknown):
```unknown
sample.tree
```

Example 15 (unknown):
```unknown
if (FALSE) { # \dontrun{
# to install the SeuratData package see https://github.com/satijalab/seurat-data
library(SeuratData)
data("panc8")

# panc8 is a merged Seurat object containing 8 separate pancreas datasets
# split the object by dataset
pancreas.list <- SplitObject(panc8, split.by = "tech")

# perform standard preprocessing on each object
for (i in 1:length(pancreas.list)) {
  pancreas.list[[i]] <- NormalizeData(pancreas.list[[i]], verbose = FALSE)
  pancreas.list[[i]] <- FindVariableFeatures(
    pancreas.list[[i]], selection.method = "vst",
    nfeatures = 2000, verbose = FALSE
  )
}

# find anchors
anchors <- FindIntegrationAnchors(object.list = pancreas.list)

# integrate data
integrated <- IntegrateData(anchorset = anchors)
} # }
```

Example 16 (r):
```r
if (FALSE) { # \dontrun{
# to install the SeuratData package see https://github.com/satijalab/seurat-data
library(SeuratData)
data("panc8")

# panc8 is a merged Seurat object containing 8 separate pancreas datasets
# split the object by dataset
pancreas.list <- SplitObject(panc8, split.by = "tech")

# perform standard preprocessing on each object
for (i in 1:length(pancreas.list)) {
  pancreas.list[[i]] <- NormalizeData(pancreas.list[[i]], verbose = FALSE)
  pancreas.list[[i]] <- FindVariableFeatures(
    pancreas.list[[i]], selection.method = "vst",
    nfeatures = 2000, verbose = FALSE
  )
}

# find anchors
anchors <- FindIntegrationAnchors(object.list = pancreas.list)

# integrate data
integrated <- IntegrateData(anchorset = anchors)
} # }
```

Example 17 (r):
```r
if (FALSE) { # \dontrun{
# to install the SeuratData package see https://github.com/satijalab/seurat-data
library(SeuratData)
data("panc8")

# panc8 is a merged Seurat object containing 8 separate pancreas datasets
# split the object by dataset
pancreas.list <- SplitObject(panc8, split.by = "tech")

# perform standard preprocessing on each object
for (i in 1:length(pancreas.list)) {
  pancreas.list[[i]] <- NormalizeData(pancreas.list[[i]], verbose = FALSE)
  pancreas.list[[i]] <- FindVariableFeatures(
    pancreas.list[[i]], selection.method = "vst",
    nfeatures = 2000, verbose = FALSE
  )
}

# find anchors
anchors <- FindIntegrationAnchors(object.list = pancreas.list)

# integrate data
integrated <- IntegrateData(anchorset = anchors)
} # }
```

---

## Gene expression markers for all identity classes — FindAllMarkers • Seurat

**URL:** http://127.0.0.1:9173/seurat/reference/findallmarkers/index.html

**Contents:**
- Gene expression markers for all identity classes
- Arguments
- Value
- Examples
- Contents

Finds markers (differentially expressed genes) for each of the identity classes in a dataset

Assay to use in differential expression testing

Genes to test. Default is to use all genes

Regroup cells into a different identity class prior to performing differential expression (see example); "ident" to use Idents

Limit testing to genes which show, on average, at least X-fold difference (log-scale) between the two groups of cells. Default is 0.1 Increasing logfc.threshold speeds up the function, but can miss weaker signals. If the slot parameter is "scale.data" no filtering is performed.

Denotes which test to use. Available options are:

"wilcox" : Identifies differentially expressed genes between two groups of cells using a Wilcoxon Rank Sum test (default); will use a fast implementation by Presto if installed

"wilcox_limma" : Identifies differentially expressed genes between two groups of cells using the limma implementation of the Wilcoxon Rank Sum test; set this option to reproduce results from Seurat v4

"bimod" : Likelihood-ratio test for single cell gene expression, (McDavid et al., Bioinformatics, 2013)

"roc" : Identifies 'markers' of gene expression using ROC analysis. For each gene, evaluates (using AUC) a classifier built on that gene alone, to classify between two groups of cells. An AUC value of 1 means that expression values for this gene alone can perfectly classify the two groupings (i.e. Each of the cells in cells.1 exhibit a higher level than each of the cells in cells.2). An AUC value of 0 also means there is perfect classification, but in the other direction. A value of 0.5 implies that the gene has no predictive power to classify the two groups. Returns a 'predictive power' (abs(AUC-0.5) * 2) ranked matrix of putative differentially expressed genes.

"t" : Identify differentially expressed genes between two groups of cells using the Student's t-test.

"negbinom" : Identifies differentially expressed genes between two groups of cells using a negative binomial generalized linear model. Use only for UMI-based datasets

"poisson" : Identifies differentially expressed genes between two groups of cells using a poisson generalized linear model. Use only for UMI-based datasets

"LR" : Uses a logistic regression framework to determine differentially expressed genes. Constructs a logistic regression model predicting group membership based on each feature individually and compares this to a null model with a likelihood ratio test.

"MAST" : Identifies differentially expressed genes between two groups of cells using a hurdle model tailored to scRNA-seq data. Utilizes the MAST package to run the DE testing.

"DESeq2" : Identifies differentially expressed genes between two groups of cells based on a model using DESeq2 which uses a negative binomial distribution (Love et al, Genome Biology, 2014).This test does not support pre-filtering of genes based on average difference (or percent detection rate) between cell groups. However, genes may be pre-filtered based on their minimum detection rate (min.pct) across both cell groups. To use this method, please install DESeq2, using the instructions at https://bioconductor.org/packages/release/bioc/html/DESeq2.html

Slot to pull data from; note that if test.use is "negbinom", "poisson", or "DESeq2", slot will be set to "counts"

only test genes that are detected in a minimum fraction of min.pct cells in either of the two populations. Meant to speed up the function by not testing genes that are very infrequently expressed. Default is 0.01

only test genes that show a minimum difference in the fraction of detection between the two groups. Set to -Inf by default

A node to find markers for and all its children; requires BuildClusterTree to have been run previously; replaces FindAllMarkersNode

Print a progress bar once expression testing begins

Only return positive markers (FALSE by default)

Down sample each identity class to a max number. Default is no downsampling. Not activated by default (set to Inf)

Random seed for downsampling

Variables to test, used only when test.use is one of 'LR', 'negbinom', 'poisson', or 'MAST'

Minimum number of cells expressing the feature in at least one of the two groups, currently only used for poisson and negative binomial tests

Minimum number of cells in one of the groups

Function to use for fold change or average difference calculation. The default depends on the the value of fc.slot:

"counts" : difference in the log of the mean counts, with pseudocount.

"data" : difference in the log of the average exponentiated data, with pseudocount. This adjusts for differences in sequencing depth between cells, and assumes that "data" has been log-normalized.

"scale.data" : difference in the means of scale.data.

Name of the fold change, average difference, or custom function column in the output data.frame. If NULL, the fold change column will be named according to the logarithm base (eg, "avg_log2FC"), or if using the scale.data slot "avg_diff".

The base with respect to which logarithms are computed.

Only return markers that have a p-value < return.thresh, or a power > return.thresh (if the test is ROC)

Convert the sparse matrix to a dense form before running the DE test. This can provide speedups but might require higher memory; default is FALSE

Arguments passed to other methods and to specific DE methods

Matrix containing a ranked list of putative markers, and associated statistics (p-values, ROC score, etc.)

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/differential_expression.R
```

Example 2 (unknown):
```unknown
FindAllMarkers.Rd
```

Example 3 (unknown):
```unknown
FindAllMarkers(
  object,
  assay = NULL,
  features = NULL,
  group.by = NULL,
  logfc.threshold = 0.1,
  test.use = "wilcox",
  slot = "data",
  min.pct = 0.01,
  min.diff.pct = -Inf,
  node = NULL,
  verbose = TRUE,
  only.pos = FALSE,
  max.cells.per.ident = Inf,
  random.seed = 1,
  latent.vars = NULL,
  min.cells.feature = 3,
  min.cells.group = 3,
  mean.fxn = NULL,
  fc.name = NULL,
  base = 2,
  return.thresh = 0.01,
  densify = FALSE,
  ...
)
```

Example 4 (r):
```r
FindAllMarkers(
  object,
  assay = NULL,
  features = NULL,
  group.by = NULL,
  logfc.threshold = 0.1,
  test.use = "wilcox",
  slot = "data",
  min.pct = 0.01,
  min.diff.pct = -Inf,
  node = NULL,
  verbose = TRUE,
  only.pos = FALSE,
  max.cells.per.ident = Inf,
  random.seed = 1,
  latent.vars = NULL,
  min.cells.feature = 3,
  min.cells.group = 3,
  mean.fxn = NULL,
  fc.name = NULL,
  base = 2,
  return.thresh = 0.01,
  densify = FALSE,
  ...
)
```

Example 5 (r):
```r
FindAllMarkers(
  object,
  assay = NULL,
  features = NULL,
  group.by = NULL,
  logfc.threshold = 0.1,
  test.use = "wilcox",
  slot = "data",
  min.pct = 0.01,
  min.diff.pct = -Inf,
  node = NULL,
  verbose = TRUE,
  only.pos = FALSE,
  max.cells.per.ident = Inf,
  random.seed = 1,
  latent.vars = NULL,
  min.cells.feature = 3,
  min.cells.group = 3,
  mean.fxn = NULL,
  fc.name = NULL,
  base = 2,
  return.thresh = 0.01,
  densify = FALSE,
  ...
)
```

Example 6 (unknown):
```unknown
BuildClusterTree
```

Example 7 (unknown):
```unknown
FindAllMarkersNode
```

Example 8 (unknown):
```unknown
data("pbmc_small")
# Find markers for all clusters
all.markers <- FindAllMarkers(object = pbmc_small)
#> Calculating cluster 0
#> Calculating cluster 1
#> Calculating cluster 2
head(x = all.markers)
#>                 p_val avg_log2FC pct.1 pct.2    p_val_adj cluster     gene
#> HLA-DPB1 9.572778e-13  -6.030507 0.083 0.909 2.201739e-10       0 HLA-DPB1
#> HLA-DRB1 7.673127e-12  -5.630708 0.083 0.864 1.764819e-09       0 HLA-DRB1
#> HLA-DPA1 3.673172e-11  -4.477325 0.111 0.864 8.448296e-09       0 HLA-DPA1
#> HLA-DRA  1.209114e-10  -4.298484 0.417 0.909 2.780962e-08       0  HLA-DRA
#> HLA-DRB5 9.547049e-10  -4.576012 0.056 0.773 2.195821e-07       0 HLA-DRB5
#> HLA-DQB1 3.035198e-08  -4.629157 0.028 0.659 6.980956e-06       0 HLA-DQB1
if (FALSE) { # \dontrun{
# Pass a value to node as a replacement for FindAllMarkersNode
pbmc_small <- BuildClusterTree(object = pbmc_small)
all.markers <- FindAllMarkers(object = pbmc_small, node = 4)
head(x = all.markers)
} # }
```

Example 9 (r):
```r
data("pbmc_small")
# Find markers for all clusters
all.markers <- FindAllMarkers(object = pbmc_small)
#> Calculating cluster 0
#> Calculating cluster 1
#> Calculating cluster 2
head(x = all.markers)
#>                 p_val avg_log2FC pct.1 pct.2    p_val_adj cluster     gene
#> HLA-DPB1 9.572778e-13  -6.030507 0.083 0.909 2.201739e-10       0 HLA-DPB1
#> HLA-DRB1 7.673127e-12  -5.630708 0.083 0.864 1.764819e-09       0 HLA-DRB1
#> HLA-DPA1 3.673172e-11  -4.477325 0.111 0.864 8.448296e-09       0 HLA-DPA1
#> HLA-DRA  1.209114e-10  -4.298484 0.417 0.909 2.780962e-08       0  HLA-DRA
#> HLA-DRB5 9.547049e-10  -4.576012 0.056 0.773 2.195821e-07       0 HLA-DRB5
#> HLA-DQB1 3.035198e-08  -4.629157 0.028 0.659 6.980956e-06       0 HLA-DQB1
if (FALSE) { # \dontrun{
# Pass a value to node as a replacement for FindAllMarkersNode
pbmc_small <- BuildClusterTree(object = pbmc_small)
all.markers <- FindAllMarkers(object = pbmc_small, node = 4)
head(x = all.markers)
} # }
```

Example 10 (r):
```r
data("pbmc_small")
# Find markers for all clusters
all.markers <- FindAllMarkers(object = pbmc_small)
#> Calculating cluster 0
#> Calculating cluster 1
#> Calculating cluster 2
head(x = all.markers)
#>                 p_val avg_log2FC pct.1 pct.2    p_val_adj cluster     gene
#> HLA-DPB1 9.572778e-13  -6.030507 0.083 0.909 2.201739e-10       0 HLA-DPB1
#> HLA-DRB1 7.673127e-12  -5.630708 0.083 0.864 1.764819e-09       0 HLA-DRB1
#> HLA-DPA1 3.673172e-11  -4.477325 0.111 0.864 8.448296e-09       0 HLA-DPA1
#> HLA-DRA  1.209114e-10  -4.298484 0.417 0.909 2.780962e-08       0  HLA-DRA
#> HLA-DRB5 9.547049e-10  -4.576012 0.056 0.773 2.195821e-07       0 HLA-DRB5
#> HLA-DQB1 3.035198e-08  -4.629157 0.028 0.659 6.980956e-06       0 HLA-DQB1
if (FALSE) { # \dontrun{
# Pass a value to node as a replacement for FindAllMarkersNode
pbmc_small <- BuildClusterTree(object = pbmc_small)
all.markers <- FindAllMarkers(object = pbmc_small, node = 4)
head(x = all.markers)
} # }
```

---

## Construct weighted nearest neighbor graph — FindMultiModalNeighbors • Seurat

**URL:** http://127.0.0.1:9173/seurat/reference/findmultimodalneighbors/index.html

**Contents:**
- Construct weighted nearest neighbor graph
- Arguments
- Value
- Contents

This function will construct a weighted nearest neighbor (WNN) graph. For each cell, we identify the nearest neighbors based on a weighted combination of two modalities. Takes as input two dimensional reductions, one computed for each modality.Other parameters are listed for debugging, but can be left as default values.

A list of two dimensional reductions, one for each of the modalities to be integrated

A list containing the dimensions for each reduction to use

the number of multimodal neighbors to compute. 20 by default

Perform L2 normalization on the cell embeddings after dimensional reduction. TRUE by default.

Multimodal knn graph name

Multimodal snn graph name

Multimodal neighbor object name

Variable name to store modality weight in object meta data

The number of approximate neighbors to compute

Cutoff not to discard edge in SNN graph

The scaling factor for kernel width. 1 by default

Constant used to avoid divide-by-zero errors. 1e-4 by default

Smoothing modality score across each individual modality neighbors. FALSE by default

Store intermediate results in misc

A ModalityWeights object generated by FindModalityWeights

Print progress bars and output

Seurat object containing a nearest-neighbor object, KNN graph, and SNN graph - each based on a weighted combination of modalities.

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/clustering.R
```

Example 2 (unknown):
```unknown
FindMultiModalNeighbors.Rd
```

Example 3 (unknown):
```unknown
FindMultiModalNeighbors(
  object,
  reduction.list,
  dims.list,
  k.nn = 20,
  l2.norm = TRUE,
  knn.graph.name = "wknn",
  snn.graph.name = "wsnn",
  weighted.nn.name = "weighted.nn",
  modality.weight.name = NULL,
  knn.range = 200,
  prune.SNN = 1/15,
  sd.scale = 1,
  cross.contant.list = NULL,
  smooth = FALSE,
  return.intermediate = FALSE,
  modality.weight = NULL,
  verbose = TRUE
)
```

Example 4 (r):
```r
FindMultiModalNeighbors(
  object,
  reduction.list,
  dims.list,
  k.nn = 20,
  l2.norm = TRUE,
  knn.graph.name = "wknn",
  snn.graph.name = "wsnn",
  weighted.nn.name = "weighted.nn",
  modality.weight.name = NULL,
  knn.range = 200,
  prune.SNN = 1/15,
  sd.scale = 1,
  cross.contant.list = NULL,
  smooth = FALSE,
  return.intermediate = FALSE,
  modality.weight = NULL,
  verbose = TRUE
)
```

Example 5 (r):
```r
FindMultiModalNeighbors(
  object,
  reduction.list,
  dims.list,
  k.nn = 20,
  l2.norm = TRUE,
  knn.graph.name = "wknn",
  snn.graph.name = "wsnn",
  weighted.nn.name = "weighted.nn",
  modality.weight.name = NULL,
  knn.range = 200,
  prune.SNN = 1/15,
  sd.scale = 1,
  cross.contant.list = NULL,
  smooth = FALSE,
  return.intermediate = FALSE,
  modality.weight = NULL,
  verbose = TRUE
)
```

Example 6 (unknown):
```unknown
ModalityWeights
```

Example 7 (unknown):
```unknown
FindModalityWeights
```

---

## Visualize spatial and clustering (dimensional reduction) data in a linked, interactive framework — LinkedPlots • Seurat

**URL:** http://127.0.0.1:9173/seurat/reference/linkedplots/index.html

**Contents:**
- Visualize spatial and clustering (dimensional reduction) data in a linked, interactive framework
- Arguments
- Value
- Examples
- Contents

Visualize spatial and clustering (dimensional reduction) data in a linked, interactive framework

Dimensions to plot, must be a two-length numeric vector specifying x- and y-dimensions

Which dimensionality reduction to use. If not specified, first searches for umap, then tsne, then pca

Name of the image to use in the plot

Choose the scale factor ("lowres"/"hires") to apply in order to matchthe plot with the specified `image` - defaults to "lowres"

Name of meta.data column to group the data by

Controls opacity of spots. Provide as a vector specifying the min and max for SpatialFeaturePlot. For SpatialDimPlot, provide a single alpha value for each plot.

Combine plots into a single gg object; note that if TRUE; themeing will not work when plotting multiple features/groupings

If plotting a feature, which data slot to pull from (counts, data, or scale.data)

Returns final plots. If combine, plots are stiched together using CombinePlots; otherwise, returns a list of ggplot objects

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/visualization.R
```

Example 2 (unknown):
```unknown
LinkedPlots.Rd
```

Example 3 (unknown):
```unknown
LinkedDimPlot(
  object,
  dims = 1:2,
  reduction = NULL,
  image = NULL,
  image.scale = "lowres",
  group.by = NULL,
  alpha = c(0.1, 1),
  combine = TRUE
)

LinkedFeaturePlot(
  object,
  feature,
  dims = 1:2,
  reduction = NULL,
  image = NULL,
  image.scale = "lowres",
  slot = "data",
  alpha = c(0.1, 1),
  combine = TRUE
)
```

Example 4 (r):
```r
LinkedDimPlot(
  object,
  dims = 1:2,
  reduction = NULL,
  image = NULL,
  image.scale = "lowres",
  group.by = NULL,
  alpha = c(0.1, 1),
  combine = TRUE
)

LinkedFeaturePlot(
  object,
  feature,
  dims = 1:2,
  reduction = NULL,
  image = NULL,
  image.scale = "lowres",
  slot = "data",
  alpha = c(0.1, 1),
  combine = TRUE
)
```

Example 5 (r):
```r
LinkedDimPlot(
  object,
  dims = 1:2,
  reduction = NULL,
  image = NULL,
  image.scale = "lowres",
  group.by = NULL,
  alpha = c(0.1, 1),
  combine = TRUE
)

LinkedFeaturePlot(
  object,
  feature,
  dims = 1:2,
  reduction = NULL,
  image = NULL,
  image.scale = "lowres",
  slot = "data",
  alpha = c(0.1, 1),
  combine = TRUE
)
```

Example 6 (unknown):
```unknown
CombinePlots
```

Example 7 (unknown):
```unknown
if (FALSE) { # \dontrun{
LinkedDimPlot(seurat.object)
LinkedFeaturePlot(seurat.object, feature = 'Hpca')
} # }
```

Example 8 (r):
```r
if (FALSE) { # \dontrun{
LinkedDimPlot(seurat.object)
LinkedFeaturePlot(seurat.object, feature = 'Hpca')
} # }
```

Example 9 (r):
```r
if (FALSE) { # \dontrun{
LinkedDimPlot(seurat.object)
LinkedFeaturePlot(seurat.object, feature = 'Hpca')
} # }
```

---

## Get an Assay object from a given Seurat object. — GetAssay • Seurat

**URL:** http://127.0.0.1:9173/reference_getassay.html

**Contents:**
- Get an Assay object from a given Seurat object.
- Arguments
- Value
- Examples
- Contents

Get an Assay object from a given Seurat object.

Arguments passed to other methods

Returns an Assay object

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/generics.R
```

Example 2 (unknown):
```unknown
R/objects.R
```

Example 3 (unknown):
```unknown
GetAssay.Rd
```

Example 4 (python):
```python
GetAssay(object, ...)

# S3 method for class 'Seurat'
GetAssay(object, assay = NULL, ...)
```

Example 5 (r):
```r
GetAssay(object, ...)

# S3 method for class 'Seurat'
GetAssay(object, assay = NULL, ...)
```

Example 6 (r):
```r
GetAssay(object, ...)

# S3 method for class 'Seurat'
GetAssay(object, assay = NULL, ...)
```

Example 7 (unknown):
```unknown
data("pbmc_small")
GetAssay(object = pbmc_small, assay = "RNA")
#> Assay data with 230 features for 80 cells
#> Top 10 variable features:
#>  PPBP, IGLL5, VDAC3, CD1C, AKR1C3, PF4, MYL9, GNLY, TREML1, CA2
```

Example 8 (r):
```r
data("pbmc_small")
GetAssay(object = pbmc_small, assay = "RNA")
#> Assay data with 230 features for 80 cells
#> Top 10 variable features:
#>  PPBP, IGLL5, VDAC3, CD1C, AKR1C3, PF4, MYL9, GNLY, TREML1, CA2
```

Example 9 (r):
```r
data("pbmc_small")
GetAssay(object = pbmc_small, assay = "RNA")
#> Assay data with 230 features for 80 cells
#> Top 10 variable features:
#>  PPBP, IGLL5, VDAC3, CD1C, AKR1C3, PF4, MYL9, GNLY, TREML1, CA2
```

---

## Subset a Seurat Object based on the Barcode Distribution Inflection Points — SubsetByBarcodeInflections • Seurat

**URL:** http://127.0.0.1:9173/reference_subsetbybarcodeinflections.html

**Contents:**
- Subset a Seurat Object based on the Barcode Distribution Inflection Points
- Arguments
- Value
- Details
- See also
- Author
- Examples
- Contents

This convenience function subsets a Seurat object based on calculated inflection points.

Returns a subsetted Seurat object.

See [CalculateBarcodeInflections()] to calculate inflection points and [BarcodeInflectionsPlot()] to visualize and test inflection point calculations.

CalculateBarcodeInflections BarcodeInflectionsPlot

Robert A. Amezquita, robert.amezquita@fredhutch.org

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/preprocessing.R
```

Example 2 (unknown):
```unknown
SubsetByBarcodeInflections.Rd
```

Example 3 (unknown):
```unknown
SubsetByBarcodeInflections(object)
```

Example 4 (r):
```r
SubsetByBarcodeInflections(object)
```

Example 5 (r):
```r
SubsetByBarcodeInflections(object)
```

Example 6 (unknown):
```unknown
CalculateBarcodeInflections
```

Example 7 (unknown):
```unknown
BarcodeInflectionsPlot
```

Example 8 (python):
```python
data("pbmc_small")
pbmc_small <- CalculateBarcodeInflections(
  object = pbmc_small,
  group.column = 'groups',
  threshold.low = 20,
  threshold.high = 30
)
SubsetByBarcodeInflections(object = pbmc_small)
#> An object of class Seurat 
#> 230 features across 16 samples within 1 assay 
#> Active assay: RNA (230 features, 20 variable features)
#>  3 layers present: counts, data, scale.data
#>  2 dimensional reductions calculated: pca, tsne
```

Example 9 (r):
```r
data("pbmc_small")
pbmc_small <- CalculateBarcodeInflections(
  object = pbmc_small,
  group.column = 'groups',
  threshold.low = 20,
  threshold.high = 30
)
SubsetByBarcodeInflections(object = pbmc_small)
#> An object of class Seurat 
#> 230 features across 16 samples within 1 assay 
#> Active assay: RNA (230 features, 20 variable features)
#>  3 layers present: counts, data, scale.data
#>  2 dimensional reductions calculated: pca, tsne
```

Example 10 (r):
```r
data("pbmc_small")
pbmc_small <- CalculateBarcodeInflections(
  object = pbmc_small,
  group.column = 'groups',
  threshold.low = 20,
  threshold.high = 30
)
SubsetByBarcodeInflections(object = pbmc_small)
#> An object of class Seurat 
#> 230 features across 16 samples within 1 assay 
#> Active assay: RNA (230 features, 20 variable features)
#>  3 layers present: counts, data, scale.data
#>  2 dimensional reductions calculated: pca, tsne
```

---

## Merge SCTAssay objects — merge.SCTAssay • Seurat

**URL:** http://127.0.0.1:9173/reference_merge.sctassay.html

**Contents:**
- Merge SCTAssay objects
- Arguments
- Contents

Merge SCTAssay objects

A single Seurat object or a list of Seurat objects

A character vector of length(x = c(x, y)); appends the corresponding values to the start of each objects' cell names

Merge the data slots instead of just merging the counts (which requires renormalization); this is recommended if the same normalization approach was applied to all objects

If na.rm = TRUE, this will only preserve residuals that are present in all SCTAssays being merged. Otherwise, missing residuals will be populated with NAs.

Arguments passed to other methods

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/objects.R
```

Example 2 (unknown):
```unknown
merge.SCTAssay.Rd
```

Example 3 (python):
```python
# S3 method for class 'SCTAssay'
merge(
  x = NULL,
  y = NULL,
  add.cell.ids = NULL,
  merge.data = TRUE,
  na.rm = TRUE,
  ...
)
```

Example 4 (r):
```r
# S3 method for class 'SCTAssay'
merge(
  x = NULL,
  y = NULL,
  add.cell.ids = NULL,
  merge.data = TRUE,
  na.rm = TRUE,
  ...
)
```

Example 5 (r):
```r
# S3 method for class 'SCTAssay'
merge(
  x = NULL,
  y = NULL,
  add.cell.ids = NULL,
  merge.data = TRUE,
  na.rm = TRUE,
  ...
)
```

Example 6 (unknown):
```unknown
length(x = c(x, y))
```

---

## The VisiumV1 class — VisiumV1-class • Seurat

**URL:** http://127.0.0.1:9173/reference_visiumv1-class.html

**Contents:**
- The VisiumV1 class
- Slots
- Contents

The VisiumV1 class represents spatial information from the 10X Genomics Visium platform

A three-dimensional array with PNG image data, see readPNG for more details

An object of class scalefactors; see scalefactors for more information

A data frame with tissue coordinate information

Single numeric value giving the radius of the spots

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/objects.R
```

Example 2 (unknown):
```unknown
VisiumV1-class.Rd
```

Example 3 (unknown):
```unknown
scale.factors
```

Example 4 (unknown):
```unknown
scalefactors
```

Example 5 (unknown):
```unknown
scalefactors
```

Example 6 (unknown):
```unknown
coordinates
```

Example 7 (unknown):
```unknown
spot.radius
```

---

## Calculates a mixing metric — MixingMetric • Seurat

**URL:** http://127.0.0.1:9173/reference_mixingmetric.html

**Contents:**
- Calculates a mixing metric
- Arguments
- Value
- Contents

Here we compute a measure of how well mixed a composite dataset is. To compute, we first examine the local neighborhood for each cell (looking at max.k neighbors) and determine for each group (could be the dataset after integration) the k nearest neighbor and what rank that neighbor was in the overall neighborhood. We then take the median across all groups as the mixing metric per cell.

Grouping variable for dataset

Which dimensionally reduced space to use

Neighbor number to examine per group

Maximum size of local neighborhood to compute

Error bound on the neighbor finding algorithm (from RANN)

Displays progress bar

Returns a vector of values of the mixing metric for each cell

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/integration.R
```

Example 2 (unknown):
```unknown
MixingMetric.Rd
```

Example 3 (unknown):
```unknown
MixingMetric(
  object,
  grouping.var,
  reduction = "pca",
  dims = 1:2,
  k = 5,
  max.k = 300,
  eps = 0,
  verbose = TRUE
)
```

Example 4 (r):
```r
MixingMetric(
  object,
  grouping.var,
  reduction = "pca",
  dims = 1:2,
  k = 5,
  max.k = 300,
  eps = 0,
  verbose = TRUE
)
```

Example 5 (r):
```r
MixingMetric(
  object,
  grouping.var,
  reduction = "pca",
  dims = 1:2,
  k = 5,
  max.k = 300,
  eps = 0,
  verbose = TRUE
)
```

---

## Run Supervised Latent Semantic Indexing — RunSLSI • Seurat

**URL:** http://127.0.0.1:9173/seurat/reference/runslsi/index.html

**Contents:**
- Run Supervised Latent Semantic Indexing
- Arguments
- Value
- Contents

Run a supervised LSI (SLSI) dimensionality reduction supervised by a cell-cell kernel. SLSI is used to capture a linear transformation of peaks that maximizes its dependency to the given cell-cell kernel.

Arguments passed to IRLBA irlba

Name of Assay SLSI is being run on

Total Number of SLSI components to compute and store

dimensional reduction key, specifies the string before the number for the dimension names

Graph used supervised by SLSI

Set a random seed. Setting NULL will not set a seed.

Features to compute SLSI on. If features=NULL, SLSI will be run using the variable features for the Assay5.

dimensional reduction name

Returns Seurat object with the SLSI calculation stored in the reductions slot

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/generics.R
```

Example 2 (unknown):
```unknown
R/dimensional_reduction.R
```

Example 3 (python):
```python
RunSLSI(object, ...)

# Default S3 method
RunSLSI(
  object,
  assay = NULL,
  n = 50,
  reduction.key = "SLSI_",
  graph = NULL,
  verbose = TRUE,
  seed.use = 42,
  ...
)

# S3 method for class 'Assay'
RunSLSI(
  object,
  assay = NULL,
  features = NULL,
  n = 50,
  reduction.key = "SLSI_",
  graph = NULL,
  verbose = TRUE,
  seed.use = 42,
  ...
)

# S3 method for class 'StdAssay'
RunSLSI(
  object,
  assay = NULL,
  features = NULL,
  n = 50,
  reduction.key = "SLSI_",
  graph = NULL,
  layer = "data",
  verbose = TRUE,
  seed.use = 42,
  ...
)

# S3 method for class 'Seurat'
RunSLSI(
  object,
  assay = NULL,
  features = NULL,
  n = 50,
  reduction.name = "slsi",
  reduction.key = "SLSI_",
  graph = NULL,
  verbose = TRUE,
  seed.use = 42,
  ...
)
```

Example 4 (r):
```r
RunSLSI(object, ...)

# Default S3 method
RunSLSI(
  object,
  assay = NULL,
  n = 50,
  reduction.key = "SLSI_",
  graph = NULL,
  verbose = TRUE,
  seed.use = 42,
  ...
)

# S3 method for class 'Assay'
RunSLSI(
  object,
  assay = NULL,
  features = NULL,
  n = 50,
  reduction.key = "SLSI_",
  graph = NULL,
  verbose = TRUE,
  seed.use = 42,
  ...
)

# S3 method for class 'StdAssay'
RunSLSI(
  object,
  assay = NULL,
  features = NULL,
  n = 50,
  reduction.key = "SLSI_",
  graph = NULL,
  layer = "data",
  verbose = TRUE,
  seed.use = 42,
  ...
)

# S3 method for class 'Seurat'
RunSLSI(
  object,
  assay = NULL,
  features = NULL,
  n = 50,
  reduction.name = "slsi",
  reduction.key = "SLSI_",
  graph = NULL,
  verbose = TRUE,
  seed.use = 42,
  ...
)
```

Example 5 (r):
```r
RunSLSI(object, ...)

# Default S3 method
RunSLSI(
  object,
  assay = NULL,
  n = 50,
  reduction.key = "SLSI_",
  graph = NULL,
  verbose = TRUE,
  seed.use = 42,
  ...
)

# S3 method for class 'Assay'
RunSLSI(
  object,
  assay = NULL,
  features = NULL,
  n = 50,
  reduction.key = "SLSI_",
  graph = NULL,
  verbose = TRUE,
  seed.use = 42,
  ...
)

# S3 method for class 'StdAssay'
RunSLSI(
  object,
  assay = NULL,
  features = NULL,
  n = 50,
  reduction.key = "SLSI_",
  graph = NULL,
  layer = "data",
  verbose = TRUE,
  seed.use = 42,
  ...
)

# S3 method for class 'Seurat'
RunSLSI(
  object,
  assay = NULL,
  features = NULL,
  n = 50,
  reduction.name = "slsi",
  reduction.key = "SLSI_",
  graph = NULL,
  verbose = TRUE,
  seed.use = 42,
  ...
)
```

---

## Calculate pearson residuals of features not in the scale.data — GetResidual • Seurat

**URL:** http://127.0.0.1:9173/reference_getresidual.html

**Contents:**
- Calculate pearson residuals of features not in the scale.data
- Arguments
- Value
- See also
- Examples
- Contents

This function calls sctransform::get_residuals.

Name of features to add into the scale.data

Name of the assay of the seurat object generated by SCTransform

Name of the assay of the seurat object containing UMI matrix and the default is RNA

Numeric of length two specifying the min and max values the Pearson residual will be clipped to

Recalculate residuals for all features, even if they are already present. Useful if you want to change the clip.range.

For features where there is no feature model stored, return NA for residual value in scale.data when na.rm = FALSE. When na.rm is TRUE, only return residuals for features with a model stored for all cells.

Whether to print messages and progress bars

Returns a Seurat object containing Pearson residuals of added features in its scale.data

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/preprocessing.R
```

Example 2 (unknown):
```unknown
GetResidual.Rd
```

Example 3 (unknown):
```unknown
GetResidual(
  object,
  features,
  assay = NULL,
  umi.assay = "RNA",
  clip.range = NULL,
  replace.value = FALSE,
  na.rm = TRUE,
  verbose = TRUE
)
```

Example 4 (r):
```r
GetResidual(
  object,
  features,
  assay = NULL,
  umi.assay = "RNA",
  clip.range = NULL,
  replace.value = FALSE,
  na.rm = TRUE,
  verbose = TRUE
)
```

Example 5 (r):
```r
GetResidual(
  object,
  features,
  assay = NULL,
  umi.assay = "RNA",
  clip.range = NULL,
  replace.value = FALSE,
  na.rm = TRUE,
  verbose = TRUE
)
```

Example 6 (unknown):
```unknown
get_residuals
```

Example 7 (unknown):
```unknown
if (FALSE) { # \dontrun{
data("pbmc_small")
pbmc_small <- SCTransform(object = pbmc_small, variable.features.n = 20)
pbmc_small <- GetResidual(object = pbmc_small, features = c('MS4A1', 'TCL1A'))
} # }
```

Example 8 (r):
```r
if (FALSE) { # \dontrun{
data("pbmc_small")
pbmc_small <- SCTransform(object = pbmc_small, variable.features.n = 20)
pbmc_small <- GetResidual(object = pbmc_small, features = c('MS4A1', 'TCL1A'))
} # }
```

Example 9 (r):
```r
if (FALSE) { # \dontrun{
data("pbmc_small")
pbmc_small <- SCTransform(object = pbmc_small, variable.features.n = 20)
pbmc_small <- GetResidual(object = pbmc_small, features = c('MS4A1', 'TCL1A'))
} # }
```

---

## Score cell cycle phases — CellCycleScoring • Seurat

**URL:** http://127.0.0.1:9173/seurat/reference/cellcyclescoring/index.html

**Contents:**
- Score cell cycle phases
- Arguments
- Value
- See also
- Examples
- Contents

Score cell cycle phases

A vector of features associated with S phase

A vector of features associated with G2M phase

Number of control features selected from the same bin per analyzed feature supplied to AddModuleScore. Defaults to value equivalent to minimum number of features present in 's.features' and 'g2m.features'.

If true, sets identity to phase assignments Stashes old identities in 'old.ident'

Arguments to be passed to AddModuleScore

A Seurat object with the following columns added to object meta data: S.Score, G2M.Score, and Phase

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/utilities.R
```

Example 2 (unknown):
```unknown
CellCycleScoring.Rd
```

Example 3 (unknown):
```unknown
CellCycleScoring(
  object,
  s.features,
  g2m.features,
  ctrl = NULL,
  set.ident = FALSE,
  ...
)
```

Example 4 (r):
```r
CellCycleScoring(
  object,
  s.features,
  g2m.features,
  ctrl = NULL,
  set.ident = FALSE,
  ...
)
```

Example 5 (r):
```r
CellCycleScoring(
  object,
  s.features,
  g2m.features,
  ctrl = NULL,
  set.ident = FALSE,
  ...
)
```

Example 6 (unknown):
```unknown
AddModuleScore
```

Example 7 (unknown):
```unknown
AddModuleScore
```

Example 8 (unknown):
```unknown
AddModuleScore
```

Example 9 (unknown):
```unknown
if (FALSE) { # \dontrun{
data("pbmc_small")
# pbmc_small doesn't have any cell-cycle genes
# To run CellCycleScoring, please use a dataset with cell-cycle genes
# An example is available at http://satijalab.org/seurat/cell_cycle_vignette.html
pbmc_small <- CellCycleScoring(
  object = pbmc_small,
  g2m.features = cc.genes$g2m.genes,
  s.features = cc.genes$s.genes
)
head(x = pbmc_small@meta.data)
} # }
```

Example 10 (r):
```r
if (FALSE) { # \dontrun{
data("pbmc_small")
# pbmc_small doesn't have any cell-cycle genes
# To run CellCycleScoring, please use a dataset with cell-cycle genes
# An example is available at http://satijalab.org/seurat/cell_cycle_vignette.html
pbmc_small <- CellCycleScoring(
  object = pbmc_small,
  g2m.features = cc.genes$g2m.genes,
  s.features = cc.genes$s.genes
)
head(x = pbmc_small@meta.data)
} # }
```

Example 11 (r):
```r
if (FALSE) { # \dontrun{
data("pbmc_small")
# pbmc_small doesn't have any cell-cycle genes
# To run CellCycleScoring, please use a dataset with cell-cycle genes
# An example is available at http://satijalab.org/seurat/cell_cycle_vignette.html
pbmc_small <- CellCycleScoring(
  object = pbmc_small,
  g2m.features = cc.genes$g2m.genes,
  s.features = cc.genes$s.genes
)
head(x = pbmc_small@meta.data)
} # }
```

---

## Regroup idents based on meta.data info — RegroupIdents • Seurat

**URL:** http://127.0.0.1:9173/seurat/reference/regroupidents/index.html

**Contents:**
- Regroup idents based on meta.data info
- Arguments
- Value
- Examples
- Contents

For cells in each ident, set a new identity based on the most common value of a specified metadata column.

Name of metadata column

A Seurat object with the active idents regrouped

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/utilities.R
```

Example 2 (unknown):
```unknown
RegroupIdents.Rd
```

Example 3 (python):
```python
RegroupIdents(object, metadata)
```

Example 4 (r):
```r
RegroupIdents(object, metadata)
```

Example 5 (r):
```r
RegroupIdents(object, metadata)
```

Example 6 (python):
```python
data("pbmc_small")
pbmc_small <- RegroupIdents(pbmc_small, metadata = "groups")
```

Example 7 (r):
```r
data("pbmc_small")
pbmc_small <- RegroupIdents(pbmc_small, metadata = "groups")
```

Example 8 (r):
```r
data("pbmc_small")
pbmc_small <- RegroupIdents(pbmc_small, metadata = "groups")
```

---

## Subset a Seurat Object based on the Barcode Distribution Inflection Points — SubsetByBarcodeInflections • Seurat

**URL:** http://127.0.0.1:9173/seurat/reference/subsetbybarcodeinflections/index.html

**Contents:**
- Subset a Seurat Object based on the Barcode Distribution Inflection Points
- Arguments
- Value
- Details
- See also
- Author
- Examples
- Contents

This convenience function subsets a Seurat object based on calculated inflection points.

Returns a subsetted Seurat object.

See [CalculateBarcodeInflections()] to calculate inflection points and [BarcodeInflectionsPlot()] to visualize and test inflection point calculations.

CalculateBarcodeInflections BarcodeInflectionsPlot

Robert A. Amezquita, robert.amezquita@fredhutch.org

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/preprocessing.R
```

Example 2 (unknown):
```unknown
SubsetByBarcodeInflections.Rd
```

Example 3 (unknown):
```unknown
SubsetByBarcodeInflections(object)
```

Example 4 (r):
```r
SubsetByBarcodeInflections(object)
```

Example 5 (r):
```r
SubsetByBarcodeInflections(object)
```

Example 6 (unknown):
```unknown
CalculateBarcodeInflections
```

Example 7 (unknown):
```unknown
BarcodeInflectionsPlot
```

Example 8 (python):
```python
data("pbmc_small")
pbmc_small <- CalculateBarcodeInflections(
  object = pbmc_small,
  group.column = 'groups',
  threshold.low = 20,
  threshold.high = 30
)
SubsetByBarcodeInflections(object = pbmc_small)
#> An object of class Seurat 
#> 230 features across 16 samples within 1 assay 
#> Active assay: RNA (230 features, 20 variable features)
#>  3 layers present: counts, data, scale.data
#>  2 dimensional reductions calculated: pca, tsne
```

Example 9 (r):
```r
data("pbmc_small")
pbmc_small <- CalculateBarcodeInflections(
  object = pbmc_small,
  group.column = 'groups',
  threshold.low = 20,
  threshold.high = 30
)
SubsetByBarcodeInflections(object = pbmc_small)
#> An object of class Seurat 
#> 230 features across 16 samples within 1 assay 
#> Active assay: RNA (230 features, 20 variable features)
#>  3 layers present: counts, data, scale.data
#>  2 dimensional reductions calculated: pca, tsne
```

Example 10 (r):
```r
data("pbmc_small")
pbmc_small <- CalculateBarcodeInflections(
  object = pbmc_small,
  group.column = 'groups',
  threshold.low = 20,
  threshold.high = 30
)
SubsetByBarcodeInflections(object = pbmc_small)
#> An object of class Seurat 
#> 230 features across 16 samples within 1 assay 
#> Active assay: RNA (230 features, 20 variable features)
#>  3 layers present: counts, data, scale.data
#>  2 dimensional reductions calculated: pca, tsne
```

---

## The IntegrationAnchorSet Class — IntegrationAnchorSet-class • Seurat

**URL:** http://127.0.0.1:9173/reference_integrationanchorset-class.html

**Contents:**
- The IntegrationAnchorSet Class
- Contents

Inherits from the Anchorset class. Implemented mainly for method dispatch purposes. See AnchorSet for slot details.

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/objects.R
```

Example 2 (unknown):
```unknown
IntegrationAnchorSet-class.Rd
```

---

## L2-normalization — L2Dim • Seurat

**URL:** http://127.0.0.1:9173/seurat/reference/l2dim/index.html

**Contents:**
- L2-normalization
- Arguments
- Value
- Contents

Perform l2 normalization on given dimensional reduction

Dimensional reduction to normalize

name of new dimensional reduction to store (default is olddr.l2)

name of key for new dimensional reduction

Returns a Seurat object

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/dimensional_reduction.R
```

Example 2 (unknown):
```unknown
L2Dim(object, reduction, new.dr = NULL, new.key = NULL)
```

Example 3 (r):
```r
L2Dim(object, reduction, new.dr = NULL, new.key = NULL)
```

Example 4 (r):
```r
L2Dim(object, reduction, new.dr = NULL, new.key = NULL)
```

---

## Read and Load Akoya CODEX data — ReadAkoya • Seurat

**URL:** http://127.0.0.1:9173/reference_readakoya.html

**Contents:**
- Read and Load Akoya CODEX data
- Arguments
- Value
- Note
- Progress Updates with progressr
- Contents

Read and Load Akoya CODEX data

Path to matrix generated by upstream processing.

Specify which type matrix is being provided.

“processor”: matrix generated by CODEX Processor

“inform”: matrix generated by inForm

“qupath”: matrix generated by QuPath

A pattern to filter features by; pass NA to skip feature filtering

When type is “inform”, the quantification level to read in

Name to store expression matrix as

ReadAkoya: A list with some combination of the following values

“matrix”: a sparse matrix with expression data; cells are columns and features are rows

“centroids”: a data frame with cell centroid coordinates in three columns: “x”, “y”, and “cell”

“metadata”: a data frame with cell-level meta data; includes all columns in filename that aren't in “matrix” or “centroids”

When type is “inform”, additional expression matrices are returned and named using their segmentation type (eg. “nucleus”, “membrane”). The “Entire Cell” segmentation type is returned in the “matrix” entry of the list

LoadAkoya: A Seurat object

This function requires the data.table package to be installed

This function uses progressr to render status updates and progress bars. To enable progress updates, wrap the function call in with_progress or run handlers(global = TRUE) before running this function. For more details about progressr, please read vignette("progressr-intro")

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/preprocessing.R
```

Example 2 (unknown):
```unknown
R/convenience.R
```

Example 3 (unknown):
```unknown
ReadAkoya.Rd
```

Example 4 (unknown):
```unknown
ReadAkoya(
  filename,
  type = c("inform", "processor", "qupath"),
  filter = "DAPI|Blank|Empty",
  inform.quant = c("mean", "total", "min", "max", "std")
)

LoadAkoya(
  filename,
  type = c("inform", "processor", "qupath"),
  fov,
  assay = "Akoya",
  ...
)
```

Example 5 (r):
```r
ReadAkoya(
  filename,
  type = c("inform", "processor", "qupath"),
  filter = "DAPI|Blank|Empty",
  inform.quant = c("mean", "total", "min", "max", "std")
)

LoadAkoya(
  filename,
  type = c("inform", "processor", "qupath"),
  fov,
  assay = "Akoya",
  ...
)
```

Example 6 (r):
```r
ReadAkoya(
  filename,
  type = c("inform", "processor", "qupath"),
  filter = "DAPI|Blank|Empty",
  inform.quant = c("mean", "total", "min", "max", "std")
)

LoadAkoya(
  filename,
  type = c("inform", "processor", "qupath"),
  fov,
  assay = "Akoya",
  ...
)
```

Example 7 (unknown):
```unknown
with_progress
```

Example 8 (unknown):
```unknown
handlers(global = TRUE)
```

Example 9 (unknown):
```unknown
vignette("progressr-intro")
```

---

## Linear discriminant analysis on pooled CRISPR screen data. — MixscapeLDA • Seurat

**URL:** http://127.0.0.1:9173/seurat/reference/mixscapelda/index.html

**Contents:**
- Linear discriminant analysis on pooled CRISPR screen data.
- Arguments
- Value
- Contents

This function performs unsupervised PCA on each mixscape class separately and projects each subspace onto all cells in the data. Finally, it uses the first 10 principle components from each projection as input to lda in MASS package together with mixscape class labels.

An object of class Seurat.

Assay to use for performing Linear Discriminant Analysis (LDA).

Number of LDA dimensions to print.

Number of features to print for each LDA component.

Value for random seed

Assay to use for running Principle components analysis.

Meta data column with target gene class labels.

Name of non-targeting cell class.

Number of principle components to use.

Limit testing to genes which show, on average, at least X-fold difference (log-scale) between the two groups of cells. Default is 0.25. Increasing logfc.threshold speeds up the function, but can miss weaker signals.

Returns a Seurat object with LDA added in the reduction slot.

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/mixscape.R
```

Example 2 (unknown):
```unknown
MixscapeLDA.Rd
```

Example 3 (unknown):
```unknown
MixscapeLDA(
  object,
  assay = NULL,
  ndims.print = 1:5,
  nfeatures.print = 30,
  reduction.key = "LDA_",
  seed = 42,
  pc.assay = "PRTB",
  labels = "gene",
  nt.label = "NT",
  npcs = 10,
  verbose = TRUE,
  logfc.threshold = 0.25
)
```

Example 4 (r):
```r
MixscapeLDA(
  object,
  assay = NULL,
  ndims.print = 1:5,
  nfeatures.print = 30,
  reduction.key = "LDA_",
  seed = 42,
  pc.assay = "PRTB",
  labels = "gene",
  nt.label = "NT",
  npcs = 10,
  verbose = TRUE,
  logfc.threshold = 0.25
)
```

Example 5 (r):
```r
MixscapeLDA(
  object,
  assay = NULL,
  ndims.print = 1:5,
  nfeatures.print = 30,
  reduction.key = "LDA_",
  seed = 42,
  pc.assay = "PRTB",
  labels = "gene",
  nt.label = "NT",
  npcs = 10,
  verbose = TRUE,
  logfc.threshold = 0.25
)
```

---

## Calculate a perturbation Signature — CalcPerturbSig • Seurat

**URL:** http://127.0.0.1:9173/seurat/reference/calcperturbsig/index.html

**Contents:**
- Calculate a perturbation Signature
- Arguments
- Value
- Contents

Function to calculate perturbation signature for pooled CRISPR screen datasets. For each target cell (expressing one target gRNA), we identified 20 cells from the control pool (non-targeting cells) with the most similar mRNA expression profiles. The perturbation signature is calculated by subtracting the averaged mRNA expression profile of the non-targeting neighbors from the mRNA expression profile of the target cell.

An object of class Seurat.

Name of Assay PRTB signature is being calculated on.

Features to compute PRTB signature for. Defaults to the variable features set in the assay specified.

Data slot to use for PRTB signature calculation.

Metadata column containing target gene classification.

Non-targeting gRNA cell classification identity.

Provide metadata column if multiple biological replicates exist to calculate PRTB signature for every replicate separately.

Number of nearest neighbors to consider.

Reduction method used to calculate nearest neighbors.

Number of dimensions to use from dimensionality reduction method.

Name for the new assay.

Display progress + messages

Returns a Seurat object with a new assay added containing the perturbation signature for all cells in the data slot.

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/mixscape.R
```

Example 2 (unknown):
```unknown
CalcPerturbSig.Rd
```

Example 3 (python):
```python
CalcPerturbSig(
  object,
  assay = NULL,
  features = NULL,
  slot = "data",
  gd.class = "guide_ID",
  nt.cell.class = "NT",
  split.by = NULL,
  num.neighbors = NULL,
  reduction = "pca",
  ndims = 15,
  new.assay.name = "PRTB",
  verbose = TRUE
)
```

Example 4 (r):
```r
CalcPerturbSig(
  object,
  assay = NULL,
  features = NULL,
  slot = "data",
  gd.class = "guide_ID",
  nt.cell.class = "NT",
  split.by = NULL,
  num.neighbors = NULL,
  reduction = "pca",
  ndims = 15,
  new.assay.name = "PRTB",
  verbose = TRUE
)
```

Example 5 (r):
```r
CalcPerturbSig(
  object,
  assay = NULL,
  features = NULL,
  slot = "data",
  gd.class = "guide_ID",
  nt.cell.class = "NT",
  split.by = NULL,
  num.neighbors = NULL,
  reduction = "pca",
  ndims = 15,
  new.assay.name = "PRTB",
  verbose = TRUE
)
```

---

## Predict value from nearest neighbors — PredictAssay • Seurat

**URL:** http://127.0.0.1:9173/seurat/reference/predictassay/index.html

**Contents:**
- Predict value from nearest neighbors
- Arguments
- Value
- Contents

This function will predict expression or cell embeddings from its k nearest neighbors index. For each cell, it will average its k neighbors value to get its new imputed value. It can average expression value in assays and cell embeddings from dimensional reductions.

The object used to calculate knn

k near neighbor indices. A cells x k matrix.

Assay used for prediction

Cell embedding of the reduction used for prediction

Number of dimensions of cell embedding

Return an assay or a predicted matrix

slot used for prediction

features used for prediction

the function used to calculate row mean

Sets the random seed to check if the nearest neighbor is query cell

return an assay containing predicted expression value in the data slot

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/clustering.R
```

Example 2 (unknown):
```unknown
PredictAssay.Rd
```

Example 3 (unknown):
```unknown
PredictAssay(
  object,
  nn.idx,
  assay,
  reduction = NULL,
  dims = NULL,
  return.assay = TRUE,
  slot = "scale.data",
  features = NULL,
  mean.function = rowMeans,
  seed = 4273,
  verbose = TRUE
)
```

Example 4 (r):
```r
PredictAssay(
  object,
  nn.idx,
  assay,
  reduction = NULL,
  dims = NULL,
  return.assay = TRUE,
  slot = "scale.data",
  features = NULL,
  mean.function = rowMeans,
  seed = 4273,
  verbose = TRUE
)
```

Example 5 (r):
```r
PredictAssay(
  object,
  nn.idx,
  assay,
  reduction = NULL,
  dims = NULL,
  return.assay = TRUE,
  slot = "scale.data",
  features = NULL,
  mean.function = rowMeans,
  seed = 4273,
  verbose = TRUE
)
```

---

## Load 10X Genomics Visium Scale Factors — Read10X_ScaleFactors • Seurat

**URL:** http://127.0.0.1:9173/reference_read10x_scalefactors.html

**Contents:**
- Load 10X Genomics Visium Scale Factors
- Arguments
- Value
- Contents

Load 10X Genomics Visium Scale Factors

Path to a scalefactors_json.json file

A scalefactors object

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/preprocessing.R
```

Example 2 (unknown):
```unknown
Read10X_ScaleFactors.Rd
```

Example 3 (unknown):
```unknown
Read10X_ScaleFactors(filename)
```

Example 4 (r):
```r
Read10X_ScaleFactors(filename)
```

Example 5 (r):
```r
Read10X_ScaleFactors(filename)
```

Example 6 (unknown):
```unknown
scalefactors_json.json
```

---

## Feature expression heatmap — DoHeatmap • Seurat

**URL:** http://127.0.0.1:9173/seurat/reference/doheatmap/index.html

**Contents:**
- Feature expression heatmap
- Arguments
- Value
- Examples
- Contents

Draws a heatmap of single cell feature expression.

A vector of features to plot, defaults to VariableFeatures(object = object)

A vector of cells to plot

A vector of variables to group cells by; pass 'ident' to group by cell identity classes

Add a color bar showing group status for cells

Colors to use for the color bar

Minimum display value (all values below are clipped)

Maximum display value (all values above are clipped); defaults to 2.5 if slot is 'scale.data', 6 otherwise

Data slot to use, choose from 'raw.data', 'data', or 'scale.data'

Label the cell identies above the color bar

Size of text above color bar

Horizontal justification of text above color bar

Vertical justification of text above color bar

Angle of text above color bar

If true, plot with geom_raster, else use geom_tile. geom_raster may look blurry on some viewing applications such as Preview due to how the raster is interpolated. Set this to FALSE if you are encountering that issue (note that plots may take longer to produce/render).

Include white lines to separate the groups

Integer number to adjust the width of the separating white lines. Corresponds to the number of "cells" between each group.

Scale the height of the color bar

Combine plots into a single patchworked ggplot object. If FALSE, return a list of ggplot objects

A patchworked ggplot object if combine = TRUE; otherwise, a list of ggplot objects

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/visualization.R
```

Example 2 (unknown):
```unknown
DoHeatmap.Rd
```

Example 3 (unknown):
```unknown
DoHeatmap(
  object,
  features = NULL,
  cells = NULL,
  group.by = "ident",
  group.bar = TRUE,
  group.colors = NULL,
  disp.min = -2.5,
  disp.max = NULL,
  slot = "scale.data",
  assay = NULL,
  label = TRUE,
  size = 5.5,
  hjust = 0,
  vjust = 0,
  angle = 45,
  raster = TRUE,
  draw.lines = TRUE,
  lines.width = NULL,
  group.bar.height = 0.02,
  combine = TRUE
)
```

Example 4 (r):
```r
DoHeatmap(
  object,
  features = NULL,
  cells = NULL,
  group.by = "ident",
  group.bar = TRUE,
  group.colors = NULL,
  disp.min = -2.5,
  disp.max = NULL,
  slot = "scale.data",
  assay = NULL,
  label = TRUE,
  size = 5.5,
  hjust = 0,
  vjust = 0,
  angle = 45,
  raster = TRUE,
  draw.lines = TRUE,
  lines.width = NULL,
  group.bar.height = 0.02,
  combine = TRUE
)
```

Example 5 (r):
```r
DoHeatmap(
  object,
  features = NULL,
  cells = NULL,
  group.by = "ident",
  group.bar = TRUE,
  group.colors = NULL,
  disp.min = -2.5,
  disp.max = NULL,
  slot = "scale.data",
  assay = NULL,
  label = TRUE,
  size = 5.5,
  hjust = 0,
  vjust = 0,
  angle = 45,
  raster = TRUE,
  draw.lines = TRUE,
  lines.width = NULL,
  group.bar.height = 0.02,
  combine = TRUE
)
```

Example 6 (unknown):
```unknown
VariableFeatures(object = object)
```

Example 7 (unknown):
```unknown
patchworked
```

Example 8 (unknown):
```unknown
patchworked
```

Example 9 (unknown):
```unknown
combine = TRUE
```

Example 10 (unknown):
```unknown
data("pbmc_small")
DoHeatmap(object = pbmc_small)
```

Example 11 (r):
```r
data("pbmc_small")
DoHeatmap(object = pbmc_small)
```

Example 12 (r):
```r
data("pbmc_small")
DoHeatmap(object = pbmc_small)
```

---

## Find spatially variable features — FindSpatiallyVariableFeatures • Seurat

**URL:** http://127.0.0.1:9173/seurat/reference/findspatiallyvariablefeatures/index.html

**Contents:**
- Find spatially variable features
- Arguments
- Contents

Identify features whose variability in expression can be explained to some degree by spatial location.

A Seurat object, assay, or expression matrix

Arguments passed to other methods

Coordinates for each cell/spot/bead

Method for selecting spatially variable features.

markvariogram: See RunMarkVario for details

moransi: See RunMoransI for details.

r value at which to report the "trans" value of the mark variogram

Number of divisions to make in the x direction, helps define the grid over which binning is performed

Number of divisions to make in the y direction, helps define the grid over which binning is performed

Print messages and progress

Slot in the Assay to pull data from

If provided, only compute on given features. Otherwise, compute for all features.

Number of features to mark as the top spatially variable.

Assay to pull the features (marks) from

Name of image to pull the coordinates from

Layer in the Assay5 to pull data from

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/generics.R
```

Example 2 (unknown):
```unknown
R/preprocessing.R
```

Example 3 (unknown):
```unknown
R/preprocessing5.R
```

Example 4 (unknown):
```unknown
FindSpatiallyVariableFeatures.Rd
```

Example 5 (python):
```python
FindSpatiallyVariableFeatures(object, ...)

# Default S3 method
FindSpatiallyVariableFeatures(
  object,
  spatial.location,
  selection.method = c("markvariogram", "moransi"),
  r.metric = 5,
  x.cuts = NULL,
  y.cuts = NULL,
  verbose = TRUE,
  ...
)

# S3 method for class 'Assay'
FindSpatiallyVariableFeatures(
  object,
  slot = "scale.data",
  spatial.location,
  selection.method = c("markvariogram", "moransi"),
  features = NULL,
  r.metric = 5,
  x.cuts = NULL,
  y.cuts = NULL,
  nfeatures = nfeatures,
  verbose = TRUE,
  ...
)

# S3 method for class 'Seurat'
FindSpatiallyVariableFeatures(
  object,
  assay = NULL,
  slot = "scale.data",
  features = NULL,
  image = NULL,
  selection.method = c("markvariogram", "moransi"),
  r.metric = 5,
  x.cuts = NULL,
  y.cuts = NULL,
  nfeatures = 2000,
  verbose = TRUE,
  ...
)

# S3 method for class 'StdAssay'
FindSpatiallyVariableFeatures(
  object,
  layer = "scale.data",
  spatial.location,
  selection.method = c("markvariogram", "moransi"),
  features = NULL,
  r.metric = 5,
  x.cuts = NULL,
  y.cuts = NULL,
  nfeatures = nfeatures,
  verbose = TRUE,
  ...
)
```

Example 6 (r):
```r
FindSpatiallyVariableFeatures(object, ...)

# Default S3 method
FindSpatiallyVariableFeatures(
  object,
  spatial.location,
  selection.method = c("markvariogram", "moransi"),
  r.metric = 5,
  x.cuts = NULL,
  y.cuts = NULL,
  verbose = TRUE,
  ...
)

# S3 method for class 'Assay'
FindSpatiallyVariableFeatures(
  object,
  slot = "scale.data",
  spatial.location,
  selection.method = c("markvariogram", "moransi"),
  features = NULL,
  r.metric = 5,
  x.cuts = NULL,
  y.cuts = NULL,
  nfeatures = nfeatures,
  verbose = TRUE,
  ...
)

# S3 method for class 'Seurat'
FindSpatiallyVariableFeatures(
  object,
  assay = NULL,
  slot = "scale.data",
  features = NULL,
  image = NULL,
  selection.method = c("markvariogram", "moransi"),
  r.metric = 5,
  x.cuts = NULL,
  y.cuts = NULL,
  nfeatures = 2000,
  verbose = TRUE,
  ...
)

# S3 method for class 'StdAssay'
FindSpatiallyVariableFeatures(
  object,
  layer = "scale.data",
  spatial.location,
  selection.method = c("markvariogram", "moransi"),
  features = NULL,
  r.metric = 5,
  x.cuts = NULL,
  y.cuts = NULL,
  nfeatures = nfeatures,
  verbose = TRUE,
  ...
)
```

Example 7 (r):
```r
FindSpatiallyVariableFeatures(object, ...)

# Default S3 method
FindSpatiallyVariableFeatures(
  object,
  spatial.location,
  selection.method = c("markvariogram", "moransi"),
  r.metric = 5,
  x.cuts = NULL,
  y.cuts = NULL,
  verbose = TRUE,
  ...
)

# S3 method for class 'Assay'
FindSpatiallyVariableFeatures(
  object,
  slot = "scale.data",
  spatial.location,
  selection.method = c("markvariogram", "moransi"),
  features = NULL,
  r.metric = 5,
  x.cuts = NULL,
  y.cuts = NULL,
  nfeatures = nfeatures,
  verbose = TRUE,
  ...
)

# S3 method for class 'Seurat'
FindSpatiallyVariableFeatures(
  object,
  assay = NULL,
  slot = "scale.data",
  features = NULL,
  image = NULL,
  selection.method = c("markvariogram", "moransi"),
  r.metric = 5,
  x.cuts = NULL,
  y.cuts = NULL,
  nfeatures = 2000,
  verbose = TRUE,
  ...
)

# S3 method for class 'StdAssay'
FindSpatiallyVariableFeatures(
  object,
  layer = "scale.data",
  spatial.location,
  selection.method = c("markvariogram", "moransi"),
  features = NULL,
  r.metric = 5,
  x.cuts = NULL,
  y.cuts = NULL,
  nfeatures = nfeatures,
  verbose = TRUE,
  ...
)
```

Example 8 (unknown):
```unknown
markvariogram
```

Example 9 (unknown):
```unknown
RunMarkVario
```

---

## Visualize spatial clustering and expression data. — SpatialPlot • Seurat

**URL:** http://127.0.0.1:9173/seurat/reference/spatialplot/index.html

**Contents:**
- Visualize spatial clustering and expression data.
- Arguments
- Value
- Examples
- Contents

SpatialPlot plots a feature or discrete grouping (e.g. cluster assignments) as spots over the image that was collected. We also provide SpatialFeaturePlot and SpatialDimPlot as wrapper functions around SpatialPlot for a consistent naming framework.

Name of meta.data column to group the data by

Name of the feature to visualize. Provide either group.by OR features, not both.

Name of the images to use in the plot(s)

Vector of colors, each color corresponds to an identity class. This may also be a single character or numeric value corresponding to a palette as specified by brewer.pal.info. By default, ggplot2 assigns colors

Adjust the opacity of the background images. Set to 0 to remove.

Choose the scale factor ("lowres"/"hires") to apply in order to matchthe plot with the specified `image` - defaults to "lowres"

Crop the plot in to focus on points plotted. Set to FALSE to show entire background image.

If plotting a feature, which data slot to pull from (counts, data, or scale.data)

How to handle the color scale across multiple plots. Options are:

“feature” (default; by row/feature scaling): The plots for each individual feature are scaled to the maximum expression of the feature across the conditions provided to split.by

“all” (universal scaling): The plots for all features and conditions are scaled to the maximum expression value for the feature with the highest overall expression

NULL (no scaling): Each individual plot is scaled to the maximum expression value of the feature in the condition provided to split.by; be aware setting NULL will result in color scales that are not comparable between plots

Vector of minimum and maximum cutoff values for each feature, may specify quantile in the form of 'q##' where '##' is the quantile (eg, 'q1', 'q10')

A list of character or numeric vectors of cells to highlight. If only one group of cells desired, can simply pass a vector instead of a list. If set, colors selected cells to the color(s) in cols.highlight

A vector of colors to highlight the cells as; ordered the same as the groups in cells.highlight; last color corresponds to unselected cells.

When highlighting certain groups of cells, split each group into its own plot

Whether to label the clusters

Sets the size of the labels

Sets the color of the label text

Whether to put a box around the label text (geom_text vs geom_label)

Repels the labels to prevent overlap

Number of columns if plotting multiple plots

Combine plots into a single gg object; note that if TRUE; themeing will not work when plotting multiple features/groupings

Scale the size of the spots.

Controls opacity of spots. Provide as a vector specifying the min and max for SpatialFeaturePlot. For SpatialDimPlot, provide a single alpha value for each plot.

Control the shape of the spots - same as the ggplot2 parameter. The default is 21, which plots circles - use 22 to plot squares.

Control the width of the border around the spots

Launch an interactive SpatialDimPlot or SpatialFeaturePlot session, see ISpatialDimPlot or ISpatialFeaturePlot for more details

DEPRECATED in favor of interactive

An optional dataframe or matrix of extra information to be displayed on hover

If do.identify, either a vector of cells selected or the object with selected cells set to the value of identify.ident (if set). Else, if do.hover, a plotly object with interactive graphics. Else, a ggplot object

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/visualization.R
```

Example 2 (unknown):
```unknown
R/convenience.R
```

Example 3 (unknown):
```unknown
SpatialPlot.Rd
```

Example 4 (unknown):
```unknown
SpatialPlot(
  object,
  group.by = NULL,
  features = NULL,
  images = NULL,
  cols = NULL,
  image.alpha = 1,
  image.scale = "lowres",
  crop = TRUE,
  slot = "data",
  keep.scale = "feature",
  min.cutoff = NA,
  max.cutoff = NA,
  cells.highlight = NULL,
  cols.highlight = c("#DE2D26", "grey50"),
  facet.highlight = FALSE,
  label = FALSE,
  label.size = 5,
  label.color = "white",
  label.box = TRUE,
  repel = FALSE,
  ncol = NULL,
  combine = TRUE,
  pt.size.factor = 1.6,
  alpha = c(1, 1),
  shape = 21,
  stroke = NA,
  interactive = FALSE,
  do.identify = FALSE,
  identify.ident = NULL,
  do.hover = FALSE,
  information = NULL
)

SpatialDimPlot(
  object,
  group.by = NULL,
  images = NULL,
  cols = NULL,
  crop = TRUE,
  cells.highlight = NULL,
  cols.highlight = c("#DE2D26", "grey50"),
  facet.highlight = FALSE,
  label = FALSE,
  label.size = 7,
  label.color = "white",
  repel = FALSE,
  ncol = NULL,
  combine = TRUE,
  pt.size.factor = 1.6,
  alpha = c(1, 1),
  image.alpha = 1,
  image.scale = "lowres",
  shape = 21,
  stroke = NA,
  label.box = TRUE,
  interactive = FALSE,
  information = NULL
)

SpatialFeaturePlot(
  object,
  features,
  images = NULL,
  crop = TRUE,
  slot = "data",
  keep.scale = "feature",
  min.cutoff = NA,
  max.cutoff = NA,
  ncol = NULL,
  combine = TRUE,
  pt.size.factor = 1.6,
  alpha = c(1, 1),
  image.alpha = 1,
  image.scale = "lowres",
  shape = 21,
  stroke = NA,
  interactive = FALSE,
  information = NULL
)
```

Example 5 (r):
```r
SpatialPlot(
  object,
  group.by = NULL,
  features = NULL,
  images = NULL,
  cols = NULL,
  image.alpha = 1,
  image.scale = "lowres",
  crop = TRUE,
  slot = "data",
  keep.scale = "feature",
  min.cutoff = NA,
  max.cutoff = NA,
  cells.highlight = NULL,
  cols.highlight = c("#DE2D26", "grey50"),
  facet.highlight = FALSE,
  label = FALSE,
  label.size = 5,
  label.color = "white",
  label.box = TRUE,
  repel = FALSE,
  ncol = NULL,
  combine = TRUE,
  pt.size.factor = 1.6,
  alpha = c(1, 1),
  shape = 21,
  stroke = NA,
  interactive = FALSE,
  do.identify = FALSE,
  identify.ident = NULL,
  do.hover = FALSE,
  information = NULL
)

SpatialDimPlot(
  object,
  group.by = NULL,
  images = NULL,
  cols = NULL,
  crop = TRUE,
  cells.highlight = NULL,
  cols.highlight = c("#DE2D26", "grey50"),
  facet.highlight = FALSE,
  label = FALSE,
  label.size = 7,
  label.color = "white",
  repel = FALSE,
  ncol = NULL,
  combine = TRUE,
  pt.size.factor = 1.6,
  alpha = c(1, 1),
  image.alpha = 1,
  image.scale = "lowres",
  shape = 21,
  stroke = NA,
  label.box = TRUE,
  interactive = FALSE,
  information = NULL
)

SpatialFeaturePlot(
  object,
  features,
  images = NULL,
  crop = TRUE,
  slot = "data",
  keep.scale = "feature",
  min.cutoff = NA,
  max.cutoff = NA,
  ncol = NULL,
  combine = TRUE,
  pt.size.factor = 1.6,
  alpha = c(1, 1),
  image.alpha = 1,
  image.scale = "lowres",
  shape = 21,
  stroke = NA,
  interactive = FALSE,
  information = NULL
)
```

Example 6 (r):
```r
SpatialPlot(
  object,
  group.by = NULL,
  features = NULL,
  images = NULL,
  cols = NULL,
  image.alpha = 1,
  image.scale = "lowres",
  crop = TRUE,
  slot = "data",
  keep.scale = "feature",
  min.cutoff = NA,
  max.cutoff = NA,
  cells.highlight = NULL,
  cols.highlight = c("#DE2D26", "grey50"),
  facet.highlight = FALSE,
  label = FALSE,
  label.size = 5,
  label.color = "white",
  label.box = TRUE,
  repel = FALSE,
  ncol = NULL,
  combine = TRUE,
  pt.size.factor = 1.6,
  alpha = c(1, 1),
  shape = 21,
  stroke = NA,
  interactive = FALSE,
  do.identify = FALSE,
  identify.ident = NULL,
  do.hover = FALSE,
  information = NULL
)

SpatialDimPlot(
  object,
  group.by = NULL,
  images = NULL,
  cols = NULL,
  crop = TRUE,
  cells.highlight = NULL,
  cols.highlight = c("#DE2D26", "grey50"),
  facet.highlight = FALSE,
  label = FALSE,
  label.size = 7,
  label.color = "white",
  repel = FALSE,
  ncol = NULL,
  combine = TRUE,
  pt.size.factor = 1.6,
  alpha = c(1, 1),
  image.alpha = 1,
  image.scale = "lowres",
  shape = 21,
  stroke = NA,
  label.box = TRUE,
  interactive = FALSE,
  information = NULL
)

SpatialFeaturePlot(
  object,
  features,
  images = NULL,
  crop = TRUE,
  slot = "data",
  keep.scale = "feature",
  min.cutoff = NA,
  max.cutoff = NA,
  ncol = NULL,
  combine = TRUE,
  pt.size.factor = 1.6,
  alpha = c(1, 1),
  image.alpha = 1,
  image.scale = "lowres",
  shape = 21,
  stroke = NA,
  interactive = FALSE,
  information = NULL
)
```

Example 7 (unknown):
```unknown
brewer.pal.info
```

Example 8 (unknown):
```unknown
ISpatialDimPlot
```

Example 9 (unknown):
```unknown
ISpatialFeaturePlot
```

Example 10 (unknown):
```unknown
interactive
```

Example 11 (unknown):
```unknown
do.identify
```

Example 12 (unknown):
```unknown
identify.ident
```

Example 13 (unknown):
```unknown
if (FALSE) { # \dontrun{
# For functionality analagous to FeaturePlot
SpatialPlot(seurat.object, features = "MS4A1")
SpatialFeaturePlot(seurat.object, features = "MS4A1")

# For functionality analagous to DimPlot
SpatialPlot(seurat.object, group.by = "clusters")
SpatialDimPlot(seurat.object, group.by = "clusters")
} # }
```

Example 14 (r):
```r
if (FALSE) { # \dontrun{
# For functionality analagous to FeaturePlot
SpatialPlot(seurat.object, features = "MS4A1")
SpatialFeaturePlot(seurat.object, features = "MS4A1")

# For functionality analagous to DimPlot
SpatialPlot(seurat.object, group.by = "clusters")
SpatialDimPlot(seurat.object, group.by = "clusters")
} # }
```

Example 15 (r):
```r
if (FALSE) { # \dontrun{
# For functionality analagous to FeaturePlot
SpatialPlot(seurat.object, features = "MS4A1")
SpatialFeaturePlot(seurat.object, features = "MS4A1")

# For functionality analagous to DimPlot
SpatialPlot(seurat.object, group.by = "clusters")
SpatialDimPlot(seurat.object, group.by = "clusters")
} # }
```

---

## The SpatialImage Class — SpatialImage-class • Seurat

**URL:** http://127.0.0.1:9173/reference_spatialimage-class.html

**Contents:**
- The SpatialImage Class
- See also
- Contents

For more details, please see the documentation in SeuratObject

SeuratObject::SpatialImage-class

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/reexports.R
```

Example 2 (unknown):
```unknown
SpatialImage-class.Rd
```

Example 3 (unknown):
```unknown
SeuratObject
```

Example 4 (unknown):
```unknown
SeuratObject::SpatialImage-class
```

---

## Scatter plot of single cell data — FeatureScatter • Seurat

**URL:** http://127.0.0.1:9173/seurat/reference/featurescatter/index.html

**Contents:**
- Scatter plot of single cell data
- Arguments
- Value
- Examples
- Contents

Creates a scatter plot of two features (typically feature expression), across a set of single cells. Cells are colored by their identity class. Pearson correlation between the two features is displayed above the plot.

First feature to plot. Typically feature expression but can also be metrics, PC scores, etc. - anything that can be retreived with FetchData

Second feature to plot.

Cells to include on the scatter plot.

Whether to randomly shuffle the order of points. This can be useful for crowded plots if points of interest are being buried. (default is FALSE)

Sets the seed if randomly shuffling the order of points.

Name of one or more metadata columns to group (color) cells by (for example, orig.ident); pass 'ident' to group by identity class

A factor in object metadata to split the feature plot by, pass 'ident' to split by cell identity

Colors to use for identity class plotting.

Size of the points on the plot

Spline span in loess function call, if NULL, no spline added

Smooth the graph (similar to smoothScatter)

Combine plots into a single patchworked

Slot to pull data from, should be one of 'counts', 'data', or 'scale.data'

Display correlation in plot title

Number of columns if plotting multiple plots

Convert points to raster format, default is NULL which will automatically use raster if the number of points plotted is greater than 100,000

Pixel resolution for rasterized plots, passed to geom_scattermore(). Default is c(512, 512).

Jitter for easier visualization of crowded points (default is FALSE)

Plot features on the log scale (default is FALSE)

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/visualization.R
```

Example 2 (unknown):
```unknown
FeatureScatter.Rd
```

Example 3 (unknown):
```unknown
FeatureScatter(
  object,
  feature1,
  feature2,
  cells = NULL,
  shuffle = FALSE,
  seed = 1,
  group.by = NULL,
  split.by = NULL,
  cols = NULL,
  pt.size = 1,
  shape.by = NULL,
  span = NULL,
  smooth = FALSE,
  combine = TRUE,
  slot = "data",
  plot.cor = TRUE,
  ncol = NULL,
  raster = NULL,
  raster.dpi = c(512, 512),
  jitter = FALSE,
  log = FALSE
)
```

Example 4 (r):
```r
FeatureScatter(
  object,
  feature1,
  feature2,
  cells = NULL,
  shuffle = FALSE,
  seed = 1,
  group.by = NULL,
  split.by = NULL,
  cols = NULL,
  pt.size = 1,
  shape.by = NULL,
  span = NULL,
  smooth = FALSE,
  combine = TRUE,
  slot = "data",
  plot.cor = TRUE,
  ncol = NULL,
  raster = NULL,
  raster.dpi = c(512, 512),
  jitter = FALSE,
  log = FALSE
)
```

Example 5 (r):
```r
FeatureScatter(
  object,
  feature1,
  feature2,
  cells = NULL,
  shuffle = FALSE,
  seed = 1,
  group.by = NULL,
  split.by = NULL,
  cols = NULL,
  pt.size = 1,
  shape.by = NULL,
  span = NULL,
  smooth = FALSE,
  combine = TRUE,
  slot = "data",
  plot.cor = TRUE,
  ncol = NULL,
  raster = NULL,
  raster.dpi = c(512, 512),
  jitter = FALSE,
  log = FALSE
)
```

Example 6 (unknown):
```unknown
patchworked
```

Example 7 (unknown):
```unknown
data("pbmc_small")
FeatureScatter(object = pbmc_small, feature1 = 'CD9', feature2 = 'CD3E')
```

Example 8 (r):
```r
data("pbmc_small")
FeatureScatter(object = pbmc_small, feature1 = 'CD9', feature2 = 'CD3E')
```

Example 9 (r):
```r
data("pbmc_small")
FeatureScatter(object = pbmc_small, feature1 = 'CD9', feature2 = 'CD3E')
```

---

## Demultiplex samples based on classification method from MULTI-seq (McGinnis et al., bioRxiv 2018) — MULTIseqDemux • Seurat

**URL:** http://127.0.0.1:9173/seurat/reference/multiseqdemux/index.html

**Contents:**
- Demultiplex samples based on classification method from MULTI-seq (McGinnis et al., bioRxiv 2018)
- Arguments
- Value
- References
- Examples
- Contents

Identify singlets, doublets and negative cells from multiplexing experiments. Annotate singlets by tags.

Seurat object. Assumes that the specified assay data has been added

Name of the multiplexing assay (HTO by default)

The quantile to use for classification

Whether to perform automated threshold finding to define the best quantile. Default is FALSE

Maximum number of iterations if autoThresh = TRUE. Default is 5

A range of possible quantile values to try if autoThresh = TRUE

A Seurat object with demultiplexing results stored at object$MULTI_ID

doi:10.1038/s41592-019-0433-8

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/preprocessing.R
```

Example 2 (unknown):
```unknown
MULTIseqDemux.Rd
```

Example 3 (python):
```python
MULTIseqDemux(
  object,
  assay = "HTO",
  quantile = 0.7,
  autoThresh = FALSE,
  maxiter = 5,
  qrange = seq(from = 0.1, to = 0.9, by = 0.05),
  verbose = TRUE
)
```

Example 4 (r):
```r
MULTIseqDemux(
  object,
  assay = "HTO",
  quantile = 0.7,
  autoThresh = FALSE,
  maxiter = 5,
  qrange = seq(from = 0.1, to = 0.9, by = 0.05),
  verbose = TRUE
)
```

Example 5 (r):
```r
MULTIseqDemux(
  object,
  assay = "HTO",
  quantile = 0.7,
  autoThresh = FALSE,
  maxiter = 5,
  qrange = seq(from = 0.1, to = 0.9, by = 0.05),
  verbose = TRUE
)
```

Example 6 (unknown):
```unknown
object$MULTI_ID
```

Example 7 (unknown):
```unknown
if (FALSE) { # \dontrun{
object <- MULTIseqDemux(object)
} # }
```

Example 8 (r):
```r
if (FALSE) { # \dontrun{
object <- MULTIseqDemux(object)
} # }
```

Example 9 (r):
```r
if (FALSE) { # \dontrun{
object <- MULTIseqDemux(object)
} # }
```

---

## Pseudobulk Expression — PseudobulkExpression • Seurat

**URL:** http://127.0.0.1:9173/seurat/reference/pseudobulkexpression/index.html

**Contents:**
- Pseudobulk Expression
- Arguments
- Value
- Contents

Normalize the count data present in a given assay.

Returns a representative expression value for each identity class

Arguments to be passed to methods such as CreateSeuratObject

The name of the passed assay - used primarily for warning/error messages

A matrix defining groupings for pseudobulk expression calculations; each column represents an identity class, and each row a sample

Features to analyze. Default is all features in the assay

Layer(s) to user; if multiple are given, assumed to follow the order of 'assays' (if specified) or object's assays

(Deprecated) See layer

Print messages and show progress bar

Which assays to use. Default is all assays

Whether to return the data as a Seurat object. Default is FALSE

Categories for grouping (e.g, "ident", "replicate", "celltype"); "ident" by default

(Deprecated) See group.by

The method used for calculating pseudobulk expression; one of: "average" or "aggregate"

Method for normalization, see NormalizeData

Scale factor for normalization, see NormalizeData

Margin to perform CLR normalization, see NormalizeData

Returns object after normalization

Returns a matrix with genes as rows, identity classes as columns. If return.seurat is TRUE, returns an object of class Seurat.

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/generics.R
```

Example 2 (unknown):
```unknown
R/utilities.R
```

Example 3 (unknown):
```unknown
PseudobulkExpression.Rd
```

Example 4 (python):
```python
PseudobulkExpression(object, ...)

# S3 method for class 'Assay'
PseudobulkExpression(
  object,
  assay,
  category.matrix,
  features = NULL,
  layer = "data",
  slot = deprecated(),
  verbose = TRUE,
  ...
)

# S3 method for class 'StdAssay'
PseudobulkExpression(
  object,
  assay,
  category.matrix,
  features = NULL,
  layer = "data",
  slot = deprecated(),
  verbose = TRUE,
  ...
)

# S3 method for class 'Seurat'
PseudobulkExpression(
  object,
  assays = NULL,
  features = NULL,
  return.seurat = FALSE,
  group.by = "ident",
  add.ident = NULL,
  layer = "data",
  slot = deprecated(),
  method = "average",
  normalization.method = "LogNormalize",
  scale.factor = 10000,
  margin = 1,
  verbose = TRUE,
  ...
)
```

Example 5 (r):
```r
PseudobulkExpression(object, ...)

# S3 method for class 'Assay'
PseudobulkExpression(
  object,
  assay,
  category.matrix,
  features = NULL,
  layer = "data",
  slot = deprecated(),
  verbose = TRUE,
  ...
)

# S3 method for class 'StdAssay'
PseudobulkExpression(
  object,
  assay,
  category.matrix,
  features = NULL,
  layer = "data",
  slot = deprecated(),
  verbose = TRUE,
  ...
)

# S3 method for class 'Seurat'
PseudobulkExpression(
  object,
  assays = NULL,
  features = NULL,
  return.seurat = FALSE,
  group.by = "ident",
  add.ident = NULL,
  layer = "data",
  slot = deprecated(),
  method = "average",
  normalization.method = "LogNormalize",
  scale.factor = 10000,
  margin = 1,
  verbose = TRUE,
  ...
)
```

Example 6 (r):
```r
PseudobulkExpression(object, ...)

# S3 method for class 'Assay'
PseudobulkExpression(
  object,
  assay,
  category.matrix,
  features = NULL,
  layer = "data",
  slot = deprecated(),
  verbose = TRUE,
  ...
)

# S3 method for class 'StdAssay'
PseudobulkExpression(
  object,
  assay,
  category.matrix,
  features = NULL,
  layer = "data",
  slot = deprecated(),
  verbose = TRUE,
  ...
)

# S3 method for class 'Seurat'
PseudobulkExpression(
  object,
  assays = NULL,
  features = NULL,
  return.seurat = FALSE,
  group.by = "ident",
  add.ident = NULL,
  layer = "data",
  slot = deprecated(),
  method = "average",
  normalization.method = "LogNormalize",
  scale.factor = 10000,
  margin = 1,
  verbose = TRUE,
  ...
)
```

Example 7 (unknown):
```unknown
CreateSeuratObject
```

Example 8 (unknown):
```unknown
NormalizeData
```

Example 9 (unknown):
```unknown
NormalizeData
```

Example 10 (unknown):
```unknown
NormalizeData
```

---

## Slim down a Seurat object — DietSeurat • Seurat

**URL:** http://127.0.0.1:9173/reference_dietseurat.html

**Contents:**
- Slim down a Seurat object
- Arguments
- Value
- Contents

Keep only certain aspects of the Seurat object. Can be useful in functions that utilize merge as it reduces the amount of data in the merge

A vector or named list of layers to keep

Only keep a subset of features, defaults to all features

Only keep a subset of assays specified here

Only keep a subset of DimReducs specified here (if NULL, remove all DimReducs)

Only keep a subset of Graphs specified here (if NULL, remove all Graphs)

Preserve the misc slot; default is TRUE

Preserve the count matrices for the assays specified

Preserve the data matrices for the assays specified

Preserve the scale data matrices for the assays specified

object with only the sub-object specified retained

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/objects.R
```

Example 2 (unknown):
```unknown
DietSeurat.Rd
```

Example 3 (unknown):
```unknown
DietSeurat(
  object,
  layers = NULL,
  features = NULL,
  assays = NULL,
  dimreducs = NULL,
  graphs = NULL,
  misc = TRUE,
  counts = deprecated(),
  data = deprecated(),
  scale.data = deprecated(),
  ...
)
```

Example 4 (r):
```r
DietSeurat(
  object,
  layers = NULL,
  features = NULL,
  assays = NULL,
  dimreducs = NULL,
  graphs = NULL,
  misc = TRUE,
  counts = deprecated(),
  data = deprecated(),
  scale.data = deprecated(),
  ...
)
```

Example 5 (r):
```r
DietSeurat(
  object,
  layers = NULL,
  features = NULL,
  assays = NULL,
  dimreducs = NULL,
  graphs = NULL,
  misc = TRUE,
  counts = deprecated(),
  data = deprecated(),
  scale.data = deprecated(),
  ...
)
```

---

## Gene expression markers for all identity classes — FindAllMarkers • Seurat

**URL:** http://127.0.0.1:9173/reference_findallmarkers.html

**Contents:**
- Gene expression markers for all identity classes
- Arguments
- Value
- Examples
- Contents

Finds markers (differentially expressed genes) for each of the identity classes in a dataset

Assay to use in differential expression testing

Genes to test. Default is to use all genes

Regroup cells into a different identity class prior to performing differential expression (see example); "ident" to use Idents

Limit testing to genes which show, on average, at least X-fold difference (log-scale) between the two groups of cells. Default is 0.1 Increasing logfc.threshold speeds up the function, but can miss weaker signals. If the slot parameter is "scale.data" no filtering is performed.

Denotes which test to use. Available options are:

"wilcox" : Identifies differentially expressed genes between two groups of cells using a Wilcoxon Rank Sum test (default); will use a fast implementation by Presto if installed

"wilcox_limma" : Identifies differentially expressed genes between two groups of cells using the limma implementation of the Wilcoxon Rank Sum test; set this option to reproduce results from Seurat v4

"bimod" : Likelihood-ratio test for single cell gene expression, (McDavid et al., Bioinformatics, 2013)

"roc" : Identifies 'markers' of gene expression using ROC analysis. For each gene, evaluates (using AUC) a classifier built on that gene alone, to classify between two groups of cells. An AUC value of 1 means that expression values for this gene alone can perfectly classify the two groupings (i.e. Each of the cells in cells.1 exhibit a higher level than each of the cells in cells.2). An AUC value of 0 also means there is perfect classification, but in the other direction. A value of 0.5 implies that the gene has no predictive power to classify the two groups. Returns a 'predictive power' (abs(AUC-0.5) * 2) ranked matrix of putative differentially expressed genes.

"t" : Identify differentially expressed genes between two groups of cells using the Student's t-test.

"negbinom" : Identifies differentially expressed genes between two groups of cells using a negative binomial generalized linear model. Use only for UMI-based datasets

"poisson" : Identifies differentially expressed genes between two groups of cells using a poisson generalized linear model. Use only for UMI-based datasets

"LR" : Uses a logistic regression framework to determine differentially expressed genes. Constructs a logistic regression model predicting group membership based on each feature individually and compares this to a null model with a likelihood ratio test.

"MAST" : Identifies differentially expressed genes between two groups of cells using a hurdle model tailored to scRNA-seq data. Utilizes the MAST package to run the DE testing.

"DESeq2" : Identifies differentially expressed genes between two groups of cells based on a model using DESeq2 which uses a negative binomial distribution (Love et al, Genome Biology, 2014).This test does not support pre-filtering of genes based on average difference (or percent detection rate) between cell groups. However, genes may be pre-filtered based on their minimum detection rate (min.pct) across both cell groups. To use this method, please install DESeq2, using the instructions at https://bioconductor.org/packages/release/bioc/html/DESeq2.html

Slot to pull data from; note that if test.use is "negbinom", "poisson", or "DESeq2", slot will be set to "counts"

only test genes that are detected in a minimum fraction of min.pct cells in either of the two populations. Meant to speed up the function by not testing genes that are very infrequently expressed. Default is 0.01

only test genes that show a minimum difference in the fraction of detection between the two groups. Set to -Inf by default

A node to find markers for and all its children; requires BuildClusterTree to have been run previously; replaces FindAllMarkersNode

Print a progress bar once expression testing begins

Only return positive markers (FALSE by default)

Down sample each identity class to a max number. Default is no downsampling. Not activated by default (set to Inf)

Random seed for downsampling

Variables to test, used only when test.use is one of 'LR', 'negbinom', 'poisson', or 'MAST'

Minimum number of cells expressing the feature in at least one of the two groups, currently only used for poisson and negative binomial tests

Minimum number of cells in one of the groups

Function to use for fold change or average difference calculation. The default depends on the the value of fc.slot:

"counts" : difference in the log of the mean counts, with pseudocount.

"data" : difference in the log of the average exponentiated data, with pseudocount. This adjusts for differences in sequencing depth between cells, and assumes that "data" has been log-normalized.

"scale.data" : difference in the means of scale.data.

Name of the fold change, average difference, or custom function column in the output data.frame. If NULL, the fold change column will be named according to the logarithm base (eg, "avg_log2FC"), or if using the scale.data slot "avg_diff".

The base with respect to which logarithms are computed.

Only return markers that have a p-value < return.thresh, or a power > return.thresh (if the test is ROC)

Convert the sparse matrix to a dense form before running the DE test. This can provide speedups but might require higher memory; default is FALSE

Arguments passed to other methods and to specific DE methods

Matrix containing a ranked list of putative markers, and associated statistics (p-values, ROC score, etc.)

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/differential_expression.R
```

Example 2 (unknown):
```unknown
FindAllMarkers.Rd
```

Example 3 (unknown):
```unknown
FindAllMarkers(
  object,
  assay = NULL,
  features = NULL,
  group.by = NULL,
  logfc.threshold = 0.1,
  test.use = "wilcox",
  slot = "data",
  min.pct = 0.01,
  min.diff.pct = -Inf,
  node = NULL,
  verbose = TRUE,
  only.pos = FALSE,
  max.cells.per.ident = Inf,
  random.seed = 1,
  latent.vars = NULL,
  min.cells.feature = 3,
  min.cells.group = 3,
  mean.fxn = NULL,
  fc.name = NULL,
  base = 2,
  return.thresh = 0.01,
  densify = FALSE,
  ...
)
```

Example 4 (r):
```r
FindAllMarkers(
  object,
  assay = NULL,
  features = NULL,
  group.by = NULL,
  logfc.threshold = 0.1,
  test.use = "wilcox",
  slot = "data",
  min.pct = 0.01,
  min.diff.pct = -Inf,
  node = NULL,
  verbose = TRUE,
  only.pos = FALSE,
  max.cells.per.ident = Inf,
  random.seed = 1,
  latent.vars = NULL,
  min.cells.feature = 3,
  min.cells.group = 3,
  mean.fxn = NULL,
  fc.name = NULL,
  base = 2,
  return.thresh = 0.01,
  densify = FALSE,
  ...
)
```

Example 5 (r):
```r
FindAllMarkers(
  object,
  assay = NULL,
  features = NULL,
  group.by = NULL,
  logfc.threshold = 0.1,
  test.use = "wilcox",
  slot = "data",
  min.pct = 0.01,
  min.diff.pct = -Inf,
  node = NULL,
  verbose = TRUE,
  only.pos = FALSE,
  max.cells.per.ident = Inf,
  random.seed = 1,
  latent.vars = NULL,
  min.cells.feature = 3,
  min.cells.group = 3,
  mean.fxn = NULL,
  fc.name = NULL,
  base = 2,
  return.thresh = 0.01,
  densify = FALSE,
  ...
)
```

Example 6 (unknown):
```unknown
BuildClusterTree
```

Example 7 (unknown):
```unknown
FindAllMarkersNode
```

Example 8 (unknown):
```unknown
data("pbmc_small")
# Find markers for all clusters
all.markers <- FindAllMarkers(object = pbmc_small)
#> Calculating cluster 0
#> Calculating cluster 1
#> Calculating cluster 2
head(x = all.markers)
#>                 p_val avg_log2FC pct.1 pct.2    p_val_adj cluster     gene
#> HLA-DPB1 9.572778e-13  -6.030507 0.083 0.909 2.201739e-10       0 HLA-DPB1
#> HLA-DRB1 7.673127e-12  -5.630708 0.083 0.864 1.764819e-09       0 HLA-DRB1
#> HLA-DPA1 3.673172e-11  -4.477325 0.111 0.864 8.448296e-09       0 HLA-DPA1
#> HLA-DRA  1.209114e-10  -4.298484 0.417 0.909 2.780962e-08       0  HLA-DRA
#> HLA-DRB5 9.547049e-10  -4.576012 0.056 0.773 2.195821e-07       0 HLA-DRB5
#> HLA-DQB1 3.035198e-08  -4.629157 0.028 0.659 6.980956e-06       0 HLA-DQB1
if (FALSE) { # \dontrun{
# Pass a value to node as a replacement for FindAllMarkersNode
pbmc_small <- BuildClusterTree(object = pbmc_small)
all.markers <- FindAllMarkers(object = pbmc_small, node = 4)
head(x = all.markers)
} # }
```

Example 9 (r):
```r
data("pbmc_small")
# Find markers for all clusters
all.markers <- FindAllMarkers(object = pbmc_small)
#> Calculating cluster 0
#> Calculating cluster 1
#> Calculating cluster 2
head(x = all.markers)
#>                 p_val avg_log2FC pct.1 pct.2    p_val_adj cluster     gene
#> HLA-DPB1 9.572778e-13  -6.030507 0.083 0.909 2.201739e-10       0 HLA-DPB1
#> HLA-DRB1 7.673127e-12  -5.630708 0.083 0.864 1.764819e-09       0 HLA-DRB1
#> HLA-DPA1 3.673172e-11  -4.477325 0.111 0.864 8.448296e-09       0 HLA-DPA1
#> HLA-DRA  1.209114e-10  -4.298484 0.417 0.909 2.780962e-08       0  HLA-DRA
#> HLA-DRB5 9.547049e-10  -4.576012 0.056 0.773 2.195821e-07       0 HLA-DRB5
#> HLA-DQB1 3.035198e-08  -4.629157 0.028 0.659 6.980956e-06       0 HLA-DQB1
if (FALSE) { # \dontrun{
# Pass a value to node as a replacement for FindAllMarkersNode
pbmc_small <- BuildClusterTree(object = pbmc_small)
all.markers <- FindAllMarkers(object = pbmc_small, node = 4)
head(x = all.markers)
} # }
```

Example 10 (r):
```r
data("pbmc_small")
# Find markers for all clusters
all.markers <- FindAllMarkers(object = pbmc_small)
#> Calculating cluster 0
#> Calculating cluster 1
#> Calculating cluster 2
head(x = all.markers)
#>                 p_val avg_log2FC pct.1 pct.2    p_val_adj cluster     gene
#> HLA-DPB1 9.572778e-13  -6.030507 0.083 0.909 2.201739e-10       0 HLA-DPB1
#> HLA-DRB1 7.673127e-12  -5.630708 0.083 0.864 1.764819e-09       0 HLA-DRB1
#> HLA-DPA1 3.673172e-11  -4.477325 0.111 0.864 8.448296e-09       0 HLA-DPA1
#> HLA-DRA  1.209114e-10  -4.298484 0.417 0.909 2.780962e-08       0  HLA-DRA
#> HLA-DRB5 9.547049e-10  -4.576012 0.056 0.773 2.195821e-07       0 HLA-DRB5
#> HLA-DQB1 3.035198e-08  -4.629157 0.028 0.659 6.980956e-06       0 HLA-DQB1
if (FALSE) { # \dontrun{
# Pass a value to node as a replacement for FindAllMarkersNode
pbmc_small <- BuildClusterTree(object = pbmc_small)
all.markers <- FindAllMarkers(object = pbmc_small, node = 4)
head(x = all.markers)
} # }
```

---

## Get integration data — GetIntegrationData • Seurat

**URL:** http://127.0.0.1:9173/seurat/reference/getintegrationdata/index.html

**Contents:**
- Get integration data
- Arguments
- Value
- Contents

Name of integration object

Which slot in integration object to get

Returns data from the requested slot within the integrated object

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/objects.R
```

Example 2 (unknown):
```unknown
GetIntegrationData.Rd
```

Example 3 (unknown):
```unknown
GetIntegrationData(object, integration.name, slot)
```

Example 4 (r):
```r
GetIntegrationData(object, integration.name, slot)
```

Example 5 (r):
```r
GetIntegrationData(object, integration.name, slot)
```

---

## Convert objects to Seurat objects — as.Seurat.CellDataSet • Seurat

**URL:** http://127.0.0.1:9173/reference_as.seurat.html

**Contents:**
- Convert objects to Seurat objects
- Arguments
- Value
- See also
- Contents

Convert objects to Seurat objects

An object to convert to class Seurat

Slot to store expression data as

Name of assays to convert; set to NULL for all assays to be converted

Show progress updates

Arguments passed to other methods

name of the SingleCellExperiment assay to store as counts; set to NULL if only normalized data are present

name of the SingleCellExperiment assay to slot as data. Set to NULL if only counts are present

Project name for new Seurat object

A Seurat object generated from x

SeuratObject::as.Seurat

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/objects.R
```

Example 2 (unknown):
```unknown
as.Seurat.Rd
```

Example 3 (python):
```python
# S3 method for class 'CellDataSet'
as.Seurat(x, slot = "counts", assay = "RNA", verbose = TRUE, ...)

# S3 method for class 'SingleCellExperiment'
as.Seurat(
  x,
  counts = "counts",
  data = "logcounts",
  assay = NULL,
  project = "SingleCellExperiment",
  ...
)
```

Example 4 (r):
```r
# S3 method for class 'CellDataSet'
as.Seurat(x, slot = "counts", assay = "RNA", verbose = TRUE, ...)

# S3 method for class 'SingleCellExperiment'
as.Seurat(
  x,
  counts = "counts",
  data = "logcounts",
  assay = NULL,
  project = "SingleCellExperiment",
  ...
)
```

Example 5 (r):
```r
# S3 method for class 'CellDataSet'
as.Seurat(x, slot = "counts", assay = "RNA", verbose = TRUE, ...)

# S3 method for class 'SingleCellExperiment'
as.Seurat(
  x,
  counts = "counts",
  data = "logcounts",
  assay = NULL,
  project = "SingleCellExperiment",
  ...
)
```

Example 6 (unknown):
```unknown
SeuratObject::as.Seurat
```

---

## Pseudobulk Expression — PseudobulkExpression • Seurat

**URL:** http://127.0.0.1:9173/reference_pseudobulkexpression.html

**Contents:**
- Pseudobulk Expression
- Arguments
- Value
- Contents

Normalize the count data present in a given assay.

Returns a representative expression value for each identity class

Arguments to be passed to methods such as CreateSeuratObject

The name of the passed assay - used primarily for warning/error messages

A matrix defining groupings for pseudobulk expression calculations; each column represents an identity class, and each row a sample

Features to analyze. Default is all features in the assay

Layer(s) to user; if multiple are given, assumed to follow the order of 'assays' (if specified) or object's assays

(Deprecated) See layer

Print messages and show progress bar

Which assays to use. Default is all assays

Whether to return the data as a Seurat object. Default is FALSE

Categories for grouping (e.g, "ident", "replicate", "celltype"); "ident" by default

(Deprecated) See group.by

The method used for calculating pseudobulk expression; one of: "average" or "aggregate"

Method for normalization, see NormalizeData

Scale factor for normalization, see NormalizeData

Margin to perform CLR normalization, see NormalizeData

Returns object after normalization

Returns a matrix with genes as rows, identity classes as columns. If return.seurat is TRUE, returns an object of class Seurat.

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/generics.R
```

Example 2 (unknown):
```unknown
R/utilities.R
```

Example 3 (unknown):
```unknown
PseudobulkExpression.Rd
```

Example 4 (python):
```python
PseudobulkExpression(object, ...)

# S3 method for class 'Assay'
PseudobulkExpression(
  object,
  assay,
  category.matrix,
  features = NULL,
  layer = "data",
  slot = deprecated(),
  verbose = TRUE,
  ...
)

# S3 method for class 'StdAssay'
PseudobulkExpression(
  object,
  assay,
  category.matrix,
  features = NULL,
  layer = "data",
  slot = deprecated(),
  verbose = TRUE,
  ...
)

# S3 method for class 'Seurat'
PseudobulkExpression(
  object,
  assays = NULL,
  features = NULL,
  return.seurat = FALSE,
  group.by = "ident",
  add.ident = NULL,
  layer = "data",
  slot = deprecated(),
  method = "average",
  normalization.method = "LogNormalize",
  scale.factor = 10000,
  margin = 1,
  verbose = TRUE,
  ...
)
```

Example 5 (r):
```r
PseudobulkExpression(object, ...)

# S3 method for class 'Assay'
PseudobulkExpression(
  object,
  assay,
  category.matrix,
  features = NULL,
  layer = "data",
  slot = deprecated(),
  verbose = TRUE,
  ...
)

# S3 method for class 'StdAssay'
PseudobulkExpression(
  object,
  assay,
  category.matrix,
  features = NULL,
  layer = "data",
  slot = deprecated(),
  verbose = TRUE,
  ...
)

# S3 method for class 'Seurat'
PseudobulkExpression(
  object,
  assays = NULL,
  features = NULL,
  return.seurat = FALSE,
  group.by = "ident",
  add.ident = NULL,
  layer = "data",
  slot = deprecated(),
  method = "average",
  normalization.method = "LogNormalize",
  scale.factor = 10000,
  margin = 1,
  verbose = TRUE,
  ...
)
```

Example 6 (r):
```r
PseudobulkExpression(object, ...)

# S3 method for class 'Assay'
PseudobulkExpression(
  object,
  assay,
  category.matrix,
  features = NULL,
  layer = "data",
  slot = deprecated(),
  verbose = TRUE,
  ...
)

# S3 method for class 'StdAssay'
PseudobulkExpression(
  object,
  assay,
  category.matrix,
  features = NULL,
  layer = "data",
  slot = deprecated(),
  verbose = TRUE,
  ...
)

# S3 method for class 'Seurat'
PseudobulkExpression(
  object,
  assays = NULL,
  features = NULL,
  return.seurat = FALSE,
  group.by = "ident",
  add.ident = NULL,
  layer = "data",
  slot = deprecated(),
  method = "average",
  normalization.method = "LogNormalize",
  scale.factor = 10000,
  margin = 1,
  verbose = TRUE,
  ...
)
```

Example 7 (unknown):
```unknown
CreateSeuratObject
```

Example 8 (unknown):
```unknown
NormalizeData
```

Example 9 (unknown):
```unknown
NormalizeData
```

Example 10 (unknown):
```unknown
NormalizeData
```

---

## Automagically calculate a point size for ggplot2-based scatter plots — AutoPointSize • Seurat

**URL:** http://127.0.0.1:9173/seurat/reference/autopointsize/index.html

**Contents:**
- Automagically calculate a point size for ggplot2-based scatter plots
- Arguments
- Value
- Examples
- Contents

It happens to look good

A data frame being passed to ggplot2

If TRUE, point size is set to 1

The "optimal" point size for visualizing these data

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/visualization.R
```

Example 2 (unknown):
```unknown
AutoPointSize.Rd
```

Example 3 (unknown):
```unknown
AutoPointSize(data, raster = NULL)
```

Example 4 (r):
```r
AutoPointSize(data, raster = NULL)
```

Example 5 (r):
```r
AutoPointSize(data, raster = NULL)
```

Example 6 (unknown):
```unknown
df <- data.frame(x = rnorm(n = 10000), y = runif(n = 10000))
AutoPointSize(data = df)
#> [1] 0.1583
```

Example 7 (r):
```r
df <- data.frame(x = rnorm(n = 10000), y = runif(n = 10000))
AutoPointSize(data = df)
#> [1] 0.1583
```

Example 8 (r):
```r
df <- data.frame(x = rnorm(n = 10000), y = runif(n = 10000))
AutoPointSize(data = df)
#> [1] 0.1583
```

---

## Construct a dictionary representation for each unimodal dataset — BridgeCellsRepresentation • Seurat

**URL:** http://127.0.0.1:9173/seurat/reference/bridgecellsrepresentation/index.html

**Contents:**
- Construct a dictionary representation for each unimodal dataset
- Arguments
- Value
- Contents

Construct a dictionary representation for each unimodal dataset

A list of Seurat objects

A multi-omic bridge Seurat which is used as the basis to represent unimodal datasets

A list of dimensional reductions from object.list used to be reconstructed by bridge.object

A list of dimensional reductions from bridge.object used to reconstruct object.reduction

Name of bridge graph laplacian dimensional reduction

Dimensions used for bridge graph laplacian dimensional reduction

Assay name used for bridge object reconstruction value (default is 'Bridge')

Whether to return all assays in the object.list. Only bridge assay is returned by default.

Whether to l2 normalize the dictionary representation

Print messages and progress

Returns a object list in which each object has a bridge cell derived assay

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/integration.R
```

Example 2 (unknown):
```unknown
BridgeCellsRepresentation.Rd
```

Example 3 (unknown):
```unknown
BridgeCellsRepresentation(
  object.list,
  bridge.object,
  object.reduction,
  bridge.reduction,
  laplacian.reduction = "lap",
  laplacian.dims = 1:50,
  bridge.assay.name = "Bridge",
  return.all.assays = FALSE,
  l2.norm = TRUE,
  verbose = TRUE
)
```

Example 4 (r):
```r
BridgeCellsRepresentation(
  object.list,
  bridge.object,
  object.reduction,
  bridge.reduction,
  laplacian.reduction = "lap",
  laplacian.dims = 1:50,
  bridge.assay.name = "Bridge",
  return.all.assays = FALSE,
  l2.norm = TRUE,
  verbose = TRUE
)
```

Example 5 (r):
```r
BridgeCellsRepresentation(
  object.list,
  bridge.object,
  object.reduction,
  bridge.reduction,
  laplacian.reduction = "lap",
  laplacian.dims = 1:50,
  bridge.assay.name = "Bridge",
  return.all.assays = FALSE,
  l2.norm = TRUE,
  verbose = TRUE
)
```

---

## DE and EnrichR pathway visualization barplot — DEenrichRPlot • Seurat

**URL:** http://127.0.0.1:9173/reference_deenrichrplot.html

**Contents:**
- DE and EnrichR pathway visualization barplot
- Arguments
- Value
- Contents

DE and EnrichR pathway visualization barplot

Name of object class Seurat.

Cell class identity 1.

Cell class identity 2.

Option to display pathway enrichments for both negative and positive DE genes.If false, only positive DE gene will be displayed.

Limit testing to genes which show, on average, at least X-fold difference (log-scale) between the two groups of cells. Default is 0.25. Increasing logfc.threshold speeds up the function, but can miss weaker signals.

Assay to use in differential expression testing

Maximum number of genes to use as input to enrichR.

Denotes which test to use. Available options are:

"wilcox" : Identifies differentially expressed genes between two groups of cells using a Wilcoxon Rank Sum test (default); will use a fast implementation by Presto if installed

"wilcox_limma" : Identifies differentially expressed genes between two groups of cells using the limma implementation of the Wilcoxon Rank Sum test; set this option to reproduce results from Seurat v4

"bimod" : Likelihood-ratio test for single cell gene expression, (McDavid et al., Bioinformatics, 2013)

"roc" : Identifies 'markers' of gene expression using ROC analysis. For each gene, evaluates (using AUC) a classifier built on that gene alone, to classify between two groups of cells. An AUC value of 1 means that expression values for this gene alone can perfectly classify the two groupings (i.e. Each of the cells in cells.1 exhibit a higher level than each of the cells in cells.2). An AUC value of 0 also means there is perfect classification, but in the other direction. A value of 0.5 implies that the gene has no predictive power to classify the two groups. Returns a 'predictive power' (abs(AUC-0.5) * 2) ranked matrix of putative differentially expressed genes.

"t" : Identify differentially expressed genes between two groups of cells using the Student's t-test.

"negbinom" : Identifies differentially expressed genes between two groups of cells using a negative binomial generalized linear model. Use only for UMI-based datasets

"poisson" : Identifies differentially expressed genes between two groups of cells using a poisson generalized linear model. Use only for UMI-based datasets

"LR" : Uses a logistic regression framework to determine differentially expressed genes. Constructs a logistic regression model predicting group membership based on each feature individually and compares this to a null model with a likelihood ratio test.

"MAST" : Identifies differentially expressed genes between two groups of cells using a hurdle model tailored to scRNA-seq data. Utilizes the MAST package to run the DE testing.

"DESeq2" : Identifies differentially expressed genes between two groups of cells based on a model using DESeq2 which uses a negative binomial distribution (Love et al, Genome Biology, 2014).This test does not support pre-filtering of genes based on average difference (or percent detection rate) between cell groups. However, genes may be pre-filtered based on their minimum detection rate (min.pct) across both cell groups. To use this method, please install DESeq2, using the instructions at https://bioconductor.org/packages/release/bioc/html/DESeq2.html

Cutoff to select DE genes.

A list of colors to use for barplots.

Database to use from enrichR.

Number of pathways to display in barplot.

Return list of DE genes

Arguments passed to other methods and to specific DE methods

Returns one (only enriched) or two (both enriched and depleted) barplots with the top enriched/depleted GO terms from EnrichR.

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/mixscape.R
```

Example 2 (unknown):
```unknown
DEenrichRPlot.Rd
```

Example 3 (unknown):
```unknown
DEenrichRPlot(
  object,
  ident.1 = NULL,
  ident.2 = NULL,
  balanced = TRUE,
  logfc.threshold = 0.25,
  assay = NULL,
  max.genes,
  test.use = "wilcox",
  p.val.cutoff = 0.05,
  cols = NULL,
  enrich.database = NULL,
  num.pathway = 10,
  return.gene.list = FALSE,
  ...
)
```

Example 4 (r):
```r
DEenrichRPlot(
  object,
  ident.1 = NULL,
  ident.2 = NULL,
  balanced = TRUE,
  logfc.threshold = 0.25,
  assay = NULL,
  max.genes,
  test.use = "wilcox",
  p.val.cutoff = 0.05,
  cols = NULL,
  enrich.database = NULL,
  num.pathway = 10,
  return.gene.list = FALSE,
  ...
)
```

Example 5 (r):
```r
DEenrichRPlot(
  object,
  ident.1 = NULL,
  ident.2 = NULL,
  balanced = TRUE,
  logfc.threshold = 0.25,
  assay = NULL,
  max.genes,
  test.use = "wilcox",
  p.val.cutoff = 0.05,
  cols = NULL,
  enrich.database = NULL,
  num.pathway = 10,
  return.gene.list = FALSE,
  ...
)
```

---

## Select integration features — SelectIntegrationFeatures • Seurat

**URL:** http://127.0.0.1:9173/reference_selectintegrationfeatures.html

**Contents:**
- Select integration features
- Arguments
- Value
- Details
- Examples
- Contents

Choose the features to use when integrating multiple datasets. This function ranks features by the number of datasets they are deemed variable in, breaking ties by the median variable feature rank across datasets. It returns the top scoring features by this ranking.

List of seurat objects

Number of features to return

Name or vector of assay names (one for each object) from which to pull the variable features.

nfeatures for FindVariableFeatures. Used if VariableFeatures have not been set for any object in object.list.

Additional parameters to FindVariableFeatures

A vector of selected features

If for any assay in the list, FindVariableFeatures hasn't been run, this method will try to run it using the fvf.nfeatures parameter and any additional ones specified through the ....

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/integration.R
```

Example 2 (unknown):
```unknown
SelectIntegrationFeatures.Rd
```

Example 3 (unknown):
```unknown
SelectIntegrationFeatures(
  object.list,
  nfeatures = 2000,
  assay = NULL,
  verbose = TRUE,
  fvf.nfeatures = 2000,
  ...
)
```

Example 4 (r):
```r
SelectIntegrationFeatures(
  object.list,
  nfeatures = 2000,
  assay = NULL,
  verbose = TRUE,
  fvf.nfeatures = 2000,
  ...
)
```

Example 5 (r):
```r
SelectIntegrationFeatures(
  object.list,
  nfeatures = 2000,
  assay = NULL,
  verbose = TRUE,
  fvf.nfeatures = 2000,
  ...
)
```

Example 6 (unknown):
```unknown
FindVariableFeatures
```

Example 7 (unknown):
```unknown
VariableFeatures
```

Example 8 (unknown):
```unknown
object.list
```

Example 9 (unknown):
```unknown
FindVariableFeatures
```

Example 10 (unknown):
```unknown
FindVariableFeatures
```

Example 11 (unknown):
```unknown
fvf.nfeatures
```

Example 12 (unknown):
```unknown
if (FALSE) { # \dontrun{
# to install the SeuratData package see https://github.com/satijalab/seurat-data
library(SeuratData)
data("panc8")

# panc8 is a merged Seurat object containing 8 separate pancreas datasets
# split the object by dataset and take the first 2
pancreas.list <- SplitObject(panc8, split.by = "tech")[1:2]

# perform SCTransform normalization
pancreas.list <- lapply(X = pancreas.list, FUN = SCTransform)

# select integration features
features <- SelectIntegrationFeatures(pancreas.list)
} # }
```

Example 13 (r):
```r
if (FALSE) { # \dontrun{
# to install the SeuratData package see https://github.com/satijalab/seurat-data
library(SeuratData)
data("panc8")

# panc8 is a merged Seurat object containing 8 separate pancreas datasets
# split the object by dataset and take the first 2
pancreas.list <- SplitObject(panc8, split.by = "tech")[1:2]

# perform SCTransform normalization
pancreas.list <- lapply(X = pancreas.list, FUN = SCTransform)

# select integration features
features <- SelectIntegrationFeatures(pancreas.list)
} # }
```

Example 14 (r):
```r
if (FALSE) { # \dontrun{
# to install the SeuratData package see https://github.com/satijalab/seurat-data
library(SeuratData)
data("panc8")

# panc8 is a merged Seurat object containing 8 separate pancreas datasets
# split the object by dataset and take the first 2
pancreas.list <- SplitObject(panc8, split.by = "tech")[1:2]

# perform SCTransform normalization
pancreas.list <- lapply(X = pancreas.list, FUN = SCTransform)

# select integration features
features <- SelectIntegrationFeatures(pancreas.list)
} # }
```

---

## Create a SCT Assay object — CreateSCTAssayObject • Seurat

**URL:** http://127.0.0.1:9173/seurat/reference/createsctassayobject/index.html

**Contents:**
- Create a SCT Assay object
- Arguments
- Details
- Contents

Create a SCT object from a feature (e.g. gene) expression matrix and a list of SCTModels. The expected format of the input matrix is features x cells.

Unnormalized data such as raw counts or TPMs

Prenormalized data; if provided, do not pass counts

The UMI assay name. Default is RNA

Include features detected in at least this many cells. Will subset the counts matrix as well. To reintroduce excluded features, create a new object with a lower cutoff

Include cells where at least this many features are detected

Non-unique cell or feature names are not allowed. Please make unique before calling this function.

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/objects.R
```

Example 2 (unknown):
```unknown
CreateSCTAssayObject.Rd
```

Example 3 (unknown):
```unknown
CreateSCTAssayObject(
  counts,
  data,
  scale.data = NULL,
  umi.assay = "RNA",
  min.cells = 0,
  min.features = 0,
  SCTModel.list = NULL
)
```

Example 4 (r):
```r
CreateSCTAssayObject(
  counts,
  data,
  scale.data = NULL,
  umi.assay = "RNA",
  min.cells = 0,
  min.features = 0,
  SCTModel.list = NULL
)
```

Example 5 (r):
```r
CreateSCTAssayObject(
  counts,
  data,
  scale.data = NULL,
  umi.assay = "RNA",
  min.cells = 0,
  min.features = 0,
  SCTModel.list = NULL
)
```

---

## Load in data from remote or local mtx files — ReadMtx • Seurat

**URL:** http://127.0.0.1:9173/seurat/reference/readmtx/index.html

**Contents:**
- Load in data from remote or local mtx files
- Arguments
- Value
- Examples
- Contents

Enables easy loading of sparse data matrices

Name or remote URL of the mtx file

Name or remote URL of the cells/barcodes file

Name or remote URL of the features/genes file

Specify which column of cells file to use for cell names; default is 1

Specify which column of features files to use for feature/gene names; default is 2

Specify the delimiter in the cell name file

Specify the delimiter in the feature name file

Number of lines to skip in the cells file before beginning to read cell names

Number of lines to skip in the features file before beginning to gene names

Transpose the matrix after reading in

Make feature names unique (default TRUE)

Remove trailing "-1" if present in all cell barcodes.

A sparse matrix containing the expression data.

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/preprocessing.R
```

Example 2 (unknown):
```unknown
ReadMtx(
  mtx,
  cells,
  features,
  cell.column = 1,
  feature.column = 2,
  cell.sep = "\t",
  feature.sep = "\t",
  skip.cell = 0,
  skip.feature = 0,
  mtx.transpose = FALSE,
  unique.features = TRUE,
  strip.suffix = FALSE
)
```

Example 3 (r):
```r
ReadMtx(
  mtx,
  cells,
  features,
  cell.column = 1,
  feature.column = 2,
  cell.sep = "\t",
  feature.sep = "\t",
  skip.cell = 0,
  skip.feature = 0,
  mtx.transpose = FALSE,
  unique.features = TRUE,
  strip.suffix = FALSE
)
```

Example 4 (r):
```r
ReadMtx(
  mtx,
  cells,
  features,
  cell.column = 1,
  feature.column = 2,
  cell.sep = "\t",
  feature.sep = "\t",
  skip.cell = 0,
  skip.feature = 0,
  mtx.transpose = FALSE,
  unique.features = TRUE,
  strip.suffix = FALSE
)
```

Example 5 (unknown):
```unknown
if (FALSE) { # \dontrun{
# For local files:

expression_matrix <- ReadMtx(
  mtx = "count_matrix.mtx.gz", features = "features.tsv.gz",
  cells = "barcodes.tsv.gz"
)
seurat_object <- CreateSeuratObject(counts = expression_matrix)

# For remote files:

expression_matrix <- ReadMtx(mtx = "http://localhost/matrix.mtx",
cells = "http://localhost/barcodes.tsv",
features = "http://localhost/genes.tsv")
seurat_object <- CreateSeuratObject(counts = data)
} # }
```

Example 6 (r):
```r
if (FALSE) { # \dontrun{
# For local files:

expression_matrix <- ReadMtx(
  mtx = "count_matrix.mtx.gz", features = "features.tsv.gz",
  cells = "barcodes.tsv.gz"
)
seurat_object <- CreateSeuratObject(counts = expression_matrix)

# For remote files:

expression_matrix <- ReadMtx(mtx = "http://localhost/matrix.mtx",
cells = "http://localhost/barcodes.tsv",
features = "http://localhost/genes.tsv")
seurat_object <- CreateSeuratObject(counts = data)
} # }
```

Example 7 (r):
```r
if (FALSE) { # \dontrun{
# For local files:

expression_matrix <- ReadMtx(
  mtx = "count_matrix.mtx.gz", features = "features.tsv.gz",
  cells = "barcodes.tsv.gz"
)
seurat_object <- CreateSeuratObject(counts = expression_matrix)

# For remote files:

expression_matrix <- ReadMtx(mtx = "http://localhost/matrix.mtx",
cells = "http://localhost/barcodes.tsv",
features = "http://localhost/genes.tsv")
seurat_object <- CreateSeuratObject(counts = data)
} # }
```

---

## Filter stray beads from Slide-seq puck — FilterSlideSeq • Seurat

**URL:** http://127.0.0.1:9173/reference_filterslideseq.html

**Contents:**
- Filter stray beads from Slide-seq puck
- Arguments
- Value
- Examples
- Contents

This function is useful for removing stray beads that fall outside the main Slide-seq puck area. Essentially, it's a circular filter where you set a center and radius defining a circle of beads to keep. If the center is not set, it will be estimated from the bead coordinates (removing the 1st and 99th quantile to avoid skewing the center by the stray beads). By default, this function will display a SpatialDimPlot showing which cells were removed for easy adjustment of the center and/or radius.

Seurat object with slide-seq data

Name of the image where the coordinates are stored

Vector specifying the x and y coordinates for the center of the inclusion circle

Radius of the circle of inclusion

Display a SpatialDimPlot with the cells being removed labeled.

Returns a Seurat object with only the subset of cells that pass the circular filter

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/objects.R
```

Example 2 (unknown):
```unknown
FilterSlideSeq.Rd
```

Example 3 (unknown):
```unknown
SpatialDimPlot
```

Example 4 (unknown):
```unknown
FilterSlideSeq(
  object,
  image = "image",
  center = NULL,
  radius = NULL,
  do.plot = TRUE
)
```

Example 5 (r):
```r
FilterSlideSeq(
  object,
  image = "image",
  center = NULL,
  radius = NULL,
  do.plot = TRUE
)
```

Example 6 (r):
```r
FilterSlideSeq(
  object,
  image = "image",
  center = NULL,
  radius = NULL,
  do.plot = TRUE
)
```

Example 7 (unknown):
```unknown
SpatialDimPlot
```

Example 8 (unknown):
```unknown
if (FALSE) { # \dontrun{
# This example uses the ssHippo dataset which you can download
# using the SeuratData package.
library(SeuratData)
data('ssHippo')
# perform filtering of beads
ssHippo.filtered <- FilterSlideSeq(ssHippo, radius = 2300)
# This radius looks to small so increase and repeat until satisfied
} # }
```

Example 9 (r):
```r
if (FALSE) { # \dontrun{
# This example uses the ssHippo dataset which you can download
# using the SeuratData package.
library(SeuratData)
data('ssHippo')
# perform filtering of beads
ssHippo.filtered <- FilterSlideSeq(ssHippo, radius = 2300)
# This radius looks to small so increase and repeat until satisfied
} # }
```

Example 10 (r):
```r
if (FALSE) { # \dontrun{
# This example uses the ssHippo dataset which you can download
# using the SeuratData package.
library(SeuratData)
data('ssHippo')
# perform filtering of beads
ssHippo.filtered <- FilterSlideSeq(ssHippo, radius = 2300)
# This radius looks to small so increase and repeat until satisfied
} # }
```

---

## Aggregated feature expression by identity class — AggregateExpression • Seurat

**URL:** http://127.0.0.1:9173/reference_aggregateexpression.html

**Contents:**
- Aggregated feature expression by identity class
- Arguments
- Value
- Details
- Examples
- Contents

Returns summed counts ("pseudobulk") for each identity class.

Which assays to use. Default is all assays

Features to analyze. Default is all features in the assay

Whether to return the data as a Seurat object. Default is FALSE

Category (or vector of categories) for grouping (e.g, ident, replicate, celltype); 'ident' by default To use multiple categories, specify a vector, such as c('ident', 'replicate', 'celltype')

(Deprecated). Place an additional label on each cell prior to pseudobulking

Method for normalization, see NormalizeData

Scale factor for normalization, see NormalizeData

Margin to perform CLR normalization, see NormalizeData

Print messages and show progress bar

Arguments to be passed to methods such as CreateSeuratObject

Returns a matrix with genes as rows, identity classes as columns. If return.seurat is TRUE, returns an object of class Seurat.

If return.seurat = TRUE, aggregated values are placed in the 'counts' layer of the returned object. The data is then normalized by running NormalizeData on the aggregated counts. ScaleData is then run on the default assay before returning the object.

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/utilities.R
```

Example 2 (unknown):
```unknown
AggregateExpression.Rd
```

Example 3 (unknown):
```unknown
AggregateExpression(
  object,
  assays = NULL,
  features = NULL,
  return.seurat = FALSE,
  group.by = "ident",
  add.ident = NULL,
  normalization.method = "LogNormalize",
  scale.factor = 10000,
  margin = 1,
  verbose = TRUE,
  ...
)
```

Example 4 (r):
```r
AggregateExpression(
  object,
  assays = NULL,
  features = NULL,
  return.seurat = FALSE,
  group.by = "ident",
  add.ident = NULL,
  normalization.method = "LogNormalize",
  scale.factor = 10000,
  margin = 1,
  verbose = TRUE,
  ...
)
```

Example 5 (r):
```r
AggregateExpression(
  object,
  assays = NULL,
  features = NULL,
  return.seurat = FALSE,
  group.by = "ident",
  add.ident = NULL,
  normalization.method = "LogNormalize",
  scale.factor = 10000,
  margin = 1,
  verbose = TRUE,
  ...
)
```

Example 6 (unknown):
```unknown
NormalizeData
```

Example 7 (unknown):
```unknown
NormalizeData
```

Example 8 (unknown):
```unknown
NormalizeData
```

Example 9 (unknown):
```unknown
CreateSeuratObject
```

Example 10 (unknown):
```unknown
return.seurat = TRUE
```

Example 11 (unknown):
```unknown
NormalizeData
```

Example 12 (unknown):
```unknown
if (FALSE) { # \dontrun{
data("pbmc_small")
head(AggregateExpression(object = pbmc_small)$RNA)
head(AggregateExpression(object = pbmc_small, group.by = c('ident', 'groups'))$RNA)
} # }
```

Example 13 (r):
```r
if (FALSE) { # \dontrun{
data("pbmc_small")
head(AggregateExpression(object = pbmc_small)$RNA)
head(AggregateExpression(object = pbmc_small, group.by = c('ident', 'groups'))$RNA)
} # }
```

Example 14 (r):
```r
if (FALSE) { # \dontrun{
data("pbmc_small")
head(AggregateExpression(object = pbmc_small)$RNA)
head(AggregateExpression(object = pbmc_small, group.by = c('ident', 'groups'))$RNA)
} # }
```

---

## Get Cell Names — Cells.SCTModel • Seurat

**URL:** http://127.0.0.1:9173/seurat/reference/cells/index.html

**Contents:**
- Get Cell Names
- Arguments
- See also
- Contents

Arguments passed to other methods

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/objects.R
```

Example 2 (python):
```python
# S3 method for class 'SCTModel'
Cells(x, ...)

# S3 method for class 'SlideSeq'
Cells(x, ...)

# S3 method for class 'STARmap'
Cells(x, ...)

# S3 method for class 'VisiumV1'
Cells(x, ...)
```

Example 3 (r):
```r
# S3 method for class 'SCTModel'
Cells(x, ...)

# S3 method for class 'SlideSeq'
Cells(x, ...)

# S3 method for class 'STARmap'
Cells(x, ...)

# S3 method for class 'VisiumV1'
Cells(x, ...)
```

Example 4 (r):
```r
# S3 method for class 'SCTModel'
Cells(x, ...)

# S3 method for class 'SlideSeq'
Cells(x, ...)

# S3 method for class 'STARmap'
Cells(x, ...)

# S3 method for class 'VisiumV1'
Cells(x, ...)
```

Example 5 (unknown):
```unknown
SeuratObject::Cells
```

---

## The Assay Class — Assay-class • Seurat

**URL:** http://127.0.0.1:9173/seurat/reference/assay-class/index.html

**Contents:**
- The Assay Class
- See also
- Contents

The Assay object is the basic unit of Seurat; for more details, please see the documentation in SeuratObject

SeuratObject::Assay-class

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/reexports.R
```

Example 2 (unknown):
```unknown
Assay-class.Rd
```

Example 3 (unknown):
```unknown
SeuratObject
```

Example 4 (unknown):
```unknown
SeuratObject::Assay-class
```

---

## Load Curio Seeker data — LoadCurioSeeker • Seurat

**URL:** http://127.0.0.1:9173/reference_loadcurioseeker.html

**Contents:**
- Load Curio Seeker data
- Arguments
- Value
- Contents

Load Curio Seeker data

location of data directory that contains the counts matrix, gene names, barcodes/beads, and barcodes/bead location files.

Name of assay to associate spatial data to

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/preprocessing.R
```

Example 2 (unknown):
```unknown
LoadCurioSeeker.Rd
```

Example 3 (unknown):
```unknown
LoadCurioSeeker(data.dir, assay = "Spatial")
```

Example 4 (r):
```r
LoadCurioSeeker(data.dir, assay = "Spatial")
```

Example 5 (r):
```r
LoadCurioSeeker(data.dir, assay = "Spatial")
```

---

## Dimensional reduction heatmap — DimHeatmap • Seurat

**URL:** http://127.0.0.1:9173/seurat/reference/dimheatmap/index.html

**Contents:**
- Dimensional reduction heatmap
- Arguments
- Value
- See also
- Examples
- Contents

Draws a heatmap focusing on a principal component. Both cells and genes are sorted by their principal component scores. Allows for nice visualization of sources of heterogeneity in the dataset.

Number of genes to plot

A list of cells to plot. If numeric, just plots the top cells.

Which dimensional reduction to use

Minimum display value (all values below are clipped)

Maximum display value (all values above are clipped); defaults to 2.5 if slot is 'scale.data', 6 otherwise

Plot an equal number of genes with both + and - scores.

Use the full projected dimensional reduction

Number of columns to plot

If true, use image to generate plots; faster than using ggplot2, but not customizable

If true, plot with geom_raster, else use geom_tile. geom_raster may look blurry on some viewing applications such as Preview due to how the raster is interpolated. Set this to FALSE if you are encountering that issue (note that plots may take longer to produce/render).

Data slot to use, choose from 'raw.data', 'data', or 'scale.data'

A vector of assays to pull data from

Combine plots into a single patchworked ggplot object. If FALSE, return a list of ggplot objects

Extra parameters passed to DimHeatmap

No return value by default. If using fast = FALSE, will return a patchworked ggplot object if combine = TRUE, otherwise returns a list of ggplot objects

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/visualization.R
```

Example 2 (unknown):
```unknown
R/convenience.R
```

Example 3 (unknown):
```unknown
DimHeatmap.Rd
```

Example 4 (unknown):
```unknown
DimHeatmap(
  object,
  dims = 1,
  nfeatures = 30,
  cells = NULL,
  reduction = "pca",
  disp.min = -2.5,
  disp.max = NULL,
  balanced = TRUE,
  projected = FALSE,
  ncol = NULL,
  fast = TRUE,
  raster = TRUE,
  slot = "scale.data",
  assays = NULL,
  combine = TRUE
)

PCHeatmap(object, ...)
```

Example 5 (r):
```r
DimHeatmap(
  object,
  dims = 1,
  nfeatures = 30,
  cells = NULL,
  reduction = "pca",
  disp.min = -2.5,
  disp.max = NULL,
  balanced = TRUE,
  projected = FALSE,
  ncol = NULL,
  fast = TRUE,
  raster = TRUE,
  slot = "scale.data",
  assays = NULL,
  combine = TRUE
)

PCHeatmap(object, ...)
```

Example 6 (r):
```r
DimHeatmap(
  object,
  dims = 1,
  nfeatures = 30,
  cells = NULL,
  reduction = "pca",
  disp.min = -2.5,
  disp.max = NULL,
  balanced = TRUE,
  projected = FALSE,
  ncol = NULL,
  fast = TRUE,
  raster = TRUE,
  slot = "scale.data",
  assays = NULL,
  combine = TRUE
)

PCHeatmap(object, ...)
```

Example 7 (unknown):
```unknown
patchworked
```

Example 8 (unknown):
```unknown
patchworked
```

Example 9 (unknown):
```unknown
geom_raster
```

Example 10 (unknown):
```unknown
data("pbmc_small")
DimHeatmap(object = pbmc_small)
#> Warning: Requested number is larger than the number of available items (20). Setting to 20.
```

Example 11 (r):
```r
data("pbmc_small")
DimHeatmap(object = pbmc_small)
#> Warning: Requested number is larger than the number of available items (20). Setting to 20.
```

Example 12 (r):
```r
data("pbmc_small")
DimHeatmap(object = pbmc_small)
#> Warning: Requested number is larger than the number of available items (20). Setting to 20.
```

---

## The JackStrawData Class — JackStrawData-class • Seurat

**URL:** http://127.0.0.1:9173/reference_jackstrawdata-class.html

**Contents:**
- The JackStrawData Class
- See also
- Contents

For more details, please see the documentation in SeuratObject

SeuratObject::JackStrawData-class

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/reexports.R
```

Example 2 (unknown):
```unknown
JackStrawData-class.Rd
```

Example 3 (unknown):
```unknown
SeuratObject
```

Example 4 (unknown):
```unknown
SeuratObject::JackStrawData-class
```

---

## The SlideSeq class — SlideSeq-class • Seurat

**URL:** http://127.0.0.1:9173/reference_slideseq-class.html

**Contents:**
- The SlideSeq class
- Slots
- Slots
- Contents

The SlideSeq class represents spatial information from the Slide-seq platform

Name of assay to associate image data with; will give this image priority for visualization when the assay is set as the active/default assay in a Seurat object

A one-length character vector with the object's key; keys must be one or more alphanumeric characters followed by an underscore “_” (regex pattern “^[a-zA-Z][a-zA-Z0-9]*_$”)

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/objects.R
```

Example 2 (unknown):
```unknown
SlideSeq-class.Rd
```

Example 3 (unknown):
```unknown
coordinates
```

Example 4 (unknown):
```unknown
^[a-zA-Z][a-zA-Z0-9]*_$
```

---

## Run Supervised Principal Component Analysis — RunSPCA • Seurat

**URL:** http://127.0.0.1:9173/seurat/reference/runspca/index.html

**Contents:**
- Run Supervised Principal Component Analysis
- Arguments
- Value
- References
- Contents

Run a supervised PCA (SPCA) dimensionality reduction supervised by a cell-cell kernel. SPCA is used to capture a linear transformation which maximizes its dependency to the given cell-cell kernel. We use SNN graph as the kernel to supervise the linear matrix factorization.

Arguments passed to other methods and IRLBA

Name of Assay SPCA is being run on

Total Number of SPCs to compute and store (50 by default)

dimensional reduction key, specifies the string before the number for the dimension names. SPC by default

Graph used supervised by SPCA

Print the top genes associated with high/low loadings for the SPCs

Set a random seed. By default, sets the seed to 42. Setting NULL will not set a seed.

Features to compute SPCA on. If features=NULL, SPCA will be run using the variable features for the Assay.

dimensional reduction name, spca by default

Returns Seurat object with the SPCA calculation stored in the reductions slot

Barshan E, Ghodsi A, Azimifar Z, Jahromi MZ. Supervised principal component analysis: Visualization, classification and regression on subspaces and submanifolds. Pattern Recognition. 2011 Jul 1;44(7):1357-71. doi:10.1016/j.patcog.2010.12.015;

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/generics.R
```

Example 2 (unknown):
```unknown
R/dimensional_reduction.R
```

Example 3 (python):
```python
RunSPCA(object, ...)

# Default S3 method
RunSPCA(
  object,
  assay = NULL,
  npcs = 50,
  reduction.key = "SPC_",
  graph = NULL,
  verbose = FALSE,
  seed.use = 42,
  ...
)

# S3 method for class 'Assay'
RunSPCA(
  object,
  assay = NULL,
  features = NULL,
  npcs = 50,
  reduction.key = "SPC_",
  graph = NULL,
  verbose = TRUE,
  seed.use = 42,
  ...
)

# S3 method for class 'Assay5'
RunSPCA(
  object,
  assay = NULL,
  features = NULL,
  npcs = 50,
  reduction.key = "SPC_",
  graph = NULL,
  verbose = TRUE,
  seed.use = 42,
  layer = "scale.data",
  ...
)

# S3 method for class 'Seurat'
RunSPCA(
  object,
  assay = NULL,
  features = NULL,
  npcs = 50,
  reduction.name = "spca",
  reduction.key = "SPC_",
  graph = NULL,
  verbose = TRUE,
  seed.use = 42,
  ...
)
```

Example 4 (r):
```r
RunSPCA(object, ...)

# Default S3 method
RunSPCA(
  object,
  assay = NULL,
  npcs = 50,
  reduction.key = "SPC_",
  graph = NULL,
  verbose = FALSE,
  seed.use = 42,
  ...
)

# S3 method for class 'Assay'
RunSPCA(
  object,
  assay = NULL,
  features = NULL,
  npcs = 50,
  reduction.key = "SPC_",
  graph = NULL,
  verbose = TRUE,
  seed.use = 42,
  ...
)

# S3 method for class 'Assay5'
RunSPCA(
  object,
  assay = NULL,
  features = NULL,
  npcs = 50,
  reduction.key = "SPC_",
  graph = NULL,
  verbose = TRUE,
  seed.use = 42,
  layer = "scale.data",
  ...
)

# S3 method for class 'Seurat'
RunSPCA(
  object,
  assay = NULL,
  features = NULL,
  npcs = 50,
  reduction.name = "spca",
  reduction.key = "SPC_",
  graph = NULL,
  verbose = TRUE,
  seed.use = 42,
  ...
)
```

Example 5 (r):
```r
RunSPCA(object, ...)

# Default S3 method
RunSPCA(
  object,
  assay = NULL,
  npcs = 50,
  reduction.key = "SPC_",
  graph = NULL,
  verbose = FALSE,
  seed.use = 42,
  ...
)

# S3 method for class 'Assay'
RunSPCA(
  object,
  assay = NULL,
  features = NULL,
  npcs = 50,
  reduction.key = "SPC_",
  graph = NULL,
  verbose = TRUE,
  seed.use = 42,
  ...
)

# S3 method for class 'Assay5'
RunSPCA(
  object,
  assay = NULL,
  features = NULL,
  npcs = 50,
  reduction.key = "SPC_",
  graph = NULL,
  verbose = TRUE,
  seed.use = 42,
  layer = "scale.data",
  ...
)

# S3 method for class 'Seurat'
RunSPCA(
  object,
  assay = NULL,
  features = NULL,
  npcs = 50,
  reduction.name = "spca",
  reduction.key = "SPC_",
  graph = NULL,
  verbose = TRUE,
  seed.use = 42,
  ...
)
```

---

## Sketch Data — SketchData • Seurat

**URL:** http://127.0.0.1:9173/reference_sketchdata.html

**Contents:**
- Sketch Data
- Arguments
- Value
- Contents

This function uses sketching methods to downsample high-dimensional single-cell RNA expression data, which can help with scalability for large datasets.

Assay name. Default is NULL, in which case the default assay of the object is used.

A positive integer or a named vector/list specifying the number of cells to sample per layer. If a single integer is provided, the same number of cells will be sampled from each layer. Default is 5000.

Sketched assay name. A sketch assay is created or overwrite with the sketch data. Default is 'sketch'.

Sketching method to use. Can be 'LeverageScore' or 'Uniform'. Default is 'LeverageScore'.

A metadata column name to store the leverage scores. Default is 'leverage.score'.

whether to overwrite existing column in the metadata. Default is FALSE.

A positive integer for the seed of the random number generator. Default is 123.

The type to cast the resulting assay to. Default is 'dgCMatrix'.

Print progress and diagnostic messages

A character vector of feature names to include in the sketched assay.

Arguments passed to other methods

A Seurat object with the sketched data added as a new assay.

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/sketching.R
```

Example 2 (unknown):
```unknown
SketchData.Rd
```

Example 3 (unknown):
```unknown
SketchData(
  object,
  assay = NULL,
  ncells = 5000L,
  sketched.assay = "sketch",
  method = c("LeverageScore", "Uniform"),
  var.name = "leverage.score",
  over.write = FALSE,
  seed = 123L,
  cast = "dgCMatrix",
  verbose = TRUE,
  features = NULL,
  ...
)
```

Example 4 (r):
```r
SketchData(
  object,
  assay = NULL,
  ncells = 5000L,
  sketched.assay = "sketch",
  method = c("LeverageScore", "Uniform"),
  var.name = "leverage.score",
  over.write = FALSE,
  seed = 123L,
  cast = "dgCMatrix",
  verbose = TRUE,
  features = NULL,
  ...
)
```

Example 5 (r):
```r
SketchData(
  object,
  assay = NULL,
  ncells = 5000L,
  sketched.assay = "sketch",
  method = c("LeverageScore", "Uniform"),
  var.name = "leverage.score",
  over.write = FALSE,
  seed = 123L,
  cast = "dgCMatrix",
  verbose = TRUE,
  features = NULL,
  ...
)
```

---

## Determine statistical significance of PCA scores. — JackStraw • Seurat

**URL:** http://127.0.0.1:9173/seurat/reference/jackstraw/index.html

**Contents:**
- Determine statistical significance of PCA scores.
- Arguments
- Value
- References
- Examples
- Contents

Randomly permutes a subset of data, and calculates projected PCA scores for these 'random' genes. Then compares the PCA scores for the 'random' genes with the observed PCA scores to determine statistical significance. End result is a p-value for each gene's association with each principal component.

DimReduc to use. ONLY PCA CURRENTLY SUPPORTED.

Assay used to calculate reduction.

Number of PCs to compute significance for

Number of replicate samplings to perform

Proportion of the data to randomly permute for each replicate

Print progress bar showing the number of replicates that have been processed.

maximum number of iterations to be performed by the irlba function of RunPCA

Returns a Seurat object where JS(object = object[['pca']], slot = 'empirical') represents p-values for each gene in the PCA analysis. If ProjectPCA is subsequently run, JS(object = object[['pca']], slot = 'full') then represents p-values for all genes.

Inspired by Chung et al, Bioinformatics (2014)

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/dimensional_reduction.R
```

Example 2 (unknown):
```unknown
JackStraw.Rd
```

Example 3 (unknown):
```unknown
JackStraw(
  object,
  reduction = "pca",
  assay = NULL,
  dims = 20,
  num.replicate = 100,
  prop.freq = 0.01,
  verbose = TRUE,
  maxit = 1000
)
```

Example 4 (r):
```r
JackStraw(
  object,
  reduction = "pca",
  assay = NULL,
  dims = 20,
  num.replicate = 100,
  prop.freq = 0.01,
  verbose = TRUE,
  maxit = 1000
)
```

Example 5 (r):
```r
JackStraw(
  object,
  reduction = "pca",
  assay = NULL,
  dims = 20,
  num.replicate = 100,
  prop.freq = 0.01,
  verbose = TRUE,
  maxit = 1000
)
```

Example 6 (unknown):
```unknown
if (FALSE) { # \dontrun{
data("pbmc_small")
pbmc_small = suppressWarnings(JackStraw(pbmc_small))
head(JS(object = pbmc_small[['pca']], slot = 'empirical'))
} # }
```

Example 7 (r):
```r
if (FALSE) { # \dontrun{
data("pbmc_small")
pbmc_small = suppressWarnings(JackStraw(pbmc_small))
head(JS(object = pbmc_small[['pca']], slot = 'empirical'))
} # }
```

Example 8 (r):
```r
if (FALSE) { # \dontrun{
data("pbmc_small")
pbmc_small = suppressWarnings(JackStraw(pbmc_small))
head(JS(object = pbmc_small[['pca']], slot = 'empirical'))
} # }
```

---

## Visualize features in dimensional reduction space interactively — IFeaturePlot • Seurat

**URL:** http://127.0.0.1:9173/seurat/reference/ifeatureplot/index.html

**Contents:**
- Visualize features in dimensional reduction space interactively
- Arguments
- Value
- Contents

Visualize features in dimensional reduction space interactively

Dimensions to plot, must be a two-length numeric vector specifying x- and y-dimensions

Which dimensionality reduction to use. If not specified, first searches for umap, then tsne, then pca

Which slot to pull expression data from?

Returns the final plot as a ggplot object

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/visualization.R
```

Example 2 (unknown):
```unknown
IFeaturePlot.Rd
```

Example 3 (unknown):
```unknown
IFeaturePlot(object, feature, dims = c(1, 2), reduction = NULL, slot = "data")
```

Example 4 (r):
```r
IFeaturePlot(object, feature, dims = c(1, 2), reduction = NULL, slot = "data")
```

Example 5 (r):
```r
IFeaturePlot(object, feature, dims = c(1, 2), reduction = NULL, slot = "data")
```

---

## Load a 10x Genomics Visium Spatial Experiment into a Seurat object — Load10X_Spatial • Seurat

**URL:** http://127.0.0.1:9173/reference_load10x_spatial.html

**Contents:**
- Load a 10x Genomics Visium Spatial Experiment into a Seurat object
- Arguments
- Value
- Examples
- Contents

Load a 10x Genomics Visium Spatial Experiment into a Seurat object

Directory containing the H5 file specified by filename and the image data in a subdirectory called spatial

Name of H5 file containing the feature barcode matrix

Name of the initial assay

Name for the stored image of the tissue slice

Specifies the bin sizes to read in - defaults to c(16, 8)

Only keep spots that have been determined to be over tissue

Converts all feature names to upper case. Can be useful when analyses require comparisons between human and mouse gene names for example.

VisiumV1/VisiumV2 instance(s) - if a vector is passed in it should be co-indexed with `bin.size`

Arguments passed to Read10X_h5

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/preprocessing.R
```

Example 2 (unknown):
```unknown
Load10X_Spatial.Rd
```

Example 3 (unknown):
```unknown
Load10X_Spatial(
  data.dir,
  filename = "filtered_feature_bc_matrix.h5",
  assay = "Spatial",
  slice = "slice1",
  bin.size = NULL,
  filter.matrix = TRUE,
  to.upper = FALSE,
  image = NULL,
  ...
)
```

Example 4 (r):
```r
Load10X_Spatial(
  data.dir,
  filename = "filtered_feature_bc_matrix.h5",
  assay = "Spatial",
  slice = "slice1",
  bin.size = NULL,
  filter.matrix = TRUE,
  to.upper = FALSE,
  image = NULL,
  ...
)
```

Example 5 (r):
```r
Load10X_Spatial(
  data.dir,
  filename = "filtered_feature_bc_matrix.h5",
  assay = "Spatial",
  slice = "slice1",
  bin.size = NULL,
  filter.matrix = TRUE,
  to.upper = FALSE,
  image = NULL,
  ...
)
```

Example 6 (unknown):
```unknown
if (FALSE) { # \dontrun{
data_dir <- 'path/to/data/directory'
list.files(data_dir) # Should show filtered_feature_bc_matrix.h5
Load10X_Spatial(data.dir = data_dir)
} # }
```

Example 7 (r):
```r
if (FALSE) { # \dontrun{
data_dir <- 'path/to/data/directory'
list.files(data_dir) # Should show filtered_feature_bc_matrix.h5
Load10X_Spatial(data.dir = data_dir)
} # }
```

Example 8 (r):
```r
if (FALSE) { # \dontrun{
data_dir <- 'path/to/data/directory'
list.files(data_dir) # Should show filtered_feature_bc_matrix.h5
Load10X_Spatial(data.dir = data_dir)
} # }
```

---

## Leverage Score Calculation — LeverageScore • Seurat

**URL:** http://127.0.0.1:9173/seurat/reference/leveragescore/index.html

**Contents:**
- Leverage Score Calculation
- Arguments
- References
- Contents

This function computes the leverage scores for a given object It uses the concept of sketching and random projections. The function provides an approximation to the leverage scores using a scalable method suitable for large matrices.

Arguments passed to other methods

A positive integer. The number of sketches to be used in the approximation. Default is 5000.

A positive integer or NULL. The number of dimensions to use. If NULL, the number of dimensions will default to the number of columns in the object.

The sketching method to use, defaults to CountSketch.

A numeric. The error tolerance for the approximation in Johnson–Lindenstrauss embeddings, defaults to 0.5.

A positive integer. The seed for the random number generator, defaults to 123.

Print progress and diagnostic messages

VariableFeatures method

A vector of feature names to use for calculating leverage score.

name of slot to store leverage scores

whether to overwrite slot that currently stores leverage scores. Defaults to FALSE, in which case the 'var.name' is modified if it already exists in the object

Clarkson, K. L. & Woodruff, D. P. Low-rank approximation and regression in input sparsity time. JACM 63, 1–45 (2017). https://dl.acm.org/doi/10.1145/3019134;

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/generics.R
```

Example 2 (unknown):
```unknown
R/sketching.R
```

Example 3 (unknown):
```unknown
LeverageScore.Rd
```

Example 4 (python):
```python
LeverageScore(object, ...)

# Default S3 method
LeverageScore(
  object,
  nsketch = 5000L,
  ndims = NULL,
  method = CountSketch,
  eps = 0.5,
  seed = 123L,
  verbose = TRUE,
  ...
)

# S3 method for class 'StdAssay'
LeverageScore(
  object,
  nsketch = 5000L,
  ndims = NULL,
  method = CountSketch,
  vf.method = NULL,
  layer = "data",
  eps = 0.5,
  seed = 123L,
  verbose = TRUE,
  features = NULL,
  ...
)

# S3 method for class 'Assay'
LeverageScore(
  object,
  nsketch = 5000L,
  ndims = NULL,
  method = CountSketch,
  vf.method = NULL,
  layer = "data",
  eps = 0.5,
  seed = 123L,
  verbose = TRUE,
  features = NULL,
  ...
)

# S3 method for class 'Seurat'
LeverageScore(
  object,
  assay = NULL,
  nsketch = 5000L,
  ndims = NULL,
  var.name = "leverage.score",
  over.write = FALSE,
  method = CountSketch,
  vf.method = NULL,
  layer = "data",
  eps = 0.5,
  seed = 123L,
  verbose = TRUE,
  features = NULL,
  ...
)
```

Example 5 (r):
```r
LeverageScore(object, ...)

# Default S3 method
LeverageScore(
  object,
  nsketch = 5000L,
  ndims = NULL,
  method = CountSketch,
  eps = 0.5,
  seed = 123L,
  verbose = TRUE,
  ...
)

# S3 method for class 'StdAssay'
LeverageScore(
  object,
  nsketch = 5000L,
  ndims = NULL,
  method = CountSketch,
  vf.method = NULL,
  layer = "data",
  eps = 0.5,
  seed = 123L,
  verbose = TRUE,
  features = NULL,
  ...
)

# S3 method for class 'Assay'
LeverageScore(
  object,
  nsketch = 5000L,
  ndims = NULL,
  method = CountSketch,
  vf.method = NULL,
  layer = "data",
  eps = 0.5,
  seed = 123L,
  verbose = TRUE,
  features = NULL,
  ...
)

# S3 method for class 'Seurat'
LeverageScore(
  object,
  assay = NULL,
  nsketch = 5000L,
  ndims = NULL,
  var.name = "leverage.score",
  over.write = FALSE,
  method = CountSketch,
  vf.method = NULL,
  layer = "data",
  eps = 0.5,
  seed = 123L,
  verbose = TRUE,
  features = NULL,
  ...
)
```

Example 6 (r):
```r
LeverageScore(object, ...)

# Default S3 method
LeverageScore(
  object,
  nsketch = 5000L,
  ndims = NULL,
  method = CountSketch,
  eps = 0.5,
  seed = 123L,
  verbose = TRUE,
  ...
)

# S3 method for class 'StdAssay'
LeverageScore(
  object,
  nsketch = 5000L,
  ndims = NULL,
  method = CountSketch,
  vf.method = NULL,
  layer = "data",
  eps = 0.5,
  seed = 123L,
  verbose = TRUE,
  features = NULL,
  ...
)

# S3 method for class 'Assay'
LeverageScore(
  object,
  nsketch = 5000L,
  ndims = NULL,
  method = CountSketch,
  vf.method = NULL,
  layer = "data",
  eps = 0.5,
  seed = 123L,
  verbose = TRUE,
  features = NULL,
  ...
)

# S3 method for class 'Seurat'
LeverageScore(
  object,
  assay = NULL,
  nsketch = 5000L,
  ndims = NULL,
  var.name = "leverage.score",
  over.write = FALSE,
  method = CountSketch,
  vf.method = NULL,
  layer = "data",
  eps = 0.5,
  seed = 123L,
  verbose = TRUE,
  features = NULL,
  ...
)
```

---

## Visualize spatial and clustering (dimensional reduction) data in a linked, interactive framework — LinkedPlots • Seurat

**URL:** http://127.0.0.1:9173/reference_linkedplots.html

**Contents:**
- Visualize spatial and clustering (dimensional reduction) data in a linked, interactive framework
- Arguments
- Value
- Examples
- Contents

Visualize spatial and clustering (dimensional reduction) data in a linked, interactive framework

Dimensions to plot, must be a two-length numeric vector specifying x- and y-dimensions

Which dimensionality reduction to use. If not specified, first searches for umap, then tsne, then pca

Name of the image to use in the plot

Choose the scale factor ("lowres"/"hires") to apply in order to matchthe plot with the specified `image` - defaults to "lowres"

Name of meta.data column to group the data by

Controls opacity of spots. Provide as a vector specifying the min and max for SpatialFeaturePlot. For SpatialDimPlot, provide a single alpha value for each plot.

Combine plots into a single gg object; note that if TRUE; themeing will not work when plotting multiple features/groupings

If plotting a feature, which data slot to pull from (counts, data, or scale.data)

Returns final plots. If combine, plots are stiched together using CombinePlots; otherwise, returns a list of ggplot objects

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/visualization.R
```

Example 2 (unknown):
```unknown
LinkedPlots.Rd
```

Example 3 (unknown):
```unknown
LinkedDimPlot(
  object,
  dims = 1:2,
  reduction = NULL,
  image = NULL,
  image.scale = "lowres",
  group.by = NULL,
  alpha = c(0.1, 1),
  combine = TRUE
)

LinkedFeaturePlot(
  object,
  feature,
  dims = 1:2,
  reduction = NULL,
  image = NULL,
  image.scale = "lowres",
  slot = "data",
  alpha = c(0.1, 1),
  combine = TRUE
)
```

Example 4 (r):
```r
LinkedDimPlot(
  object,
  dims = 1:2,
  reduction = NULL,
  image = NULL,
  image.scale = "lowres",
  group.by = NULL,
  alpha = c(0.1, 1),
  combine = TRUE
)

LinkedFeaturePlot(
  object,
  feature,
  dims = 1:2,
  reduction = NULL,
  image = NULL,
  image.scale = "lowres",
  slot = "data",
  alpha = c(0.1, 1),
  combine = TRUE
)
```

Example 5 (r):
```r
LinkedDimPlot(
  object,
  dims = 1:2,
  reduction = NULL,
  image = NULL,
  image.scale = "lowres",
  group.by = NULL,
  alpha = c(0.1, 1),
  combine = TRUE
)

LinkedFeaturePlot(
  object,
  feature,
  dims = 1:2,
  reduction = NULL,
  image = NULL,
  image.scale = "lowres",
  slot = "data",
  alpha = c(0.1, 1),
  combine = TRUE
)
```

Example 6 (unknown):
```unknown
CombinePlots
```

Example 7 (unknown):
```unknown
if (FALSE) { # \dontrun{
LinkedDimPlot(seurat.object)
LinkedFeaturePlot(seurat.object, feature = 'Hpca')
} # }
```

Example 8 (r):
```r
if (FALSE) { # \dontrun{
LinkedDimPlot(seurat.object)
LinkedFeaturePlot(seurat.object, feature = 'Hpca')
} # }
```

Example 9 (r):
```r
if (FALSE) { # \dontrun{
LinkedDimPlot(seurat.object)
LinkedFeaturePlot(seurat.object, feature = 'Hpca')
} # }
```

---

## Find integration bridge anchors between query and extended bridge-reference — FindBridgeIntegrationAnchors • Seurat

**URL:** http://127.0.0.1:9173/seurat/reference/findbridgeintegrationanchors/index.html

**Contents:**
- Find integration bridge anchors between query and extended bridge-reference
- Arguments
- Value
- Contents

Find a set of anchors between unimodal query and the other unimodal reference using a pre-computed BridgeReferenceSet. These integration anchors can later be used to integrate query and reference using the IntegrateEmbeddings object.

BridgeReferenceSet object generated from PrepareBridgeReference

A query Seurat object

Assay name for query-bridge integration

Number of dimensions for query-bridge integration

Determine if scale the query data for projection

Dimensional reduction to perform when finding anchors. Options are:

pcaproject: Project the PCA from the bridge onto the query. We recommend using PCA when bridge and query datasets are from scRNA-seq

lsiproject: Project the LSI from the bridge onto the query. We recommend using LSI when bridge and query datasets are from scATAC-seq or scCUT&TAG data. This requires that LSI or supervised LSI has been computed for the bridge dataset, and the same features (eg, peaks or genome bins) are present in both the bridge and query.

Dimensional reduction to perform when finding anchors between query and reference. Options are:

direct: find anchors directly on the bridge representation space

cca: perform cca on the on the bridge representation space and then find anchors

Print messages and progress

Returns an AnchorSet object that can be used as input to IntegrateEmbeddings.

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/integration.R
```

Example 2 (unknown):
```unknown
FindBridgeIntegrationAnchors.Rd
```

Example 3 (unknown):
```unknown
BridgeReferenceSet
```

Example 4 (unknown):
```unknown
IntegrateEmbeddings
```

Example 5 (unknown):
```unknown
FindBridgeIntegrationAnchors(
  extended.reference,
  query,
  query.assay = NULL,
  dims = 1:30,
  scale = FALSE,
  reduction = c("lsiproject", "pcaproject"),
  integration.reduction = c("direct", "cca"),
  verbose = TRUE
)
```

Example 6 (r):
```r
FindBridgeIntegrationAnchors(
  extended.reference,
  query,
  query.assay = NULL,
  dims = 1:30,
  scale = FALSE,
  reduction = c("lsiproject", "pcaproject"),
  integration.reduction = c("direct", "cca"),
  verbose = TRUE
)
```

Example 7 (r):
```r
FindBridgeIntegrationAnchors(
  extended.reference,
  query,
  query.assay = NULL,
  dims = 1:30,
  scale = FALSE,
  reduction = c("lsiproject", "pcaproject"),
  integration.reduction = c("direct", "cca"),
  verbose = TRUE
)
```

Example 8 (unknown):
```unknown
PrepareBridgeReference
```

Example 9 (unknown):
```unknown
IntegrateEmbeddings
```

---

## Find features with highest scores for a given dimensional reduction technique — TopFeatures • Seurat

**URL:** http://127.0.0.1:9173/reference_topfeatures.html

**Contents:**
- Find features with highest scores for a given dimensional reduction technique
- Arguments
- Value
- Examples
- Contents

Return a list of features with the strongest contribution to a set of components

Number of features to return

Use the projected feature loadings

Return an equal number of features with both + and - scores.

Extra parameters passed to Loadings

Returns a vector of features

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/objects.R
```

Example 2 (unknown):
```unknown
TopFeatures.Rd
```

Example 3 (unknown):
```unknown
TopFeatures(
  object,
  dim = 1,
  nfeatures = 20,
  projected = FALSE,
  balanced = FALSE,
  ...
)
```

Example 4 (r):
```r
TopFeatures(
  object,
  dim = 1,
  nfeatures = 20,
  projected = FALSE,
  balanced = FALSE,
  ...
)
```

Example 5 (r):
```r
TopFeatures(
  object,
  dim = 1,
  nfeatures = 20,
  projected = FALSE,
  balanced = FALSE,
  ...
)
```

Example 6 (python):
```python
data("pbmc_small")
pbmc_small
#> An object of class Seurat 
#> 230 features across 80 samples within 1 assay 
#> Active assay: RNA (230 features, 20 variable features)
#>  3 layers present: counts, data, scale.data
#>  2 dimensional reductions calculated: pca, tsne
TopFeatures(object = pbmc_small[["pca"]], dim = 1)
#>  [1] "HLA-DPB1"      "HLA-DQA1"      "S100A9"        "S100A8"       
#>  [5] "GNLY"          "RP11-290F20.3" "CD1C"          "AKR1C3"       
#>  [9] "IGLL5"         "VDAC3"         "PARVB"         "RUFY1"        
#> [13] "PGRMC1"        "MYL9"          "TREML1"        "CA2"          
#> [17] "TUBB1"         "PPBP"          "PF4"           "SDPR"         
# After projection:
TopFeatures(object = pbmc_small[["pca"]], dim = 1,  projected = TRUE)
#>  [1] "HLA-DPB1"      "HLA-DQA1"      "S100A9"        "S100A8"       
#>  [5] "GNLY"          "RP11-290F20.3" "CD1C"          "AKR1C3"       
#>  [9] "IGLL5"         "VDAC3"         "PARVB"         "RUFY1"        
#> [13] "PGRMC1"        "MYL9"          "TREML1"        "CA2"          
#> [17] "TUBB1"         "PPBP"          "PF4"           "SDPR"
```

Example 7 (r):
```r
data("pbmc_small")
pbmc_small
#> An object of class Seurat 
#> 230 features across 80 samples within 1 assay 
#> Active assay: RNA (230 features, 20 variable features)
#>  3 layers present: counts, data, scale.data
#>  2 dimensional reductions calculated: pca, tsne
TopFeatures(object = pbmc_small[["pca"]], dim = 1)
#>  [1] "HLA-DPB1"      "HLA-DQA1"      "S100A9"        "S100A8"       
#>  [5] "GNLY"          "RP11-290F20.3" "CD1C"          "AKR1C3"       
#>  [9] "IGLL5"         "VDAC3"         "PARVB"         "RUFY1"        
#> [13] "PGRMC1"        "MYL9"          "TREML1"        "CA2"          
#> [17] "TUBB1"         "PPBP"          "PF4"           "SDPR"         
# After projection:
TopFeatures(object = pbmc_small[["pca"]], dim = 1,  projected = TRUE)
#>  [1] "HLA-DPB1"      "HLA-DQA1"      "S100A9"        "S100A8"       
#>  [5] "GNLY"          "RP11-290F20.3" "CD1C"          "AKR1C3"       
#>  [9] "IGLL5"         "VDAC3"         "PARVB"         "RUFY1"        
#> [13] "PGRMC1"        "MYL9"          "TREML1"        "CA2"          
#> [17] "TUBB1"         "PPBP"          "PF4"           "SDPR"
```

Example 8 (r):
```r
data("pbmc_small")
pbmc_small
#> An object of class Seurat 
#> 230 features across 80 samples within 1 assay 
#> Active assay: RNA (230 features, 20 variable features)
#>  3 layers present: counts, data, scale.data
#>  2 dimensional reductions calculated: pca, tsne
TopFeatures(object = pbmc_small[["pca"]], dim = 1)
#>  [1] "HLA-DPB1"      "HLA-DQA1"      "S100A9"        "S100A8"       
#>  [5] "GNLY"          "RP11-290F20.3" "CD1C"          "AKR1C3"       
#>  [9] "IGLL5"         "VDAC3"         "PARVB"         "RUFY1"        
#> [13] "PGRMC1"        "MYL9"          "TREML1"        "CA2"          
#> [17] "TUBB1"         "PPBP"          "PF4"           "SDPR"         
# After projection:
TopFeatures(object = pbmc_small[["pca"]], dim = 1,  projected = TRUE)
#>  [1] "HLA-DPB1"      "HLA-DQA1"      "S100A9"        "S100A8"       
#>  [5] "GNLY"          "RP11-290F20.3" "CD1C"          "AKR1C3"       
#>  [9] "IGLL5"         "VDAC3"         "PARVB"         "RUFY1"        
#> [13] "PGRMC1"        "MYL9"          "TREML1"        "CA2"          
#> [17] "TUBB1"         "PPBP"          "PF4"           "SDPR"
```

---

## Discrete colour palettes from pals — DiscretePalette • Seurat

**URL:** http://127.0.0.1:9173/seurat/reference/discretepalette/index.html

**Contents:**
- Discrete colour palettes from pals
- Arguments
- Value
- Details
- Contents

These are included here because pals depends on a number of compiled packages, and this can lead to increases in run time for Travis, and generally should be avoided when possible.

Number of colours to be generated.

Options are "alphabet", "alphabet2", "glasbey", "polychrome", "stepped", and "parade". Can be omitted and the function will use the one based on the requested n.

Shuffle the colors in the selected palette.

These palettes are a much better default for data with many classes than the default ggplot2 palette.

Many thanks to Kevin Wright for writing the pals package.

Taken from the pals package (Licence: GPL-3). https://cran.r-project.org/package=pals Credit: Kevin Wright

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/visualization.R
```

Example 2 (unknown):
```unknown
DiscretePalette.Rd
```

Example 3 (unknown):
```unknown
DiscretePalette(n, palette = NULL, shuffle = FALSE)
```

Example 4 (r):
```r
DiscretePalette(n, palette = NULL, shuffle = FALSE)
```

Example 5 (r):
```r
DiscretePalette(n, palette = NULL, shuffle = FALSE)
```

---

## Hover Locator — HoverLocator • Seurat

**URL:** http://127.0.0.1:9173/reference_hoverlocator.html

**Contents:**
- Hover Locator
- Arguments
- See also
- Examples
- Contents

Get quick information from a scatterplot by hovering over points

An optional dataframe or matrix of extra information to be displayed on hover

Display or hide x- and y-axes

Plot using a dark theme?

Extra parameters to be passed to layout

layout ggplot_build DimPlot FeaturePlot

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/visualization.R
```

Example 2 (unknown):
```unknown
HoverLocator.Rd
```

Example 3 (unknown):
```unknown
HoverLocator(plot, information = NULL, axes = TRUE, dark.theme = FALSE, ...)
```

Example 4 (r):
```r
HoverLocator(plot, information = NULL, axes = TRUE, dark.theme = FALSE, ...)
```

Example 5 (r):
```r
HoverLocator(plot, information = NULL, axes = TRUE, dark.theme = FALSE, ...)
```

Example 6 (unknown):
```unknown
ggplot_build
```

Example 7 (unknown):
```unknown
FeaturePlot
```

Example 8 (unknown):
```unknown
if (FALSE) { # \dontrun{
data("pbmc_small")
plot <- DimPlot(object = pbmc_small)
HoverLocator(plot = plot, information = FetchData(object = pbmc_small, vars = 'percent.mito'))
} # }
```

Example 9 (r):
```r
if (FALSE) { # \dontrun{
data("pbmc_small")
plot <- DimPlot(object = pbmc_small)
HoverLocator(plot = plot, information = FetchData(object = pbmc_small, vars = 'percent.mito'))
} # }
```

Example 10 (r):
```r
if (FALSE) { # \dontrun{
data("pbmc_small")
plot <- DimPlot(object = pbmc_small)
HoverLocator(plot = plot, information = FetchData(object = pbmc_small, vars = 'percent.mito'))
} # }
```

---

## Function to plot perturbation score distributions. — PlotPerturbScore • Seurat

**URL:** http://127.0.0.1:9173/seurat/reference/plotperturbscore/index.html

**Contents:**
- Function to plot perturbation score distributions.
- Arguments
- Value
- Contents

Density plots to visualize perturbation scores calculated from RunMixscape function.

An object of class Seurat.

meta data column specifying all target gene names in the experiment.

Target gene name to visualize perturbation scores for.

meta data column specifying mixscape classifications.

Specify color of target gene class or knockout cell class. For control non-targeting and non-perturbed cells, colors are set to different shades of grey.

For datasets with more than one cell type. Set equal TRUE to visualize perturbation scores for each cell type separately.

Option to split densities based on mixscape classification (default) or original target gene classification. Default is set to NULL and plots cells by original class ID.

specify type of CRISPR perturbation expected for labeling mixscape classifications. Default is KO.

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/mixscape.R
```

Example 2 (unknown):
```unknown
PlotPerturbScore.Rd
```

Example 3 (python):
```python
PlotPerturbScore(
  object,
  target.gene.class = "gene",
  target.gene.ident = NULL,
  mixscape.class = "mixscape_class",
  col = "orange2",
  split.by = NULL,
  before.mixscape = FALSE,
  prtb.type = "KO"
)
```

Example 4 (r):
```r
PlotPerturbScore(
  object,
  target.gene.class = "gene",
  target.gene.ident = NULL,
  mixscape.class = "mixscape_class",
  col = "orange2",
  split.by = NULL,
  before.mixscape = FALSE,
  prtb.type = "KO"
)
```

Example 5 (r):
```r
PlotPerturbScore(
  object,
  target.gene.class = "gene",
  target.gene.ident = NULL,
  mixscape.class = "mixscape_class",
  col = "orange2",
  split.by = NULL,
  before.mixscape = FALSE,
  prtb.type = "KO"
)
```

---

## Create a SCT Assay object — CreateSCTAssayObject • Seurat

**URL:** http://127.0.0.1:9173/reference_createsctassayobject.html

**Contents:**
- Create a SCT Assay object
- Arguments
- Details
- Contents

Create a SCT object from a feature (e.g. gene) expression matrix and a list of SCTModels. The expected format of the input matrix is features x cells.

Unnormalized data such as raw counts or TPMs

Prenormalized data; if provided, do not pass counts

The UMI assay name. Default is RNA

Include features detected in at least this many cells. Will subset the counts matrix as well. To reintroduce excluded features, create a new object with a lower cutoff

Include cells where at least this many features are detected

Non-unique cell or feature names are not allowed. Please make unique before calling this function.

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/objects.R
```

Example 2 (unknown):
```unknown
CreateSCTAssayObject.Rd
```

Example 3 (unknown):
```unknown
CreateSCTAssayObject(
  counts,
  data,
  scale.data = NULL,
  umi.assay = "RNA",
  min.cells = 0,
  min.features = 0,
  SCTModel.list = NULL
)
```

Example 4 (r):
```r
CreateSCTAssayObject(
  counts,
  data,
  scale.data = NULL,
  umi.assay = "RNA",
  min.cells = 0,
  min.features = 0,
  SCTModel.list = NULL
)
```

Example 5 (r):
```r
CreateSCTAssayObject(
  counts,
  data,
  scale.data = NULL,
  umi.assay = "RNA",
  min.cells = 0,
  min.features = 0,
  SCTModel.list = NULL
)
```

---

## Run a custom distance function on an input data matrix — CustomDistance • Seurat

**URL:** http://127.0.0.1:9173/seurat/reference/customdistance/index.html

**Contents:**
- Run a custom distance function on an input data matrix
- Arguments
- Value
- Author
- Examples
- Contents

Run a custom distance function on an input data matrix

A matrix to calculate distance on

A function to calculate distance

Extra parameters to my.function

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/utilities.R
```

Example 2 (unknown):
```unknown
CustomDistance.Rd
```

Example 3 (unknown):
```unknown
CustomDistance(my.mat, my.function, ...)
```

Example 4 (r):
```r
CustomDistance(my.mat, my.function, ...)
```

Example 5 (r):
```r
CustomDistance(my.mat, my.function, ...)
```

Example 6 (javascript):
```javascript
data("pbmc_small")
# Define custom distance matrix
manhattan.distance <- function(x, y) return(sum(abs(x-y)))

input.data <- GetAssayData(pbmc_small, assay.type = "RNA", slot = "scale.data")
#> Warning: The following arguments are not used: assay.type
#> Warning: The `slot` argument of `GetAssayData()` is deprecated as of SeuratObject 5.0.0.
#> ℹ Please use the `layer` argument instead.
cell.manhattan.dist <- CustomDistance(input.data, manhattan.distance)
```

Example 7 (r):
```r
data("pbmc_small")
# Define custom distance matrix
manhattan.distance <- function(x, y) return(sum(abs(x-y)))

input.data <- GetAssayData(pbmc_small, assay.type = "RNA", slot = "scale.data")
#> Warning: The following arguments are not used: assay.type
#> Warning: The `slot` argument of `GetAssayData()` is deprecated as of SeuratObject 5.0.0.
#> ℹ Please use the `layer` argument instead.
cell.manhattan.dist <- CustomDistance(input.data, manhattan.distance)
```

Example 8 (r):
```r
data("pbmc_small")
# Define custom distance matrix
manhattan.distance <- function(x, y) return(sum(abs(x-y)))

input.data <- GetAssayData(pbmc_small, assay.type = "RNA", slot = "scale.data")
#> Warning: The following arguments are not used: assay.type
#> Warning: The `slot` argument of `GetAssayData()` is deprecated as of SeuratObject 5.0.0.
#> ℹ Please use the `layer` argument instead.
cell.manhattan.dist <- CustomDistance(input.data, manhattan.distance)
```

---

## Find integration bridge anchors between query and extended bridge-reference — FindBridgeIntegrationAnchors • Seurat

**URL:** http://127.0.0.1:9173/reference_findbridgeintegrationanchors.html

**Contents:**
- Find integration bridge anchors between query and extended bridge-reference
- Arguments
- Value
- Contents

Find a set of anchors between unimodal query and the other unimodal reference using a pre-computed BridgeReferenceSet. These integration anchors can later be used to integrate query and reference using the IntegrateEmbeddings object.

BridgeReferenceSet object generated from PrepareBridgeReference

A query Seurat object

Assay name for query-bridge integration

Number of dimensions for query-bridge integration

Determine if scale the query data for projection

Dimensional reduction to perform when finding anchors. Options are:

pcaproject: Project the PCA from the bridge onto the query. We recommend using PCA when bridge and query datasets are from scRNA-seq

lsiproject: Project the LSI from the bridge onto the query. We recommend using LSI when bridge and query datasets are from scATAC-seq or scCUT&TAG data. This requires that LSI or supervised LSI has been computed for the bridge dataset, and the same features (eg, peaks or genome bins) are present in both the bridge and query.

Dimensional reduction to perform when finding anchors between query and reference. Options are:

direct: find anchors directly on the bridge representation space

cca: perform cca on the on the bridge representation space and then find anchors

Print messages and progress

Returns an AnchorSet object that can be used as input to IntegrateEmbeddings.

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/integration.R
```

Example 2 (unknown):
```unknown
FindBridgeIntegrationAnchors.Rd
```

Example 3 (unknown):
```unknown
BridgeReferenceSet
```

Example 4 (unknown):
```unknown
IntegrateEmbeddings
```

Example 5 (unknown):
```unknown
FindBridgeIntegrationAnchors(
  extended.reference,
  query,
  query.assay = NULL,
  dims = 1:30,
  scale = FALSE,
  reduction = c("lsiproject", "pcaproject"),
  integration.reduction = c("direct", "cca"),
  verbose = TRUE
)
```

Example 6 (r):
```r
FindBridgeIntegrationAnchors(
  extended.reference,
  query,
  query.assay = NULL,
  dims = 1:30,
  scale = FALSE,
  reduction = c("lsiproject", "pcaproject"),
  integration.reduction = c("direct", "cca"),
  verbose = TRUE
)
```

Example 7 (r):
```r
FindBridgeIntegrationAnchors(
  extended.reference,
  query,
  query.assay = NULL,
  dims = 1:30,
  scale = FALSE,
  reduction = c("lsiproject", "pcaproject"),
  integration.reduction = c("direct", "cca"),
  verbose = TRUE
)
```

Example 8 (unknown):
```unknown
PrepareBridgeReference
```

Example 9 (unknown):
```unknown
IntegrateEmbeddings
```

---

## Project query into UMAP coordinates of a reference — ProjectUMAP • Seurat

**URL:** http://127.0.0.1:9173/seurat/reference/projectumap/index.html

**Contents:**
- Project query into UMAP coordinates of a reference
- Arguments
- Contents

This function will take a query dataset and project it into the coordinates of a provided reference UMAP. This is essentially a wrapper around two steps:

FindNeighbors - Find the nearest reference cell neighbors and their distances for each query cell.

RunUMAP - Perform umap projection by providing the neighbor set calculated above and the umap model previously computed in the reference.

Additional parameters to RunUMAP

Dimensions (columns) to use from query

Dimensions (columns) to use from reference

Defines k for the k-nearest neighbor algorithm

Method for nearest neighbor finding. Options include: rann, annoy

More trees gives higher precision when using annoy approximate nearest neighbor search

Distance metric for annoy. Options include: euclidean, cosine, manhattan, and hamming

Take L2Norm of the data

Include cached index in returned Neighbor object (only relevant if return.neighbor = TRUE)

Precomputed index. Useful if querying new data against existing index to avoid recomputing.

Name to store neighbor information in the query

DimReduc object that contains the umap model

Name of reduction to use from the query for neighbor finding

Name of reduction to use from the reference for neighbor finding

Name of projected UMAP to store in the query

Value for the projected UMAP key

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/generics.R
```

Example 2 (unknown):
```unknown
R/dimensional_reduction.R
```

Example 3 (unknown):
```unknown
ProjectUMAP.Rd
```

Example 4 (python):
```python
ProjectUMAP(query, ...)

# Default S3 method
ProjectUMAP(
  query,
  query.dims = NULL,
  reference,
  reference.dims = NULL,
  k.param = 30,
  nn.method = "annoy",
  n.trees = 50,
  annoy.metric = "cosine",
  l2.norm = FALSE,
  cache.index = TRUE,
  index = NULL,
  neighbor.name = "query_ref.nn",
  reduction.model,
  ...
)

# S3 method for class 'DimReduc'
ProjectUMAP(
  query,
  query.dims = NULL,
  reference,
  reference.dims = NULL,
  k.param = 30,
  nn.method = "annoy",
  n.trees = 50,
  annoy.metric = "cosine",
  l2.norm = FALSE,
  cache.index = TRUE,
  index = NULL,
  neighbor.name = "query_ref.nn",
  reduction.model,
  ...
)

# S3 method for class 'Seurat'
ProjectUMAP(
  query,
  query.reduction,
  query.dims = NULL,
  reference,
  reference.reduction,
  reference.dims = NULL,
  k.param = 30,
  nn.method = "annoy",
  n.trees = 50,
  annoy.metric = "cosine",
  l2.norm = FALSE,
  cache.index = TRUE,
  index = NULL,
  neighbor.name = "query_ref.nn",
  reduction.model,
  reduction.name = "ref.umap",
  reduction.key = "refUMAP_",
  ...
)
```

Example 5 (r):
```r
ProjectUMAP(query, ...)

# Default S3 method
ProjectUMAP(
  query,
  query.dims = NULL,
  reference,
  reference.dims = NULL,
  k.param = 30,
  nn.method = "annoy",
  n.trees = 50,
  annoy.metric = "cosine",
  l2.norm = FALSE,
  cache.index = TRUE,
  index = NULL,
  neighbor.name = "query_ref.nn",
  reduction.model,
  ...
)

# S3 method for class 'DimReduc'
ProjectUMAP(
  query,
  query.dims = NULL,
  reference,
  reference.dims = NULL,
  k.param = 30,
  nn.method = "annoy",
  n.trees = 50,
  annoy.metric = "cosine",
  l2.norm = FALSE,
  cache.index = TRUE,
  index = NULL,
  neighbor.name = "query_ref.nn",
  reduction.model,
  ...
)

# S3 method for class 'Seurat'
ProjectUMAP(
  query,
  query.reduction,
  query.dims = NULL,
  reference,
  reference.reduction,
  reference.dims = NULL,
  k.param = 30,
  nn.method = "annoy",
  n.trees = 50,
  annoy.metric = "cosine",
  l2.norm = FALSE,
  cache.index = TRUE,
  index = NULL,
  neighbor.name = "query_ref.nn",
  reduction.model,
  reduction.name = "ref.umap",
  reduction.key = "refUMAP_",
  ...
)
```

Example 6 (r):
```r
ProjectUMAP(query, ...)

# Default S3 method
ProjectUMAP(
  query,
  query.dims = NULL,
  reference,
  reference.dims = NULL,
  k.param = 30,
  nn.method = "annoy",
  n.trees = 50,
  annoy.metric = "cosine",
  l2.norm = FALSE,
  cache.index = TRUE,
  index = NULL,
  neighbor.name = "query_ref.nn",
  reduction.model,
  ...
)

# S3 method for class 'DimReduc'
ProjectUMAP(
  query,
  query.dims = NULL,
  reference,
  reference.dims = NULL,
  k.param = 30,
  nn.method = "annoy",
  n.trees = 50,
  annoy.metric = "cosine",
  l2.norm = FALSE,
  cache.index = TRUE,
  index = NULL,
  neighbor.name = "query_ref.nn",
  reduction.model,
  ...
)

# S3 method for class 'Seurat'
ProjectUMAP(
  query,
  query.reduction,
  query.dims = NULL,
  reference,
  reference.reduction,
  reference.dims = NULL,
  k.param = 30,
  nn.method = "annoy",
  n.trees = 50,
  annoy.metric = "cosine",
  l2.norm = FALSE,
  cache.index = TRUE,
  index = NULL,
  neighbor.name = "query_ref.nn",
  reduction.model,
  reduction.name = "ref.umap",
  reduction.key = "refUMAP_",
  ...
)
```

---

## The IntegrationAnchorSet Class — IntegrationAnchorSet-class • Seurat

**URL:** http://127.0.0.1:9173/seurat/reference/integrationanchorset-class/index.html

**Contents:**
- The IntegrationAnchorSet Class
- Contents

Inherits from the Anchorset class. Implemented mainly for method dispatch purposes. See AnchorSet for slot details.

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/objects.R
```

Example 2 (unknown):
```unknown
IntegrationAnchorSet-class.Rd
```

---

## View variable features — VariableFeaturePlot • Seurat

**URL:** http://127.0.0.1:9173/reference_variablefeatureplot.html

**Contents:**
- View variable features
- Arguments
- Value
- See also
- Examples
- Contents

View variable features

Colors to specify non-variable/variable status

Size of the points on the plot

Plot the x-axis in log scale

Assay to pull variable features from

Convert points to raster format, default is NULL which will automatically use raster if the number of points plotted is greater than 100,000

Pixel resolution for rasterized plots, passed to geom_scattermore(). Default is c(512, 512).

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/visualization.R
```

Example 2 (unknown):
```unknown
VariableFeaturePlot.Rd
```

Example 3 (unknown):
```unknown
VariableFeaturePlot(
  object,
  cols = c("black", "red"),
  pt.size = 1,
  log = NULL,
  selection.method = NULL,
  assay = NULL,
  raster = NULL,
  raster.dpi = c(512, 512)
)
```

Example 4 (r):
```r
VariableFeaturePlot(
  object,
  cols = c("black", "red"),
  pt.size = 1,
  log = NULL,
  selection.method = NULL,
  assay = NULL,
  raster = NULL,
  raster.dpi = c(512, 512)
)
```

Example 5 (r):
```r
VariableFeaturePlot(
  object,
  cols = c("black", "red"),
  pt.size = 1,
  log = NULL,
  selection.method = NULL,
  assay = NULL,
  raster = NULL,
  raster.dpi = c(512, 512)
)
```

Example 6 (unknown):
```unknown
FindVariableFeatures
```

Example 7 (unknown):
```unknown
data("pbmc_small")
VariableFeaturePlot(object = pbmc_small)
```

Example 8 (r):
```r
data("pbmc_small")
VariableFeaturePlot(object = pbmc_small)
```

Example 9 (r):
```r
data("pbmc_small")
VariableFeaturePlot(object = pbmc_small)
```

---

## Update pre-V4 Assays generated with SCTransform in the Seurat to the new SCTAssay class — UpdateSCTAssays • Seurat

**URL:** http://127.0.0.1:9173/seurat/reference/updatesctassays/index.html

**Contents:**
- Update pre-V4 Assays generated with SCTransform in the Seurat to the new SCTAssay class
- Arguments
- Value
- Contents

Update pre-V4 Assays generated with SCTransform in the Seurat to the new SCTAssay class

A Seurat object with updated SCTAssays

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/objects.R
```

Example 2 (unknown):
```unknown
UpdateSCTAssays.Rd
```

Example 3 (unknown):
```unknown
UpdateSCTAssays(object)
```

Example 4 (r):
```r
UpdateSCTAssays(object)
```

Example 5 (r):
```r
UpdateSCTAssays(object)
```

---

## The SeuratCommand Class — SeuratCommand-class • Seurat

**URL:** http://127.0.0.1:9173/seurat/reference/seuratcommand-class/index.html

**Contents:**
- The SeuratCommand Class
- See also
- Contents

For more details, please see the documentation in SeuratObject

SeuratObject::SeuratCommand-class

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/reexports.R
```

Example 2 (unknown):
```unknown
SeuratCommand-class.Rd
```

Example 3 (unknown):
```unknown
SeuratObject
```

Example 4 (unknown):
```unknown
SeuratObject::SeuratCommand-class
```

---

## Calculate the percentage of a vector above some threshold — PercentAbove • Seurat

**URL:** http://127.0.0.1:9173/reference_percentabove.html

**Contents:**
- Calculate the percentage of a vector above some threshold
- Arguments
- Value
- Examples
- Contents

Calculate the percentage of a vector above some threshold

Threshold to use when calculating percentage

Returns the percentage of x values above the given threshold

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/utilities.R
```

Example 2 (unknown):
```unknown
PercentAbove.Rd
```

Example 3 (unknown):
```unknown
PercentAbove(x, threshold)
```

Example 4 (r):
```r
PercentAbove(x, threshold)
```

Example 5 (r):
```r
PercentAbove(x, threshold)
```

Example 6 (unknown):
```unknown
set.seed(42)
PercentAbove(sample(1:100, 10), 75)
#> [1] 0.2
```

Example 7 (r):
```r
set.seed(42)
PercentAbove(sample(1:100, 10), 75)
#> [1] 0.2
```

Example 8 (r):
```r
set.seed(42)
PercentAbove(sample(1:100, 10), 75)
#> [1] 0.2
```

---

## Demultiplex samples based on data from cell 'hashing' — HTODemux • Seurat

**URL:** http://127.0.0.1:9173/reference_htodemux.html

**Contents:**
- Demultiplex samples based on data from cell 'hashing'
- Arguments
- Value
- See also
- Examples
- Contents

Assign sample-of-origin for each cell, annotate doublets.

Seurat object. Assumes that the hash tag oligo (HTO) data has been added and normalized.

Name of the Hashtag assay (HTO by default)

The quantile of inferred 'negative' distribution for each hashtag - over which the cell is considered 'positive'. Default is 0.99

Initial number of clusters for hashtags. Default is the # of hashtag oligo names + 1 (to account for negatives)

nstarts value for k-means clustering (for kfunc = "kmeans"). 100 by default

Clustering function for initial hashtag grouping. Default is "clara" for fast k-medoids clustering on large applications, also support "kmeans" for kmeans clustering

Number of samples to be drawn from the dataset used for clustering, for kfunc = "clara"

Sets the random seed. If NULL, seed is not set

The Seurat object with the following demultiplexed information stored in the meta data:

Name of hashtag with the highest signal

Name of hashtag with the second highest signal

The difference between signals for hash.maxID and hash.secondID

Classification result, with doublets/multiplets named by the top two highest hashtags

Global classification result (singlet, doublet or negative)

Classification result where doublet IDs are collapsed

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/preprocessing.R
```

Example 2 (unknown):
```unknown
HTODemux.Rd
```

Example 3 (unknown):
```unknown
HTODemux(
  object,
  assay = "HTO",
  positive.quantile = 0.99,
  init = NULL,
  nstarts = 100,
  kfunc = "clara",
  nsamples = 100,
  seed = 42,
  verbose = TRUE
)
```

Example 4 (r):
```r
HTODemux(
  object,
  assay = "HTO",
  positive.quantile = 0.99,
  init = NULL,
  nstarts = 100,
  kfunc = "clara",
  nsamples = 100,
  seed = 42,
  verbose = TRUE
)
```

Example 5 (r):
```r
HTODemux(
  object,
  assay = "HTO",
  positive.quantile = 0.99,
  init = NULL,
  nstarts = 100,
  kfunc = "clara",
  nsamples = 100,
  seed = 42,
  verbose = TRUE
)
```

Example 6 (unknown):
```unknown
if (FALSE) { # \dontrun{
object <- HTODemux(object)
} # }
```

Example 7 (r):
```r
if (FALSE) { # \dontrun{
object <- HTODemux(object)
} # }
```

Example 8 (r):
```r
if (FALSE) { # \dontrun{
object <- HTODemux(object)
} # }
```

---

## Load 10X Genomics Visium Tissue Positions — Read10X_Coordinates • Seurat

**URL:** http://127.0.0.1:9173/seurat/reference/read10x_coordinates/index.html

**Contents:**
- Load 10X Genomics Visium Tissue Positions
- Arguments
- Value
- Contents

Load 10X Genomics Visium Tissue Positions

Path to a tissue_positions_list.csv file

Filter spot/feature matrix to only include spots that have been determined to be over tissue

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/preprocessing.R
```

Example 2 (unknown):
```unknown
Read10X_Coordinates.Rd
```

Example 3 (unknown):
```unknown
Read10X_Coordinates(filename, filter.matrix)
```

Example 4 (r):
```r
Read10X_Coordinates(filename, filter.matrix)
```

Example 5 (r):
```r
Read10X_Coordinates(filename, filter.matrix)
```

Example 6 (unknown):
```unknown
tissue_positions_list.csv
```

---

## Find the Quantile of Data — SetQuantile • Seurat

**URL:** http://127.0.0.1:9173/seurat/reference/setquantile/index.html

**Contents:**
- Find the Quantile of Data
- Arguments
- Value
- Examples
- Contents

Converts a quantile in character form to a number regarding some data. String form for a quantile is represented as a number prefixed with “q”; for example, 10th quantile is “q10” while 2nd quantile is “q2”. Will only take a quantile of non-zero data values

The cutoff to turn into a quantile

The data to turn find the quantile of

The numerical representation of the quantile

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/utilities.R
```

Example 2 (unknown):
```unknown
SetQuantile.Rd
```

Example 3 (unknown):
```unknown
SetQuantile(cutoff, data)
```

Example 4 (r):
```r
SetQuantile(cutoff, data)
```

Example 5 (r):
```r
SetQuantile(cutoff, data)
```

Example 6 (unknown):
```unknown
set.seed(42)
SetQuantile('q10', sample(1:100, 10))
#> [1] 23.4
```

Example 7 (r):
```r
set.seed(42)
SetQuantile('q10', sample(1:100, 10))
#> [1] 23.4
```

Example 8 (r):
```r
set.seed(42)
SetQuantile('q10', sample(1:100, 10))
#> [1] 23.4
```

---

## The DimReduc Class — DimReduc-class • Seurat

**URL:** http://127.0.0.1:9173/seurat/reference/dimreduc-class/index.html

**Contents:**
- The DimReduc Class
- See also
- Contents

The DimReduc object stores a dimensionality reduction taken out in Seurat; for more details, please see the documentation in SeuratObject

SeuratObject::DimReduc-class

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/reexports.R
```

Example 2 (unknown):
```unknown
DimReduc-class.Rd
```

Example 3 (unknown):
```unknown
SeuratObject
```

Example 4 (unknown):
```unknown
SeuratObject::DimReduc-class
```

---

## Get Variable Feature Information — HVFInfo.SCTAssay • Seurat

**URL:** http://127.0.0.1:9173/reference_hvfinfo.sctassay.html

**Contents:**
- Get Variable Feature Information
- Arguments
- See also
- Examples
- Contents

Get variable feature information from SCTAssay objects

method to determine variable features

Add variable status to the resulting data frame

Arguments passed to other methods

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/objects.R
```

Example 2 (unknown):
```unknown
HVFInfo.SCTAssay.Rd
```

Example 3 (python):
```python
# S3 method for class 'SCTAssay'
HVFInfo(object, method, status = FALSE, ...)
```

Example 4 (r):
```r
# S3 method for class 'SCTAssay'
HVFInfo(object, method, status = FALSE, ...)
```

Example 5 (r):
```r
# S3 method for class 'SCTAssay'
HVFInfo(object, method, status = FALSE, ...)
```

Example 6 (python):
```python
if (FALSE) { # \dontrun{
# Get the HVF info directly from an SCTAssay object
pbmc_small <- SCTransform(pbmc_small)
HVFInfo(pbmc_small[["SCT"]], method = 'sct')[1:5, ]
} # }
```

Example 7 (r):
```r
if (FALSE) { # \dontrun{
# Get the HVF info directly from an SCTAssay object
pbmc_small <- SCTransform(pbmc_small)
HVFInfo(pbmc_small[["SCT"]], method = 'sct')[1:5, ]
} # }
```

Example 8 (r):
```r
if (FALSE) { # \dontrun{
# Get the HVF info directly from an SCTAssay object
pbmc_small <- SCTransform(pbmc_small)
HVFInfo(pbmc_small[["SCT"]], method = 'sct')[1:5, ]
} # }
```

---

## Normalize Raw Data — LogNormalize • Seurat

**URL:** http://127.0.0.1:9173/reference_lognormalize.html

**Contents:**
- Normalize Raw Data
- Arguments
- Value
- Examples
- Contents

Matrix with the raw count data

Scale the data; default is 1e4

Margin to normalize over

Arguments passed to other methods

A matrix with the normalized and log-transformed data

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/generics.R
```

Example 2 (unknown):
```unknown
R/preprocessing.R
```

Example 3 (unknown):
```unknown
R/preprocessing5.R
```

Example 4 (unknown):
```unknown
LogNormalize.Rd
```

Example 5 (python):
```python
LogNormalize(data, scale.factor = 10000, margin = 2L, verbose = TRUE, ...)

# S3 method for class 'data.frame'
LogNormalize(data, scale.factor = 10000, margin = 2L, verbose = TRUE, ...)

# S3 method for class 'V3Matrix'
LogNormalize(data, scale.factor = 10000, margin = 2L, verbose = TRUE, ...)

# Default S3 method
LogNormalize(data, scale.factor = 10000, margin = 2L, verbose = TRUE, ...)
```

Example 6 (r):
```r
LogNormalize(data, scale.factor = 10000, margin = 2L, verbose = TRUE, ...)

# S3 method for class 'data.frame'
LogNormalize(data, scale.factor = 10000, margin = 2L, verbose = TRUE, ...)

# S3 method for class 'V3Matrix'
LogNormalize(data, scale.factor = 10000, margin = 2L, verbose = TRUE, ...)

# Default S3 method
LogNormalize(data, scale.factor = 10000, margin = 2L, verbose = TRUE, ...)
```

Example 7 (r):
```r
LogNormalize(data, scale.factor = 10000, margin = 2L, verbose = TRUE, ...)

# S3 method for class 'data.frame'
LogNormalize(data, scale.factor = 10000, margin = 2L, verbose = TRUE, ...)

# S3 method for class 'V3Matrix'
LogNormalize(data, scale.factor = 10000, margin = 2L, verbose = TRUE, ...)

# Default S3 method
LogNormalize(data, scale.factor = 10000, margin = 2L, verbose = TRUE, ...)
```

Example 8 (unknown):
```unknown
mat <- matrix(data = rbinom(n = 25, size = 5, prob = 0.2), nrow = 5)
mat
#>      [,1] [,2] [,3] [,4] [,5]
#> [1,]    0    0    2    2    0
#> [2,]    2    0    1    2    1
#> [3,]    3    0    1    0    0
#> [4,]    1    1    3    1    1
#> [5,]    1    1    1    0    2
mat_norm <- LogNormalize(data = mat)
mat_norm
#>          [,1]     [,2]     [,3]     [,4]     [,5]
#> [1,] 0.000000 0.000000 7.824446 8.294300 0.000000
#> [2,] 7.957927 0.000000 7.131699 8.294300 7.824446
#> [3,] 8.363276 0.000000 7.131699 0.000000 0.000000
#> [4,] 7.265130 8.517393 8.229778 7.601402 7.824446
#> [5,] 7.265130 8.517393 7.131699 0.000000 8.517393
```

Example 9 (r):
```r
mat <- matrix(data = rbinom(n = 25, size = 5, prob = 0.2), nrow = 5)
mat
#>      [,1] [,2] [,3] [,4] [,5]
#> [1,]    0    0    2    2    0
#> [2,]    2    0    1    2    1
#> [3,]    3    0    1    0    0
#> [4,]    1    1    3    1    1
#> [5,]    1    1    1    0    2
mat_norm <- LogNormalize(data = mat)
mat_norm
#>          [,1]     [,2]     [,3]     [,4]     [,5]
#> [1,] 0.000000 0.000000 7.824446 8.294300 0.000000
#> [2,] 7.957927 0.000000 7.131699 8.294300 7.824446
#> [3,] 8.363276 0.000000 7.131699 0.000000 0.000000
#> [4,] 7.265130 8.517393 8.229778 7.601402 7.824446
#> [5,] 7.265130 8.517393 7.131699 0.000000 8.517393
```

Example 10 (r):
```r
mat <- matrix(data = rbinom(n = 25, size = 5, prob = 0.2), nrow = 5)
mat
#>      [,1] [,2] [,3] [,4] [,5]
#> [1,]    0    0    2    2    0
#> [2,]    2    0    1    2    1
#> [3,]    3    0    1    0    0
#> [4,]    1    1    3    1    1
#> [5,]    1    1    1    0    2
mat_norm <- LogNormalize(data = mat)
mat_norm
#>          [,1]     [,2]     [,3]     [,4]     [,5]
#> [1,] 0.000000 0.000000 7.824446 8.294300 0.000000
#> [2,] 7.957927 0.000000 7.131699 8.294300 7.824446
#> [3,] 8.363276 0.000000 7.131699 0.000000 0.000000
#> [4,] 7.265130 8.517393 8.229778 7.601402 7.824446
#> [5,] 7.265130 8.517393 7.131699 0.000000 8.517393
```

---

## Dimensional reduction plot — DimPlot • Seurat

**URL:** http://127.0.0.1:9173/seurat/reference/dimplot/index.html

**Contents:**
- Dimensional reduction plot
- Arguments
- Value
- Note
- See also
- Examples
- Contents

Graphs the output of a dimensional reduction technique on a 2D scatter plot where each point is a cell and it's positioned based on the cell embeddings determined by the reduction technique. By default, cells are colored by their identity class (can be changed with the group.by parameter).

Dimensions to plot, must be a two-length numeric vector specifying x- and y-dimensions

Vector of cells to plot (default is all cells)

Vector of colors, each color corresponds to an identity class. This may also be a single character or numeric value corresponding to a palette as specified by brewer.pal.info. By default, ggplot2 assigns colors. We also include a number of palettes from the pals package. See DiscretePalette for details.

Adjust point size for plotting

Which dimensionality reduction to use. If not specified, first searches for umap, then tsne, then pca

Name of one or more metadata columns to group (color) cells by (for example, orig.ident); pass 'ident' to group by identity class

A factor in object metadata to split the plot by, pass 'ident' to split by cell identity

If NULL, all points are circles (default). You can specify any cell attribute (that can be pulled with FetchData) allowing for both different colors and different shapes on cells. Only applicable if raster = FALSE.

Specify the order of plotting for the idents. This can be useful for crowded plots if points of interest are being buried. Provide either a full list of valid idents or a subset to be plotted last (on top)

Whether to randomly shuffle the order of points. This can be useful for crowded plots if points of interest are being buried. (default is FALSE)

Sets the seed if randomly shuffling the order of points.

Whether to label the clusters

Sets the color of the label text

Whether to put a box around the label text (geom_text vs geom_label)

Alpha value for plotting (default is 1)

Adjust stroke (outline) size of points

A list of character or numeric vectors of cells to highlight. If only one group of cells desired, can simply pass a vector instead of a list. If set, colors selected cells to the color(s) in cols.highlight and other cells black (white if dark.theme = TRUE); will also resize to the size(s) passed to sizes.highlight

A vector of colors to highlight the cells as; will repeat to the length groups in cells.highlight

Size of highlighted cells; will repeat to the length groups in cells.highlight. If sizes.highlight = TRUE size of all points will be this value.

Color value for NA points when using custom scale

Number of columns for display when combining plots

Combine plots into a single patchworked ggplot object. If FALSE, return a list of ggplot objects

Convert points to raster format, default is NULL which automatically rasterizes if plotting more than 100,000 cells

Pixel resolution for rasterized plots, passed to geom_scattermore(). Default is c(512, 512).

Extra parameters passed to DimPlot

A patchworked ggplot object if combine = TRUE; otherwise, a list of ggplot objects

For the old do.hover and do.identify functionality, please see HoverLocator and CellSelector, respectively.

FeaturePlot HoverLocator CellSelector FetchData

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/visualization.R
```

Example 2 (unknown):
```unknown
R/convenience.R
```

Example 3 (unknown):
```unknown
DimPlot(
  object,
  dims = c(1, 2),
  cells = NULL,
  cols = NULL,
  pt.size = NULL,
  reduction = NULL,
  group.by = NULL,
  split.by = NULL,
  shape.by = NULL,
  order = NULL,
  shuffle = FALSE,
  seed = 1,
  label = FALSE,
  label.size = 4,
  label.color = "black",
  label.box = FALSE,
  repel = FALSE,
  alpha = 1,
  stroke.size = NULL,
  cells.highlight = NULL,
  cols.highlight = "#DE2D26",
  sizes.highlight = 1,
  na.value = "grey50",
  ncol = NULL,
  combine = TRUE,
  raster = NULL,
  raster.dpi = c(512, 512)
)

PCAPlot(object, ...)

TSNEPlot(object, ...)

UMAPPlot(object, ...)
```

Example 4 (r):
```r
DimPlot(
  object,
  dims = c(1, 2),
  cells = NULL,
  cols = NULL,
  pt.size = NULL,
  reduction = NULL,
  group.by = NULL,
  split.by = NULL,
  shape.by = NULL,
  order = NULL,
  shuffle = FALSE,
  seed = 1,
  label = FALSE,
  label.size = 4,
  label.color = "black",
  label.box = FALSE,
  repel = FALSE,
  alpha = 1,
  stroke.size = NULL,
  cells.highlight = NULL,
  cols.highlight = "#DE2D26",
  sizes.highlight = 1,
  na.value = "grey50",
  ncol = NULL,
  combine = TRUE,
  raster = NULL,
  raster.dpi = c(512, 512)
)

PCAPlot(object, ...)

TSNEPlot(object, ...)

UMAPPlot(object, ...)
```

Example 5 (r):
```r
DimPlot(
  object,
  dims = c(1, 2),
  cells = NULL,
  cols = NULL,
  pt.size = NULL,
  reduction = NULL,
  group.by = NULL,
  split.by = NULL,
  shape.by = NULL,
  order = NULL,
  shuffle = FALSE,
  seed = 1,
  label = FALSE,
  label.size = 4,
  label.color = "black",
  label.box = FALSE,
  repel = FALSE,
  alpha = 1,
  stroke.size = NULL,
  cells.highlight = NULL,
  cols.highlight = "#DE2D26",
  sizes.highlight = 1,
  na.value = "grey50",
  ncol = NULL,
  combine = TRUE,
  raster = NULL,
  raster.dpi = c(512, 512)
)

PCAPlot(object, ...)

TSNEPlot(object, ...)

UMAPPlot(object, ...)
```

Example 6 (unknown):
```unknown
brewer.pal.info
```

Example 7 (unknown):
```unknown
DiscretePalette
```

Example 8 (unknown):
```unknown
raster = FALSE
```

Example 9 (unknown):
```unknown
cols.highlight
```

Example 10 (unknown):
```unknown
sizes.highlight
```

Example 11 (unknown):
```unknown
sizes.highlight = TRUE
```

Example 12 (unknown):
```unknown
patchworked
```

Example 13 (unknown):
```unknown
patchworked
```

Example 14 (unknown):
```unknown
combine = TRUE
```

Example 15 (unknown):
```unknown
do.identify
```

Example 16 (unknown):
```unknown
HoverLocator
```

Example 17 (unknown):
```unknown
CellSelector
```

Example 18 (unknown):
```unknown
FeaturePlot
```

Example 19 (unknown):
```unknown
HoverLocator
```

Example 20 (unknown):
```unknown
CellSelector
```

Example 21 (unknown):
```unknown
data("pbmc_small")
DimPlot(object = pbmc_small)

DimPlot(object = pbmc_small, split.by = 'letter.idents')
```

Example 22 (r):
```r
data("pbmc_small")
DimPlot(object = pbmc_small)

DimPlot(object = pbmc_small, split.by = 'letter.idents')
```

Example 23 (r):
```r
data("pbmc_small")
DimPlot(object = pbmc_small)

DimPlot(object = pbmc_small, split.by = 'letter.idents')
```

---

## Analysis, visualization, and integration of Visium HD spatial datasets with Seurat • Seurat

**URL:** http://127.0.0.1:9173/seurat/articles/multimodal_reference_mapping/index.html

**Contents:**
- Multimodal reference mapping
    - Compiled: October 31, 2023
- Intro: Seurat v4 Reference Mapping
- Example 1: Mapping human peripheral blood cells
  - A Multimodal PBMC Reference Dataset
  - Mapping
  - Explore the mapping results
  - Computing a new UMAP visualiztion
- Example 2: Mapping human bone marrow cells
  - A Multimodal BMNC Reference Dataset
  - Computing an sPCA transformation
  - Computing a cached neighbor index
  - Query dataset preprocessing
  - Mapping
  - Explore the mapping results
- Contents

This vignette introduces the process of mapping query datasets to annotated references in Seurat. In this example, we map one of the first scRNA-seq datasets released by 10X Genomics of 2,700 PBMC to our recently described CITE-seq reference of 162,000 PBMC measured with 228 antibodies. We chose this example to demonstrate how supervised analysis guided by a reference dataset can help to enumerate cell states that would be challenging to find with unsupervised analysis. In a second example, we demonstrate how to serially map Human Cell Atlas datasets of human BMNC profiled from different individuals onto a consistent reference.

We have previously demonstrated how to use reference-mapping approach to annotate cell labels in a query dataset . In Seurat v4, we have substantially improved the speed and memory requirements for integrative tasks including reference mapping, and also include new functionality to project query cells onto a previously computed UMAP visualization.

In this vignette, we demonstrate how to use a previously established reference to interpret an scRNA-seq query:

To run this vignette please install Seurat v4, available on CRAN. Additionally, you will need to install the SeuratDisk package.

We load the reference from our recent paper, and visualize the pre-computed UMAP.

To demonstrate mapping to this multimodal reference, we will use a dataset of 2,700 PBMCs generated by 10x Genomics and available via SeuratData.

The reference was normalized using SCTransform(), so we use the same approach to normalize the query here.

We then find anchors between reference and query. As described in the manuscript, we used a precomputed supervised PCA (spca) transformation for this example. We recommend the use of supervised PCA for CITE-seq datasets, and demonstrate how to compute this transformation on the next tab of this vignette. However, you can also use a standard PCA transformation.

We then transfer cell type labels and protein data from the reference to the query. Additionally, we project the query data onto the UMAP structure of the reference.

What is MapQuery doing?

MapQuery() is a wrapper around three functions: TransferData(), IntegrateEmbeddings(), and ProjectUMAP(). TransferData() is used to transfer cell type labels and impute the ADT values. IntegrateEmbeddings() and ProjectUMAP() are used to project the query data onto the UMAP structure of the reference. The equivalent code for doing this with the intermediate functions is below:

We can now visualize the 2,700 query cells. They have been projected into a UMAP visualization defined by the reference, and each has received annotations at two levels of granularity (level 1, and level 2).

The reference-mapped dataset helps us identify cell types that were previously blended in an unsupervised analysis of the query dataset. Just a few examples include plasmacytoid dendritic cells (pDC), hematopoietic stem and progenitor cells (HSPC), regulatory T cells (Treg), CD8 Naive T cells, cells, CD56+ NK cells, memory, and naive B cells, and plasmablasts.

Each prediction is assigned a score between 0 and 1.

We can verify our predictions by exploring the expression of canonical marker genes. For example, CLEC4C and LIRA4 have been reported as markers of pDC identity, consistent with our predictions. Similarly, if we perform differential expression to identify markers of Tregs, we identify a set of canonical markers including RTKN2, CTLA4, FOXP3, and IL2RA.

Finally, we can visualize the imputed levels of surface protein, which were inferred based on the CITE-seq reference.

In the previous examples, we visualize the query cells after mapping to the reference-derived UMAP. Keeping a consistent visualization can assist with the interpretation of new datasets. However, if there are cell states that are present in the query dataset that are not represented in the reference, they will project to the most similar cell in the reference. This is the expected behavior and functionality as established by the UMAP package, but can potentially mask the presence of new cell types in the query which may be of interest.

In our manuscript, we map a query dataset containing developing and differentiated neutrophils, which are not included in our reference. We find that computing a new UMAP (‘de novo visualization’) after merging the reference and query can help to identify these populations, as demonstrated in Supplementary Figure 8. In the ‘de novo’ visualization, unique cell states in the query remain separated. In this example, the 2,700 PBMC does not contain unique cell states, but we demonstrate how to compute this visualization below.

We emphasize that if users are attempting to map datasets where the underlying samples are not PBMC, or contain cell types that are not present in the reference, computing a ‘de novo’ visualization is an important step in interpreting their dataset.

As a second example, we map a dataset of human bone marrow mononuclear (BMNC) cells from eight individual donors, produced by the Human Cell Atlas. As a reference, we use the CITE-seq reference of human BMNC that we analyzed using weighted-nearest neighbor analysis (WNN).

This vignette exhibits the same reference-mapping functionality as the PBMC example on the previous tab. In addition, we also demonstrate:

The reference dataset contains a WNN graph, reflecting a weighted combination of the RNA and protein data in this CITE-seq experiment.

We can compute a UMAP visualization based on this graph. We set return.model = TRUE, which will enable us to project query datasets onto this visualization.

As described in our manuscript, we first compute a ‘supervised’ PCA. This identifies the transformation of the transcriptome data that best encapsulates the structure of the WNN graph. This allows a weighted combination of the protein and RNA measurements to ‘supervise’ the PCA, and highlight the most relevant sources of variation. After computing this transformation, we can project it onto a query dataset. We can also compute and project a PCA projection, but recommend the use of sPCA when working with multimodal references that have been constructed with WNN analysis.

The sPCA calculation is performed once, and then can be rapidly projected onto each query dataset.

Since we will be mapping multiple query samples to the same reference, we can cache particular steps that only involve the reference. This step is optional but will improve speed when mapping multiple samples.

We compute the first 50 neighbors in the sPCA space of the reference. We store this information in the spca.annoy.neighbors object within the reference Seurat object and also cache the annoy index data structure (via cache.index = TRUE).

How can I save and load a cached annoy index?

If you want to save and load a cached index for a Neighbor object generated with method = "annoy" and cache.index = TRUE, use the SaveAnnoyIndex()/LoadAnnoyIndex() functions. Importantly, this index cannot be saved normally to an RDS or RDA file, so it will not persist correctly across R session restarts or saveRDS/readRDS for the Seurat object containing it. Instead, use LoadAnnoyIndex() to add the Annoy index to the Neighbor object every time R restarts or you load the reference Seurat object from RDS. The file created by SaveAnnoyIndex() can be distributed along with a reference Seurat object, and added to the Neighbor object in the reference.

Here we will demonstrate mapping multiple donor bone marrow samples to the multimodal bone marrow reference. These query datasets are derived from the Human Cell Atlas (HCA) Immune Cell Atlas Bone marrow dataset and are available through SeuratData. This dataset is provided as a single merged object with 8 donors. We first split the data back into 8 separate Seurat objects, one for each original donor to map individually.

We then normalize the query in the same manner as the reference. Here, the reference was normalized using log-normalization via NormalizeData(). If the reference had been normalized using SCTransform(), the query must be normalized with SCTransform() as well.

We then find anchors between each donor query dataset and the multimodal reference. This command is optimized to minimize mapping time, by passing in a pre-computed set of reference neighbors, and turning off anchor filtration.

We then individually map each of the datasets.

Now that mapping is complete, we can visualize the results for individual objects

We can also merge all the objects into one dataset. Note that they have all been integrated into a common space, defined by the reference. We can then visualize the results together.

We can visualize gene expression, cluster prediction scores, and (imputed) surface protein levels in the query cells:

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.0.7.

**Examples:**

Example 1 (unknown):
```unknown
vignettes/multimodal_reference_mapping.Rmd
```

Example 2 (unknown):
```unknown
multimodal_reference_mapping.Rmd
```

Example 3 (unknown):
```unknown
library(Seurat)
library(ggplot2)
library(patchwork)
```

Example 4 (r):
```r
library(Seurat)
library(ggplot2)
library(patchwork)
```

Example 5 (r):
```r
library(Seurat)
library(ggplot2)
library(patchwork)
```

Example 6 (unknown):
```unknown
options(SeuratData.repo.use = "http://seurat.nygenome.org")
```

Example 7 (r):
```r
options(SeuratData.repo.use = "http://seurat.nygenome.org")
```

Example 8 (r):
```r
options(SeuratData.repo.use = "http://seurat.nygenome.org")
```

Example 9 (unknown):
```unknown
reference <- readRDS("/brahms/hartmana/vignette_data/pbmc_multimodal_2023.rds")
```

Example 10 (r):
```r
reference <- readRDS("/brahms/hartmana/vignette_data/pbmc_multimodal_2023.rds")
```

Example 11 (r):
```r
reference <- readRDS("/brahms/hartmana/vignette_data/pbmc_multimodal_2023.rds")
```

Example 12 (unknown):
```unknown
DimPlot(object = reference, reduction = "wnn.umap", group.by = "celltype.l2", label = TRUE, label.size = 3, repel = TRUE) + NoLegend()
```

Example 13 (r):
```r
DimPlot(object = reference, reduction = "wnn.umap", group.by = "celltype.l2", label = TRUE, label.size = 3, repel = TRUE) + NoLegend()
```

Example 14 (r):
```r
DimPlot(object = reference, reduction = "wnn.umap", group.by = "celltype.l2", label = TRUE, label.size = 3, repel = TRUE) + NoLegend()
```

Example 15 (unknown):
```unknown
library(SeuratData)
InstallData('pbmc3k')

pbmc3k <- LoadData('pbmc3k')
pbmc3k <- UpdateSeuratObject(pbmc3k)
```

Example 16 (r):
```r
library(SeuratData)
InstallData('pbmc3k')

pbmc3k <- LoadData('pbmc3k')
pbmc3k <- UpdateSeuratObject(pbmc3k)
```

Example 17 (r):
```r
library(SeuratData)
InstallData('pbmc3k')

pbmc3k <- LoadData('pbmc3k')
pbmc3k <- UpdateSeuratObject(pbmc3k)
```

Example 18 (unknown):
```unknown
SCTransform()
```

Example 19 (unknown):
```unknown
pbmc3k <- SCTransform(pbmc3k, verbose = FALSE)
```

Example 20 (r):
```r
pbmc3k <- SCTransform(pbmc3k, verbose = FALSE)
```

Example 21 (r):
```r
pbmc3k <- SCTransform(pbmc3k, verbose = FALSE)
```

Example 22 (unknown):
```unknown
anchors <- FindTransferAnchors(
  reference = reference,
  query = pbmc3k,
  normalization.method = "SCT",
  reference.reduction = "spca",
  dims = 1:50
)
```

Example 23 (r):
```r
anchors <- FindTransferAnchors(
  reference = reference,
  query = pbmc3k,
  normalization.method = "SCT",
  reference.reduction = "spca",
  dims = 1:50
)
```

Example 24 (r):
```r
anchors <- FindTransferAnchors(
  reference = reference,
  query = pbmc3k,
  normalization.method = "SCT",
  reference.reduction = "spca",
  dims = 1:50
)
```

Example 25 (unknown):
```unknown
pbmc3k <- MapQuery(
  anchorset = anchors,
  query = pbmc3k,
  reference = reference,
  refdata = list(
    celltype.l1 = "celltype.l1",
    celltype.l2 = "celltype.l2",
    predicted_ADT = "ADT"
  ),
  reference.reduction = "spca", 
  reduction.model = "wnn.umap"
)
```

Example 26 (r):
```r
pbmc3k <- MapQuery(
  anchorset = anchors,
  query = pbmc3k,
  reference = reference,
  refdata = list(
    celltype.l1 = "celltype.l1",
    celltype.l2 = "celltype.l2",
    predicted_ADT = "ADT"
  ),
  reference.reduction = "spca", 
  reduction.model = "wnn.umap"
)
```

Example 27 (r):
```r
pbmc3k <- MapQuery(
  anchorset = anchors,
  query = pbmc3k,
  reference = reference,
  refdata = list(
    celltype.l1 = "celltype.l1",
    celltype.l2 = "celltype.l2",
    predicted_ADT = "ADT"
  ),
  reference.reduction = "spca", 
  reduction.model = "wnn.umap"
)
```

Example 28 (unknown):
```unknown
TransferData()
```

Example 29 (unknown):
```unknown
IntegrateEmbeddings()
```

Example 30 (unknown):
```unknown
ProjectUMAP()
```

Example 31 (unknown):
```unknown
TransferData()
```

Example 32 (unknown):
```unknown
IntegrateEmbeddings()
```

Example 33 (unknown):
```unknown
ProjectUMAP()
```

Example 34 (unknown):
```unknown
pbmc3k <- TransferData(
  anchorset = anchors, 
  reference = reference,
  query = pbmc3k,
  refdata = list(
    celltype.l1 = "celltype.l1",
    celltype.l2 = "celltype.l2",
    predicted_ADT = "ADT")
)
pbmc3k <- IntegrateEmbeddings(
  anchorset = anchors,
  reference = reference,
  query = pbmc3k, 
  new.reduction.name = "ref.spca"
)
pbmc3k <- ProjectUMAP(
  query = pbmc3k, 
  query.reduction = "ref.spca", 
  reference = reference, 
  reference.reduction = "spca", 
  reduction.model = "wnn.umap"
)
```

Example 35 (r):
```r
pbmc3k <- TransferData(
  anchorset = anchors, 
  reference = reference,
  query = pbmc3k,
  refdata = list(
    celltype.l1 = "celltype.l1",
    celltype.l2 = "celltype.l2",
    predicted_ADT = "ADT")
)
pbmc3k <- IntegrateEmbeddings(
  anchorset = anchors,
  reference = reference,
  query = pbmc3k, 
  new.reduction.name = "ref.spca"
)
pbmc3k <- ProjectUMAP(
  query = pbmc3k, 
  query.reduction = "ref.spca", 
  reference = reference, 
  reference.reduction = "spca", 
  reduction.model = "wnn.umap"
)
```

Example 36 (r):
```r
pbmc3k <- TransferData(
  anchorset = anchors, 
  reference = reference,
  query = pbmc3k,
  refdata = list(
    celltype.l1 = "celltype.l1",
    celltype.l2 = "celltype.l2",
    predicted_ADT = "ADT")
)
pbmc3k <- IntegrateEmbeddings(
  anchorset = anchors,
  reference = reference,
  query = pbmc3k, 
  new.reduction.name = "ref.spca"
)
pbmc3k <- ProjectUMAP(
  query = pbmc3k, 
  query.reduction = "ref.spca", 
  reference = reference, 
  reference.reduction = "spca", 
  reduction.model = "wnn.umap"
)
```

Example 37 (unknown):
```unknown
p1 = DimPlot(pbmc3k, reduction = "ref.umap", group.by = "predicted.celltype.l1", label = TRUE, label.size = 3, repel = TRUE) + NoLegend()
p2 = DimPlot(pbmc3k, reduction = "ref.umap", group.by = "predicted.celltype.l2", label = TRUE, label.size = 3 ,repel = TRUE) + NoLegend()
p1 + p2
```

Example 38 (r):
```r
p1 = DimPlot(pbmc3k, reduction = "ref.umap", group.by = "predicted.celltype.l1", label = TRUE, label.size = 3, repel = TRUE) + NoLegend()
p2 = DimPlot(pbmc3k, reduction = "ref.umap", group.by = "predicted.celltype.l2", label = TRUE, label.size = 3 ,repel = TRUE) + NoLegend()
p1 + p2
```

Example 39 (r):
```r
p1 = DimPlot(pbmc3k, reduction = "ref.umap", group.by = "predicted.celltype.l1", label = TRUE, label.size = 3, repel = TRUE) + NoLegend()
p2 = DimPlot(pbmc3k, reduction = "ref.umap", group.by = "predicted.celltype.l2", label = TRUE, label.size = 3 ,repel = TRUE) + NoLegend()
p1 + p2
```

Example 40 (unknown):
```unknown
FeaturePlot(pbmc3k, features = c("pDC", "CD16 Mono", "Treg"),  reduction = "ref.umap", cols = c("lightgrey", "darkred"), ncol = 3) & theme(plot.title = element_text(size = 10))
```

Example 41 (r):
```r
FeaturePlot(pbmc3k, features = c("pDC", "CD16 Mono", "Treg"),  reduction = "ref.umap", cols = c("lightgrey", "darkred"), ncol = 3) & theme(plot.title = element_text(size = 10))
```

Example 42 (r):
```r
FeaturePlot(pbmc3k, features = c("pDC", "CD16 Mono", "Treg"),  reduction = "ref.umap", cols = c("lightgrey", "darkred"), ncol = 3) & theme(plot.title = element_text(size = 10))
```

Example 43 (unknown):
```unknown
library(ggplot2)
plot <- FeaturePlot(pbmc3k, features = "CD16 Mono",  reduction = "ref.umap", cols = c("lightgrey", "darkred"))  + ggtitle("CD16 Mono") + theme(plot.title = element_text(hjust = 0.5, size = 30)) + labs(color = "Prediction Score") +  xlab("UMAP 1") + ylab("UMAP 2") + 
  theme(axis.title = element_text(size = 18), legend.text = element_text(size = 18), legend.title = element_text(size = 25)) 
ggsave(filename = "../output/images/multimodal_reference_mapping.jpg", height = 7, width = 12, plot = plot, quality = 50)
```

Example 44 (r):
```r
library(ggplot2)
plot <- FeaturePlot(pbmc3k, features = "CD16 Mono",  reduction = "ref.umap", cols = c("lightgrey", "darkred"))  + ggtitle("CD16 Mono") + theme(plot.title = element_text(hjust = 0.5, size = 30)) + labs(color = "Prediction Score") +  xlab("UMAP 1") + ylab("UMAP 2") + 
  theme(axis.title = element_text(size = 18), legend.text = element_text(size = 18), legend.title = element_text(size = 25)) 
ggsave(filename = "../output/images/multimodal_reference_mapping.jpg", height = 7, width = 12, plot = plot, quality = 50)
```

Example 45 (r):
```r
library(ggplot2)
plot <- FeaturePlot(pbmc3k, features = "CD16 Mono",  reduction = "ref.umap", cols = c("lightgrey", "darkred"))  + ggtitle("CD16 Mono") + theme(plot.title = element_text(hjust = 0.5, size = 30)) + labs(color = "Prediction Score") +  xlab("UMAP 1") + ylab("UMAP 2") + 
  theme(axis.title = element_text(size = 18), legend.text = element_text(size = 18), legend.title = element_text(size = 25)) 
ggsave(filename = "../output/images/multimodal_reference_mapping.jpg", height = 7, width = 12, plot = plot, quality = 50)
```

Example 46 (unknown):
```unknown
Idents(pbmc3k) <- 'predicted.celltype.l2'
VlnPlot(pbmc3k, features = c("CLEC4C", "LILRA4"), sort = TRUE) + NoLegend()
```

Example 47 (r):
```r
Idents(pbmc3k) <- 'predicted.celltype.l2'
VlnPlot(pbmc3k, features = c("CLEC4C", "LILRA4"), sort = TRUE) + NoLegend()
```

Example 48 (r):
```r
Idents(pbmc3k) <- 'predicted.celltype.l2'
VlnPlot(pbmc3k, features = c("CLEC4C", "LILRA4"), sort = TRUE) + NoLegend()
```

Example 49 (python):
```python
treg_markers <- FindMarkers(pbmc3k, ident.1 = "Treg", only.pos = TRUE, logfc.threshold = 0.1)
print(head(treg_markers))
```

Example 50 (r):
```r
treg_markers <- FindMarkers(pbmc3k, ident.1 = "Treg", only.pos = TRUE, logfc.threshold = 0.1)
print(head(treg_markers))
```

Example 51 (r):
```r
treg_markers <- FindMarkers(pbmc3k, ident.1 = "Treg", only.pos = TRUE, logfc.threshold = 0.1)
print(head(treg_markers))
```

Example 52 (unknown):
```unknown
##                       p_val avg_log2FC pct.1 pct.2    p_val_adj
## AC004854.4     4.795409e-26   7.800900 0.042 0.000 6.028789e-22
## RP11-297N6.4   4.795409e-26   7.800900 0.042 0.000 6.028789e-22
## RTKN2          4.795409e-26   7.800900 0.042 0.000 6.028789e-22
## CTD-2020K17.4  4.795409e-26   7.800900 0.042 0.000 6.028789e-22
## RP11-1399P15.1 2.782841e-18   4.172869 0.292 0.021 3.498588e-14
## IL2RA          1.808612e-14   4.137935 0.208 0.014 2.273787e-10
```

Example 53 (unknown):
```unknown
##                       p_val avg_log2FC pct.1 pct.2    p_val_adj
## AC004854.4     4.795409e-26   7.800900 0.042 0.000 6.028789e-22
## RP11-297N6.4   4.795409e-26   7.800900 0.042 0.000 6.028789e-22
## RTKN2          4.795409e-26   7.800900 0.042 0.000 6.028789e-22
## CTD-2020K17.4  4.795409e-26   7.800900 0.042 0.000 6.028789e-22
## RP11-1399P15.1 2.782841e-18   4.172869 0.292 0.021 3.498588e-14
## IL2RA          1.808612e-14   4.137935 0.208 0.014 2.273787e-10
```

Example 54 (unknown):
```unknown
DefaultAssay(pbmc3k) <- 'predicted_ADT'
# see a list of proteins: rownames(pbmc3k)
FeaturePlot(pbmc3k, features = c("CD3-1", "CD45RA", "IgD"), reduction = "ref.umap", cols = c("lightgrey", "darkgreen"), ncol = 3)
```

Example 55 (r):
```r
DefaultAssay(pbmc3k) <- 'predicted_ADT'
# see a list of proteins: rownames(pbmc3k)
FeaturePlot(pbmc3k, features = c("CD3-1", "CD45RA", "IgD"), reduction = "ref.umap", cols = c("lightgrey", "darkgreen"), ncol = 3)
```

Example 56 (r):
```r
DefaultAssay(pbmc3k) <- 'predicted_ADT'
# see a list of proteins: rownames(pbmc3k)
FeaturePlot(pbmc3k, features = c("CD3-1", "CD45RA", "IgD"), reduction = "ref.umap", cols = c("lightgrey", "darkgreen"), ncol = 3)
```

Example 57 (unknown):
```unknown
reference <- DietSeurat(reference, counts = FALSE, dimreducs = "spca")
pbmc3k <- DietSeurat(pbmc3k, counts = FALSE, dimreducs = "ref.spca")
```

Example 58 (r):
```r
reference <- DietSeurat(reference, counts = FALSE, dimreducs = "spca")
pbmc3k <- DietSeurat(pbmc3k, counts = FALSE, dimreducs = "ref.spca")
```

Example 59 (r):
```r
reference <- DietSeurat(reference, counts = FALSE, dimreducs = "spca")
pbmc3k <- DietSeurat(pbmc3k, counts = FALSE, dimreducs = "ref.spca")
```

Example 60 (unknown):
```unknown
#merge reference and query
reference$id <- 'reference'
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', shuffle = TRUE)
```

Example 61 (r):
```r
#merge reference and query
reference$id <- 'reference'
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', shuffle = TRUE)
```

Example 62 (r):
```r
#merge reference and query
reference$id <- 'reference'
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', shuffle = TRUE)
```

Example 63 (unknown):
```unknown
# Both datasets are available through SeuratData
library(SeuratData)
#load reference data
InstallData("bmcite")
bm <- LoadData(ds = "bmcite")
#load query data
InstallData('hcabm40k')
hcabm40k <- LoadData(ds = "hcabm40k")
```

Example 64 (r):
```r
# Both datasets are available through SeuratData
library(SeuratData)
#load reference data
InstallData("bmcite")
bm <- LoadData(ds = "bmcite")
#load query data
InstallData('hcabm40k')
hcabm40k <- LoadData(ds = "hcabm40k")
```

Example 65 (r):
```r
# Both datasets are available through SeuratData
library(SeuratData)
#load reference data
InstallData("bmcite")
bm <- LoadData(ds = "bmcite")
#load query data
InstallData('hcabm40k')
hcabm40k <- LoadData(ds = "hcabm40k")
```

Example 66 (unknown):
```unknown
return.model = TRUE
```

Example 67 (unknown):
```unknown
bm <- RunUMAP(bm, nn.name = "weighted.nn", reduction.name = "wnn.umap", 
              reduction.key = "wnnUMAP_", return.model = TRUE)
DimPlot(bm, group.by = "celltype.l2", reduction = "wnn.umap")
```

Example 68 (r):
```r
bm <- RunUMAP(bm, nn.name = "weighted.nn", reduction.name = "wnn.umap", 
              reduction.key = "wnnUMAP_", return.model = TRUE)
DimPlot(bm, group.by = "celltype.l2", reduction = "wnn.umap")
```

Example 69 (r):
```r
bm <- RunUMAP(bm, nn.name = "weighted.nn", reduction.name = "wnn.umap", 
              reduction.key = "wnnUMAP_", return.model = TRUE)
DimPlot(bm, group.by = "celltype.l2", reduction = "wnn.umap")
```

Example 70 (unknown):
```unknown
bm <- ScaleData(bm, assay = 'RNA')
bm <- RunSPCA(bm, assay = 'RNA', graph = 'wsnn')
```

Example 71 (r):
```r
bm <- ScaleData(bm, assay = 'RNA')
bm <- RunSPCA(bm, assay = 'RNA', graph = 'wsnn')
```

Example 72 (r):
```r
bm <- ScaleData(bm, assay = 'RNA')
bm <- RunSPCA(bm, assay = 'RNA', graph = 'wsnn')
```

Example 73 (unknown):
```unknown
spca.annoy.neighbors
```

Example 74 (unknown):
```unknown
cache.index = TRUE
```

Example 75 (unknown):
```unknown
bm <- FindNeighbors(
  object = bm,
  reduction = "spca",
  dims = 1:50,
  graph.name = "spca.annoy.neighbors", 
  k.param = 50,
  cache.index = TRUE,
  return.neighbor = TRUE,
  l2.norm = TRUE
)
```

Example 76 (r):
```r
bm <- FindNeighbors(
  object = bm,
  reduction = "spca",
  dims = 1:50,
  graph.name = "spca.annoy.neighbors", 
  k.param = 50,
  cache.index = TRUE,
  return.neighbor = TRUE,
  l2.norm = TRUE
)
```

Example 77 (r):
```r
bm <- FindNeighbors(
  object = bm,
  reduction = "spca",
  dims = 1:50,
  graph.name = "spca.annoy.neighbors", 
  k.param = 50,
  cache.index = TRUE,
  return.neighbor = TRUE,
  l2.norm = TRUE
)
```

Example 78 (unknown):
```unknown
method = "annoy"
```

Example 79 (unknown):
```unknown
cache.index = TRUE
```

Example 80 (unknown):
```unknown
SaveAnnoyIndex()
```

Example 81 (unknown):
```unknown
LoadAnnoyIndex()
```

Example 82 (unknown):
```unknown
LoadAnnoyIndex()
```

Example 83 (unknown):
```unknown
SaveAnnoyIndex()
```

Example 84 (unknown):
```unknown
bm[["spca.annoy.neighbors"]]
```

Example 85 (r):
```r
bm[["spca.annoy.neighbors"]]
```

Example 86 (r):
```r
bm[["spca.annoy.neighbors"]]
```

Example 87 (unknown):
```unknown
## A Neighbor object containing the 50 nearest neighbors for 30672 cells
```

Example 88 (unknown):
```unknown
## A Neighbor object containing the 50 nearest neighbors for 30672 cells
```

Example 89 (unknown):
```unknown
SaveAnnoyIndex(object = bm[["spca.annoy.neighbors"]], file = "/brahms/shared/vignette-data/reftmp.idx")
bm[["spca.annoy.neighbors"]] <- LoadAnnoyIndex(object = bm[["spca.annoy.neighbors"]], file = "/brahms/shared/vignette-data/reftmp.idx")
```

Example 90 (r):
```r
SaveAnnoyIndex(object = bm[["spca.annoy.neighbors"]], file = "/brahms/shared/vignette-data/reftmp.idx")
bm[["spca.annoy.neighbors"]] <- LoadAnnoyIndex(object = bm[["spca.annoy.neighbors"]], file = "/brahms/shared/vignette-data/reftmp.idx")
```

Example 91 (r):
```r
SaveAnnoyIndex(object = bm[["spca.annoy.neighbors"]], file = "/brahms/shared/vignette-data/reftmp.idx")
bm[["spca.annoy.neighbors"]] <- LoadAnnoyIndex(object = bm[["spca.annoy.neighbors"]], file = "/brahms/shared/vignette-data/reftmp.idx")
```

Example 92 (unknown):
```unknown
library(dplyr)
library(SeuratData)
InstallData('hcabm40k')
hcabm40k.batches <- SplitObject(hcabm40k, split.by = "orig.ident")
```

Example 93 (r):
```r
library(dplyr)
library(SeuratData)
InstallData('hcabm40k')
hcabm40k.batches <- SplitObject(hcabm40k, split.by = "orig.ident")
```

Example 94 (r):
```r
library(dplyr)
library(SeuratData)
InstallData('hcabm40k')
hcabm40k.batches <- SplitObject(hcabm40k, split.by = "orig.ident")
```

Example 95 (unknown):
```unknown
NormalizeData()
```

Example 96 (unknown):
```unknown
SCTransform()
```

Example 97 (unknown):
```unknown
SCTransform()
```

Example 98 (unknown):
```unknown
hcabm40k.batches <- lapply(X = hcabm40k.batches, FUN = NormalizeData, verbose = FALSE)
```

Example 99 (r):
```r
hcabm40k.batches <- lapply(X = hcabm40k.batches, FUN = NormalizeData, verbose = FALSE)
```

Example 100 (r):
```r
hcabm40k.batches <- lapply(X = hcabm40k.batches, FUN = NormalizeData, verbose = FALSE)
```

Example 101 (unknown):
```unknown
anchors <- list()
for (i in 1:length(hcabm40k.batches)) {
  anchors[[i]] <- FindTransferAnchors(
    reference = bm,
    query = hcabm40k.batches[[i]],
    k.filter = NA,
    reference.reduction = "spca", 
    reference.neighbors = "spca.annoy.neighbors", 
    dims = 1:50
  )
}
```

Example 102 (r):
```r
anchors <- list()
for (i in 1:length(hcabm40k.batches)) {
  anchors[[i]] <- FindTransferAnchors(
    reference = bm,
    query = hcabm40k.batches[[i]],
    k.filter = NA,
    reference.reduction = "spca", 
    reference.neighbors = "spca.annoy.neighbors", 
    dims = 1:50
  )
}
```

Example 103 (r):
```r
anchors <- list()
for (i in 1:length(hcabm40k.batches)) {
  anchors[[i]] <- FindTransferAnchors(
    reference = bm,
    query = hcabm40k.batches[[i]],
    k.filter = NA,
    reference.reduction = "spca", 
    reference.neighbors = "spca.annoy.neighbors", 
    dims = 1:50
  )
}
```

Example 104 (unknown):
```unknown
for (i in 1:length(hcabm40k.batches)) {
  hcabm40k.batches[[i]] <- MapQuery(
    anchorset = anchors[[i]], 
    query = hcabm40k.batches[[i]],
    reference = bm, 
    refdata = list(
      celltype = "celltype.l2", 
      predicted_ADT = "ADT"),
    reference.reduction = "spca",
    reduction.model = "wnn.umap"
  )
}
```

Example 105 (r):
```r
for (i in 1:length(hcabm40k.batches)) {
  hcabm40k.batches[[i]] <- MapQuery(
    anchorset = anchors[[i]], 
    query = hcabm40k.batches[[i]],
    reference = bm, 
    refdata = list(
      celltype = "celltype.l2", 
      predicted_ADT = "ADT"),
    reference.reduction = "spca",
    reduction.model = "wnn.umap"
  )
}
```

Example 106 (r):
```r
for (i in 1:length(hcabm40k.batches)) {
  hcabm40k.batches[[i]] <- MapQuery(
    anchorset = anchors[[i]], 
    query = hcabm40k.batches[[i]],
    reference = bm, 
    refdata = list(
      celltype = "celltype.l2", 
      predicted_ADT = "ADT"),
    reference.reduction = "spca",
    reduction.model = "wnn.umap"
  )
}
```

Example 107 (unknown):
```unknown
p1 <- DimPlot(hcabm40k.batches[[1]], reduction = 'ref.umap', group.by = 'predicted.celltype', label.size = 3)
p2 <- DimPlot(hcabm40k.batches[[2]], reduction = 'ref.umap', group.by = 'predicted.celltype', label.size = 3)
p1 + p2 + plot_layout(guides = "collect")
```

Example 108 (r):
```r
p1 <- DimPlot(hcabm40k.batches[[1]], reduction = 'ref.umap', group.by = 'predicted.celltype', label.size = 3)
p2 <- DimPlot(hcabm40k.batches[[2]], reduction = 'ref.umap', group.by = 'predicted.celltype', label.size = 3)
p1 + p2 + plot_layout(guides = "collect")
```

Example 109 (r):
```r
p1 <- DimPlot(hcabm40k.batches[[1]], reduction = 'ref.umap', group.by = 'predicted.celltype', label.size = 3)
p2 <- DimPlot(hcabm40k.batches[[2]], reduction = 'ref.umap', group.by = 'predicted.celltype', label.size = 3)
p1 + p2 + plot_layout(guides = "collect")
```

Example 110 (unknown):
```unknown
# Merge the batches 
hcabm40k <- merge(hcabm40k.batches[[1]], hcabm40k.batches[2:length(hcabm40k.batches)], merge.dr = "ref.umap")
DimPlot(hcabm40k, reduction = "ref.umap", group.by =  "predicted.celltype", label = TRUE, repel = TRUE, label.size = 3) + NoLegend()
```

Example 111 (r):
```r
# Merge the batches 
hcabm40k <- merge(hcabm40k.batches[[1]], hcabm40k.batches[2:length(hcabm40k.batches)], merge.dr = "ref.umap")
DimPlot(hcabm40k, reduction = "ref.umap", group.by =  "predicted.celltype", label = TRUE, repel = TRUE, label.size = 3) + NoLegend()
```

Example 112 (r):
```r
# Merge the batches 
hcabm40k <- merge(hcabm40k.batches[[1]], hcabm40k.batches[2:length(hcabm40k.batches)], merge.dr = "ref.umap")
DimPlot(hcabm40k, reduction = "ref.umap", group.by =  "predicted.celltype", label = TRUE, repel = TRUE, label.size = 3) + NoLegend()
```

Example 113 (unknown):
```unknown
p3 <- FeaturePlot(hcabm40k, features = c("rna_TRDC", "rna_MPO", "rna_AVP"), reduction = 'ref.umap', 
                  max.cutoff = 3, ncol = 3)

# cell type prediction scores
DefaultAssay(hcabm40k) <- 'prediction.score.celltype'
p4 <- FeaturePlot(hcabm40k, features = c("CD16 Mono", "HSC", "Prog-RBC"), ncol = 3, 
                  cols = c("lightgrey", "darkred"))

# imputed protein levels
DefaultAssay(hcabm40k) <- 'predicted_ADT'
p5 <- FeaturePlot(hcabm40k, features = c("CD45RA", "CD16", "CD161"), reduction = 'ref.umap',
                  min.cutoff = 'q10', max.cutoff = 'q99', cols = c("lightgrey", "darkgreen") ,
                  ncol = 3)
p3 / p4 / p5
```

Example 114 (r):
```r
p3 <- FeaturePlot(hcabm40k, features = c("rna_TRDC", "rna_MPO", "rna_AVP"), reduction = 'ref.umap', 
                  max.cutoff = 3, ncol = 3)

# cell type prediction scores
DefaultAssay(hcabm40k) <- 'prediction.score.celltype'
p4 <- FeaturePlot(hcabm40k, features = c("CD16 Mono", "HSC", "Prog-RBC"), ncol = 3, 
                  cols = c("lightgrey", "darkred"))

# imputed protein levels
DefaultAssay(hcabm40k) <- 'predicted_ADT'
p5 <- FeaturePlot(hcabm40k, features = c("CD45RA", "CD16", "CD161"), reduction = 'ref.umap',
                  min.cutoff = 'q10', max.cutoff = 'q99', cols = c("lightgrey", "darkgreen") ,
                  ncol = 3)
p3 / p4 / p5
```

Example 115 (r):
```r
p3 <- FeaturePlot(hcabm40k, features = c("rna_TRDC", "rna_MPO", "rna_AVP"), reduction = 'ref.umap', 
                  max.cutoff = 3, ncol = 3)

# cell type prediction scores
DefaultAssay(hcabm40k) <- 'prediction.score.celltype'
p4 <- FeaturePlot(hcabm40k, features = c("CD16 Mono", "HSC", "Prog-RBC"), ncol = 3, 
                  cols = c("lightgrey", "darkred"))

# imputed protein levels
DefaultAssay(hcabm40k) <- 'predicted_ADT'
p5 <- FeaturePlot(hcabm40k, features = c("CD45RA", "CD16", "CD161"), reduction = 'ref.umap',
                  min.cutoff = 'q10', max.cutoff = 'q99', cols = c("lightgrey", "darkgreen") ,
                  ncol = 3)
p3 / p4 / p5
```

Example 116 (unknown):
```unknown
sessionInfo()
```

Example 117 (r):
```r
sessionInfo()
```

Example 118 (r):
```r
sessionInfo()
```

Example 119 (unknown):
```unknown
## R version 4.2.2 Patched (2022-11-10 r83330)
## Platform: x86_64-pc-linux-gnu (64-bit)
## Running under: Ubuntu 20.04.6 LTS
## 
## Matrix products: default
## BLAS:   /usr/lib/x86_64-linux-gnu/blas/libblas.so.3.9.0
## LAPACK: /usr/lib/x86_64-linux-gnu/lapack/liblapack.so.3.9.0
## 
## locale:
##  [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C              
##  [3] LC_TIME=en_US.UTF-8        LC_COLLATE=en_US.UTF-8    
##  [5] LC_MONETARY=en_US.UTF-8    LC_MESSAGES=en_US.UTF-8   
##  [7] LC_PAPER=en_US.UTF-8       LC_NAME=C                 
##  [9] LC_ADDRESS=C               LC_TELEPHONE=C            
## [11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C       
## 
## attached base packages:
## [1] stats     graphics  grDevices utils     datasets  methods   base     
## 
## other attached packages:
##  [1] dplyr_1.1.3                   thp1.eccite.SeuratData_3.1.5 
##  [3] stxBrain.SeuratData_0.1.1     ssHippo.SeuratData_3.1.4     
##  [5] pbmcsca.SeuratData_3.0.0      pbmcref.SeuratData_1.0.0     
##  [7] pbmcMultiome.SeuratData_0.1.4 pbmc3k.SeuratData_3.1.4      
##  [9] panc8.SeuratData_3.0.2        ifnb.SeuratData_3.0.0        
## [11] hcabm40k.SeuratData_3.0.0     cbmc.SeuratData_3.1.4        
## [13] bmcite.SeuratData_0.3.0       SeuratData_0.2.2.9001        
## [15] patchwork_1.1.3               ggplot2_3.4.4                
## [17] Seurat_5.0.0                  SeuratObject_5.0.0           
## [19] sp_2.1-1                     
## 
## loaded via a namespace (and not attached):
##   [1] utf8_1.2.4                  spatstat.explore_3.2-5     
##   [3] reticulate_1.34.0           tidyselect_1.2.0           
##   [5] htmlwidgets_1.6.2           grid_4.2.2                 
##   [7] Rtsne_0.16                  munsell_0.5.0              
##   [9] codetools_0.2-19            ragg_1.2.5                 
##  [11] ica_1.0-3                   future_1.33.0              
##  [13] miniUI_0.1.1.1              withr_2.5.2                
##  [15] spatstat.random_3.2-1       colorspace_2.1-0           
##  [17] progressr_0.14.0            Biobase_2.58.0             
##  [19] highr_0.10                  knitr_1.45                 
##  [21] stats4_4.2.2                ROCR_1.0-11                
##  [23] tensor_1.5                  listenv_0.9.0              
##  [25] MatrixGenerics_1.10.0       labeling_0.4.3             
##  [27] GenomeInfoDbData_1.2.9      polyclip_1.10-6            
##  [29] farver_2.1.1                rprojroot_2.0.3            
##  [31] parallelly_1.36.0           vctrs_0.6.4                
##  [33] generics_0.1.3              xfun_0.40                  
##  [35] R6_2.5.1                    GenomeInfoDb_1.34.9        
##  [37] ggbeeswarm_0.7.1            bitops_1.0-7               
##  [39] spatstat.utils_3.0-4        cachem_1.0.8               
##  [41] DelayedArray_0.24.0         promises_1.2.1             
##  [43] scales_1.2.1                beeswarm_0.4.0             
##  [45] gtable_0.3.4                globals_0.16.2             
##  [47] goftest_1.2-3               spam_2.10-0                
##  [49] rlang_1.1.1                 systemfonts_1.0.4          
##  [51] splines_4.2.2               lazyeval_0.2.2             
##  [53] spatstat.geom_3.2-7         yaml_2.3.7                 
##  [55] reshape2_1.4.4              abind_1.4-5                
##  [57] httpuv_1.6.12               tools_4.2.2                
##  [59] ellipsis_0.3.2              jquerylib_0.1.4            
##  [61] RColorBrewer_1.1-3          BiocGenerics_0.44.0        
##  [63] ggridges_0.5.4              Rcpp_1.0.11                
##  [65] plyr_1.8.9                  sparseMatrixStats_1.10.0   
##  [67] zlibbioc_1.44.0             purrr_1.0.2                
##  [69] RCurl_1.98-1.12             deldir_1.0-9               
##  [71] pbapply_1.7-2               cowplot_1.1.1              
##  [73] S4Vectors_0.36.2            zoo_1.8-12                 
##  [75] SummarizedExperiment_1.28.0 ggrepel_0.9.4              
##  [77] cluster_2.1.4               fs_1.6.3                   
##  [79] magrittr_2.0.3              data.table_1.14.8          
##  [81] RSpectra_0.16-1             glmGamPoi_1.10.2           
##  [83] scattermore_1.2             lmtest_0.9-40              
##  [85] RANN_2.6.1                  fitdistrplus_1.1-11        
##  [87] matrixStats_1.0.0           mime_0.12                  
##  [89] evaluate_0.22               xtable_1.8-4               
##  [91] fastDummies_1.7.3           IRanges_2.32.0             
##  [93] gridExtra_2.3               compiler_4.2.2             
##  [95] tibble_3.2.1                KernSmooth_2.23-22         
##  [97] crayon_1.5.2                htmltools_0.5.6.1          
##  [99] later_1.3.1                 tidyr_1.3.0                
## [101] MASS_7.3-58.2               rappdirs_0.3.3             
## [103] Matrix_1.6-1.1              cli_3.6.1                  
## [105] parallel_4.2.2              dotCall64_1.1-0            
## [107] igraph_1.5.1                GenomicRanges_1.50.2       
## [109] pkgconfig_2.0.3             pkgdown_2.0.7              
## [111] plotly_4.10.3               spatstat.sparse_3.0-3      
## [113] vipor_0.4.5                 bslib_0.5.1                
## [115] XVector_0.38.0              stringr_1.5.0              
## [117] digest_0.6.33               sctransform_0.4.1          
## [119] RcppAnnoy_0.0.21            spatstat.data_3.0-3        
## [121] rmarkdown_2.25              leiden_0.4.3               
## [123] uwot_0.1.16                 DelayedMatrixStats_1.20.0  
## [125] shiny_1.7.5.1               lifecycle_1.0.3            
## [127] nlme_3.1-162                jsonlite_1.8.7             
## [129] limma_3.54.1                desc_1.4.2                 
## [131] viridisLite_0.4.2           fansi_1.0.5                
## [133] pillar_1.9.0                lattice_0.21-9             
## [135] ggrastr_1.0.1               fastmap_1.1.1              
## [137] httr_1.4.7                  survival_3.5-7             
## [139] glue_1.6.2                  png_0.1-8                  
## [141] presto_1.0.0                stringi_1.7.12             
## [143] sass_0.4.7                  textshaping_0.3.6          
## [145] RcppHNSW_0.5.0              memoise_2.0.1              
## [147] irlba_2.3.5.1               future.apply_1.11.0
```

Example 120 (unknown):
```unknown
## R version 4.2.2 Patched (2022-11-10 r83330)
## Platform: x86_64-pc-linux-gnu (64-bit)
## Running under: Ubuntu 20.04.6 LTS
## 
## Matrix products: default
## BLAS:   /usr/lib/x86_64-linux-gnu/blas/libblas.so.3.9.0
## LAPACK: /usr/lib/x86_64-linux-gnu/lapack/liblapack.so.3.9.0
## 
## locale:
##  [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C              
##  [3] LC_TIME=en_US.UTF-8        LC_COLLATE=en_US.UTF-8    
##  [5] LC_MONETARY=en_US.UTF-8    LC_MESSAGES=en_US.UTF-8   
##  [7] LC_PAPER=en_US.UTF-8       LC_NAME=C                 
##  [9] LC_ADDRESS=C               LC_TELEPHONE=C            
## [11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C       
## 
## attached base packages:
## [1] stats     graphics  grDevices utils     datasets  methods   base     
## 
## other attached packages:
##  [1] dplyr_1.1.3                   thp1.eccite.SeuratData_3.1.5 
##  [3] stxBrain.SeuratData_0.1.1     ssHippo.SeuratData_3.1.4     
##  [5] pbmcsca.SeuratData_3.0.0      pbmcref.SeuratData_1.0.0     
##  [7] pbmcMultiome.SeuratData_0.1.4 pbmc3k.SeuratData_3.1.4      
##  [9] panc8.SeuratData_3.0.2        ifnb.SeuratData_3.0.0        
## [11] hcabm40k.SeuratData_3.0.0     cbmc.SeuratData_3.1.4        
## [13] bmcite.SeuratData_0.3.0       SeuratData_0.2.2.9001        
## [15] patchwork_1.1.3               ggplot2_3.4.4                
## [17] Seurat_5.0.0                  SeuratObject_5.0.0           
## [19] sp_2.1-1                     
## 
## loaded via a namespace (and not attached):
##   [1] utf8_1.2.4                  spatstat.explore_3.2-5     
##   [3] reticulate_1.34.0           tidyselect_1.2.0           
##   [5] htmlwidgets_1.6.2           grid_4.2.2                 
##   [7] Rtsne_0.16                  munsell_0.5.0              
##   [9] codetools_0.2-19            ragg_1.2.5                 
##  [11] ica_1.0-3                   future_1.33.0              
##  [13] miniUI_0.1.1.1              withr_2.5.2                
##  [15] spatstat.random_3.2-1       colorspace_2.1-0           
##  [17] progressr_0.14.0            Biobase_2.58.0             
##  [19] highr_0.10                  knitr_1.45                 
##  [21] stats4_4.2.2                ROCR_1.0-11                
##  [23] tensor_1.5                  listenv_0.9.0              
##  [25] MatrixGenerics_1.10.0       labeling_0.4.3             
##  [27] GenomeInfoDbData_1.2.9      polyclip_1.10-6            
##  [29] farver_2.1.1                rprojroot_2.0.3            
##  [31] parallelly_1.36.0           vctrs_0.6.4                
##  [33] generics_0.1.3              xfun_0.40                  
##  [35] R6_2.5.1                    GenomeInfoDb_1.34.9        
##  [37] ggbeeswarm_0.7.1            bitops_1.0-7               
##  [39] spatstat.utils_3.0-4        cachem_1.0.8               
##  [41] DelayedArray_0.24.0         promises_1.2.1             
##  [43] scales_1.2.1                beeswarm_0.4.0             
##  [45] gtable_0.3.4                globals_0.16.2             
##  [47] goftest_1.2-3               spam_2.10-0                
##  [49] rlang_1.1.1                 systemfonts_1.0.4          
##  [51] splines_4.2.2               lazyeval_0.2.2             
##  [53] spatstat.geom_3.2-7         yaml_2.3.7                 
##  [55] reshape2_1.4.4              abind_1.4-5                
##  [57] httpuv_1.6.12               tools_4.2.2                
##  [59] ellipsis_0.3.2              jquerylib_0.1.4            
##  [61] RColorBrewer_1.1-3          BiocGenerics_0.44.0        
##  [63] ggridges_0.5.4              Rcpp_1.0.11                
##  [65] plyr_1.8.9                  sparseMatrixStats_1.10.0   
##  [67] zlibbioc_1.44.0             purrr_1.0.2                
##  [69] RCurl_1.98-1.12             deldir_1.0-9               
##  [71] pbapply_1.7-2               cowplot_1.1.1              
##  [73] S4Vectors_0.36.2            zoo_1.8-12                 
##  [75] SummarizedExperiment_1.28.0 ggrepel_0.9.4              
##  [77] cluster_2.1.4               fs_1.6.3                   
##  [79] magrittr_2.0.3              data.table_1.14.8          
##  [81] RSpectra_0.16-1             glmGamPoi_1.10.2           
##  [83] scattermore_1.2             lmtest_0.9-40              
##  [85] RANN_2.6.1                  fitdistrplus_1.1-11        
##  [87] matrixStats_1.0.0           mime_0.12                  
##  [89] evaluate_0.22               xtable_1.8-4               
##  [91] fastDummies_1.7.3           IRanges_2.32.0             
##  [93] gridExtra_2.3               compiler_4.2.2             
##  [95] tibble_3.2.1                KernSmooth_2.23-22         
##  [97] crayon_1.5.2                htmltools_0.5.6.1          
##  [99] later_1.3.1                 tidyr_1.3.0                
## [101] MASS_7.3-58.2               rappdirs_0.3.3             
## [103] Matrix_1.6-1.1              cli_3.6.1                  
## [105] parallel_4.2.2              dotCall64_1.1-0            
## [107] igraph_1.5.1                GenomicRanges_1.50.2       
## [109] pkgconfig_2.0.3             pkgdown_2.0.7              
## [111] plotly_4.10.3               spatstat.sparse_3.0-3      
## [113] vipor_0.4.5                 bslib_0.5.1                
## [115] XVector_0.38.0              stringr_1.5.0              
## [117] digest_0.6.33               sctransform_0.4.1          
## [119] RcppAnnoy_0.0.21            spatstat.data_3.0-3        
## [121] rmarkdown_2.25              leiden_0.4.3               
## [123] uwot_0.1.16                 DelayedMatrixStats_1.20.0  
## [125] shiny_1.7.5.1               lifecycle_1.0.3            
## [127] nlme_3.1-162                jsonlite_1.8.7             
## [129] limma_3.54.1                desc_1.4.2                 
## [131] viridisLite_0.4.2           fansi_1.0.5                
## [133] pillar_1.9.0                lattice_0.21-9             
## [135] ggrastr_1.0.1               fastmap_1.1.1              
## [137] httr_1.4.7                  survival_3.5-7             
## [139] glue_1.6.2                  png_0.1-8                  
## [141] presto_1.0.0                stringi_1.7.12             
## [143] sass_0.4.7                  textshaping_0.3.6          
## [145] RcppHNSW_0.5.0              memoise_2.0.1              
## [147] irlba_2.3.5.1               future.apply_1.11.0
```

---

## Package index • Seurat

**URL:** http://127.0.0.1:9173/reference.html

**Contents:**
- Reference
- Object interaction
- Preprocessing
- Differential expression
- Dimensional Reduction
- Clustering
- Integration
- Spatial
- Sketching
- Mixscape
- Visualization
- Tree-related functions
- Utility functions
- Data
- Convenience functions
- Sketching
- Re-exports
- Contents

Functions for interacting with a Seurat object

AnchorSet-class AnchorSet

BridgeReferenceSet-class BridgeReferenceSet

The BridgeReferenceSet Class The BridgeReferenceSet is an output from PrepareBridgeReference

Cells(<SCTModel>) Cells(<SlideSeq>) Cells(<STARmap>) Cells(<VisiumV1>)

CreateSCTAssayObject()

Create a SCT Assay object

Slim down a Seurat object

Filter stray beads from Slide-seq puck

Get an Assay object from a given Seurat object.

GetImage(<SlideSeq>) GetImage(<STARmap>) GetImage(<VisiumV1>) GetImage(<VisiumV2>)

GetTissueCoordinates(<SlideSeq>) GetTissueCoordinates(<STARmap>) GetTissueCoordinates(<VisiumV1>) GetTissueCoordinates(<VisiumV2>)

Get Tissue Coordinates

Get Variable Feature Information

IntegrationAnchorSet-class IntegrationAnchorSet

The IntegrationAnchorSet Class

IntegrationData-class IntegrationData

The IntegrationData Class

ModalityWeights-class ModalityWeights

The ModalityWeights Class

Radius(<SlideSeq>) Radius(<STARmap>) Radius(<VisiumV1>)

RenameCells(<SCTAssay>) RenameCells(<SlideSeq>) RenameCells(<STARmap>) RenameCells(<VisiumV1>)

Rename Cells in an Object

levels(<SCTAssay>) `levels<-`(<SCTAssay>)

SCTResults() `SCTResults<-`()

Get SCT results from an Assay

STARmap-class STARmap

ScaleFactors() scalefactors()

Get image scale factors

Splits object into a list of subsetted objects.

Find cells with highest scores for a given dimensional reduction technique

Find features with highest scores for a given dimensional reduction technique

Get nearest neighbors for given cell

TransferAnchorSet-class TransferAnchorSet

The TransferAnchorSet Class

Update pre-V4 Assays generated with SCTransform in the Seurat to the new SCTAssay class

VisiumV1-class VisiumV1

VisiumV2-class VisiumV2

Convert objects to CellDataSet objects

as.Seurat(<CellDataSet>) as.Seurat(<SingleCellExperiment>)

Convert objects to Seurat objects

as.SingleCellExperiment()

Convert objects to SingleCellExperiment objects

as.sparse(<H5Group>) as.data.frame(<Matrix>)

Merge SCTAssay objects

Subset an AnchorSet object

Functions for preprocessing single-cell data

CalculateBarcodeInflections()

Calculate the Barcode Distribution Inflection

Calculate pearson residuals of features not in the scale.data

FindSpatiallyVariableFeatures()

Find spatially variable features

FindVariableFeatures()

Find variable features

Calculate pearson residuals of features not in the scale.data

Demultiplex samples based on data from cell 'hashing'

Load a 10x Genomics Visium Spatial Experiment into a Seurat object

Load Curio Seeker data

Demultiplex samples based on classification method from MULTI-seq (McGinnis et al., bioRxiv 2018)

Load in data from 10X

Read10X_Coordinates()

Load 10X Genomics Visium Tissue Positions

Load a 10X Genomics Visium Image

Read10X_ScaleFactors()

Load 10X Genomics Visium Scale Factors

Read10X_probe_metadata()

Read10x Probe Metadata

ReadAkoya() LoadAkoya()

Read and Load Akoya CODEX data

Load in data from remote or local mtx files

ReadNanostring() LoadNanostring()

Read and Load Nanostring SMI data

Load Slide-seq spatial data

ReadVitessce() LoadHuBMAPCODEX()

Read Data From Vitessce

ReadVizgen() LoadVizgen()

Read and Load MERFISH Input from Vizgen

LoadXenium() ReadXenium()

Read and Load 10x Genomics Xenium in-situ data

Normalize raw data to fractions

Run the mark variogram computation on a given position matrix and expression matrix.

Compute Moran's I value.

Perform sctransform-based normalization

Scale and center the data.

SubsetByBarcodeInflections()

Subset a Seurat Object based on the Barcode Distribution Inflection Points

Functions for testing differential gene (feature) expression

Gene expression markers for all identity classes

FindConservedMarkers()

Finds markers that are conserved between the groups

Gene expression markers of identity classes

Prepare object to run differential expression on SCT assay with multiple models

Functions to reduce the dimensionality of datasets

Determine statistical significance of PCA scores.

Significant genes from a PCA

Project Dimensional reduction onto full dataset

Project query into UMAP coordinates of a reference

Perform Canonical Correlation Analysis

Run Graph Laplacian Eigendecomposition

Run Independent Component Analysis on gene expression

Run Principal Component Analysis

Run Supervised Latent Semantic Indexing

Run Supervised Principal Component Analysis

Run t-distributed Stochastic Neighbor Embedding

Compute Jackstraw scores significance.

Functions to cluster single-cell data

Construct an assay for spatial niche analysis

Cluster Determination

FindMultiModalNeighbors()

Construct weighted nearest neighbor graph

(Shared) Nearest-neighbor graph construction

Find subclusters under one cluster

Run Leiden clustering algorithm

Functions related to the Seurat v3 integration and label transfer algorithms

Add info to anchor matrix

BridgeCellsRepresentation()

Construct a dictionary representation for each unimodal dataset

Seurat-CCA Integration

FastRPCAIntegration()

Perform integration on the joint PCA cell embeddings.

FindBridgeIntegrationAnchors()

Find integration bridge anchors between query and extended bridge-reference

FindBridgeTransferAnchors()

Find bridge anchors between query and extended bridge-reference

FindIntegrationAnchors()

Find integration anchors

FindTransferAnchors()

Find transfer anchors

GetTransferPredictions()

Get the predicted identity

IntegrateEmbeddings()

Integrate low dimensional embeddings

JointPCAIntegration()

Seurat-Joint PCA Integration

Calculate the local structure preservation metric

Map query cells to a reference

Metric for evaluating mapping success

Calculates a mixing metric

Convert Neighbor class to an asymmetrical Graph class

Predict value from nearest neighbors

Prepare an object list normalized with sctransform for integration.

PrepareBridgeReference()

Prepare the bridge and reference datasets

Project query data to reference dimensional reduction

Integrate embeddings from the integrated sketched.assay

SelectIntegrationFeatures()

Select integration features

SelectIntegrationFeatures5()

Select integration features

SelectSCTIntegrationFeatures()

Select SCT integration features

Transfer embeddings from sketched cells to the full data

Functions related to the analysis of spatially-resolved single-cell data

Cells(<SCTModel>) Cells(<SlideSeq>) Cells(<STARmap>) Cells(<VisiumV1>)

Filter stray beads from Slide-seq puck

FindSpatiallyVariableFeatures()

Find spatially variable features

GetImage(<SlideSeq>) GetImage(<STARmap>) GetImage(<VisiumV1>) GetImage(<VisiumV2>)

GetTissueCoordinates(<SlideSeq>) GetTissueCoordinates(<STARmap>) GetTissueCoordinates(<VisiumV1>) GetTissueCoordinates(<VisiumV2>)

Get Tissue Coordinates

Visualize clusters spatially and interactively

ISpatialFeaturePlot()

Visualize features spatially and interactively

Spatial Cluster Plots

Spatial Feature Plots

LinkedDimPlot() LinkedFeaturePlot()

Visualize spatial and clustering (dimensional reduction) data in a linked, interactive framework

Radius(<SlideSeq>) Radius(<STARmap>) Radius(<VisiumV1>)

STARmap-class STARmap

ScaleFactors() scalefactors()

Get image scale factors

SlideSeq-class SlideSeq

SpatialPlot() SpatialDimPlot() SpatialFeaturePlot()

Visualize spatial clustering and expression data.

VisiumV1-class VisiumV1

VisiumV2-class VisiumV2

Functions for flexible analysis of massively scalable datasets

Leverage Score Calculation

Project full data to the sketch assay

TransferSketchLabels()

Transfer data from sketch data to full data

Functions related to the mixscape algorithm

Calculate a perturbation Signature

DE and EnrichR pathway visualization barplot

Differential expression heatmap for mixscape

Linear discriminant analysis on pooled CRISPR screen data.

Function to plot perturbation score distributions.

Function to prepare data for Linear Discriminant Analysis.

Run Linear Discriminant Analysis

Functions for plotting data and adjusting

Augments ggplot2-based plot with a PNG image.

Automagically calculate a point size for ggplot2-based scatter plots

Determine text color based on background color

BarcodeInflectionsPlot()

Plot the Barcode Distribution and Calculated Inflection Points

Cell-cell scatter plot

CellSelector() FeatureLocator()

CollapseEmbeddingOutliers()

Move outliers towards center on dimension reduction plot

Color dimensional reduction plot by tree split

Combine ggplot2-based plots into a single plot

BlackAndWhite() BlueAndRed() CustomPalette() PurpleAndYellow()

Create a custom color palette

DimHeatmap() PCHeatmap()

Dimensional reduction heatmap

DimPlot() PCAPlot() TSNEPlot() UMAPPlot()

Dimensional reduction plot

Discrete colour palettes from pals

Feature expression heatmap

Dot plot visualization

Quickly Pick Relevant Dimensions

Visualize 'features' on a dimensional reduction plot

Scatter plot of single cell data

GroupCorrelationPlot()

Boxplot of correlation of a variable (e.g. number of UMIs) with expression data

Hashtag oligo heatmap

Visualize features in dimensional reduction space interactively

Visualize clusters spatially and interactively

ISpatialFeaturePlot()

Visualize features spatially and interactively

Spatial Cluster Plots

Spatial Feature Plots

Label clusters on a ggplot2-based scatter plot

Add text labels to a ggplot2 plot

LinkedDimPlot() LinkedFeaturePlot()

Visualize spatial and clustering (dimensional reduction) data in a linked, interactive framework

Highlight Neighbors in DimPlot

Plot clusters as a tree

Single cell ridge plot

SeuratTheme() CenterTitle() DarkTheme() FontSize() NoAxes() NoLegend() NoGrid() SeuratAxes() SpatialTheme() RestoreLegend() RotatedAxis() BoldTitle() WhiteBackground()

SpatialPlot() SpatialDimPlot() SpatialFeaturePlot()

Visualize spatial clustering and expression data.

VariableFeaturePlot()

View variable features

Visualize Dimensional Reduction genes

Single cell violin plot

Intensity() Luminance()

Get the intensity and/or luminance of a color

Function related to tree-based analysis of identity classes

Phylogenetic Analysis of Identity Classes

Useful functions to help with a variety of tasks

Calculate module scores for feature expression programs in single cells

AggregateExpression()

Aggregated feature expression by identity class

Averaged feature expression by identity class

Match the case of character vectors

Score cell cycle phases

CollapseSpeciesExpressionMatrix()

Slim down a multi-species expression matrix, when only one species is primarily of interenst.

CreateCategoryMatrix()

Create one hot matrix for a given label

Run a custom distance function on an input data matrix

Calculate the mean of logged values

Calculate the standard deviation of logged values

Calculate the variance of logged values

Scale and/or center matrix rowwise

Compute the correlation of features broken down by groups with another covariate

Load the Annoy index file

Calculate the variance to mean ratio of logged values

Aggregate expression of multiple features into a single feature

Apply a ceiling and floor to all values in a matrix

Calculate the percentage of a vector above some threshold

PercentageFeatureSet()

Calculate the percentage of all counts that belong to a given set of features

PseudobulkExpression()

Pseudobulk Expression

Seurat-RPCA Integration

Regroup idents based on meta.data info

Find the Quantile of Data

GeneSymbolThesarus() UpdateSymbolList()

Get updated synonyms for gene symbols

as.sparse(<H5Group>) as.data.frame(<Matrix>)

Descriptions of data included with Seurat

cc.genes.updated.2019

Cell cycle genes: 2019 update

Functions included for user convenience and to keep maintain backwards compatability

DimHeatmap() PCHeatmap()

Dimensional reduction heatmap

DimPlot() PCAPlot() TSNEPlot() UMAPPlot()

Dimensional reduction plot

Read output from Parse Biosciences

Read output from STARsolo

SpatialPlot() SpatialDimPlot() SpatialFeaturePlot()

Visualize spatial clustering and expression data.

Functions for flexible analysis of massively scalable datasets

Leverage Score Calculation

Project full data to the sketch assay

TransferSketchLabels()

Transfer data from sketch data to full data

Functions re-exported from other packages

components() `%||%` `%iff%`

Objects exported from other packages

The SpatialImage Class

The JackStrawData Class

The SeuratCommand Class

Seurat Seurat-package

Seurat: Tools for Single Cell Genomics

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
AnchorSet-class
```

Example 2 (unknown):
```unknown
BridgeReferenceSet-class
```

Example 3 (unknown):
```unknown
BridgeReferenceSet
```

Example 4 (unknown):
```unknown
Cells(<SCTModel>)
```

Example 5 (unknown):
```unknown
Cells(<SlideSeq>)
```

Example 6 (unknown):
```unknown
Cells(<STARmap>)
```

Example 7 (unknown):
```unknown
Cells(<VisiumV1>)
```

Example 8 (unknown):
```unknown
CreateSCTAssayObject()
```

Example 9 (unknown):
```unknown
DietSeurat()
```

Example 10 (unknown):
```unknown
FilterSlideSeq()
```

Example 11 (unknown):
```unknown
GetImage(<SlideSeq>)
```

Example 12 (unknown):
```unknown
GetImage(<STARmap>)
```

Example 13 (unknown):
```unknown
GetImage(<VisiumV1>)
```

Example 14 (unknown):
```unknown
GetImage(<VisiumV2>)
```

Example 15 (unknown):
```unknown
GetIntegrationData()
```

Example 16 (unknown):
```unknown
GetTissueCoordinates(<SlideSeq>)
```

Example 17 (unknown):
```unknown
GetTissueCoordinates(<STARmap>)
```

Example 18 (unknown):
```unknown
GetTissueCoordinates(<VisiumV1>)
```

Example 19 (unknown):
```unknown
GetTissueCoordinates(<VisiumV2>)
```

Example 20 (unknown):
```unknown
HVFInfo(<SCTAssay>)
```

Example 21 (unknown):
```unknown
IntegrationAnchorSet-class
```

Example 22 (unknown):
```unknown
IntegrationAnchorSet
```

Example 23 (unknown):
```unknown
IntegrationData-class
```

Example 24 (unknown):
```unknown
IntegrationData
```

Example 25 (unknown):
```unknown
ModalityWeights-class
```

Example 26 (unknown):
```unknown
ModalityWeights
```

Example 27 (unknown):
```unknown
Radius(<SlideSeq>)
```

Example 28 (unknown):
```unknown
Radius(<STARmap>)
```

Example 29 (unknown):
```unknown
Radius(<VisiumV1>)
```

Example 30 (unknown):
```unknown
RenameCells(<SCTAssay>)
```

Example 31 (unknown):
```unknown
RenameCells(<SlideSeq>)
```

Example 32 (unknown):
```unknown
RenameCells(<STARmap>)
```

Example 33 (unknown):
```unknown
RenameCells(<VisiumV1>)
```

Example 34 (unknown):
```unknown
levels(<SCTAssay>)
```

Example 35 (unknown):
```unknown
`levels<-`(<SCTAssay>)
```

Example 36 (unknown):
```unknown
SCTResults()
```

Example 37 (unknown):
```unknown
`SCTResults<-`()
```

Example 38 (unknown):
```unknown
STARmap-class
```

Example 39 (unknown):
```unknown
ScaleFactors()
```

Example 40 (unknown):
```unknown
scalefactors()
```

Example 41 (unknown):
```unknown
SetIntegrationData()
```

Example 42 (unknown):
```unknown
SplitObject()
```

Example 43 (unknown):
```unknown
TopFeatures()
```

Example 44 (unknown):
```unknown
TopNeighbors()
```

Example 45 (unknown):
```unknown
TransferAnchorSet-class
```

Example 46 (unknown):
```unknown
TransferAnchorSet
```

Example 47 (unknown):
```unknown
UpdateSCTAssays()
```

Example 48 (unknown):
```unknown
VisiumV1-class
```

Example 49 (unknown):
```unknown
VisiumV2-class
```

Example 50 (unknown):
```unknown
as.CellDataSet()
```

Example 51 (unknown):
```unknown
as.Seurat(<CellDataSet>)
```

Example 52 (unknown):
```unknown
as.Seurat(<SingleCellExperiment>)
```

Example 53 (unknown):
```unknown
as.SingleCellExperiment()
```

Example 54 (unknown):
```unknown
as.sparse(<H5Group>)
```

Example 55 (unknown):
```unknown
as.data.frame(<Matrix>)
```

Example 56 (unknown):
```unknown
merge(<SCTAssay>)
```

Example 57 (unknown):
```unknown
subset(<AnchorSet>)
```

Example 58 (unknown):
```unknown
CalculateBarcodeInflections()
```

Example 59 (unknown):
```unknown
FetchResiduals()
```

Example 60 (unknown):
```unknown
FindSpatiallyVariableFeatures()
```

Example 61 (unknown):
```unknown
FindVariableFeatures()
```

Example 62 (unknown):
```unknown
GetResidual()
```

Example 63 (unknown):
```unknown
Load10X_Spatial()
```

Example 64 (unknown):
```unknown
LoadCurioSeeker()
```

Example 65 (unknown):
```unknown
LoadSTARmap()
```

Example 66 (unknown):
```unknown
LogNormalize()
```

Example 67 (unknown):
```unknown
MULTIseqDemux()
```

Example 68 (unknown):
```unknown
NormalizeData()
```

Example 69 (unknown):
```unknown
Read10X_Coordinates()
```

Example 70 (unknown):
```unknown
Read10X_Image()
```

Example 71 (unknown):
```unknown
Read10X_ScaleFactors()
```

Example 72 (unknown):
```unknown
Read10X_h5()
```

Example 73 (python):
```python
Read10X_probe_metadata()
```

Example 74 (unknown):
```unknown
ReadAkoya()
```

Example 75 (unknown):
```unknown
LoadAkoya()
```

Example 76 (unknown):
```unknown
ReadNanostring()
```

Example 77 (unknown):
```unknown
LoadNanostring()
```

Example 78 (unknown):
```unknown
ReadSlideSeq()
```

Example 79 (unknown):
```unknown
ReadVitessce()
```

Example 80 (unknown):
```unknown
LoadHuBMAPCODEX()
```

Example 81 (unknown):
```unknown
ReadVizgen()
```

Example 82 (unknown):
```unknown
LoadVizgen()
```

Example 83 (unknown):
```unknown
LoadXenium()
```

Example 84 (unknown):
```unknown
ReadXenium()
```

Example 85 (unknown):
```unknown
RelativeCounts()
```

Example 86 (unknown):
```unknown
RunMarkVario()
```

Example 87 (unknown):
```unknown
RunMoransI()
```

Example 88 (unknown):
```unknown
SCTransform()
```

Example 89 (unknown):
```unknown
SampleUMI()
```

Example 90 (unknown):
```unknown
ScaleData()
```

Example 91 (unknown):
```unknown
SubsetByBarcodeInflections()
```

Example 92 (unknown):
```unknown
FindAllMarkers()
```

Example 93 (unknown):
```unknown
FindConservedMarkers()
```

Example 94 (unknown):
```unknown
FindMarkers()
```

Example 95 (unknown):
```unknown
FoldChange()
```

Example 96 (unknown):
```unknown
PrepSCTFindMarkers()
```

Example 97 (unknown):
```unknown
JackStraw()
```

Example 98 (unknown):
```unknown
PCASigGenes()
```

Example 99 (unknown):
```unknown
ProjectDim()
```

Example 100 (unknown):
```unknown
ProjectUMAP()
```

Example 101 (unknown):
```unknown
RunGraphLaplacian()
```

Example 102 (unknown):
```unknown
ScoreJackStraw()
```

Example 103 (unknown):
```unknown
BuildNicheAssay()
```

Example 104 (unknown):
```unknown
FindClusters()
```

Example 105 (unknown):
```unknown
FindMultiModalNeighbors()
```

Example 106 (unknown):
```unknown
FindNeighbors()
```

Example 107 (unknown):
```unknown
FindSubCluster()
```

Example 108 (unknown):
```unknown
RunLeiden()
```

Example 109 (unknown):
```unknown
AnnotateAnchors()
```

Example 110 (unknown):
```unknown
BridgeCellsRepresentation()
```

Example 111 (unknown):
```unknown
CCAIntegration()
```

Example 112 (unknown):
```unknown
FastRPCAIntegration()
```

Example 113 (unknown):
```unknown
FindBridgeIntegrationAnchors()
```

Example 114 (unknown):
```unknown
FindBridgeTransferAnchors()
```

Example 115 (unknown):
```unknown
FindIntegrationAnchors()
```

Example 116 (unknown):
```unknown
FindTransferAnchors()
```

Example 117 (unknown):
```unknown
GetTransferPredictions()
```

Example 118 (unknown):
```unknown
HarmonyIntegration()
```

Example 119 (unknown):
```unknown
IntegrateData()
```

Example 120 (unknown):
```unknown
IntegrateEmbeddings()
```

Example 121 (unknown):
```unknown
IntegrateLayers()
```

Example 122 (unknown):
```unknown
JointPCAIntegration()
```

Example 123 (unknown):
```unknown
LocalStruct()
```

Example 124 (unknown):
```unknown
MappingScore()
```

Example 125 (unknown):
```unknown
MixingMetric()
```

Example 126 (unknown):
```unknown
NNtoGraph()
```

Example 127 (unknown):
```unknown
PredictAssay()
```

Example 128 (unknown):
```unknown
PrepSCTIntegration()
```

Example 129 (unknown):
```unknown
PrepareBridgeReference()
```

Example 130 (unknown):
```unknown
ProjectDimReduc()
```

Example 131 (unknown):
```unknown
ProjectIntegration()
```

Example 132 (unknown):
```unknown
SelectIntegrationFeatures()
```

Example 133 (unknown):
```unknown
SelectIntegrationFeatures5()
```

Example 134 (unknown):
```unknown
SelectSCTIntegrationFeatures()
```

Example 135 (unknown):
```unknown
TransferData()
```

Example 136 (unknown):
```unknown
UnSketchEmbeddings()
```

Example 137 (unknown):
```unknown
Cells(<SCTModel>)
```

Example 138 (unknown):
```unknown
Cells(<SlideSeq>)
```

Example 139 (unknown):
```unknown
Cells(<STARmap>)
```

Example 140 (unknown):
```unknown
Cells(<VisiumV1>)
```

Example 141 (unknown):
```unknown
FilterSlideSeq()
```

Example 142 (unknown):
```unknown
FindSpatiallyVariableFeatures()
```

Example 143 (unknown):
```unknown
GetImage(<SlideSeq>)
```

Example 144 (unknown):
```unknown
GetImage(<STARmap>)
```

Example 145 (unknown):
```unknown
GetImage(<VisiumV1>)
```

Example 146 (unknown):
```unknown
GetImage(<VisiumV2>)
```

Example 147 (unknown):
```unknown
GetTissueCoordinates(<SlideSeq>)
```

Example 148 (unknown):
```unknown
GetTissueCoordinates(<STARmap>)
```

Example 149 (unknown):
```unknown
GetTissueCoordinates(<VisiumV1>)
```

Example 150 (unknown):
```unknown
GetTissueCoordinates(<VisiumV2>)
```

Example 151 (unknown):
```unknown
ISpatialDimPlot()
```

Example 152 (unknown):
```unknown
ISpatialFeaturePlot()
```

Example 153 (unknown):
```unknown
ImageDimPlot()
```

Example 154 (unknown):
```unknown
ImageFeaturePlot()
```

Example 155 (unknown):
```unknown
LinkedDimPlot()
```

Example 156 (unknown):
```unknown
LinkedFeaturePlot()
```

Example 157 (unknown):
```unknown
PolyFeaturePlot()
```

Example 158 (unknown):
```unknown
Radius(<SlideSeq>)
```

Example 159 (unknown):
```unknown
Radius(<STARmap>)
```

Example 160 (unknown):
```unknown
Radius(<VisiumV1>)
```

Example 161 (unknown):
```unknown
STARmap-class
```

Example 162 (unknown):
```unknown
ScaleFactors()
```

Example 163 (unknown):
```unknown
scalefactors()
```

Example 164 (unknown):
```unknown
SlideSeq-class
```

Example 165 (unknown):
```unknown
SpatialPlot()
```

Example 166 (unknown):
```unknown
SpatialDimPlot()
```

Example 167 (unknown):
```unknown
SpatialFeaturePlot()
```

Example 168 (unknown):
```unknown
VisiumV1-class
```

Example 169 (unknown):
```unknown
VisiumV2-class
```

Example 170 (unknown):
```unknown
LeverageScore()
```

Example 171 (unknown):
```unknown
ProjectData()
```

Example 172 (unknown):
```unknown
SketchData()
```

Example 173 (unknown):
```unknown
TransferSketchLabels()
```

Example 174 (unknown):
```unknown
CalcPerturbSig()
```

Example 175 (unknown):
```unknown
DEenrichRPlot()
```

Example 176 (unknown):
```unknown
MixscapeHeatmap()
```

Example 177 (unknown):
```unknown
MixscapeLDA()
```

Example 178 (unknown):
```unknown
PlotPerturbScore()
```

Example 179 (unknown):
```unknown
RunMixscape()
```

Example 180 (unknown):
```unknown
AugmentPlot()
```

Example 181 (unknown):
```unknown
AutoPointSize()
```

Example 182 (unknown):
```unknown
BGTextColor()
```

Example 183 (unknown):
```unknown
BarcodeInflectionsPlot()
```

Example 184 (unknown):
```unknown
CellScatter()
```

Example 185 (unknown):
```unknown
CellSelector()
```

Example 186 (unknown):
```unknown
FeatureLocator()
```

Example 187 (unknown):
```unknown
CollapseEmbeddingOutliers()
```

Example 188 (unknown):
```unknown
ColorDimSplit()
```

Example 189 (unknown):
```unknown
CombinePlots()
```

Example 190 (unknown):
```unknown
BlackAndWhite()
```

Example 191 (unknown):
```unknown
BlueAndRed()
```

Example 192 (unknown):
```unknown
CustomPalette()
```

Example 193 (unknown):
```unknown
PurpleAndYellow()
```

Example 194 (unknown):
```unknown
DimHeatmap()
```

Example 195 (unknown):
```unknown
PCHeatmap()
```

Example 196 (unknown):
```unknown
DiscretePalette()
```

Example 197 (unknown):
```unknown
DoHeatmap()
```

Example 198 (unknown):
```unknown
ElbowPlot()
```

Example 199 (unknown):
```unknown
FeaturePlot()
```

Example 200 (unknown):
```unknown
FeatureScatter()
```

Example 201 (unknown):
```unknown
GroupCorrelationPlot()
```

Example 202 (unknown):
```unknown
HTOHeatmap()
```

Example 203 (unknown):
```unknown
HoverLocator()
```

Example 204 (unknown):
```unknown
IFeaturePlot()
```

Example 205 (unknown):
```unknown
ISpatialDimPlot()
```

Example 206 (unknown):
```unknown
ISpatialFeaturePlot()
```

Example 207 (unknown):
```unknown
ImageDimPlot()
```

Example 208 (unknown):
```unknown
ImageFeaturePlot()
```

Example 209 (unknown):
```unknown
JackStrawPlot()
```

Example 210 (unknown):
```unknown
LabelClusters()
```

Example 211 (unknown):
```unknown
LabelPoints()
```

Example 212 (unknown):
```unknown
LinkedDimPlot()
```

Example 213 (unknown):
```unknown
LinkedFeaturePlot()
```

Example 214 (unknown):
```unknown
PlotClusterTree()
```

Example 215 (unknown):
```unknown
PolyDimPlot()
```

Example 216 (unknown):
```unknown
PolyFeaturePlot()
```

Example 217 (unknown):
```unknown
RidgePlot()
```

Example 218 (unknown):
```unknown
SeuratTheme()
```

Example 219 (unknown):
```unknown
CenterTitle()
```

Example 220 (unknown):
```unknown
DarkTheme()
```

Example 221 (unknown):
```unknown
SeuratAxes()
```

Example 222 (unknown):
```unknown
SpatialTheme()
```

Example 223 (unknown):
```unknown
RestoreLegend()
```

Example 224 (unknown):
```unknown
RotatedAxis()
```

Example 225 (unknown):
```unknown
BoldTitle()
```

Example 226 (unknown):
```unknown
WhiteBackground()
```

Example 227 (unknown):
```unknown
SpatialPlot()
```

Example 228 (unknown):
```unknown
SpatialDimPlot()
```

Example 229 (unknown):
```unknown
SpatialFeaturePlot()
```

Example 230 (unknown):
```unknown
VariableFeaturePlot()
```

Example 231 (unknown):
```unknown
VizDimLoadings()
```

Example 232 (unknown):
```unknown
Intensity()
```

Example 233 (unknown):
```unknown
Luminance()
```

Example 234 (unknown):
```unknown
BuildClusterTree()
```

Example 235 (unknown):
```unknown
AddAzimuthResults()
```

Example 236 (unknown):
```unknown
AddModuleScore()
```

Example 237 (unknown):
```unknown
AggregateExpression()
```

Example 238 (unknown):
```unknown
AverageExpression()
```

Example 239 (unknown):
```unknown
CaseMatch()
```

Example 240 (unknown):
```unknown
CellCycleScoring()
```

Example 241 (unknown):
```unknown
CollapseSpeciesExpressionMatrix()
```

Example 242 (unknown):
```unknown
CreateCategoryMatrix()
```

Example 243 (unknown):
```unknown
CustomDistance()
```

Example 244 (unknown):
```unknown
FastRowScale()
```

Example 245 (unknown):
```unknown
GroupCorrelation()
```

Example 246 (unknown):
```unknown
LoadAnnoyIndex()
```

Example 247 (unknown):
```unknown
MetaFeature()
```

Example 248 (unknown):
```unknown
PercentAbove()
```

Example 249 (unknown):
```unknown
PercentageFeatureSet()
```

Example 250 (unknown):
```unknown
PseudobulkExpression()
```

Example 251 (unknown):
```unknown
RPCAIntegration()
```

Example 252 (unknown):
```unknown
RegroupIdents()
```

Example 253 (unknown):
```unknown
SaveAnnoyIndex()
```

Example 254 (unknown):
```unknown
SetQuantile()
```

Example 255 (unknown):
```unknown
GeneSymbolThesarus()
```

Example 256 (unknown):
```unknown
UpdateSymbolList()
```

Example 257 (unknown):
```unknown
as.sparse(<H5Group>)
```

Example 258 (unknown):
```unknown
as.data.frame(<Matrix>)
```

Example 259 (unknown):
```unknown
cc.genes.updated.2019
```

Example 260 (unknown):
```unknown
DimHeatmap()
```

Example 261 (unknown):
```unknown
PCHeatmap()
```

Example 262 (unknown):
```unknown
ReadParseBio()
```

Example 263 (unknown):
```unknown
ReadSTARsolo()
```

Example 264 (unknown):
```unknown
SpatialPlot()
```

Example 265 (unknown):
```unknown
SpatialDimPlot()
```

Example 266 (unknown):
```unknown
SpatialFeaturePlot()
```

Example 267 (unknown):
```unknown
LeverageScore()
```

Example 268 (unknown):
```unknown
ProjectData()
```

Example 269 (unknown):
```unknown
SketchData()
```

Example 270 (unknown):
```unknown
TransferSketchLabels()
```

Example 271 (unknown):
```unknown
components()
```

Example 272 (unknown):
```unknown
Seurat-class
```

Example 273 (unknown):
```unknown
Assay-class
```

Example 274 (unknown):
```unknown
DimReduc-class
```

Example 275 (unknown):
```unknown
Neighbor-class
```

Example 276 (unknown):
```unknown
Graph-class
```

Example 277 (unknown):
```unknown
SpatialImage-class
```

Example 278 (unknown):
```unknown
JackStrawData-class
```

Example 279 (unknown):
```unknown
SeuratCommand-class
```

Example 280 (unknown):
```unknown
Seurat-package
```

---

## Add Azimuth Results — AddAzimuthResults • Seurat

**URL:** http://127.0.0.1:9173/seurat/reference/addazimuthresults/index.html

**Contents:**
- Add Azimuth Results
- Arguments
- Value
- Examples
- Contents

Add mapping and prediction scores, UMAP embeddings, and imputed assay (if available) from Azimuth to an existing or new Seurat object

Path to Azimuth mapping scores file

object with Azimuth results added

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/utilities.R
```

Example 2 (unknown):
```unknown
AddAzimuthResults.Rd
```

Example 3 (unknown):
```unknown
AddAzimuthResults(object = NULL, filename)
```

Example 4 (r):
```r
AddAzimuthResults(object = NULL, filename)
```

Example 5 (r):
```r
AddAzimuthResults(object = NULL, filename)
```

Example 6 (unknown):
```unknown
if (FALSE) { # \dontrun{
object <- AddAzimuthResults(object, filename = "azimuth_results.Rds")
} # }
```

Example 7 (r):
```r
if (FALSE) { # \dontrun{
object <- AddAzimuthResults(object, filename = "azimuth_results.Rds")
} # }
```

Example 8 (r):
```r
if (FALSE) { # \dontrun{
object <- AddAzimuthResults(object, filename = "azimuth_results.Rds")
} # }
```

---

## Visualize clusters spatially and interactively — ISpatialDimPlot • Seurat

**URL:** http://127.0.0.1:9173/seurat/reference/ispatialdimplot/index.html

**Contents:**
- Visualize clusters spatially and interactively
- Arguments
- Value
- Contents

Visualize clusters spatially and interactively

Name of the image to use in the plot

Choose the scale factor ("lowres"/"hires") to apply in order to matchthe plot with the specified `image` - defaults to "lowres"

Name of meta.data column to group the data by

Controls opacity of spots. Provide as a vector specifying the min and max for SpatialFeaturePlot. For SpatialDimPlot, provide a single alpha value for each plot.

Returns final plot as a ggplot object

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/visualization.R
```

Example 2 (unknown):
```unknown
ISpatialDimPlot.Rd
```

Example 3 (unknown):
```unknown
ISpatialDimPlot(
  object,
  image = NULL,
  image.scale = "lowres",
  group.by = NULL,
  alpha = c(0.3, 1)
)
```

Example 4 (r):
```r
ISpatialDimPlot(
  object,
  image = NULL,
  image.scale = "lowres",
  group.by = NULL,
  alpha = c(0.3, 1)
)
```

Example 5 (r):
```r
ISpatialDimPlot(
  object,
  image = NULL,
  image.scale = "lowres",
  group.by = NULL,
  alpha = c(0.3, 1)
)
```

---

## Finds markers that are conserved between the groups — FindConservedMarkers • Seurat

**URL:** http://127.0.0.1:9173/reference_findconservedmarkers.html

**Contents:**
- Finds markers that are conserved between the groups
- Arguments
- Value
- Examples
- Contents

Finds markers that are conserved between the groups

Identity class to define markers for

A second identity class for comparison. If NULL (default) - use all other cells for comparison.

of assay to fetch data for (default is RNA)

Slot to pull data from; note that if test.use is "negbinom", "poisson", or "DESeq2", slot will be set to "counts"

Minimum number of cells in one of the groups

method for combining p-values. Should be a function from the metap package (NOTE: pass the function, not a string)

Print a progress bar once expression testing begins

parameters to pass to FindMarkers

data.frame containing a ranked list of putative conserved markers, and associated statistics (p-values within each group and a combined p-value (such as Fishers combined p-value or others from the metap package), percentage of cells expressing the marker, average differences). Name of group is appended to each associated output column (e.g. CTRL_p_val). If only one group is tested in the grouping.var, max and combined p-values are not returned.

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/differential_expression.R
```

Example 2 (unknown):
```unknown
FindConservedMarkers.Rd
```

Example 3 (unknown):
```unknown
FindConservedMarkers(
  object,
  ident.1,
  ident.2 = NULL,
  grouping.var,
  assay = "RNA",
  slot = "data",
  min.cells.group = 3,
  meta.method = metap::minimump,
  verbose = TRUE,
  ...
)
```

Example 4 (r):
```r
FindConservedMarkers(
  object,
  ident.1,
  ident.2 = NULL,
  grouping.var,
  assay = "RNA",
  slot = "data",
  min.cells.group = 3,
  meta.method = metap::minimump,
  verbose = TRUE,
  ...
)
```

Example 5 (r):
```r
FindConservedMarkers(
  object,
  ident.1,
  ident.2 = NULL,
  grouping.var,
  assay = "RNA",
  slot = "data",
  min.cells.group = 3,
  meta.method = metap::minimump,
  verbose = TRUE,
  ...
)
```

Example 6 (unknown):
```unknown
if (FALSE) { # \dontrun{
data("pbmc_small")
pbmc_small
# Create a simulated grouping variable
pbmc_small[['groups']] <- sample(x = c('g1', 'g2'), size = ncol(x = pbmc_small), replace = TRUE)
FindConservedMarkers(pbmc_small, ident.1 = 0, ident.2 = 1, grouping.var = "groups")
} # }
```

Example 7 (r):
```r
if (FALSE) { # \dontrun{
data("pbmc_small")
pbmc_small
# Create a simulated grouping variable
pbmc_small[['groups']] <- sample(x = c('g1', 'g2'), size = ncol(x = pbmc_small), replace = TRUE)
FindConservedMarkers(pbmc_small, ident.1 = 0, ident.2 = 1, grouping.var = "groups")
} # }
```

Example 8 (r):
```r
if (FALSE) { # \dontrun{
data("pbmc_small")
pbmc_small
# Create a simulated grouping variable
pbmc_small[['groups']] <- sample(x = c('g1', 'g2'), size = ncol(x = pbmc_small), replace = TRUE)
FindConservedMarkers(pbmc_small, ident.1 = 0, ident.2 = 1, grouping.var = "groups")
} # }
```

---

## Read and Load MERFISH Input from Vizgen — ReadVizgen • Seurat

**URL:** http://127.0.0.1:9173/reference_readvizgen.html

**Contents:**
- Read and Load MERFISH Input from Vizgen
- Arguments
- Value
- Note
- Progress Updates with progressr
- Parallelization with future
- Contents

Read and load in MERFISH data from Vizgen-formatted files

Path to the directory with Vizgen MERFISH files; requires at least one of the following files present:

“cell_by_gene.csv”: used for reading count matrix

“cell_metadata.csv”: used for reading cell spatial coordinate matrices

“detected_transcripts.csv”: used for reading molecule spatial coordinate matrices

Optional file path for counts matrix; pass NA to suppress reading counts matrix

Optional file path for spatial metadata; pass NA to suppress reading spatial coordinates. If spatial is provided and type is “segmentations”, uses dirname(spatial) instead of data.dir to find HDF5 files

Optional file path for molecule coordinates file; pass NA to suppress reading spatial molecule information

Type of cell spatial coordinate matrices to read; choose one or more of:

“segmentations”: cell segmentation vertices; requires hdf5r to be installed and requires a directory “cell_boundaries” within data.dir. Within “cell_boundaries”, there must be one or more HDF5 file named “feature_data_##.hdf5”

“centroids”: cell centroids in micron coordinate space

“boxes”: cell box outlines in micron coordinate space

Type of molecule spatial coordinate matrices to read; choose one or more of:

“pixels”: molecule coordinates in pixel space

“microns”: molecule coordinates in micron space

Type of available metadata to read; choose zero or more of:

“volume”: estimated cell volume

A character to filter molecules by, pass NA to skip molecule filtering

Z-index to load; must be between 0 and 6, inclusive

Name to store expression matrix as

ReadVizgen: A list with some combination of the following values:

“transcripts”: a sparse matrix with expression data; cells are columns and features are rows

“segmentations”: a data frame with cell polygon outlines in three columns: “x”, “y”, and “cell”

“centroids”: a data frame with cell centroid coordinates in three columns: “x”, “y”, and “cell”

“boxes”: a data frame with cell box outlines in three columns: “x”, “y”, and “cell”

“microns”: a data frame with molecule micron coordinates in three columns: “x”, “y”, and “gene”

“pixels”: a data frame with molecule pixel coordinates in three columns: “x”, “y”, and “gene”

“metadata”: a data frame with the cell-level metadata requested by metadata

LoadVizgen: A Seurat object

This function requires the data.table package to be installed

This function uses progressr to render status updates and progress bars. To enable progress updates, wrap the function call in with_progress or run handlers(global = TRUE) before running this function. For more details about progressr, please read vignette("progressr-intro")

This function uses future to enable parallelization. Parallelization strategies can be set using plan. Common plans include “sequential” for non-parallelized processing or “multisession” for parallel evaluation using multiple R sessions; for other plans, see the “Implemented evaluation strategies” section of ?future::plan. For a more thorough introduction to future, see vignette("future-1-overview")

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/preprocessing.R
```

Example 2 (unknown):
```unknown
R/convenience.R
```

Example 3 (unknown):
```unknown
ReadVizgen.Rd
```

Example 4 (python):
```python
ReadVizgen(
  data.dir,
  transcripts = NULL,
  spatial = NULL,
  molecules = NULL,
  type = "segmentations",
  mol.type = "microns",
  metadata = NULL,
  filter = NA_character_,
  z = 3L
)

LoadVizgen(data.dir, fov, assay = "Vizgen", z = 3L)
```

Example 5 (r):
```r
ReadVizgen(
  data.dir,
  transcripts = NULL,
  spatial = NULL,
  molecules = NULL,
  type = "segmentations",
  mol.type = "microns",
  metadata = NULL,
  filter = NA_character_,
  z = 3L
)

LoadVizgen(data.dir, fov, assay = "Vizgen", z = 3L)
```

Example 6 (r):
```r
ReadVizgen(
  data.dir,
  transcripts = NULL,
  spatial = NULL,
  molecules = NULL,
  type = "segmentations",
  mol.type = "microns",
  metadata = NULL,
  filter = NA_character_,
  z = 3L
)

LoadVizgen(data.dir, fov, assay = "Vizgen", z = 3L)
```

Example 7 (unknown):
```unknown
cell_by_gene.csv
```

Example 8 (python):
```python
cell_metadata.csv
```

Example 9 (unknown):
```unknown
detected_transcripts.csv
```

Example 10 (unknown):
```unknown
dirname(spatial)
```

Example 11 (unknown):
```unknown
cell_boundaries
```

Example 12 (unknown):
```unknown
cell_boundaries
```

Example 13 (unknown):
```unknown
feature_data_##.hdf5
```

Example 14 (unknown):
```unknown
transcripts
```

Example 15 (unknown):
```unknown
segmentations
```

Example 16 (unknown):
```unknown
with_progress
```

Example 17 (unknown):
```unknown
handlers(global = TRUE)
```

Example 18 (unknown):
```unknown
vignette("progressr-intro")
```

Example 19 (unknown):
```unknown
multisession
```

Example 20 (unknown):
```unknown
?future::plan
```

Example 21 (unknown):
```unknown
vignette("future-1-overview")
```

---

## Calculate the mean of logged values — ExpMean • Seurat

**URL:** http://127.0.0.1:9173/seurat/reference/expmean/index.html

**Contents:**
- Calculate the mean of logged values
- Arguments
- Value
- Examples
- Contents

Calculate mean of logged values in non-log space (return answer in log-space)

Other arguments (not used)

Returns the mean in log-space

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/utilities.R
```

Example 2 (unknown):
```unknown
ExpMean(x, ...)
```

Example 3 (r):
```r
ExpMean(x, ...)
```

Example 4 (r):
```r
ExpMean(x, ...)
```

Example 5 (unknown):
```unknown
ExpMean(x = c(1, 2, 3))
#> [1] 2.308994
```

Example 6 (r):
```r
ExpMean(x = c(1, 2, 3))
#> [1] 2.308994
```

Example 7 (r):
```r
ExpMean(x = c(1, 2, 3))
#> [1] 2.308994
```

---

## Visualize spatial clustering and expression data. — SpatialPlot • Seurat

**URL:** http://127.0.0.1:9173/reference_spatialplot.html

**Contents:**
- Visualize spatial clustering and expression data.
- Arguments
- Value
- Examples
- Contents

SpatialPlot plots a feature or discrete grouping (e.g. cluster assignments) as spots over the image that was collected. We also provide SpatialFeaturePlot and SpatialDimPlot as wrapper functions around SpatialPlot for a consistent naming framework.

Name of meta.data column to group the data by

Name of the feature to visualize. Provide either group.by OR features, not both.

Name of the images to use in the plot(s)

Vector of colors, each color corresponds to an identity class. This may also be a single character or numeric value corresponding to a palette as specified by brewer.pal.info. By default, ggplot2 assigns colors

Adjust the opacity of the background images. Set to 0 to remove.

Choose the scale factor ("lowres"/"hires") to apply in order to matchthe plot with the specified `image` - defaults to "lowres"

Crop the plot in to focus on points plotted. Set to FALSE to show entire background image.

If plotting a feature, which data slot to pull from (counts, data, or scale.data)

How to handle the color scale across multiple plots. Options are:

“feature” (default; by row/feature scaling): The plots for each individual feature are scaled to the maximum expression of the feature across the conditions provided to split.by

“all” (universal scaling): The plots for all features and conditions are scaled to the maximum expression value for the feature with the highest overall expression

NULL (no scaling): Each individual plot is scaled to the maximum expression value of the feature in the condition provided to split.by; be aware setting NULL will result in color scales that are not comparable between plots

Vector of minimum and maximum cutoff values for each feature, may specify quantile in the form of 'q##' where '##' is the quantile (eg, 'q1', 'q10')

A list of character or numeric vectors of cells to highlight. If only one group of cells desired, can simply pass a vector instead of a list. If set, colors selected cells to the color(s) in cols.highlight

A vector of colors to highlight the cells as; ordered the same as the groups in cells.highlight; last color corresponds to unselected cells.

When highlighting certain groups of cells, split each group into its own plot

Whether to label the clusters

Sets the size of the labels

Sets the color of the label text

Whether to put a box around the label text (geom_text vs geom_label)

Repels the labels to prevent overlap

Number of columns if plotting multiple plots

Combine plots into a single gg object; note that if TRUE; themeing will not work when plotting multiple features/groupings

Scale the size of the spots.

Controls opacity of spots. Provide as a vector specifying the min and max for SpatialFeaturePlot. For SpatialDimPlot, provide a single alpha value for each plot.

Control the shape of the spots - same as the ggplot2 parameter. The default is 21, which plots circles - use 22 to plot squares.

Control the width of the border around the spots

Launch an interactive SpatialDimPlot or SpatialFeaturePlot session, see ISpatialDimPlot or ISpatialFeaturePlot for more details

DEPRECATED in favor of interactive

An optional dataframe or matrix of extra information to be displayed on hover

If do.identify, either a vector of cells selected or the object with selected cells set to the value of identify.ident (if set). Else, if do.hover, a plotly object with interactive graphics. Else, a ggplot object

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/visualization.R
```

Example 2 (unknown):
```unknown
R/convenience.R
```

Example 3 (unknown):
```unknown
SpatialPlot.Rd
```

Example 4 (unknown):
```unknown
SpatialPlot(
  object,
  group.by = NULL,
  features = NULL,
  images = NULL,
  cols = NULL,
  image.alpha = 1,
  image.scale = "lowres",
  crop = TRUE,
  slot = "data",
  keep.scale = "feature",
  min.cutoff = NA,
  max.cutoff = NA,
  cells.highlight = NULL,
  cols.highlight = c("#DE2D26", "grey50"),
  facet.highlight = FALSE,
  label = FALSE,
  label.size = 5,
  label.color = "white",
  label.box = TRUE,
  repel = FALSE,
  ncol = NULL,
  combine = TRUE,
  pt.size.factor = 1.6,
  alpha = c(1, 1),
  shape = 21,
  stroke = NA,
  interactive = FALSE,
  do.identify = FALSE,
  identify.ident = NULL,
  do.hover = FALSE,
  information = NULL
)

SpatialDimPlot(
  object,
  group.by = NULL,
  images = NULL,
  cols = NULL,
  crop = TRUE,
  cells.highlight = NULL,
  cols.highlight = c("#DE2D26", "grey50"),
  facet.highlight = FALSE,
  label = FALSE,
  label.size = 7,
  label.color = "white",
  repel = FALSE,
  ncol = NULL,
  combine = TRUE,
  pt.size.factor = 1.6,
  alpha = c(1, 1),
  image.alpha = 1,
  image.scale = "lowres",
  shape = 21,
  stroke = NA,
  label.box = TRUE,
  interactive = FALSE,
  information = NULL
)

SpatialFeaturePlot(
  object,
  features,
  images = NULL,
  crop = TRUE,
  slot = "data",
  keep.scale = "feature",
  min.cutoff = NA,
  max.cutoff = NA,
  ncol = NULL,
  combine = TRUE,
  pt.size.factor = 1.6,
  alpha = c(1, 1),
  image.alpha = 1,
  image.scale = "lowres",
  shape = 21,
  stroke = NA,
  interactive = FALSE,
  information = NULL
)
```

Example 5 (r):
```r
SpatialPlot(
  object,
  group.by = NULL,
  features = NULL,
  images = NULL,
  cols = NULL,
  image.alpha = 1,
  image.scale = "lowres",
  crop = TRUE,
  slot = "data",
  keep.scale = "feature",
  min.cutoff = NA,
  max.cutoff = NA,
  cells.highlight = NULL,
  cols.highlight = c("#DE2D26", "grey50"),
  facet.highlight = FALSE,
  label = FALSE,
  label.size = 5,
  label.color = "white",
  label.box = TRUE,
  repel = FALSE,
  ncol = NULL,
  combine = TRUE,
  pt.size.factor = 1.6,
  alpha = c(1, 1),
  shape = 21,
  stroke = NA,
  interactive = FALSE,
  do.identify = FALSE,
  identify.ident = NULL,
  do.hover = FALSE,
  information = NULL
)

SpatialDimPlot(
  object,
  group.by = NULL,
  images = NULL,
  cols = NULL,
  crop = TRUE,
  cells.highlight = NULL,
  cols.highlight = c("#DE2D26", "grey50"),
  facet.highlight = FALSE,
  label = FALSE,
  label.size = 7,
  label.color = "white",
  repel = FALSE,
  ncol = NULL,
  combine = TRUE,
  pt.size.factor = 1.6,
  alpha = c(1, 1),
  image.alpha = 1,
  image.scale = "lowres",
  shape = 21,
  stroke = NA,
  label.box = TRUE,
  interactive = FALSE,
  information = NULL
)

SpatialFeaturePlot(
  object,
  features,
  images = NULL,
  crop = TRUE,
  slot = "data",
  keep.scale = "feature",
  min.cutoff = NA,
  max.cutoff = NA,
  ncol = NULL,
  combine = TRUE,
  pt.size.factor = 1.6,
  alpha = c(1, 1),
  image.alpha = 1,
  image.scale = "lowres",
  shape = 21,
  stroke = NA,
  interactive = FALSE,
  information = NULL
)
```

Example 6 (r):
```r
SpatialPlot(
  object,
  group.by = NULL,
  features = NULL,
  images = NULL,
  cols = NULL,
  image.alpha = 1,
  image.scale = "lowres",
  crop = TRUE,
  slot = "data",
  keep.scale = "feature",
  min.cutoff = NA,
  max.cutoff = NA,
  cells.highlight = NULL,
  cols.highlight = c("#DE2D26", "grey50"),
  facet.highlight = FALSE,
  label = FALSE,
  label.size = 5,
  label.color = "white",
  label.box = TRUE,
  repel = FALSE,
  ncol = NULL,
  combine = TRUE,
  pt.size.factor = 1.6,
  alpha = c(1, 1),
  shape = 21,
  stroke = NA,
  interactive = FALSE,
  do.identify = FALSE,
  identify.ident = NULL,
  do.hover = FALSE,
  information = NULL
)

SpatialDimPlot(
  object,
  group.by = NULL,
  images = NULL,
  cols = NULL,
  crop = TRUE,
  cells.highlight = NULL,
  cols.highlight = c("#DE2D26", "grey50"),
  facet.highlight = FALSE,
  label = FALSE,
  label.size = 7,
  label.color = "white",
  repel = FALSE,
  ncol = NULL,
  combine = TRUE,
  pt.size.factor = 1.6,
  alpha = c(1, 1),
  image.alpha = 1,
  image.scale = "lowres",
  shape = 21,
  stroke = NA,
  label.box = TRUE,
  interactive = FALSE,
  information = NULL
)

SpatialFeaturePlot(
  object,
  features,
  images = NULL,
  crop = TRUE,
  slot = "data",
  keep.scale = "feature",
  min.cutoff = NA,
  max.cutoff = NA,
  ncol = NULL,
  combine = TRUE,
  pt.size.factor = 1.6,
  alpha = c(1, 1),
  image.alpha = 1,
  image.scale = "lowres",
  shape = 21,
  stroke = NA,
  interactive = FALSE,
  information = NULL
)
```

Example 7 (unknown):
```unknown
brewer.pal.info
```

Example 8 (unknown):
```unknown
ISpatialDimPlot
```

Example 9 (unknown):
```unknown
ISpatialFeaturePlot
```

Example 10 (unknown):
```unknown
interactive
```

Example 11 (unknown):
```unknown
do.identify
```

Example 12 (unknown):
```unknown
identify.ident
```

Example 13 (unknown):
```unknown
if (FALSE) { # \dontrun{
# For functionality analagous to FeaturePlot
SpatialPlot(seurat.object, features = "MS4A1")
SpatialFeaturePlot(seurat.object, features = "MS4A1")

# For functionality analagous to DimPlot
SpatialPlot(seurat.object, group.by = "clusters")
SpatialDimPlot(seurat.object, group.by = "clusters")
} # }
```

Example 14 (r):
```r
if (FALSE) { # \dontrun{
# For functionality analagous to FeaturePlot
SpatialPlot(seurat.object, features = "MS4A1")
SpatialFeaturePlot(seurat.object, features = "MS4A1")

# For functionality analagous to DimPlot
SpatialPlot(seurat.object, group.by = "clusters")
SpatialDimPlot(seurat.object, group.by = "clusters")
} # }
```

Example 15 (r):
```r
if (FALSE) { # \dontrun{
# For functionality analagous to FeaturePlot
SpatialPlot(seurat.object, features = "MS4A1")
SpatialFeaturePlot(seurat.object, features = "MS4A1")

# For functionality analagous to DimPlot
SpatialPlot(seurat.object, group.by = "clusters")
SpatialDimPlot(seurat.object, group.by = "clusters")
} # }
```

---

## Seurat-RPCA Integration — RPCAIntegration • Seurat

**URL:** http://127.0.0.1:9173/reference_rpcaintegration.html

**Contents:**
- Seurat-RPCA Integration
- Arguments
- Examples
- Contents

Seurat-RPCA Integration

Name of Assay in the Seurat object

Names of layers in assay

A DimReduc to correct

Name of new integrated dimensional reduction

A reference Seurat object

A vector of features to use for integration

Name of normalization method used: LogNormalize or SCT

Dimensions of dimensional reduction to use for integration

Number of anchors to filter

Name of scaled layer in Assay

Number of dimensions to return integrated values for

Number of neighbors to consider when weighting anchors

Dimension reduction to use when calculating anchor weights. This can be one of:

A string, specifying the name of a dimension reduction present in all objects to be integrated

A vector of strings, specifying the name of a dimension reduction to use for each object to be integrated

A vector of DimReduc objects, specifying the object to use for each object in the integration

NULL, in which case the full corrected space is used for computing anchor weights.

Controls the bandwidth of the Gaussian kernel for weighting

Specify the order of integration. Order of integration should be encoded in a matrix, where each row represents one of the pairwise integration steps. Negative numbers specify a dataset, positive numbers specify the integration results from a given row (the format of the merge matrix included in the hclust function output). For example: matrix(c(-2, 1, -3, -1), ncol = 2) gives:

Which would cause dataset 2 and 3 to be integrated first, then the resulting object integrated with dataset 1.

If NULL, the sample tree will be computed automatically.

Do not reorder objects based on size for each pairwise integration.

Arguments passed on to FindIntegrationAnchors

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/integration5.R
```

Example 2 (unknown):
```unknown
RPCAIntegration.Rd
```

Example 3 (unknown):
```unknown
RPCAIntegration(
  object = NULL,
  assay = NULL,
  layers = NULL,
  orig = NULL,
  new.reduction = "integrated.dr",
  reference = NULL,
  features = NULL,
  normalization.method = c("LogNormalize", "SCT"),
  dims = 1:30,
  k.filter = NA,
  scale.layer = "scale.data",
  dims.to.integrate = NULL,
  k.weight = 100,
  weight.reduction = NULL,
  sd.weight = 1,
  sample.tree = NULL,
  preserve.order = FALSE,
  verbose = TRUE,
  ...
)
```

Example 4 (r):
```r
RPCAIntegration(
  object = NULL,
  assay = NULL,
  layers = NULL,
  orig = NULL,
  new.reduction = "integrated.dr",
  reference = NULL,
  features = NULL,
  normalization.method = c("LogNormalize", "SCT"),
  dims = 1:30,
  k.filter = NA,
  scale.layer = "scale.data",
  dims.to.integrate = NULL,
  k.weight = 100,
  weight.reduction = NULL,
  sd.weight = 1,
  sample.tree = NULL,
  preserve.order = FALSE,
  verbose = TRUE,
  ...
)
```

Example 5 (r):
```r
RPCAIntegration(
  object = NULL,
  assay = NULL,
  layers = NULL,
  orig = NULL,
  new.reduction = "integrated.dr",
  reference = NULL,
  features = NULL,
  normalization.method = c("LogNormalize", "SCT"),
  dims = 1:30,
  k.filter = NA,
  scale.layer = "scale.data",
  dims.to.integrate = NULL,
  k.weight = 100,
  weight.reduction = NULL,
  sd.weight = 1,
  sample.tree = NULL,
  preserve.order = FALSE,
  verbose = TRUE,
  ...
)
```

Example 6 (unknown):
```unknown
matrix(c(-2, 1, -3, -1), ncol = 2)
```

Example 7 (unknown):
```unknown
[,1]  [,2]
       [1,]   -2   -3
       [2,]    1   -1
```

Example 8 (unknown):
```unknown
[,1]  [,2]
       [1,]   -2   -3
       [2,]    1   -1
```

Example 9 (unknown):
```unknown
[,1]  [,2]
       [1,]   -2   -3
       [2,]    1   -1
```

Example 10 (unknown):
```unknown
FindIntegrationAnchors
```

Example 11 (unknown):
```unknown
if (FALSE) { # \dontrun{
# Preprocessing
obj <- SeuratData::LoadData("pbmcsca")
obj[["RNA"]] <- split(obj[["RNA"]], f = obj$Method)
obj <- NormalizeData(obj)
obj <- FindVariableFeatures(obj)
obj <- ScaleData(obj)
obj <- RunPCA(obj)

# After preprocessing, we run integration
obj <- IntegrateLayers(object = obj, method = RPCAIntegration,
  orig.reduction = "pca", new.reduction = 'integrated.rpca',
  verbose = FALSE)

# Reference-based Integration
# Here, we use the first layer as a reference for integraion
# Thus, we only identify anchors between the reference and the rest of the datasets,
# saving computational resources
obj <- IntegrateLayers(object = obj, method = RPCAIntegration,
  orig.reduction = "pca", new.reduction = 'integrated.rpca',
  reference = 1, verbose = FALSE)

# Modifying parameters
# We can also specify parameters such as `k.anchor` to increase the strength of
# integration
obj <- IntegrateLayers(object = obj, method = RPCAIntegration,
  orig.reduction = "pca", new.reduction = 'integrated.rpca',
  k.anchor = 20, verbose = FALSE)

# Integrating SCTransformed data
obj <- SCTransform(object = obj)
obj <- IntegrateLayers(object = obj, method = RPCAIntegration,
  orig.reduction = "pca", new.reduction = 'integrated.rpca',
  assay = "SCT", verbose = FALSE)
} # }
```

Example 12 (r):
```r
if (FALSE) { # \dontrun{
# Preprocessing
obj <- SeuratData::LoadData("pbmcsca")
obj[["RNA"]] <- split(obj[["RNA"]], f = obj$Method)
obj <- NormalizeData(obj)
obj <- FindVariableFeatures(obj)
obj <- ScaleData(obj)
obj <- RunPCA(obj)

# After preprocessing, we run integration
obj <- IntegrateLayers(object = obj, method = RPCAIntegration,
  orig.reduction = "pca", new.reduction = 'integrated.rpca',
  verbose = FALSE)

# Reference-based Integration
# Here, we use the first layer as a reference for integraion
# Thus, we only identify anchors between the reference and the rest of the datasets,
# saving computational resources
obj <- IntegrateLayers(object = obj, method = RPCAIntegration,
  orig.reduction = "pca", new.reduction = 'integrated.rpca',
  reference = 1, verbose = FALSE)

# Modifying parameters
# We can also specify parameters such as `k.anchor` to increase the strength of
# integration
obj <- IntegrateLayers(object = obj, method = RPCAIntegration,
  orig.reduction = "pca", new.reduction = 'integrated.rpca',
  k.anchor = 20, verbose = FALSE)

# Integrating SCTransformed data
obj <- SCTransform(object = obj)
obj <- IntegrateLayers(object = obj, method = RPCAIntegration,
  orig.reduction = "pca", new.reduction = 'integrated.rpca',
  assay = "SCT", verbose = FALSE)
} # }
```

Example 13 (r):
```r
if (FALSE) { # \dontrun{
# Preprocessing
obj <- SeuratData::LoadData("pbmcsca")
obj[["RNA"]] <- split(obj[["RNA"]], f = obj$Method)
obj <- NormalizeData(obj)
obj <- FindVariableFeatures(obj)
obj <- ScaleData(obj)
obj <- RunPCA(obj)

# After preprocessing, we run integration
obj <- IntegrateLayers(object = obj, method = RPCAIntegration,
  orig.reduction = "pca", new.reduction = 'integrated.rpca',
  verbose = FALSE)

# Reference-based Integration
# Here, we use the first layer as a reference for integraion
# Thus, we only identify anchors between the reference and the rest of the datasets,
# saving computational resources
obj <- IntegrateLayers(object = obj, method = RPCAIntegration,
  orig.reduction = "pca", new.reduction = 'integrated.rpca',
  reference = 1, verbose = FALSE)

# Modifying parameters
# We can also specify parameters such as `k.anchor` to increase the strength of
# integration
obj <- IntegrateLayers(object = obj, method = RPCAIntegration,
  orig.reduction = "pca", new.reduction = 'integrated.rpca',
  k.anchor = 20, verbose = FALSE)

# Integrating SCTransformed data
obj <- SCTransform(object = obj)
obj <- IntegrateLayers(object = obj, method = RPCAIntegration,
  orig.reduction = "pca", new.reduction = 'integrated.rpca',
  assay = "SCT", verbose = FALSE)
} # }
```

---

## Select integration features — SelectIntegrationFeatures • Seurat

**URL:** http://127.0.0.1:9173/seurat/reference/selectintegrationfeatures/index.html

**Contents:**
- Select integration features
- Arguments
- Value
- Details
- Examples
- Contents

Choose the features to use when integrating multiple datasets. This function ranks features by the number of datasets they are deemed variable in, breaking ties by the median variable feature rank across datasets. It returns the top scoring features by this ranking.

List of seurat objects

Number of features to return

Name or vector of assay names (one for each object) from which to pull the variable features.

nfeatures for FindVariableFeatures. Used if VariableFeatures have not been set for any object in object.list.

Additional parameters to FindVariableFeatures

A vector of selected features

If for any assay in the list, FindVariableFeatures hasn't been run, this method will try to run it using the fvf.nfeatures parameter and any additional ones specified through the ....

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/integration.R
```

Example 2 (unknown):
```unknown
SelectIntegrationFeatures.Rd
```

Example 3 (unknown):
```unknown
SelectIntegrationFeatures(
  object.list,
  nfeatures = 2000,
  assay = NULL,
  verbose = TRUE,
  fvf.nfeatures = 2000,
  ...
)
```

Example 4 (r):
```r
SelectIntegrationFeatures(
  object.list,
  nfeatures = 2000,
  assay = NULL,
  verbose = TRUE,
  fvf.nfeatures = 2000,
  ...
)
```

Example 5 (r):
```r
SelectIntegrationFeatures(
  object.list,
  nfeatures = 2000,
  assay = NULL,
  verbose = TRUE,
  fvf.nfeatures = 2000,
  ...
)
```

Example 6 (unknown):
```unknown
FindVariableFeatures
```

Example 7 (unknown):
```unknown
VariableFeatures
```

Example 8 (unknown):
```unknown
object.list
```

Example 9 (unknown):
```unknown
FindVariableFeatures
```

Example 10 (unknown):
```unknown
FindVariableFeatures
```

Example 11 (unknown):
```unknown
fvf.nfeatures
```

Example 12 (unknown):
```unknown
if (FALSE) { # \dontrun{
# to install the SeuratData package see https://github.com/satijalab/seurat-data
library(SeuratData)
data("panc8")

# panc8 is a merged Seurat object containing 8 separate pancreas datasets
# split the object by dataset and take the first 2
pancreas.list <- SplitObject(panc8, split.by = "tech")[1:2]

# perform SCTransform normalization
pancreas.list <- lapply(X = pancreas.list, FUN = SCTransform)

# select integration features
features <- SelectIntegrationFeatures(pancreas.list)
} # }
```

Example 13 (r):
```r
if (FALSE) { # \dontrun{
# to install the SeuratData package see https://github.com/satijalab/seurat-data
library(SeuratData)
data("panc8")

# panc8 is a merged Seurat object containing 8 separate pancreas datasets
# split the object by dataset and take the first 2
pancreas.list <- SplitObject(panc8, split.by = "tech")[1:2]

# perform SCTransform normalization
pancreas.list <- lapply(X = pancreas.list, FUN = SCTransform)

# select integration features
features <- SelectIntegrationFeatures(pancreas.list)
} # }
```

Example 14 (r):
```r
if (FALSE) { # \dontrun{
# to install the SeuratData package see https://github.com/satijalab/seurat-data
library(SeuratData)
data("panc8")

# panc8 is a merged Seurat object containing 8 separate pancreas datasets
# split the object by dataset and take the first 2
pancreas.list <- SplitObject(panc8, split.by = "tech")[1:2]

# perform SCTransform normalization
pancreas.list <- lapply(X = pancreas.list, FUN = SCTransform)

# select integration features
features <- SelectIntegrationFeatures(pancreas.list)
} # }
```

---

## JackStraw Plot — JackStrawPlot • Seurat

**URL:** http://127.0.0.1:9173/reference_jackstrawplot.html

**Contents:**
- JackStraw Plot
- Arguments
- Value
- Details
- See also
- Author
- Examples
- Contents

Plots the results of the JackStraw analysis for PCA significance. For each PC, plots a QQ-plot comparing the distribution of p-values for all genes across each PC, compared with a uniform distribution. Also determines a p-value for the overall significance of each PC (see Details).

Vector of colors, each color corresponds to an individual PC. This may also be a single character or numeric value corresponding to a palette as specified by brewer.pal.info. By default, ggplot2 assigns colors. We also include a number of palettes from the pals package. See DiscretePalette for details.

reduction to pull jackstraw info from

X-axis maximum on each QQ plot.

Y-axis maximum on each QQ plot.

Significant PCs should show a p-value distribution (black curve) that is strongly skewed to the left compared to the null distribution (dashed line) The p-value for each PC is based on a proportion test comparing the number of genes with a p-value below a particular threshold (score.thresh), compared with the proportion of genes expected under a uniform distribution of p-values.

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/visualization.R
```

Example 2 (unknown):
```unknown
JackStrawPlot.Rd
```

Example 3 (unknown):
```unknown
JackStrawPlot(
  object,
  dims = 1:5,
  cols = NULL,
  reduction = "pca",
  xmax = 0.1,
  ymax = 0.3
)
```

Example 4 (r):
```r
JackStrawPlot(
  object,
  dims = 1:5,
  cols = NULL,
  reduction = "pca",
  xmax = 0.1,
  ymax = 0.3
)
```

Example 5 (r):
```r
JackStrawPlot(
  object,
  dims = 1:5,
  cols = NULL,
  reduction = "pca",
  xmax = 0.1,
  ymax = 0.3
)
```

Example 6 (unknown):
```unknown
brewer.pal.info
```

Example 7 (unknown):
```unknown
DiscretePalette
```

Example 8 (unknown):
```unknown
ScoreJackStraw
```

Example 9 (unknown):
```unknown
data("pbmc_small")
JackStrawPlot(object = pbmc_small)
#> Warning: Removed 83 rows containing missing values or values outside the scale range (`geom_point()`).
```

Example 10 (r):
```r
data("pbmc_small")
JackStrawPlot(object = pbmc_small)
#> Warning: Removed 83 rows containing missing values or values outside the scale range (`geom_point()`).
```

Example 11 (r):
```r
data("pbmc_small")
JackStrawPlot(object = pbmc_small)
#> Warning: Removed 83 rows containing missing values or values outside the scale range (`geom_point()`).
```

---

## Prepare an object list normalized with sctransform for integration. — PrepSCTIntegration • Seurat

**URL:** http://127.0.0.1:9173/seurat/reference/prepsctintegration/index.html

**Contents:**
- Prepare an object list normalized with sctransform for integration.
- Arguments
- Value
- Examples
- Contents

This function takes in a list of objects that have been normalized with the SCTransform method and performs the following steps:

If anchor.features is a numeric value, calls SelectIntegrationFeatures to determine the features to use in the downstream integration procedure.

Ensures that the sctransform residuals for the features specified to anchor.features are present in each object in the list. This is necessary because the default behavior of SCTransform is to only store the residuals for the features determined to be variable. Residuals are recomputed for missing features using the stored model parameters via the GetResidual function.

Subsets the scale.data slot to only contain the residuals for anchor.features for efficiency in downstream processing.

A list of Seurat objects to prepare for integration

The name of the Assay to use for integration. This can be a single name if all the assays to be integrated have the same name, or a character vector containing the name of each Assay in each object to be integrated. The specified assays must have been normalized using SCTransform. If NULL (default), the current default assay for each object is used.

A numeric value. This will call SelectIntegrationFeatures to select the provided number of features to be used in anchor finding

A vector of features to be used as input to the anchor finding process

Numeric of length two specifying the min and max values the Pearson residual will be clipped to

Display output/messages

A list of Seurat objects with the appropriate scale.data slots containing only the required anchor.features.

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/integration.R
```

Example 2 (unknown):
```unknown
PrepSCTIntegration.Rd
```

Example 3 (unknown):
```unknown
SCTransform
```

Example 4 (unknown):
```unknown
SelectIntegrationFeatures
```

Example 5 (unknown):
```unknown
SCTransform
```

Example 6 (unknown):
```unknown
GetResidual
```

Example 7 (unknown):
```unknown
PrepSCTIntegration(
  object.list,
  assay = NULL,
  anchor.features = 2000,
  sct.clip.range = NULL,
  verbose = TRUE
)
```

Example 8 (r):
```r
PrepSCTIntegration(
  object.list,
  assay = NULL,
  anchor.features = 2000,
  sct.clip.range = NULL,
  verbose = TRUE
)
```

Example 9 (r):
```r
PrepSCTIntegration(
  object.list,
  assay = NULL,
  anchor.features = 2000,
  sct.clip.range = NULL,
  verbose = TRUE
)
```

Example 10 (unknown):
```unknown
SCTransform
```

Example 11 (unknown):
```unknown
SelectIntegrationFeatures
```

Example 12 (unknown):
```unknown
anchor.features
```

Example 13 (unknown):
```unknown
if (FALSE) { # \dontrun{
# to install the SeuratData package see https://github.com/satijalab/seurat-data
library(SeuratData)
data("panc8")

# panc8 is a merged Seurat object containing 8 separate pancreas datasets
# split the object by dataset and take the first 2 to integrate
pancreas.list <- SplitObject(panc8, split.by = "tech")[1:2]

# perform SCTransform normalization
pancreas.list <- lapply(X = pancreas.list, FUN = SCTransform)

# select integration features and prep step
features <- SelectIntegrationFeatures(pancreas.list)
pancreas.list <- PrepSCTIntegration(
  pancreas.list,
  anchor.features = features
)

# downstream integration steps
anchors <- FindIntegrationAnchors(
  pancreas.list,
  normalization.method = "SCT",
  anchor.features = features
)
pancreas.integrated <- IntegrateData(anchors, normalization.method = "SCT")
} # }
```

Example 14 (r):
```r
if (FALSE) { # \dontrun{
# to install the SeuratData package see https://github.com/satijalab/seurat-data
library(SeuratData)
data("panc8")

# panc8 is a merged Seurat object containing 8 separate pancreas datasets
# split the object by dataset and take the first 2 to integrate
pancreas.list <- SplitObject(panc8, split.by = "tech")[1:2]

# perform SCTransform normalization
pancreas.list <- lapply(X = pancreas.list, FUN = SCTransform)

# select integration features and prep step
features <- SelectIntegrationFeatures(pancreas.list)
pancreas.list <- PrepSCTIntegration(
  pancreas.list,
  anchor.features = features
)

# downstream integration steps
anchors <- FindIntegrationAnchors(
  pancreas.list,
  normalization.method = "SCT",
  anchor.features = features
)
pancreas.integrated <- IntegrateData(anchors, normalization.method = "SCT")
} # }
```

Example 15 (r):
```r
if (FALSE) { # \dontrun{
# to install the SeuratData package see https://github.com/satijalab/seurat-data
library(SeuratData)
data("panc8")

# panc8 is a merged Seurat object containing 8 separate pancreas datasets
# split the object by dataset and take the first 2 to integrate
pancreas.list <- SplitObject(panc8, split.by = "tech")[1:2]

# perform SCTransform normalization
pancreas.list <- lapply(X = pancreas.list, FUN = SCTransform)

# select integration features and prep step
features <- SelectIntegrationFeatures(pancreas.list)
pancreas.list <- PrepSCTIntegration(
  pancreas.list,
  anchor.features = features
)

# downstream integration steps
anchors <- FindIntegrationAnchors(
  pancreas.list,
  normalization.method = "SCT",
  anchor.features = features
)
pancreas.integrated <- IntegrateData(anchors, normalization.method = "SCT")
} # }
```

---

## The SlideSeq class — SlideSeq-class • Seurat

**URL:** http://127.0.0.1:9173/seurat/reference/slideseq-class/index.html

**Contents:**
- The SlideSeq class
- Slots
- Slots
- Contents

The SlideSeq class represents spatial information from the Slide-seq platform

Name of assay to associate image data with; will give this image priority for visualization when the assay is set as the active/default assay in a Seurat object

A one-length character vector with the object's key; keys must be one or more alphanumeric characters followed by an underscore “_” (regex pattern “^[a-zA-Z][a-zA-Z0-9]*_$”)

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/objects.R
```

Example 2 (unknown):
```unknown
SlideSeq-class.Rd
```

Example 3 (unknown):
```unknown
coordinates
```

Example 4 (unknown):
```unknown
^[a-zA-Z][a-zA-Z0-9]*_$
```

---

## Calculate the local structure preservation metric — LocalStruct • Seurat

**URL:** http://127.0.0.1:9173/reference_localstruct.html

**Contents:**
- Calculate the local structure preservation metric
- Arguments
- Value
- Contents

Calculates a metric that describes how well the local structure of each group prior to integration is preserved after integration. This procedure works as follows: For each group, compute a PCA, compute the top num.neighbors in pca space, compute the top num.neighbors in corrected pca space, compute the size of the intersection of those two sets of neighbors. Return the average over all groups.

Optionally specify a set of idents to compute metric for

Number of neighbors to compute in pca/corrected pca space

Dimensional reduction to use for corrected space

Number of reduced dimensions to use

Number of PCs to use in original space

Returns the average preservation metric

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/integration.R
```

Example 2 (unknown):
```unknown
LocalStruct.Rd
```

Example 3 (unknown):
```unknown
LocalStruct(
  object,
  grouping.var,
  idents = NULL,
  neighbors = 100,
  reduction = "pca",
  reduced.dims = 1:10,
  orig.dims = 1:10,
  verbose = TRUE
)
```

Example 4 (r):
```r
LocalStruct(
  object,
  grouping.var,
  idents = NULL,
  neighbors = 100,
  reduction = "pca",
  reduced.dims = 1:10,
  orig.dims = 1:10,
  verbose = TRUE
)
```

Example 5 (r):
```r
LocalStruct(
  object,
  grouping.var,
  idents = NULL,
  neighbors = 100,
  reduction = "pca",
  reduced.dims = 1:10,
  orig.dims = 1:10,
  verbose = TRUE
)
```

---

## Cast to Sparse — as.sparse.H5Group • Seurat

**URL:** http://127.0.0.1:9173/reference_as.sparse.html

**Contents:**
- Cast to Sparse
- Arguments
- Value
- See also
- Contents

Arguments passed to other methods

NULL or a character vector giving the row names for the data; missing values are not allowed

logical. If TRUE, setting row names and converting column names (to syntactic names: see make.names) is optional. Note that all of R's base package as.data.frame() methods use optional only for column names treatment, basically with the meaning of data.frame(*, check.names = !optional). See also the make.names argument of the matrix method.

logical: should the character vector be converted to a factor?

as.data.frame.Matrix: A data frame representation of the S4 Matrix

SeuratObject::as.sparse

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/objects.R
```

Example 2 (unknown):
```unknown
R/utilities.R
```

Example 3 (unknown):
```unknown
as.sparse.Rd
```

Example 4 (python):
```python
# S3 method for class 'H5Group'
as.sparse(x, ...)

# S3 method for class 'Matrix'
as.data.frame(
  x,
  row.names = NULL,
  optional = FALSE,
  ...,
  stringsAsFactors = getOption(x = "stringsAsFactors", default = FALSE)
)
```

Example 5 (r):
```r
# S3 method for class 'H5Group'
as.sparse(x, ...)

# S3 method for class 'Matrix'
as.data.frame(
  x,
  row.names = NULL,
  optional = FALSE,
  ...,
  stringsAsFactors = getOption(x = "stringsAsFactors", default = FALSE)
)
```

Example 6 (r):
```r
# S3 method for class 'H5Group'
as.sparse(x, ...)

# S3 method for class 'Matrix'
as.data.frame(
  x,
  row.names = NULL,
  optional = FALSE,
  ...,
  stringsAsFactors = getOption(x = "stringsAsFactors", default = FALSE)
)
```

Example 7 (unknown):
```unknown
as.data.frame()
```

Example 8 (unknown):
```unknown
data.frame(*, check.names = !optional)
```

Example 9 (unknown):
```unknown
as.data.frame.Matrix
```

Example 10 (unknown):
```unknown
SeuratObject::as.sparse
```

---

## Integrate low dimensional embeddings — IntegrateEmbeddings • Seurat

**URL:** http://127.0.0.1:9173/reference_integrateembeddings.html

**Contents:**
- Integrate low dimensional embeddings
- Arguments
- Value
- Details
- Contents

Perform dataset integration using a pre-computed Anchorset of specified low dimensional representations.

Reserved for internal use

Name for new integrated dimensional reduction.

Name of reductions to be integrated. For a TransferAnchorSet, this should be the name of a reduction present in the anchorset object (for example, "pcaproject"). For an IntegrationAnchorSet, this should be a DimReduc object containing all cells present in the anchorset object.

Number of dimensions to return integrated values for

Number of neighbors to consider when weighting anchors

Dimension reduction to use when calculating anchor weights. This can be one of:

A string, specifying the name of a dimension reduction present in all objects to be integrated

A vector of strings, specifying the name of a dimension reduction to use for each object to be integrated

A vector of DimReduc objects, specifying the object to use for each object in the integration

NULL, in which case the full corrected space is used for computing anchor weights.

Controls the bandwidth of the Gaussian kernel for weighting

Specify the order of integration. Order of integration should be encoded in a matrix, where each row represents one of the pairwise integration steps. Negative numbers specify a dataset, positive numbers specify the integration results from a given row (the format of the merge matrix included in the hclust function output). For example: matrix(c(-2, 1, -3, -1), ncol = 2) gives:

Which would cause dataset 2 and 3 to be integrated first, then the resulting object integrated with dataset 1.

If NULL, the sample tree will be computed automatically.

Do not reorder objects based on size for each pairwise integration.

Print progress bars and output

Reference object used in anchorset construction

Query object used in anchorset construction

Name of the Assay to use from query

Can be used in conjunction with the store.weights parameter in TransferData to reuse a precomputed weights matrix.

When called on a TransferAnchorSet (from FindTransferAnchors), this will return the query object with the integrated embeddings stored in a new reduction. When called on an IntegrationAnchorSet (from IntegrateData), this will return a merged object with the integrated reduction stored.

The main steps of this procedure are identical to IntegrateData with one key distinction. When computing the weights matrix, the distance calculations are performed in the full space of integrated embeddings when integrating more than two datasets, as opposed to a reduced PCA space which is the default behavior in IntegrateData.

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/generics.R
```

Example 2 (unknown):
```unknown
R/integration.R
```

Example 3 (unknown):
```unknown
IntegrateEmbeddings.Rd
```

Example 4 (python):
```python
IntegrateEmbeddings(anchorset, ...)

# S3 method for class 'IntegrationAnchorSet'
IntegrateEmbeddings(
  anchorset,
  new.reduction.name = "integrated_dr",
  reductions = NULL,
  dims.to.integrate = NULL,
  k.weight = 100,
  weight.reduction = NULL,
  sd.weight = 1,
  sample.tree = NULL,
  preserve.order = FALSE,
  verbose = TRUE,
  ...
)

# S3 method for class 'TransferAnchorSet'
IntegrateEmbeddings(
  anchorset,
  reference,
  query,
  query.assay = NULL,
  new.reduction.name = "integrated_dr",
  reductions = "pcaproject",
  dims.to.integrate = NULL,
  k.weight = 100,
  weight.reduction = NULL,
  reuse.weights.matrix = TRUE,
  sd.weight = 1,
  preserve.order = FALSE,
  verbose = TRUE,
  ...
)
```

Example 5 (r):
```r
IntegrateEmbeddings(anchorset, ...)

# S3 method for class 'IntegrationAnchorSet'
IntegrateEmbeddings(
  anchorset,
  new.reduction.name = "integrated_dr",
  reductions = NULL,
  dims.to.integrate = NULL,
  k.weight = 100,
  weight.reduction = NULL,
  sd.weight = 1,
  sample.tree = NULL,
  preserve.order = FALSE,
  verbose = TRUE,
  ...
)

# S3 method for class 'TransferAnchorSet'
IntegrateEmbeddings(
  anchorset,
  reference,
  query,
  query.assay = NULL,
  new.reduction.name = "integrated_dr",
  reductions = "pcaproject",
  dims.to.integrate = NULL,
  k.weight = 100,
  weight.reduction = NULL,
  reuse.weights.matrix = TRUE,
  sd.weight = 1,
  preserve.order = FALSE,
  verbose = TRUE,
  ...
)
```

Example 6 (r):
```r
IntegrateEmbeddings(anchorset, ...)

# S3 method for class 'IntegrationAnchorSet'
IntegrateEmbeddings(
  anchorset,
  new.reduction.name = "integrated_dr",
  reductions = NULL,
  dims.to.integrate = NULL,
  k.weight = 100,
  weight.reduction = NULL,
  sd.weight = 1,
  sample.tree = NULL,
  preserve.order = FALSE,
  verbose = TRUE,
  ...
)

# S3 method for class 'TransferAnchorSet'
IntegrateEmbeddings(
  anchorset,
  reference,
  query,
  query.assay = NULL,
  new.reduction.name = "integrated_dr",
  reductions = "pcaproject",
  dims.to.integrate = NULL,
  k.weight = 100,
  weight.reduction = NULL,
  reuse.weights.matrix = TRUE,
  sd.weight = 1,
  preserve.order = FALSE,
  verbose = TRUE,
  ...
)
```

Example 7 (unknown):
```unknown
matrix(c(-2, 1, -3, -1), ncol = 2)
```

Example 8 (unknown):
```unknown
[,1]  [,2]
       [1,]   -2   -3
       [2,]    1   -1
```

Example 9 (unknown):
```unknown
[,1]  [,2]
       [1,]   -2   -3
       [2,]    1   -1
```

Example 10 (unknown):
```unknown
[,1]  [,2]
       [1,]   -2   -3
       [2,]    1   -1
```

Example 11 (unknown):
```unknown
IntegrateData
```

Example 12 (unknown):
```unknown
IntegrateData
```

---

## Significant genes from a PCA — PCASigGenes • Seurat

**URL:** http://127.0.0.1:9173/seurat/reference/pcasiggenes/index.html

**Contents:**
- Significant genes from a PCA
- Arguments
- Value
- See also
- Examples
- Contents

Returns a set of genes, based on the JackStraw analysis, that have statistically significant associations with a set of PCs.

Use the full list of genes (from the projected PCA). Assumes that ProjectDim has been run. Currently, must be set to FALSE.

Maximum number of genes to return per PC. Used to avoid genes from one PC dominating the entire analysis.

A vector of genes whose p-values are statistically significant for at least one of the given PCs.

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/dimensional_reduction.R
```

Example 2 (unknown):
```unknown
PCASigGenes.Rd
```

Example 3 (unknown):
```unknown
PCASigGenes(
  object,
  pcs.use,
  pval.cut = 0.1,
  use.full = FALSE,
  max.per.pc = NULL
)
```

Example 4 (r):
```r
PCASigGenes(
  object,
  pcs.use,
  pval.cut = 0.1,
  use.full = FALSE,
  max.per.pc = NULL
)
```

Example 5 (r):
```r
PCASigGenes(
  object,
  pcs.use,
  pval.cut = 0.1,
  use.full = FALSE,
  max.per.pc = NULL
)
```

Example 6 (unknown):
```unknown
data("pbmc_small")
PCASigGenes(pbmc_small, pcs.use = 1:2)
#>  [1] "PPBP"     "VDAC3"    "CD1C"     "AKR1C3"   "PF4"      "MYL9"    
#>  [7] "GNLY"     "TREML1"   "CA2"      "SDPR"     "PGRMC1"   "S100A8"  
#> [13] "TUBB1"    "HLA-DQA1" "PARVB"    "RUFY1"    "HLA-DPB1" "S100A9"
```

Example 7 (r):
```r
data("pbmc_small")
PCASigGenes(pbmc_small, pcs.use = 1:2)
#>  [1] "PPBP"     "VDAC3"    "CD1C"     "AKR1C3"   "PF4"      "MYL9"    
#>  [7] "GNLY"     "TREML1"   "CA2"      "SDPR"     "PGRMC1"   "S100A8"  
#> [13] "TUBB1"    "HLA-DQA1" "PARVB"    "RUFY1"    "HLA-DPB1" "S100A9"
```

Example 8 (r):
```r
data("pbmc_small")
PCASigGenes(pbmc_small, pcs.use = 1:2)
#>  [1] "PPBP"     "VDAC3"    "CD1C"     "AKR1C3"   "PF4"      "MYL9"    
#>  [7] "GNLY"     "TREML1"   "CA2"      "SDPR"     "PGRMC1"   "S100A8"  
#> [13] "TUBB1"    "HLA-DQA1" "PARVB"    "RUFY1"    "HLA-DPB1" "S100A9"
```

---

## Writing Integration Method Functions — writing-integration • Seurat

**URL:** http://127.0.0.1:9173/seurat/reference/writing-integration/index.html

**Contents:**
- Writing Integration Method Functions
- Provided Parameters
- Method Discovery
- See also
- Contents

Integration method functions can be written by anyone to implement any integration method in Seurat. These methods should expect to take a v5 assay as input and return a named list of objects that can be added back to a Seurat object (eg. a dimensional reduction or cell-level meta data)

Every integration method function should expect the following arguments:

“object”: an Assay5 object

“orig”: dimensional reduction to correct

“layers”: names of normalized layers in object

“scale.layer”: name(s) of scaled layer(s) in object

“features”: a vector of features for integration

“groups”: a one-column data frame with the groups for each cell in object; the column name will be “group”

The documentation for IntegrateLayers() will automatically link to integration method functions provided by packages in the search() space. To make an integration method function discoverable by the documentation, simply add an attribute named “Seurat.method” to the function with a value of “integration”

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/integration5.R
```

Example 2 (unknown):
```unknown
writing-integration.Rd
```

Example 3 (unknown):
```unknown
scale.layer
```

Example 4 (unknown):
```unknown
IntegrateLayers()
```

Example 5 (unknown):
```unknown
Seurat.method
```

Example 6 (unknown):
```unknown
integration
```

Example 7 (unknown):
```unknown
attr(MyIntegrationFunction, which = "Seurat.method") <- "integration"
```

Example 8 (unknown):
```unknown
attr(MyIntegrationFunction, which = "Seurat.method") <- "integration"
```

Example 9 (unknown):
```unknown
attr(MyIntegrationFunction, which = "Seurat.method") <- "integration"
```

Example 10 (unknown):
```unknown
IntegrateLayers()
```

---

## Single cell ridge plot — RidgePlot • Seurat

**URL:** http://127.0.0.1:9173/reference_ridgeplot.html

**Contents:**
- Single cell ridge plot
- Arguments
- Value
- Examples
- Contents

Draws a ridge plot of single cell data (gene expression, metrics, PC scores, etc.)

Features to plot (gene expression, metrics, PC scores, anything that can be retreived by FetchData)

Colors to use for plotting

Which classes to include in the plot (default is all)

Sort identity classes (on the x-axis) by the average expression of the attribute being potted, can also pass 'increasing' or 'decreasing' to change sort direction

Name of assay to use, defaults to the active assay

Group (color) cells in different ways (for example, orig.ident)

Set all the y-axis limits to the same values

plot the feature axis on log scale

Number of columns if multiple plots are displayed

Slot to pull expression data from (e.g. "counts" or "data")

Layer to pull expression data from (e.g. "counts" or "data")

Horizontally stack plots for each feature

Combine plots into a single patchworked ggplot object. If FALSE, return a list of ggplot

Color violins/ridges based on either 'feature' or 'ident'

A patchworked ggplot object if combine = TRUE; otherwise, a list of ggplot objects

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/visualization.R
```

Example 2 (unknown):
```unknown
RidgePlot.Rd
```

Example 3 (unknown):
```unknown
RidgePlot(
  object,
  features,
  cols = NULL,
  idents = NULL,
  sort = FALSE,
  assay = NULL,
  group.by = NULL,
  y.max = NULL,
  same.y.lims = FALSE,
  log = FALSE,
  ncol = NULL,
  slot = deprecated(),
  layer = "data",
  stack = FALSE,
  combine = TRUE,
  fill.by = "feature"
)
```

Example 4 (r):
```r
RidgePlot(
  object,
  features,
  cols = NULL,
  idents = NULL,
  sort = FALSE,
  assay = NULL,
  group.by = NULL,
  y.max = NULL,
  same.y.lims = FALSE,
  log = FALSE,
  ncol = NULL,
  slot = deprecated(),
  layer = "data",
  stack = FALSE,
  combine = TRUE,
  fill.by = "feature"
)
```

Example 5 (r):
```r
RidgePlot(
  object,
  features,
  cols = NULL,
  idents = NULL,
  sort = FALSE,
  assay = NULL,
  group.by = NULL,
  y.max = NULL,
  same.y.lims = FALSE,
  log = FALSE,
  ncol = NULL,
  slot = deprecated(),
  layer = "data",
  stack = FALSE,
  combine = TRUE,
  fill.by = "feature"
)
```

Example 6 (unknown):
```unknown
patchworked
```

Example 7 (unknown):
```unknown
patchworked
```

Example 8 (unknown):
```unknown
combine = TRUE
```

Example 9 (unknown):
```unknown
data("pbmc_small")
RidgePlot(object = pbmc_small, features = 'PC_1')
#> Picking joint bandwidth of 0.387
```

Example 10 (r):
```r
data("pbmc_small")
RidgePlot(object = pbmc_small, features = 'PC_1')
#> Picking joint bandwidth of 0.387
```

Example 11 (r):
```r
data("pbmc_small")
RidgePlot(object = pbmc_small, features = 'PC_1')
#> Picking joint bandwidth of 0.387
```

---

## Calculate the local structure preservation metric — LocalStruct • Seurat

**URL:** http://127.0.0.1:9173/seurat/reference/localstruct/index.html

**Contents:**
- Calculate the local structure preservation metric
- Arguments
- Value
- Contents

Calculates a metric that describes how well the local structure of each group prior to integration is preserved after integration. This procedure works as follows: For each group, compute a PCA, compute the top num.neighbors in pca space, compute the top num.neighbors in corrected pca space, compute the size of the intersection of those two sets of neighbors. Return the average over all groups.

Optionally specify a set of idents to compute metric for

Number of neighbors to compute in pca/corrected pca space

Dimensional reduction to use for corrected space

Number of reduced dimensions to use

Number of PCs to use in original space

Returns the average preservation metric

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/integration.R
```

Example 2 (unknown):
```unknown
LocalStruct.Rd
```

Example 3 (unknown):
```unknown
LocalStruct(
  object,
  grouping.var,
  idents = NULL,
  neighbors = 100,
  reduction = "pca",
  reduced.dims = 1:10,
  orig.dims = 1:10,
  verbose = TRUE
)
```

Example 4 (r):
```r
LocalStruct(
  object,
  grouping.var,
  idents = NULL,
  neighbors = 100,
  reduction = "pca",
  reduced.dims = 1:10,
  orig.dims = 1:10,
  verbose = TRUE
)
```

Example 5 (r):
```r
LocalStruct(
  object,
  grouping.var,
  idents = NULL,
  neighbors = 100,
  reduction = "pca",
  reduced.dims = 1:10,
  orig.dims = 1:10,
  verbose = TRUE
)
```

---

## The VisiumV2 class — VisiumV2-class • Seurat

**URL:** http://127.0.0.1:9173/reference_visiumv2-class.html

**Contents:**
- The VisiumV2 class
- Slots
- Contents

The VisiumV2 class represents spatial information from the 10X Genomics Visium HD platform - it can also accomodate data from the standard Visium platform

A three-dimensional array with PNG image data, see readPNG for more details

An object of class scalefactors; see scalefactors for more information

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/objects.R
```

Example 2 (unknown):
```unknown
VisiumV2-class.Rd
```

Example 3 (unknown):
```unknown
scale.factors
```

Example 4 (unknown):
```unknown
scalefactors
```

Example 5 (unknown):
```unknown
scalefactors
```

---

## Dot plot visualization — DotPlot • Seurat

**URL:** http://127.0.0.1:9173/reference_dotplot.html

**Contents:**
- Dot plot visualization
- Arguments
- Value
- See also
- Examples
- Contents

Intuitive way of visualizing how feature expression changes across different identity classes (clusters). The size of the dot encodes the percentage of cells within a class, while the color encodes the AverageExpression level across all cells within a class (blue is high).

Input vector of features, or named list of feature vectors if feature-grouped panels are desired (replicates the functionality of the old SplitDotPlotGG)

Name of assay to use, defaults to the active assay

Colors to plot: the name of a palette from RColorBrewer::brewer.pal.info, a pair of colors defining a gradient, or 3+ colors defining multiple gradients (if split.by is set)

Minimum scaled average expression threshold (everything smaller will be set to this)

Maximum scaled average expression threshold (everything larger will be set to this)

The fraction of cells at which to draw the smallest dot (default is 0). All cell groups with less than this expressing the given gene will have no dot drawn.

Scale the size of the points, similar to cex

Identity classes to include in plot (default is all)

Factor to group the cells by

A factor in object metadata to split the plot by, pass 'ident' to split by cell identity see FetchData for more details

Whether to order identities by hierarchical clusters based on given features, default is FALSE

Determine whether the data is scaled, TRUE for default

Scale the size of the points by 'size' or by 'radius'

Set lower limit for scaling, use NA for default

Set upper limit for scaling, use NA for default

RColorBrewer::brewer.pal.info

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/visualization.R
```

Example 2 (unknown):
```unknown
DotPlot(
  object,
  features,
  assay = NULL,
  cols = c("lightgrey", "blue"),
  col.min = -2.5,
  col.max = 2.5,
  dot.min = 0,
  dot.scale = 6,
  idents = NULL,
  group.by = NULL,
  split.by = NULL,
  cluster.idents = FALSE,
  scale = TRUE,
  scale.by = "radius",
  scale.min = NA,
  scale.max = NA
)
```

Example 3 (r):
```r
DotPlot(
  object,
  features,
  assay = NULL,
  cols = c("lightgrey", "blue"),
  col.min = -2.5,
  col.max = 2.5,
  dot.min = 0,
  dot.scale = 6,
  idents = NULL,
  group.by = NULL,
  split.by = NULL,
  cluster.idents = FALSE,
  scale = TRUE,
  scale.by = "radius",
  scale.min = NA,
  scale.max = NA
)
```

Example 4 (r):
```r
DotPlot(
  object,
  features,
  assay = NULL,
  cols = c("lightgrey", "blue"),
  col.min = -2.5,
  col.max = 2.5,
  dot.min = 0,
  dot.scale = 6,
  idents = NULL,
  group.by = NULL,
  split.by = NULL,
  cluster.idents = FALSE,
  scale = TRUE,
  scale.by = "radius",
  scale.min = NA,
  scale.max = NA
)
```

Example 5 (unknown):
```unknown
RColorBrewer::brewer.pal.info
```

Example 6 (unknown):
```unknown
RColorBrewer::brewer.pal.info
```

Example 7 (unknown):
```unknown
data("pbmc_small")
cd_genes <- c("CD247", "CD3E", "CD9")
DotPlot(object = pbmc_small, features = cd_genes)
#> Warning: Scaling data with a low number of groups may produce misleading results

pbmc_small[['groups']] <- sample(x = c('g1', 'g2'), size = ncol(x = pbmc_small), replace = TRUE)
DotPlot(object = pbmc_small, features = cd_genes, split.by = 'groups')
```

Example 8 (r):
```r
data("pbmc_small")
cd_genes <- c("CD247", "CD3E", "CD9")
DotPlot(object = pbmc_small, features = cd_genes)
#> Warning: Scaling data with a low number of groups may produce misleading results

pbmc_small[['groups']] <- sample(x = c('g1', 'g2'), size = ncol(x = pbmc_small), replace = TRUE)
DotPlot(object = pbmc_small, features = cd_genes, split.by = 'groups')
```

Example 9 (r):
```r
data("pbmc_small")
cd_genes <- c("CD247", "CD3E", "CD9")
DotPlot(object = pbmc_small, features = cd_genes)
#> Warning: Scaling data with a low number of groups may produce misleading results

pbmc_small[['groups']] <- sample(x = c('g1', 'g2'), size = ncol(x = pbmc_small), replace = TRUE)
DotPlot(object = pbmc_small, features = cd_genes, split.by = 'groups')
```

---

## Add text labels to a ggplot2 plot — LabelPoints • Seurat

**URL:** http://127.0.0.1:9173/reference_labelpoints.html

**Contents:**
- Add text labels to a ggplot2 plot
- Arguments
- Value
- See also
- Examples
- Contents

Add text labels to a ggplot2 plot

A ggplot2 plot with a GeomPoint layer

A vector of points to label; if NULL, will use all points in the plot

A vector of labels for the points; if NULL, will use rownames of the data provided to the plot at the points selected

Use geom_text_repel to create a nicely-repelled labels; this is slow when a lot of points are being plotted. If using repel, set xnudge and ynudge to 0

Amount to nudge X and Y coordinates of labels by

Extra parameters passed to geom_text

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/visualization.R
```

Example 2 (unknown):
```unknown
LabelPoints.Rd
```

Example 3 (unknown):
```unknown
LabelPoints(
  plot,
  points,
  labels = NULL,
  repel = FALSE,
  xnudge = 0.3,
  ynudge = 0.05,
  ...
)
```

Example 4 (r):
```r
LabelPoints(
  plot,
  points,
  labels = NULL,
  repel = FALSE,
  xnudge = 0.3,
  ynudge = 0.05,
  ...
)
```

Example 5 (r):
```r
LabelPoints(
  plot,
  points,
  labels = NULL,
  repel = FALSE,
  xnudge = 0.3,
  ynudge = 0.05,
  ...
)
```

Example 6 (unknown):
```unknown
geom_text_repel
```

Example 7 (unknown):
```unknown
data("pbmc_small")
ff <- TopFeatures(object = pbmc_small[['pca']])
cc <- TopCells(object = pbmc_small[['pca']])
plot <- FeatureScatter(object = pbmc_small, feature1 = ff[1], feature2 = ff[2])
LabelPoints(plot = plot, points = cc)
```

Example 8 (r):
```r
data("pbmc_small")
ff <- TopFeatures(object = pbmc_small[['pca']])
cc <- TopCells(object = pbmc_small[['pca']])
plot <- FeatureScatter(object = pbmc_small, feature1 = ff[1], feature2 = ff[2])
LabelPoints(plot = plot, points = cc)
```

Example 9 (r):
```r
data("pbmc_small")
ff <- TopFeatures(object = pbmc_small[['pca']])
cc <- TopCells(object = pbmc_small[['pca']])
plot <- FeatureScatter(object = pbmc_small, feature1 = ff[1], feature2 = ff[2])
LabelPoints(plot = plot, points = cc)
```

---

## Calculate pearson residuals of features not in the scale.data — FetchResiduals • Seurat

**URL:** http://127.0.0.1:9173/reference_fetchresiduals.html

**Contents:**
- Calculate pearson residuals of features not in the scale.data
- Arguments
- Value
- See also
- Contents

This function calls sctransform::get_residuals.

Name of features to add into the scale.data

Name of the assay of the seurat object generated by SCTransform

Name of the assay of the seurat object containing UMI matrix and the default is RNA

Name (prefix) of the layer to pull counts from

Numeric of length two specifying the min and max values the Pearson residual will be clipped to

reference.SCT.model If a reference SCT model should be used for calculating the residuals. When set to not NULL, ignores the `SCTModel` paramater.

Recalculate residuals for all features, even if they are already present. Useful if you want to change the clip.range.

For features where there is no feature model stored, return NA for residual value in scale.data when na.rm = FALSE. When na.rm is TRUE, only return residuals for features with a model stored for all cells.

Whether to print messages and progress bars

Returns a Seurat object containing Pearson residuals of added features in its scale.data

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/preprocessing5.R
```

Example 2 (unknown):
```unknown
FetchResiduals.Rd
```

Example 3 (unknown):
```unknown
FetchResiduals(
  object,
  features,
  assay = NULL,
  umi.assay = "RNA",
  layer = "counts",
  clip.range = NULL,
  reference.SCT.model = NULL,
  replace.value = FALSE,
  na.rm = TRUE,
  verbose = TRUE
)
```

Example 4 (r):
```r
FetchResiduals(
  object,
  features,
  assay = NULL,
  umi.assay = "RNA",
  layer = "counts",
  clip.range = NULL,
  reference.SCT.model = NULL,
  replace.value = FALSE,
  na.rm = TRUE,
  verbose = TRUE
)
```

Example 5 (r):
```r
FetchResiduals(
  object,
  features,
  assay = NULL,
  umi.assay = "RNA",
  layer = "counts",
  clip.range = NULL,
  reference.SCT.model = NULL,
  replace.value = FALSE,
  na.rm = TRUE,
  verbose = TRUE
)
```

Example 6 (unknown):
```unknown
get_residuals
```

---

## Feature expression heatmap — DoHeatmap • Seurat

**URL:** http://127.0.0.1:9173/reference_doheatmap.html

**Contents:**
- Feature expression heatmap
- Arguments
- Value
- Examples
- Contents

Draws a heatmap of single cell feature expression.

A vector of features to plot, defaults to VariableFeatures(object = object)

A vector of cells to plot

A vector of variables to group cells by; pass 'ident' to group by cell identity classes

Add a color bar showing group status for cells

Colors to use for the color bar

Minimum display value (all values below are clipped)

Maximum display value (all values above are clipped); defaults to 2.5 if slot is 'scale.data', 6 otherwise

Data slot to use, choose from 'raw.data', 'data', or 'scale.data'

Label the cell identies above the color bar

Size of text above color bar

Horizontal justification of text above color bar

Vertical justification of text above color bar

Angle of text above color bar

If true, plot with geom_raster, else use geom_tile. geom_raster may look blurry on some viewing applications such as Preview due to how the raster is interpolated. Set this to FALSE if you are encountering that issue (note that plots may take longer to produce/render).

Include white lines to separate the groups

Integer number to adjust the width of the separating white lines. Corresponds to the number of "cells" between each group.

Scale the height of the color bar

Combine plots into a single patchworked ggplot object. If FALSE, return a list of ggplot objects

A patchworked ggplot object if combine = TRUE; otherwise, a list of ggplot objects

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/visualization.R
```

Example 2 (unknown):
```unknown
DoHeatmap.Rd
```

Example 3 (unknown):
```unknown
DoHeatmap(
  object,
  features = NULL,
  cells = NULL,
  group.by = "ident",
  group.bar = TRUE,
  group.colors = NULL,
  disp.min = -2.5,
  disp.max = NULL,
  slot = "scale.data",
  assay = NULL,
  label = TRUE,
  size = 5.5,
  hjust = 0,
  vjust = 0,
  angle = 45,
  raster = TRUE,
  draw.lines = TRUE,
  lines.width = NULL,
  group.bar.height = 0.02,
  combine = TRUE
)
```

Example 4 (r):
```r
DoHeatmap(
  object,
  features = NULL,
  cells = NULL,
  group.by = "ident",
  group.bar = TRUE,
  group.colors = NULL,
  disp.min = -2.5,
  disp.max = NULL,
  slot = "scale.data",
  assay = NULL,
  label = TRUE,
  size = 5.5,
  hjust = 0,
  vjust = 0,
  angle = 45,
  raster = TRUE,
  draw.lines = TRUE,
  lines.width = NULL,
  group.bar.height = 0.02,
  combine = TRUE
)
```

Example 5 (r):
```r
DoHeatmap(
  object,
  features = NULL,
  cells = NULL,
  group.by = "ident",
  group.bar = TRUE,
  group.colors = NULL,
  disp.min = -2.5,
  disp.max = NULL,
  slot = "scale.data",
  assay = NULL,
  label = TRUE,
  size = 5.5,
  hjust = 0,
  vjust = 0,
  angle = 45,
  raster = TRUE,
  draw.lines = TRUE,
  lines.width = NULL,
  group.bar.height = 0.02,
  combine = TRUE
)
```

Example 6 (unknown):
```unknown
VariableFeatures(object = object)
```

Example 7 (unknown):
```unknown
patchworked
```

Example 8 (unknown):
```unknown
patchworked
```

Example 9 (unknown):
```unknown
combine = TRUE
```

Example 10 (unknown):
```unknown
data("pbmc_small")
DoHeatmap(object = pbmc_small)
```

Example 11 (r):
```r
data("pbmc_small")
DoHeatmap(object = pbmc_small)
```

Example 12 (r):
```r
data("pbmc_small")
DoHeatmap(object = pbmc_small)
```

---

## Calculate the Barcode Distribution Inflection — CalculateBarcodeInflections • Seurat

**URL:** http://127.0.0.1:9173/reference_calculatebarcodeinflections.html

**Contents:**
- Calculate the Barcode Distribution Inflection
- Arguments
- Value
- Details
- See also
- Author
- Examples
- Contents

This function calculates an adaptive inflection point ("knee") of the barcode distribution for each sample group. This is useful for determining a threshold for removing low-quality samples.

Column to use as proxy for barcodes ("nCount_RNA" by default)

Column to group by ("orig.ident" by default)

Ignore barcodes of rank below this threshold in inflection calculation

Ignore barcodes of rank above this threshold in inflection calculation

Returns Seurat object with a new list in the `tools` slot, `CalculateBarcodeInflections` with values:

* `barcode_distribution` - contains the full barcode distribution across the entire dataset * `inflection_points` - the calculated inflection points within the thresholds * `threshold_values` - the provided (or default) threshold values to search within for inflections * `cells_pass` - the cells that pass the inflection point calculation

The function operates by calculating the slope of the barcode number vs. rank distribution, and then finding the point at which the distribution changes most steeply (the "knee"). Of note, this calculation often must be restricted as to the range at which it performs, so `threshold` parameters are provided to restrict the range of the calculation based on the rank of the barcodes. [BarcodeInflectionsPlot()] is provided as a convenience function to visualize and test different thresholds and thus provide more sensical end results.

See [BarcodeInflectionsPlot()] to visualize the calculated inflection points and [SubsetByBarcodeInflections()] to subsequently subset the Seurat object.

BarcodeInflectionsPlot SubsetByBarcodeInflections

Robert A. Amezquita, robert.amezquita@fredhutch.org

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/preprocessing.R
```

Example 2 (unknown):
```unknown
CalculateBarcodeInflections.Rd
```

Example 3 (unknown):
```unknown
CalculateBarcodeInflections(
  object,
  barcode.column = "nCount_RNA",
  group.column = "orig.ident",
  threshold.low = NULL,
  threshold.high = NULL
)
```

Example 4 (r):
```r
CalculateBarcodeInflections(
  object,
  barcode.column = "nCount_RNA",
  group.column = "orig.ident",
  threshold.low = NULL,
  threshold.high = NULL
)
```

Example 5 (r):
```r
CalculateBarcodeInflections(
  object,
  barcode.column = "nCount_RNA",
  group.column = "orig.ident",
  threshold.low = NULL,
  threshold.high = NULL
)
```

Example 6 (unknown):
```unknown
BarcodeInflectionsPlot
```

Example 7 (unknown):
```unknown
SubsetByBarcodeInflections
```

Example 8 (python):
```python
data("pbmc_small")
CalculateBarcodeInflections(pbmc_small, group.column = 'groups')
#> An object of class Seurat 
#> 230 features across 80 samples within 1 assay 
#> Active assay: RNA (230 features, 20 variable features)
#>  3 layers present: counts, data, scale.data
#>  2 dimensional reductions calculated: pca, tsne
```

Example 9 (r):
```r
data("pbmc_small")
CalculateBarcodeInflections(pbmc_small, group.column = 'groups')
#> An object of class Seurat 
#> 230 features across 80 samples within 1 assay 
#> Active assay: RNA (230 features, 20 variable features)
#>  3 layers present: counts, data, scale.data
#>  2 dimensional reductions calculated: pca, tsne
```

Example 10 (r):
```r
data("pbmc_small")
CalculateBarcodeInflections(pbmc_small, group.column = 'groups')
#> An object of class Seurat 
#> 230 features across 80 samples within 1 assay 
#> Active assay: RNA (230 features, 20 variable features)
#>  3 layers present: counts, data, scale.data
#>  2 dimensional reductions calculated: pca, tsne
```

---

## (Shared) Nearest-neighbor graph construction — FindNeighbors • Seurat

**URL:** http://127.0.0.1:9173/seurat/reference/findneighbors/index.html

**Contents:**
- (Shared) Nearest-neighbor graph construction
- Arguments
- Value
- Examples
- Contents

Computes the k.param nearest neighbors for a given dataset. Can also optionally (via compute.SNN), construct a shared nearest neighbor graph by calculating the neighborhood overlap (Jaccard index) between every cell and its k.param nearest neighbors.

Arguments passed to other methods

Matrix of data to query against object. If missing, defaults to object.

Boolean value of whether the provided matrix is a distance matrix; note, for objects of class dist, this parameter will be set automatically

Defines k for the k-nearest neighbor algorithm

Return result as Neighbor object. Not used with distance matrix input.

also compute the shared nearest neighbor graph

Sets the cutoff for acceptable Jaccard index when computing the neighborhood overlap for the SNN construction. Any edges with values less than or equal to this will be set to 0 and removed from the SNN graph. Essentially sets the stringency of pruning (0 — no pruning, 1 — prune everything).

Method for nearest neighbor finding. Options include: rann, annoy

More trees gives higher precision when using annoy approximate nearest neighbor search

Distance metric for annoy. Options include: euclidean, cosine, manhattan, and hamming

Error bound when performing nearest neighbor search using RANN; default of 0.0 implies exact nearest neighbor search

Whether or not to print output to the console

Take L2Norm of the data

Include cached index in returned Neighbor object (only relevant if return.neighbor = TRUE)

Precomputed index. Useful if querying new data against existing index to avoid recomputing.

Features to use as input for building the (S)NN; used only when dims is NULL

Reduction to use as input for building the (S)NN

Dimensions of reduction to use as input

Assay to use in construction of (S)NN; used only when dims is NULL

Plot SNN graph on tSNE coordinates

Optional naming parameter for stored (S)NN graph (or Neighbor object, if return.neighbor = TRUE). Default is assay.name_(s)nn. To store both the neighbor graph and the shared nearest neighbor (SNN) graph, you must supply a vector containing two names to the graph.name parameter. The first element in the vector will be used to store the nearest neighbor (NN) graph, and the second element used to store the SNN graph. If only one name is supplied, only the NN graph is stored.

This function can either return a Neighbor object with the KNN information or a list of Graph objects with the KNN and SNN depending on the settings of return.neighbor and compute.SNN. When running on a Seurat object, this returns the Seurat object with the Graphs or Neighbor objects stored in their respective slots. Names of the Graph or Neighbor object can be found with Graphs or Neighbors.

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/generics.R
```

Example 2 (unknown):
```unknown
R/clustering.R
```

Example 3 (unknown):
```unknown
FindNeighbors.Rd
```

Example 4 (unknown):
```unknown
compute.SNN
```

Example 5 (python):
```python
FindNeighbors(object, ...)

# Default S3 method
FindNeighbors(
  object,
  query = NULL,
  distance.matrix = FALSE,
  k.param = 20,
  return.neighbor = FALSE,
  compute.SNN = !return.neighbor,
  prune.SNN = 1/15,
  nn.method = "annoy",
  n.trees = 50,
  annoy.metric = "euclidean",
  nn.eps = 0,
  verbose = TRUE,
  l2.norm = FALSE,
  cache.index = FALSE,
  index = NULL,
  ...
)

# S3 method for class 'Assay'
FindNeighbors(
  object,
  features = NULL,
  k.param = 20,
  return.neighbor = FALSE,
  compute.SNN = !return.neighbor,
  prune.SNN = 1/15,
  nn.method = "annoy",
  n.trees = 50,
  annoy.metric = "euclidean",
  nn.eps = 0,
  verbose = TRUE,
  l2.norm = FALSE,
  cache.index = FALSE,
  ...
)

# S3 method for class 'dist'
FindNeighbors(
  object,
  k.param = 20,
  return.neighbor = FALSE,
  compute.SNN = !return.neighbor,
  prune.SNN = 1/15,
  nn.method = "annoy",
  n.trees = 50,
  annoy.metric = "euclidean",
  nn.eps = 0,
  verbose = TRUE,
  l2.norm = FALSE,
  cache.index = FALSE,
  ...
)

# S3 method for class 'Seurat'
FindNeighbors(
  object,
  reduction = "pca",
  dims = 1:10,
  assay = NULL,
  features = NULL,
  k.param = 20,
  return.neighbor = FALSE,
  compute.SNN = !return.neighbor,
  prune.SNN = 1/15,
  nn.method = "annoy",
  n.trees = 50,
  annoy.metric = "euclidean",
  nn.eps = 0,
  verbose = TRUE,
  do.plot = FALSE,
  graph.name = NULL,
  l2.norm = FALSE,
  cache.index = FALSE,
  ...
)
```

Example 6 (r):
```r
FindNeighbors(object, ...)

# Default S3 method
FindNeighbors(
  object,
  query = NULL,
  distance.matrix = FALSE,
  k.param = 20,
  return.neighbor = FALSE,
  compute.SNN = !return.neighbor,
  prune.SNN = 1/15,
  nn.method = "annoy",
  n.trees = 50,
  annoy.metric = "euclidean",
  nn.eps = 0,
  verbose = TRUE,
  l2.norm = FALSE,
  cache.index = FALSE,
  index = NULL,
  ...
)

# S3 method for class 'Assay'
FindNeighbors(
  object,
  features = NULL,
  k.param = 20,
  return.neighbor = FALSE,
  compute.SNN = !return.neighbor,
  prune.SNN = 1/15,
  nn.method = "annoy",
  n.trees = 50,
  annoy.metric = "euclidean",
  nn.eps = 0,
  verbose = TRUE,
  l2.norm = FALSE,
  cache.index = FALSE,
  ...
)

# S3 method for class 'dist'
FindNeighbors(
  object,
  k.param = 20,
  return.neighbor = FALSE,
  compute.SNN = !return.neighbor,
  prune.SNN = 1/15,
  nn.method = "annoy",
  n.trees = 50,
  annoy.metric = "euclidean",
  nn.eps = 0,
  verbose = TRUE,
  l2.norm = FALSE,
  cache.index = FALSE,
  ...
)

# S3 method for class 'Seurat'
FindNeighbors(
  object,
  reduction = "pca",
  dims = 1:10,
  assay = NULL,
  features = NULL,
  k.param = 20,
  return.neighbor = FALSE,
  compute.SNN = !return.neighbor,
  prune.SNN = 1/15,
  nn.method = "annoy",
  n.trees = 50,
  annoy.metric = "euclidean",
  nn.eps = 0,
  verbose = TRUE,
  do.plot = FALSE,
  graph.name = NULL,
  l2.norm = FALSE,
  cache.index = FALSE,
  ...
)
```

Example 7 (r):
```r
FindNeighbors(object, ...)

# Default S3 method
FindNeighbors(
  object,
  query = NULL,
  distance.matrix = FALSE,
  k.param = 20,
  return.neighbor = FALSE,
  compute.SNN = !return.neighbor,
  prune.SNN = 1/15,
  nn.method = "annoy",
  n.trees = 50,
  annoy.metric = "euclidean",
  nn.eps = 0,
  verbose = TRUE,
  l2.norm = FALSE,
  cache.index = FALSE,
  index = NULL,
  ...
)

# S3 method for class 'Assay'
FindNeighbors(
  object,
  features = NULL,
  k.param = 20,
  return.neighbor = FALSE,
  compute.SNN = !return.neighbor,
  prune.SNN = 1/15,
  nn.method = "annoy",
  n.trees = 50,
  annoy.metric = "euclidean",
  nn.eps = 0,
  verbose = TRUE,
  l2.norm = FALSE,
  cache.index = FALSE,
  ...
)

# S3 method for class 'dist'
FindNeighbors(
  object,
  k.param = 20,
  return.neighbor = FALSE,
  compute.SNN = !return.neighbor,
  prune.SNN = 1/15,
  nn.method = "annoy",
  n.trees = 50,
  annoy.metric = "euclidean",
  nn.eps = 0,
  verbose = TRUE,
  l2.norm = FALSE,
  cache.index = FALSE,
  ...
)

# S3 method for class 'Seurat'
FindNeighbors(
  object,
  reduction = "pca",
  dims = 1:10,
  assay = NULL,
  features = NULL,
  k.param = 20,
  return.neighbor = FALSE,
  compute.SNN = !return.neighbor,
  prune.SNN = 1/15,
  nn.method = "annoy",
  n.trees = 50,
  annoy.metric = "euclidean",
  nn.eps = 0,
  verbose = TRUE,
  do.plot = FALSE,
  graph.name = NULL,
  l2.norm = FALSE,
  cache.index = FALSE,
  ...
)
```

Example 8 (unknown):
```unknown
return.neighbor
```

Example 9 (unknown):
```unknown
compute.SNN
```

Example 10 (python):
```python
data("pbmc_small")
pbmc_small
#> An object of class Seurat 
#> 230 features across 80 samples within 1 assay 
#> Active assay: RNA (230 features, 20 variable features)
#>  3 layers present: counts, data, scale.data
#>  2 dimensional reductions calculated: pca, tsne
# Compute an SNN on the gene expression level
pbmc_small <- FindNeighbors(pbmc_small, features = VariableFeatures(object = pbmc_small))
#> Computing nearest neighbor graph
#> Computing SNN

# More commonly, we build the SNN on a dimensionally reduced form of the data
# such as the first 10 principle components.

pbmc_small <- FindNeighbors(pbmc_small, reduction = "pca", dims = 1:10)
#> Computing nearest neighbor graph
#> Computing SNN
```

Example 11 (r):
```r
data("pbmc_small")
pbmc_small
#> An object of class Seurat 
#> 230 features across 80 samples within 1 assay 
#> Active assay: RNA (230 features, 20 variable features)
#>  3 layers present: counts, data, scale.data
#>  2 dimensional reductions calculated: pca, tsne
# Compute an SNN on the gene expression level
pbmc_small <- FindNeighbors(pbmc_small, features = VariableFeatures(object = pbmc_small))
#> Computing nearest neighbor graph
#> Computing SNN

# More commonly, we build the SNN on a dimensionally reduced form of the data
# such as the first 10 principle components.

pbmc_small <- FindNeighbors(pbmc_small, reduction = "pca", dims = 1:10)
#> Computing nearest neighbor graph
#> Computing SNN
```

Example 12 (r):
```r
data("pbmc_small")
pbmc_small
#> An object of class Seurat 
#> 230 features across 80 samples within 1 assay 
#> Active assay: RNA (230 features, 20 variable features)
#>  3 layers present: counts, data, scale.data
#>  2 dimensional reductions calculated: pca, tsne
# Compute an SNN on the gene expression level
pbmc_small <- FindNeighbors(pbmc_small, features = VariableFeatures(object = pbmc_small))
#> Computing nearest neighbor graph
#> Computing SNN

# More commonly, we build the SNN on a dimensionally reduced form of the data
# such as the first 10 principle components.

pbmc_small <- FindNeighbors(pbmc_small, reduction = "pca", dims = 1:10)
#> Computing nearest neighbor graph
#> Computing SNN
```

---

## Get integration data — GetIntegrationData • Seurat

**URL:** http://127.0.0.1:9173/reference_getintegrationdata.html

**Contents:**
- Get integration data
- Arguments
- Value
- Contents

Name of integration object

Which slot in integration object to get

Returns data from the requested slot within the integrated object

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/objects.R
```

Example 2 (unknown):
```unknown
GetIntegrationData.Rd
```

Example 3 (unknown):
```unknown
GetIntegrationData(object, integration.name, slot)
```

Example 4 (r):
```r
GetIntegrationData(object, integration.name, slot)
```

Example 5 (r):
```r
GetIntegrationData(object, integration.name, slot)
```

---

## Compute Jackstraw scores significance. — ScoreJackStraw • Seurat

**URL:** http://127.0.0.1:9173/reference_scorejackstraw.html

**Contents:**
- Compute Jackstraw scores significance.
- Arguments
- Value
- See also
- Author
- Contents

Significant PCs should show a p-value distribution that is strongly skewed to the left compared to the null distribution. The p-value for each PC is based on a proportion test comparing the number of features with a p-value below a particular threshold (score.thresh), compared with the proportion of features expected under a uniform distribution of p-values.

Arguments passed to other methods

Which dimensions to examine

Threshold to use for the proportion test of PC significance (see Details)

Reduction associated with JackStraw to score

Show plot. To return ggplot object, use JackStrawPlot after running ScoreJackStraw.

Returns a Seurat object

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/generics.R
```

Example 2 (unknown):
```unknown
R/dimensional_reduction.R
```

Example 3 (unknown):
```unknown
ScoreJackStraw.Rd
```

Example 4 (python):
```python
ScoreJackStraw(object, ...)

# S3 method for class 'JackStrawData'
ScoreJackStraw(object, dims = 1:5, score.thresh = 1e-05, ...)

# S3 method for class 'DimReduc'
ScoreJackStraw(object, dims = 1:5, score.thresh = 1e-05, ...)

# S3 method for class 'Seurat'
ScoreJackStraw(
  object,
  reduction = "pca",
  dims = 1:5,
  score.thresh = 1e-05,
  do.plot = FALSE,
  ...
)
```

Example 5 (r):
```r
ScoreJackStraw(object, ...)

# S3 method for class 'JackStrawData'
ScoreJackStraw(object, dims = 1:5, score.thresh = 1e-05, ...)

# S3 method for class 'DimReduc'
ScoreJackStraw(object, dims = 1:5, score.thresh = 1e-05, ...)

# S3 method for class 'Seurat'
ScoreJackStraw(
  object,
  reduction = "pca",
  dims = 1:5,
  score.thresh = 1e-05,
  do.plot = FALSE,
  ...
)
```

Example 6 (r):
```r
ScoreJackStraw(object, ...)

# S3 method for class 'JackStrawData'
ScoreJackStraw(object, dims = 1:5, score.thresh = 1e-05, ...)

# S3 method for class 'DimReduc'
ScoreJackStraw(object, dims = 1:5, score.thresh = 1e-05, ...)

# S3 method for class 'Seurat'
ScoreJackStraw(
  object,
  reduction = "pca",
  dims = 1:5,
  score.thresh = 1e-05,
  do.plot = FALSE,
  ...
)
```

Example 7 (unknown):
```unknown
JackStrawPlot
```

Example 8 (unknown):
```unknown
JackStrawPlot
```

Example 9 (unknown):
```unknown
JackStrawPlot
```

---

## Calculate the variance to mean ratio of logged values — LogVMR • Seurat

**URL:** http://127.0.0.1:9173/reference_logvmr.html

**Contents:**
- Calculate the variance to mean ratio of logged values
- Arguments
- Value
- Examples
- Contents

Calculate the variance to mean ratio (VMR) in non-logspace (return answer in log-space)

Other arguments (not used)

Returns the VMR in log-space

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/utilities.R
```

Example 2 (unknown):
```unknown
LogVMR(x, ...)
```

Example 3 (r):
```r
LogVMR(x, ...)
```

Example 4 (r):
```r
LogVMR(x, ...)
```

Example 5 (unknown):
```unknown
LogVMR(x = c(1, 2, 3))
#> [1] 2.187301
```

Example 6 (r):
```r
LogVMR(x = c(1, 2, 3))
#> [1] 2.187301
```

Example 7 (r):
```r
LogVMR(x = c(1, 2, 3))
#> [1] 2.187301
```

---

## Get Image Data — GetImage.SlideSeq • Seurat

**URL:** http://127.0.0.1:9173/seurat/reference/getimage/index.html

**Contents:**
- Get Image Data
- Arguments
- See also
- Contents

How to return the image; should accept one of “grob”, “raster”, “plotly”, or “raw”

Arguments passed to other methods

SeuratObject::GetImage

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/objects.R
```

Example 2 (unknown):
```unknown
GetImage.Rd
```

Example 3 (python):
```python
# S3 method for class 'SlideSeq'
GetImage(object, mode = c("grob", "raster", "plotly", "raw"), ...)

# S3 method for class 'STARmap'
GetImage(object, mode = c("grob", "raster", "plotly", "raw"), ...)

# S3 method for class 'VisiumV1'
GetImage(object, mode = c("grob", "raster", "plotly", "raw"), ...)

# S3 method for class 'VisiumV2'
GetImage(object, mode = c("grob", "raster", "plotly", "raw"), ...)
```

Example 4 (r):
```r
# S3 method for class 'SlideSeq'
GetImage(object, mode = c("grob", "raster", "plotly", "raw"), ...)

# S3 method for class 'STARmap'
GetImage(object, mode = c("grob", "raster", "plotly", "raw"), ...)

# S3 method for class 'VisiumV1'
GetImage(object, mode = c("grob", "raster", "plotly", "raw"), ...)

# S3 method for class 'VisiumV2'
GetImage(object, mode = c("grob", "raster", "plotly", "raw"), ...)
```

Example 5 (r):
```r
# S3 method for class 'SlideSeq'
GetImage(object, mode = c("grob", "raster", "plotly", "raw"), ...)

# S3 method for class 'STARmap'
GetImage(object, mode = c("grob", "raster", "plotly", "raw"), ...)

# S3 method for class 'VisiumV1'
GetImage(object, mode = c("grob", "raster", "plotly", "raw"), ...)

# S3 method for class 'VisiumV2'
GetImage(object, mode = c("grob", "raster", "plotly", "raw"), ...)
```

Example 6 (unknown):
```unknown
SeuratObject::GetImage
```

---

## The Seurat Class — Seurat-class • Seurat

**URL:** http://127.0.0.1:9173/reference_seurat-class.html

**Contents:**
- The Seurat Class
- See also
- Contents

The Seurat object is a representation of single-cell expression data for R; for more details, please see the documentation in SeuratObject

SeuratObject::Seurat-class

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/reexports.R
```

Example 2 (unknown):
```unknown
Seurat-class.Rd
```

Example 3 (unknown):
```unknown
SeuratObject
```

Example 4 (unknown):
```unknown
SeuratObject::Seurat-class
```

---

## Convert Neighbor class to an asymmetrical Graph class — NNtoGraph • Seurat

**URL:** http://127.0.0.1:9173/seurat/reference/nntograph/index.html

**Contents:**
- Convert Neighbor class to an asymmetrical Graph class
- Arguments
- Value
- Contents

Convert Neighbor class to an asymmetrical Graph class

A neighbor class object

Cells names of the neighbors, cell names in nn.object is used by default

Determine if use distance in the Graph

Returns a Graph object

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/integration.R
```

Example 2 (unknown):
```unknown
NNtoGraph.Rd
```

Example 3 (unknown):
```unknown
NNtoGraph(nn.object, col.cells = NULL, weighted = FALSE)
```

Example 4 (r):
```r
NNtoGraph(nn.object, col.cells = NULL, weighted = FALSE)
```

Example 5 (r):
```r
NNtoGraph(nn.object, col.cells = NULL, weighted = FALSE)
```

---

## Visualize 'features' on a dimensional reduction plot — FeaturePlot • Seurat

**URL:** http://127.0.0.1:9173/seurat/reference/featureplot/index.html

**Contents:**
- Visualize 'features' on a dimensional reduction plot
- Arguments
- Value
- Note
- See also
- Examples
- Contents

Colors single cells on a dimensional reduction plot according to a 'feature' (i.e. gene expression, PC scores, number of genes detected, etc.)

Vector of features to plot. Features can come from:

An Assay feature (e.g. a gene name - "MS4A1")

A column name from meta.data (e.g. mitochondrial percentage - "percent.mito")

A column name from a DimReduc object corresponding to the cell embedding values (e.g. the PC 1 scores - "PC_1")

Dimensions to plot, must be a two-length numeric vector specifying x- and y-dimensions

Vector of cells to plot (default is all cells)

The two colors to form the gradient over. Provide as string vector with the first color corresponding to low values, the second to high. Also accepts a Brewer color scale or vector of colors. Note: this will bin the data into number of colors provided. When blend is TRUE, takes anywhere from 1-3 colors:

Treated as color for double-negatives, will use default colors 2 and 3 for per-feature expression

Treated as colors for per-feature expression, will use default color 1 for double-negatives

First color used for double-negatives, colors 2 and 3 used for per-feature expression, all others ignored

Adjust point size for plotting

Alpha value for plotting (default is 1)

Boolean determining whether to plot cells in order of expression. Can be useful if cells expressing given feature are getting buried.

Vector of minimum and maximum cutoff values for each feature, may specify quantile in the form of 'q##' where '##' is the quantile (eg, 'q1', 'q10')

Which dimensionality reduction to use. If not specified, first searches for umap, then tsne, then pca

A factor in object metadata to split the plot by, pass 'ident' to split by cell identity

How to handle the color scale across multiple plots. Options are:

“feature” (default; by row/feature scaling): The plots for each individual feature are scaled to the maximum expression of the feature across the conditions provided to split.by

“all” (universal scaling): The plots for all features and conditions are scaled to the maximum expression value for the feature with the highest overall expression

NULL (no scaling): Each individual plot is scaled to the maximum expression value of the feature in the condition provided to split.by. Be aware setting NULL will result in color scales that are not comparable between plots

If NULL, all points are circles (default). You can specify any cell attribute (that can be pulled with FetchData) allowing for both different colors and different shapes on cells. Only applicable if raster = FALSE.

Which slot to pull expression data from?

Scale and blend expression values to visualize coexpression of two features

The color cutoff from weak signal to strong signal; ranges from 0 to 1.

Whether to label the clusters

Sets the color of the label text

Number of columns to combine multiple feature plots to, ignored if split.by is not NULL

Plot cartesian coordinates with fixed aspect ratio

If splitting by a factor, plot the splits per column with the features as rows; ignored if blend = TRUE

Redundant with order. This argument is being deprecated. Please use order instead.

Launch an interactive FeaturePlot

Combine plots into a single patchworked ggplot object. If FALSE, return a list of ggplot objects

Convert points to raster format, default is NULL which automatically rasterizes if plotting more than 100,000 cells

Pixel resolution for rasterized plots, passed to geom_scattermore(). Default is c(512, 512).

A patchworked ggplot object if combine = TRUE; otherwise, a list of ggplot objects

For the old do.hover and do.identify functionality, please see HoverLocator and CellSelector, respectively.

DimPlot HoverLocator CellSelector

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/visualization.R
```

Example 2 (unknown):
```unknown
FeaturePlot.Rd
```

Example 3 (unknown):
```unknown
FeaturePlot(
  object,
  features,
  dims = c(1, 2),
  cells = NULL,
  cols = if (blend) {
     c("lightgrey", "#ff0000", "#00ff00")
 } else {
    
    c("lightgrey", "blue")
 },
  pt.size = NULL,
  alpha = 1,
  order = FALSE,
  min.cutoff = NA,
  max.cutoff = NA,
  reduction = NULL,
  split.by = NULL,
  keep.scale = "feature",
  shape.by = NULL,
  slot = "data",
  blend = FALSE,
  blend.threshold = 0.5,
  label = FALSE,
  label.size = 4,
  label.color = "black",
  repel = FALSE,
  ncol = NULL,
  coord.fixed = FALSE,
  by.col = TRUE,
  sort.cell = deprecated(),
  interactive = FALSE,
  combine = TRUE,
  raster = NULL,
  raster.dpi = c(512, 512)
)
```

Example 4 (r):
```r
FeaturePlot(
  object,
  features,
  dims = c(1, 2),
  cells = NULL,
  cols = if (blend) {
     c("lightgrey", "#ff0000", "#00ff00")
 } else {
    
    c("lightgrey", "blue")
 },
  pt.size = NULL,
  alpha = 1,
  order = FALSE,
  min.cutoff = NA,
  max.cutoff = NA,
  reduction = NULL,
  split.by = NULL,
  keep.scale = "feature",
  shape.by = NULL,
  slot = "data",
  blend = FALSE,
  blend.threshold = 0.5,
  label = FALSE,
  label.size = 4,
  label.color = "black",
  repel = FALSE,
  ncol = NULL,
  coord.fixed = FALSE,
  by.col = TRUE,
  sort.cell = deprecated(),
  interactive = FALSE,
  combine = TRUE,
  raster = NULL,
  raster.dpi = c(512, 512)
)
```

Example 5 (r):
```r
FeaturePlot(
  object,
  features,
  dims = c(1, 2),
  cells = NULL,
  cols = if (blend) {
     c("lightgrey", "#ff0000", "#00ff00")
 } else {
    
    c("lightgrey", "blue")
 },
  pt.size = NULL,
  alpha = 1,
  order = FALSE,
  min.cutoff = NA,
  max.cutoff = NA,
  reduction = NULL,
  split.by = NULL,
  keep.scale = "feature",
  shape.by = NULL,
  slot = "data",
  blend = FALSE,
  blend.threshold = 0.5,
  label = FALSE,
  label.size = 4,
  label.color = "black",
  repel = FALSE,
  ncol = NULL,
  coord.fixed = FALSE,
  by.col = TRUE,
  sort.cell = deprecated(),
  interactive = FALSE,
  combine = TRUE,
  raster = NULL,
  raster.dpi = c(512, 512)
)
```

Example 6 (unknown):
```unknown
raster = FALSE
```

Example 7 (unknown):
```unknown
blend = TRUE
```

Example 8 (unknown):
```unknown
FeaturePlot
```

Example 9 (unknown):
```unknown
patchworked
```

Example 10 (unknown):
```unknown
patchworked
```

Example 11 (unknown):
```unknown
combine = TRUE
```

Example 12 (unknown):
```unknown
do.identify
```

Example 13 (unknown):
```unknown
HoverLocator
```

Example 14 (unknown):
```unknown
CellSelector
```

Example 15 (unknown):
```unknown
HoverLocator
```

Example 16 (unknown):
```unknown
CellSelector
```

Example 17 (unknown):
```unknown
data("pbmc_small")
FeaturePlot(object = pbmc_small, features = 'PC_1')
```

Example 18 (r):
```r
data("pbmc_small")
FeaturePlot(object = pbmc_small, features = 'PC_1')
```

Example 19 (r):
```r
data("pbmc_small")
FeaturePlot(object = pbmc_small, features = 'PC_1')
```

---

## Run UMAP — RunUMAP • Seurat

**URL:** http://127.0.0.1:9173/seurat/reference/runumap/index.html

**Contents:**
- Run UMAP
- Arguments
- Value
- References
- Examples
- Contents

Runs the Uniform Manifold Approximation and Projection (UMAP) dimensional reduction technique. To run using umap.method="umap-learn", you must first install the umap-learn python package (e.g. via pip install umap-learn). Details on this package can be found here: https://github.com/lmcinnes/umap. For a more in depth discussion of the mathematics underlying UMAP, see the ArXiv paper here: https://arxiv.org/abs/1802.03426.

Arguments passed to other methods and UMAP

dimensional reduction key, specifies the string before the number for the dimension names. UMAP by default

Assay to pull data for when using features, or assay used to construct Graph if running UMAP on a Graph

DimReduc object that contains the umap model

whether UMAP will return the uwot model

UMAP implementation to run. Can be

Runs umap via the uwot R package

Runs umap via the uwot R package and return the learned umap model

Run the Seurat wrapper of the python umap-learn package

This determines the number of neighboring points used in local approximations of manifold structure. Larger values will result in more global structure being preserved at the loss of detailed local structure. In general this parameter should often be in the range 5 to 50.

The dimension of the space to embed into.

metric: This determines the choice of metric used to measure distance in the input space. A wide variety of metrics are already coded, and a user defined function can be passed as long as it has been JITd by numba.

he number of training epochs to be used in optimizing the low dimensional embedding. Larger values result in more accurate embeddings. If NULL is specified, a value will be selected based on the size of the input dataset (200 for large datasets, 500 for small).

The initial learning rate for the embedding optimization.

This controls how tightly the embedding is allowed compress points together. Larger values ensure embedded points are more evenly distributed, while smaller values allow the algorithm to optimize more accurately with regard to local structure. Sensible values are in the range 0.001 to 0.5.

The effective scale of embedded points. In combination with min.dist this determines how clustered/clumped the embedded points are.

Interpolate between (fuzzy) union and intersection as the set operation used to combine local fuzzy simplicial sets to obtain a global fuzzy simplicial sets. Both fuzzy set operations use the product t-norm. The value of this parameter should be between 0.0 and 1.0; a value of 1.0 will use a pure fuzzy union, while 0.0 will use a pure fuzzy intersection.

The local connectivity required - i.e. the number of nearest neighbors that should be assumed to be connected at a local level. The higher this value the more connected the manifold becomes locally. In practice this should be not more than the local intrinsic dimension of the manifold.

Weighting applied to negative samples in low dimensional embedding optimization. Values higher than one will result in greater weight being given to negative samples.

The number of negative samples to select per positive sample in the optimization process. Increasing this value will result in greater repulsive force being applied, greater optimization cost, but slightly more accuracy.

More specific parameters controlling the embedding. If NULL, these values are set automatically as determined by min. dist and spread. Parameter of differentiable approximation of right adjoint functor.

More specific parameters controlling the embedding. If NULL, these values are set automatically as determined by min. dist and spread. Parameter of differentiable approximation of right adjoint functor.

Set uwot::umap(fast_sgd = TRUE); see umap for more details

Set a random seed. By default, sets the seed to 42. Setting NULL will not set a seed

A dictionary of arguments to pass on to the metric, such as the p value for Minkowski distance. If NULL then no arguments are passed on.

Whether to use an angular random projection forest to initialize the approximate nearest neighbor search. This can be faster, but is mostly on useful for metric that use an angular style distance such as cosine, correlation etc. In the case of those metrics angular forests will be chosen automatically.

Whether to use the density-augmented objective of densMAP. Turning on this option generates an embedding where the local densities are encouraged to be correlated with those in the original space. Parameters below with the prefix ‘dens’ further control the behavior of this extension. Default is FALSE. Only compatible with 'umap-learn' method and version of umap-learn >= 0.5.0

Specific parameter which controls the regularization weight of the density correlation term in densMAP. Higher values prioritize density preservation over the UMAP objective, and vice versa for values closer to zero. Setting this parameter to zero is equivalent to running the original UMAP algorithm. Default value is 2.

Specific parameter which controls the fraction of epochs (between 0 and 1) where the density-augmented objective is used in densMAP. The first (1 - dens_frac) fraction of epochs optimize the original UMAP objective before introducing the density correlation term. Default is 0.3.

Specific parameter which specifies a small constant added to the variance of local radii in the embedding when calculating the density correlation objective to prevent numerical instability from dividing by a small number. Default is 0.1.

A dictionary of arguments to pass on to the densMAP optimization.

Which dimensions to use as input features, used only if features is NULL

Which dimensional reduction (PCA or ICA) to use for the UMAP input. Default is PCA

If set, run UMAP on this subset of features (instead of running on a set of reduced dimensions). Not set (NULL) by default; dims must be NULL to run on features

Name of graph on which to run UMAP

Name of knn output on which to run UMAP

The slot used to pull data for when using features. data slot is by default.

Name to store dimensional reduction under in the Seurat object

Returns a Seurat object containing a UMAP representation

McInnes, L, Healy, J, UMAP: Uniform Manifold Approximation and Projection for Dimension Reduction, ArXiv e-prints 1802.03426, 2018

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/generics.R
```

Example 2 (unknown):
```unknown
R/dimensional_reduction.R
```

Example 3 (unknown):
```unknown
umap.method="umap-learn"
```

Example 4 (unknown):
```unknown
pip install umap-learn
```

Example 5 (python):
```python
RunUMAP(object, ...)

# Default S3 method
RunUMAP(
  object,
  reduction.key = "UMAP_",
  assay = NULL,
  reduction.model = NULL,
  return.model = FALSE,
  umap.method = "uwot",
  n.neighbors = 30L,
  n.components = 2L,
  metric = "cosine",
  n.epochs = NULL,
  learning.rate = 1,
  min.dist = 0.3,
  spread = 1,
  set.op.mix.ratio = 1,
  local.connectivity = 1L,
  repulsion.strength = 1,
  negative.sample.rate = 5,
  a = NULL,
  b = NULL,
  uwot.sgd = FALSE,
  seed.use = 42,
  metric.kwds = NULL,
  angular.rp.forest = FALSE,
  densmap = FALSE,
  dens.lambda = 2,
  dens.frac = 0.3,
  dens.var.shift = 0.1,
  verbose = TRUE,
  ...
)

# S3 method for class 'Graph'
RunUMAP(
  object,
  assay = NULL,
  umap.method = "umap-learn",
  n.components = 2L,
  metric = "correlation",
  n.epochs = 0L,
  learning.rate = 1,
  min.dist = 0.3,
  spread = 1,
  repulsion.strength = 1,
  negative.sample.rate = 5L,
  a = NULL,
  b = NULL,
  uwot.sgd = FALSE,
  seed.use = 42L,
  metric.kwds = NULL,
  densmap = FALSE,
  densmap.kwds = NULL,
  verbose = TRUE,
  reduction.key = "UMAP_",
  ...
)

# S3 method for class 'Neighbor'
RunUMAP(object, reduction.model, ...)

# S3 method for class 'Seurat'
RunUMAP(
  object,
  dims = NULL,
  reduction = "pca",
  features = NULL,
  graph = NULL,
  assay = DefaultAssay(object = object),
  nn.name = NULL,
  slot = "data",
  umap.method = "uwot",
  reduction.model = NULL,
  return.model = FALSE,
  n.neighbors = 30L,
  n.components = 2L,
  metric = "cosine",
  n.epochs = NULL,
  learning.rate = 1,
  min.dist = 0.3,
  spread = 1,
  set.op.mix.ratio = 1,
  local.connectivity = 1L,
  repulsion.strength = 1,
  negative.sample.rate = 5L,
  a = NULL,
  b = NULL,
  uwot.sgd = FALSE,
  seed.use = 42L,
  metric.kwds = NULL,
  angular.rp.forest = FALSE,
  densmap = FALSE,
  dens.lambda = 2,
  dens.frac = 0.3,
  dens.var.shift = 0.1,
  verbose = TRUE,
  reduction.name = "umap",
  reduction.key = NULL,
  ...
)
```

Example 6 (r):
```r
RunUMAP(object, ...)

# Default S3 method
RunUMAP(
  object,
  reduction.key = "UMAP_",
  assay = NULL,
  reduction.model = NULL,
  return.model = FALSE,
  umap.method = "uwot",
  n.neighbors = 30L,
  n.components = 2L,
  metric = "cosine",
  n.epochs = NULL,
  learning.rate = 1,
  min.dist = 0.3,
  spread = 1,
  set.op.mix.ratio = 1,
  local.connectivity = 1L,
  repulsion.strength = 1,
  negative.sample.rate = 5,
  a = NULL,
  b = NULL,
  uwot.sgd = FALSE,
  seed.use = 42,
  metric.kwds = NULL,
  angular.rp.forest = FALSE,
  densmap = FALSE,
  dens.lambda = 2,
  dens.frac = 0.3,
  dens.var.shift = 0.1,
  verbose = TRUE,
  ...
)

# S3 method for class 'Graph'
RunUMAP(
  object,
  assay = NULL,
  umap.method = "umap-learn",
  n.components = 2L,
  metric = "correlation",
  n.epochs = 0L,
  learning.rate = 1,
  min.dist = 0.3,
  spread = 1,
  repulsion.strength = 1,
  negative.sample.rate = 5L,
  a = NULL,
  b = NULL,
  uwot.sgd = FALSE,
  seed.use = 42L,
  metric.kwds = NULL,
  densmap = FALSE,
  densmap.kwds = NULL,
  verbose = TRUE,
  reduction.key = "UMAP_",
  ...
)

# S3 method for class 'Neighbor'
RunUMAP(object, reduction.model, ...)

# S3 method for class 'Seurat'
RunUMAP(
  object,
  dims = NULL,
  reduction = "pca",
  features = NULL,
  graph = NULL,
  assay = DefaultAssay(object = object),
  nn.name = NULL,
  slot = "data",
  umap.method = "uwot",
  reduction.model = NULL,
  return.model = FALSE,
  n.neighbors = 30L,
  n.components = 2L,
  metric = "cosine",
  n.epochs = NULL,
  learning.rate = 1,
  min.dist = 0.3,
  spread = 1,
  set.op.mix.ratio = 1,
  local.connectivity = 1L,
  repulsion.strength = 1,
  negative.sample.rate = 5L,
  a = NULL,
  b = NULL,
  uwot.sgd = FALSE,
  seed.use = 42L,
  metric.kwds = NULL,
  angular.rp.forest = FALSE,
  densmap = FALSE,
  dens.lambda = 2,
  dens.frac = 0.3,
  dens.var.shift = 0.1,
  verbose = TRUE,
  reduction.name = "umap",
  reduction.key = NULL,
  ...
)
```

Example 7 (r):
```r
RunUMAP(object, ...)

# Default S3 method
RunUMAP(
  object,
  reduction.key = "UMAP_",
  assay = NULL,
  reduction.model = NULL,
  return.model = FALSE,
  umap.method = "uwot",
  n.neighbors = 30L,
  n.components = 2L,
  metric = "cosine",
  n.epochs = NULL,
  learning.rate = 1,
  min.dist = 0.3,
  spread = 1,
  set.op.mix.ratio = 1,
  local.connectivity = 1L,
  repulsion.strength = 1,
  negative.sample.rate = 5,
  a = NULL,
  b = NULL,
  uwot.sgd = FALSE,
  seed.use = 42,
  metric.kwds = NULL,
  angular.rp.forest = FALSE,
  densmap = FALSE,
  dens.lambda = 2,
  dens.frac = 0.3,
  dens.var.shift = 0.1,
  verbose = TRUE,
  ...
)

# S3 method for class 'Graph'
RunUMAP(
  object,
  assay = NULL,
  umap.method = "umap-learn",
  n.components = 2L,
  metric = "correlation",
  n.epochs = 0L,
  learning.rate = 1,
  min.dist = 0.3,
  spread = 1,
  repulsion.strength = 1,
  negative.sample.rate = 5L,
  a = NULL,
  b = NULL,
  uwot.sgd = FALSE,
  seed.use = 42L,
  metric.kwds = NULL,
  densmap = FALSE,
  densmap.kwds = NULL,
  verbose = TRUE,
  reduction.key = "UMAP_",
  ...
)

# S3 method for class 'Neighbor'
RunUMAP(object, reduction.model, ...)

# S3 method for class 'Seurat'
RunUMAP(
  object,
  dims = NULL,
  reduction = "pca",
  features = NULL,
  graph = NULL,
  assay = DefaultAssay(object = object),
  nn.name = NULL,
  slot = "data",
  umap.method = "uwot",
  reduction.model = NULL,
  return.model = FALSE,
  n.neighbors = 30L,
  n.components = 2L,
  metric = "cosine",
  n.epochs = NULL,
  learning.rate = 1,
  min.dist = 0.3,
  spread = 1,
  set.op.mix.ratio = 1,
  local.connectivity = 1L,
  repulsion.strength = 1,
  negative.sample.rate = 5L,
  a = NULL,
  b = NULL,
  uwot.sgd = FALSE,
  seed.use = 42L,
  metric.kwds = NULL,
  angular.rp.forest = FALSE,
  densmap = FALSE,
  dens.lambda = 2,
  dens.frac = 0.3,
  dens.var.shift = 0.1,
  verbose = TRUE,
  reduction.name = "umap",
  reduction.key = NULL,
  ...
)
```

Example 8 (unknown):
```unknown
uwot::umap(fast_sgd = TRUE)
```

Example 9 (unknown):
```unknown
if (FALSE) { # \dontrun{
data("pbmc_small")
pbmc_small
# Run UMAP map on first 5 PCs
pbmc_small <- RunUMAP(object = pbmc_small, dims = 1:5)
# Plot results
DimPlot(object = pbmc_small, reduction = 'umap')
} # }
```

Example 10 (r):
```r
if (FALSE) { # \dontrun{
data("pbmc_small")
pbmc_small
# Run UMAP map on first 5 PCs
pbmc_small <- RunUMAP(object = pbmc_small, dims = 1:5)
# Plot results
DimPlot(object = pbmc_small, reduction = 'umap')
} # }
```

Example 11 (r):
```r
if (FALSE) { # \dontrun{
data("pbmc_small")
pbmc_small
# Run UMAP map on first 5 PCs
pbmc_small <- RunUMAP(object = pbmc_small, dims = 1:5)
# Plot results
DimPlot(object = pbmc_small, reduction = 'umap')
} # }
```

---

## Automagically calculate a point size for ggplot2-based scatter plots — AutoPointSize • Seurat

**URL:** http://127.0.0.1:9173/reference_autopointsize.html

**Contents:**
- Automagically calculate a point size for ggplot2-based scatter plots
- Arguments
- Value
- Examples
- Contents

It happens to look good

A data frame being passed to ggplot2

If TRUE, point size is set to 1

The "optimal" point size for visualizing these data

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/visualization.R
```

Example 2 (unknown):
```unknown
AutoPointSize.Rd
```

Example 3 (unknown):
```unknown
AutoPointSize(data, raster = NULL)
```

Example 4 (r):
```r
AutoPointSize(data, raster = NULL)
```

Example 5 (r):
```r
AutoPointSize(data, raster = NULL)
```

Example 6 (unknown):
```unknown
df <- data.frame(x = rnorm(n = 10000), y = runif(n = 10000))
AutoPointSize(data = df)
#> [1] 0.1583
```

Example 7 (r):
```r
df <- data.frame(x = rnorm(n = 10000), y = runif(n = 10000))
AutoPointSize(data = df)
#> [1] 0.1583
```

Example 8 (r):
```r
df <- data.frame(x = rnorm(n = 10000), y = runif(n = 10000))
AutoPointSize(data = df)
#> [1] 0.1583
```

---

## Function to prepare data for Linear Discriminant Analysis. — PrepLDA • Seurat

**URL:** http://127.0.0.1:9173/seurat/reference/preplda/index.html

**Contents:**
- Function to prepare data for Linear Discriminant Analysis.
- Arguments
- Value
- Contents

This function performs unsupervised PCA on each mixscape class separately and projects each subspace onto all cells in the data.

An object of class Seurat.

Assay to use for selection of DE genes.

Assay to use for running Principle components analysis.

Meta data column with target gene class labels.

Name of non-targeting cell class.

Number of principle components to use.

Limit testing to genes which show, on average, at least X-fold difference (log-scale) between the two groups of cells. Default is 0.25. Increasing logfc.threshold speeds up the function, but can miss weaker signals.

Returns a list of the first 10 PCs from each projection.

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/mixscape.R
```

Example 2 (unknown):
```unknown
PrepLDA(
  object,
  de.assay = "RNA",
  pc.assay = "PRTB",
  labels = "gene",
  nt.label = "NT",
  npcs = 10,
  verbose = TRUE,
  logfc.threshold = 0.25
)
```

Example 3 (r):
```r
PrepLDA(
  object,
  de.assay = "RNA",
  pc.assay = "PRTB",
  labels = "gene",
  nt.label = "NT",
  npcs = 10,
  verbose = TRUE,
  logfc.threshold = 0.25
)
```

Example 4 (r):
```r
PrepLDA(
  object,
  de.assay = "RNA",
  pc.assay = "PRTB",
  labels = "gene",
  nt.label = "NT",
  npcs = 10,
  verbose = TRUE,
  logfc.threshold = 0.25
)
```

---

## L2-Normalize CCA — L2CCA • Seurat

**URL:** http://127.0.0.1:9173/seurat/reference/l2cca/index.html

**Contents:**
- L2-Normalize CCA
- Arguments
- Contents

Perform l2 normalization on CCs

Additional parameters to L2Dim.

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/dimensional_reduction.R
```

Example 2 (unknown):
```unknown
L2CCA(object, ...)
```

Example 3 (r):
```r
L2CCA(object, ...)
```

Example 4 (r):
```r
L2CCA(object, ...)
```

---

## Find transfer anchors — FindTransferAnchors • Seurat

**URL:** http://127.0.0.1:9173/seurat/reference/findtransferanchors/index.html

**Contents:**
- Find transfer anchors
- Arguments
- Value
- Details
- References
- Examples
- Contents

Find a set of anchors between a reference and query object. These anchors can later be used to transfer data from the reference to query object using the TransferData object.

Seurat object to use as the reference

Seurat object to use as the query

Name of normalization method used: LogNormalize or SCT.

If using SCT as a normalization method, compute query Pearson residuals using the reference SCT model parameters.

Name of the Assay to use from reference

Name of the Neighbor to use from the reference. Optionally enables reuse of precomputed neighbors.

Name of the Assay to use from query

Dimensional reduction to perform when finding anchors. Options are:

pcaproject: Project the PCA from the reference onto the query. We recommend using PCA when reference and query datasets are from scRNA-seq

lsiproject: Project the LSI from the reference onto the query. We recommend using LSI when reference and query datasets are from scATAC-seq. This requires that LSI has been computed for the reference dataset, and the same features (eg, peaks or genome bins) are present in both the reference and query. See RunTFIDF and RunSVD

rpca: Project the PCA from the reference onto the query, and the PCA from the query onto the reference (reciprocal PCA projection).

cca: Run a CCA on the reference and query

Name of dimensional reduction to use from the reference if running the pcaproject workflow. Optionally enables reuse of precomputed reference dimensional reduction. If NULL (default), use a PCA computed on the reference object.

Project the PCA from the query dataset onto the reference. Use only in rare cases where the query dataset has a much larger cell number, but the reference dataset has a unique assay for transfer. In this case, the default features will be set to the variable features of the query object that are alos present in the reference.

Features to use for dimensional reduction. If not specified, set as variable features of the reference object which are also present in the query.

Number of PCs to compute on reference if reference.reduction is not provided.

Perform L2 normalization on the cell embeddings after dimensional reduction

Which dimensions to use from the reduction to specify the neighbor search space

How many neighbors (k) to use when finding anchors

How many neighbors (k) to use when filtering anchors. Set to NA to turn off filtering.

How many neighbors (k) to use when scoring anchors

The maximum number of features to use when specifying the neighborhood search space in the anchor filtering

Method for nearest neighbor finding. Options include: rann, annoy

More trees gives higher precision when using annoy approximate nearest neighbor search

Error bound on the neighbor finding algorithm (from RANN or RcppAnnoy)

Use truncated singular value decomposition to approximate PCA

Compute and store nearest k query neighbors in the AnchorSet object that is returned. You can optionally set this if you plan on computing the mapping score and want to enable reuse of some downstream neighbor calculations to make the mapping score function more efficient.

Print progress bars and output

Returns an AnchorSet object that can be used as input to TransferData, IntegrateEmbeddings and MapQuery. The dimension reduction used for finding anchors is stored in the AnchorSet object and can be used for computing anchor weights in downstream functions. Note that only the requested dimensions are stored in the dimension reduction object in the AnchorSet. This means that if dims=2:20 is used, for example, the dimension of the stored reduction is 1:19.

The main steps of this procedure are outlined below. For a more detailed description of the methodology, please see Stuart, Butler, et al Cell 2019. doi:10.1016/j.cell.2019.05.031 ; doi:10.1101/460147

Perform dimensional reduction. Exactly what is done here depends on the values set for the reduction and project.query parameters. If reduction = "pcaproject", a PCA is performed on either the reference (if project.query = FALSE) or the query (if project.query = TRUE), using the features specified. The data from the other dataset is then projected onto this learned PCA structure. If reduction = "cca", then CCA is performed on the reference and query for this dimensional reduction step. If reduction = "lsiproject", the stored LSI dimension reduction in the reference object is used to project the query dataset onto the reference. If l2.norm is set to TRUE, perform L2 normalization of the embedding vectors.

Identify anchors between the reference and query - pairs of cells from each dataset that are contained within each other's neighborhoods (also known as mutual nearest neighbors).

Filter low confidence anchors to ensure anchors in the low dimension space are in broad agreement with the high dimensional measurements. This is done by looking at the neighbors of each query cell in the reference dataset using max.features to define this space. If the reference cell isn't found within the first k.filter neighbors, remove the anchor.

Assign each remaining anchor a score. For each anchor cell, determine the nearest k.score anchors within its own dataset and within its pair's dataset. Based on these neighborhoods, construct an overall neighbor graph and then compute the shared neighbor overlap between anchor and query cells (analogous to an SNN graph). We use the 0.01 and 0.90 quantiles on these scores to dampen outlier effects and rescale to range between 0-1.

Stuart T, Butler A, et al. Comprehensive Integration of Single-Cell Data. Cell. 2019;177:1888-1902 doi:10.1016/j.cell.2019.05.031 ;

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/integration.R
```

Example 2 (unknown):
```unknown
FindTransferAnchors.Rd
```

Example 3 (unknown):
```unknown
TransferData
```

Example 4 (unknown):
```unknown
FindTransferAnchors(
  reference,
  query,
  normalization.method = "LogNormalize",
  recompute.residuals = TRUE,
  reference.assay = NULL,
  reference.neighbors = NULL,
  query.assay = NULL,
  reduction = "pcaproject",
  reference.reduction = NULL,
  project.query = FALSE,
  features = NULL,
  scale = TRUE,
  npcs = 30,
  l2.norm = TRUE,
  dims = 1:30,
  k.anchor = 5,
  k.filter = NA,
  k.score = 30,
  max.features = 200,
  nn.method = "annoy",
  n.trees = 50,
  eps = 0,
  approx.pca = TRUE,
  mapping.score.k = NULL,
  verbose = TRUE
)
```

Example 5 (r):
```r
FindTransferAnchors(
  reference,
  query,
  normalization.method = "LogNormalize",
  recompute.residuals = TRUE,
  reference.assay = NULL,
  reference.neighbors = NULL,
  query.assay = NULL,
  reduction = "pcaproject",
  reference.reduction = NULL,
  project.query = FALSE,
  features = NULL,
  scale = TRUE,
  npcs = 30,
  l2.norm = TRUE,
  dims = 1:30,
  k.anchor = 5,
  k.filter = NA,
  k.score = 30,
  max.features = 200,
  nn.method = "annoy",
  n.trees = 50,
  eps = 0,
  approx.pca = TRUE,
  mapping.score.k = NULL,
  verbose = TRUE
)
```

Example 6 (r):
```r
FindTransferAnchors(
  reference,
  query,
  normalization.method = "LogNormalize",
  recompute.residuals = TRUE,
  reference.assay = NULL,
  reference.neighbors = NULL,
  query.assay = NULL,
  reduction = "pcaproject",
  reference.reduction = NULL,
  project.query = FALSE,
  features = NULL,
  scale = TRUE,
  npcs = 30,
  l2.norm = TRUE,
  dims = 1:30,
  k.anchor = 5,
  k.filter = NA,
  k.score = 30,
  max.features = 200,
  nn.method = "annoy",
  n.trees = 50,
  eps = 0,
  approx.pca = TRUE,
  mapping.score.k = NULL,
  verbose = TRUE
)
```

Example 7 (unknown):
```unknown
TransferData
```

Example 8 (unknown):
```unknown
IntegrateEmbeddings
```

Example 9 (unknown):
```unknown
project.query
```

Example 10 (unknown):
```unknown
reduction = "pcaproject"
```

Example 11 (unknown):
```unknown
project.query = FALSE
```

Example 12 (unknown):
```unknown
project.query = TRUE
```

Example 13 (unknown):
```unknown
reduction = "cca"
```

Example 14 (unknown):
```unknown
reduction = "lsiproject"
```

Example 15 (unknown):
```unknown
max.features
```

Example 16 (python):
```python
if (FALSE) { # \dontrun{
# to install the SeuratData package see https://github.com/satijalab/seurat-data
library(SeuratData)
data("pbmc3k")

# for demonstration, split the object into reference and query
pbmc.reference <- pbmc3k[, 1:1350]
pbmc.query <- pbmc3k[, 1351:2700]

# perform standard preprocessing on each object
pbmc.reference <- NormalizeData(pbmc.reference)
pbmc.reference <- FindVariableFeatures(pbmc.reference)
pbmc.reference <- ScaleData(pbmc.reference)

pbmc.query <- NormalizeData(pbmc.query)
pbmc.query <- FindVariableFeatures(pbmc.query)
pbmc.query <- ScaleData(pbmc.query)

# find anchors
anchors <- FindTransferAnchors(reference = pbmc.reference, query = pbmc.query)

# transfer labels
predictions <- TransferData(
  anchorset = anchors,
  refdata = pbmc.reference$seurat_annotations
)
pbmc.query <- AddMetaData(object = pbmc.query, metadata = predictions)
} # }
```

Example 17 (r):
```r
if (FALSE) { # \dontrun{
# to install the SeuratData package see https://github.com/satijalab/seurat-data
library(SeuratData)
data("pbmc3k")

# for demonstration, split the object into reference and query
pbmc.reference <- pbmc3k[, 1:1350]
pbmc.query <- pbmc3k[, 1351:2700]

# perform standard preprocessing on each object
pbmc.reference <- NormalizeData(pbmc.reference)
pbmc.reference <- FindVariableFeatures(pbmc.reference)
pbmc.reference <- ScaleData(pbmc.reference)

pbmc.query <- NormalizeData(pbmc.query)
pbmc.query <- FindVariableFeatures(pbmc.query)
pbmc.query <- ScaleData(pbmc.query)

# find anchors
anchors <- FindTransferAnchors(reference = pbmc.reference, query = pbmc.query)

# transfer labels
predictions <- TransferData(
  anchorset = anchors,
  refdata = pbmc.reference$seurat_annotations
)
pbmc.query <- AddMetaData(object = pbmc.query, metadata = predictions)
} # }
```

Example 18 (r):
```r
if (FALSE) { # \dontrun{
# to install the SeuratData package see https://github.com/satijalab/seurat-data
library(SeuratData)
data("pbmc3k")

# for demonstration, split the object into reference and query
pbmc.reference <- pbmc3k[, 1:1350]
pbmc.query <- pbmc3k[, 1351:2700]

# perform standard preprocessing on each object
pbmc.reference <- NormalizeData(pbmc.reference)
pbmc.reference <- FindVariableFeatures(pbmc.reference)
pbmc.reference <- ScaleData(pbmc.reference)

pbmc.query <- NormalizeData(pbmc.query)
pbmc.query <- FindVariableFeatures(pbmc.query)
pbmc.query <- ScaleData(pbmc.query)

# find anchors
anchors <- FindTransferAnchors(reference = pbmc.reference, query = pbmc.query)

# transfer labels
predictions <- TransferData(
  anchorset = anchors,
  refdata = pbmc.reference$seurat_annotations
)
pbmc.query <- AddMetaData(object = pbmc.query, metadata = predictions)
} # }
```

---

## Get Spot Radius — Radius.SlideSeq • Seurat

**URL:** http://127.0.0.1:9173/seurat/reference/radius/index.html

**Contents:**
- Get Spot Radius
- Arguments
- See also
- Contents

Arguments passed to other methods

A factor to scale the radius by; one of: "hires", "lowres", or NULL for the unscaled value.

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/objects.R
```

Example 2 (python):
```python
# S3 method for class 'SlideSeq'
Radius(object, ...)

# S3 method for class 'STARmap'
Radius(object, ...)

# S3 method for class 'VisiumV1'
Radius(object, scale = "lowres", ...)

# S3 method for class 'VisiumV1'
Radius(object, scale = "lowres", ...)
```

Example 3 (r):
```r
# S3 method for class 'SlideSeq'
Radius(object, ...)

# S3 method for class 'STARmap'
Radius(object, ...)

# S3 method for class 'VisiumV1'
Radius(object, scale = "lowres", ...)

# S3 method for class 'VisiumV1'
Radius(object, scale = "lowres", ...)
```

Example 4 (r):
```r
# S3 method for class 'SlideSeq'
Radius(object, ...)

# S3 method for class 'STARmap'
Radius(object, ...)

# S3 method for class 'VisiumV1'
Radius(object, scale = "lowres", ...)

# S3 method for class 'VisiumV1'
Radius(object, scale = "lowres", ...)
```

Example 5 (unknown):
```unknown
SeuratObject::Radius
```

---

## Project full data to the sketch assay — ProjectData • Seurat

**URL:** http://127.0.0.1:9173/reference_projectdata.html

**Contents:**
- Project full data to the sketch assay
- Arguments
- Value
- Contents

This function allows projection of high-dimensional single-cell RNA expression data from a full dataset onto the lower-dimensional embedding of the sketch of the dataset.

Assay name for the full data. Default is 'RNA'.

Sketched assay name to project onto. Default is 'sketch'.

Dimensional reduction results of the sketched assay to project onto.

Dimensional reduction name for the projected full dataset.

Dimensions to include in the projection.

Normalization method to use. Can be 'LogNormalize' or 'SCT'. Default is 'LogNormalize'.

An optional list for label transfer from sketch to full data. Default is NULL. Similar to refdata in `MapQuery`

Number of neighbors to consider when weighting labels for transfer. Default is 50.

An optional pre-computed UMAP model. Default is NULL.

Whether to recompute the neighbors for label transfer. Default is FALSE.

Whether to recompute the weights for label transfer. Default is FALSE.

Print progress and diagnostic messages.

A Seurat object with the full data projected onto the sketched dimensional reduction results. The projected data are stored in the specified full reduction.

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/sketching.R
```

Example 2 (unknown):
```unknown
ProjectData.Rd
```

Example 3 (unknown):
```unknown
ProjectData(
  object,
  assay = "RNA",
  sketched.assay = "sketch",
  sketched.reduction,
  full.reduction,
  dims,
  normalization.method = c("LogNormalize", "SCT"),
  refdata = NULL,
  k.weight = 50,
  umap.model = NULL,
  recompute.neighbors = FALSE,
  recompute.weights = FALSE,
  verbose = TRUE
)
```

Example 4 (r):
```r
ProjectData(
  object,
  assay = "RNA",
  sketched.assay = "sketch",
  sketched.reduction,
  full.reduction,
  dims,
  normalization.method = c("LogNormalize", "SCT"),
  refdata = NULL,
  k.weight = 50,
  umap.model = NULL,
  recompute.neighbors = FALSE,
  recompute.weights = FALSE,
  verbose = TRUE
)
```

Example 5 (r):
```r
ProjectData(
  object,
  assay = "RNA",
  sketched.assay = "sketch",
  sketched.reduction,
  full.reduction,
  dims,
  normalization.method = c("LogNormalize", "SCT"),
  refdata = NULL,
  k.weight = 50,
  umap.model = NULL,
  recompute.neighbors = FALSE,
  recompute.weights = FALSE,
  verbose = TRUE
)
```

---

## Predict value from nearest neighbors — PredictAssay • Seurat

**URL:** http://127.0.0.1:9173/reference_predictassay.html

**Contents:**
- Predict value from nearest neighbors
- Arguments
- Value
- Contents

This function will predict expression or cell embeddings from its k nearest neighbors index. For each cell, it will average its k neighbors value to get its new imputed value. It can average expression value in assays and cell embeddings from dimensional reductions.

The object used to calculate knn

k near neighbor indices. A cells x k matrix.

Assay used for prediction

Cell embedding of the reduction used for prediction

Number of dimensions of cell embedding

Return an assay or a predicted matrix

slot used for prediction

features used for prediction

the function used to calculate row mean

Sets the random seed to check if the nearest neighbor is query cell

return an assay containing predicted expression value in the data slot

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/clustering.R
```

Example 2 (unknown):
```unknown
PredictAssay.Rd
```

Example 3 (unknown):
```unknown
PredictAssay(
  object,
  nn.idx,
  assay,
  reduction = NULL,
  dims = NULL,
  return.assay = TRUE,
  slot = "scale.data",
  features = NULL,
  mean.function = rowMeans,
  seed = 4273,
  verbose = TRUE
)
```

Example 4 (r):
```r
PredictAssay(
  object,
  nn.idx,
  assay,
  reduction = NULL,
  dims = NULL,
  return.assay = TRUE,
  slot = "scale.data",
  features = NULL,
  mean.function = rowMeans,
  seed = 4273,
  verbose = TRUE
)
```

Example 5 (r):
```r
PredictAssay(
  object,
  nn.idx,
  assay,
  reduction = NULL,
  dims = NULL,
  return.assay = TRUE,
  slot = "scale.data",
  features = NULL,
  mean.function = rowMeans,
  seed = 4273,
  verbose = TRUE
)
```

---

## Find variable features — FindVariableFeatures • Seurat

**URL:** http://127.0.0.1:9173/seurat/reference/findvariablefeatures/index.html

**Contents:**
- Find variable features
- Arguments
- Details
- Contents

Identifies features that are outliers on a 'mean variability plot'.

Arguments passed to other methods

How to choose top variable features. Choose one of :

“vst”: First, fits a line to the relationship of log(variance) and log(mean) using local polynomial regression (loess). Then standardizes the feature values using the observed mean and expected variance (given by the fitted line). Feature variance is then calculated on the standardized values after clipping to a maximum (see clip.max parameter).

“mean.var.plot” (mvp): First, uses a function to calculate average expression (mean.function) and dispersion (dispersion.function) for each feature. Next, divides features into num.bin (default 20) bins based on their average expression, and calculates z-scores for dispersion within each bin. The purpose of this is to identify variable features while controlling for the strong relationship between variability and average expression

“dispersion” (disp): selects the genes with the highest dispersion values

(vst method) Loess span parameter used when fitting the variance-mean relationship

(vst method) After standardization values larger than clip.max will be set to clip.max; default is 'auto' which sets this value to the square root of the number of cells

Function to compute x-axis value (average expression). Default is to take the mean of the detected (i.e. non-zero) values

Function to compute y-axis value (dispersion). Default is to take the standard deviation of all values

Total number of bins to use in the scaled analysis (default is 20)

Specifies how the bins should be computed. Available methods are:

“equal_width”: each bin is of equal width along the x-axis (default)

“equal_frequency”: each bin contains an equal number of features (can increase statistical power to detect overdispersed features at high expression values, at the cost of reduced resolution along the x-axis)

show progress bar for calculations

Number of features to select as top variable features; only used when selection.method is set to 'dispersion' or 'vst'

A two-length numeric vector with low- and high-cutoffs for feature means

A two-length numeric vector with low- and high-cutoffs for feature dispersions

For the mean.var.plot method: Exact parameter settings may vary empirically from dataset to dataset, and based on visual inspection of the plot. Setting the y.cutoff parameter to 2 identifies features that are more than two standard deviations away from the average dispersion within a bin. The default X-axis function is the mean expression level, and for Y-axis it is the log(Variance/mean). All mean/variance calculations are not performed in log-space, but the results are reported in log-space - see relevant functions for exact details.

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/generics.R
```

Example 2 (unknown):
```unknown
R/preprocessing.R
```

Example 3 (unknown):
```unknown
FindVariableFeatures.Rd
```

Example 4 (python):
```python
FindVariableFeatures(object, ...)

# S3 method for class 'V3Matrix'
FindVariableFeatures(
  object,
  selection.method = "vst",
  loess.span = 0.3,
  clip.max = "auto",
  mean.function = FastExpMean,
  dispersion.function = FastLogVMR,
  num.bin = 20,
  binning.method = "equal_width",
  verbose = TRUE,
  ...
)

# S3 method for class 'Assay'
FindVariableFeatures(
  object,
  selection.method = "vst",
  loess.span = 0.3,
  clip.max = "auto",
  mean.function = FastExpMean,
  dispersion.function = FastLogVMR,
  num.bin = 20,
  binning.method = "equal_width",
  nfeatures = 2000,
  mean.cutoff = c(0.1, 8),
  dispersion.cutoff = c(1, Inf),
  verbose = TRUE,
  ...
)

# S3 method for class 'SCTAssay'
FindVariableFeatures(object, nfeatures = 2000, ...)

# S3 method for class 'Seurat'
FindVariableFeatures(
  object,
  assay = NULL,
  selection.method = "vst",
  loess.span = 0.3,
  clip.max = "auto",
  mean.function = FastExpMean,
  dispersion.function = FastLogVMR,
  num.bin = 20,
  binning.method = "equal_width",
  nfeatures = 2000,
  mean.cutoff = c(0.1, 8),
  dispersion.cutoff = c(1, Inf),
  verbose = TRUE,
  ...
)
```

Example 5 (r):
```r
FindVariableFeatures(object, ...)

# S3 method for class 'V3Matrix'
FindVariableFeatures(
  object,
  selection.method = "vst",
  loess.span = 0.3,
  clip.max = "auto",
  mean.function = FastExpMean,
  dispersion.function = FastLogVMR,
  num.bin = 20,
  binning.method = "equal_width",
  verbose = TRUE,
  ...
)

# S3 method for class 'Assay'
FindVariableFeatures(
  object,
  selection.method = "vst",
  loess.span = 0.3,
  clip.max = "auto",
  mean.function = FastExpMean,
  dispersion.function = FastLogVMR,
  num.bin = 20,
  binning.method = "equal_width",
  nfeatures = 2000,
  mean.cutoff = c(0.1, 8),
  dispersion.cutoff = c(1, Inf),
  verbose = TRUE,
  ...
)

# S3 method for class 'SCTAssay'
FindVariableFeatures(object, nfeatures = 2000, ...)

# S3 method for class 'Seurat'
FindVariableFeatures(
  object,
  assay = NULL,
  selection.method = "vst",
  loess.span = 0.3,
  clip.max = "auto",
  mean.function = FastExpMean,
  dispersion.function = FastLogVMR,
  num.bin = 20,
  binning.method = "equal_width",
  nfeatures = 2000,
  mean.cutoff = c(0.1, 8),
  dispersion.cutoff = c(1, Inf),
  verbose = TRUE,
  ...
)
```

Example 6 (r):
```r
FindVariableFeatures(object, ...)

# S3 method for class 'V3Matrix'
FindVariableFeatures(
  object,
  selection.method = "vst",
  loess.span = 0.3,
  clip.max = "auto",
  mean.function = FastExpMean,
  dispersion.function = FastLogVMR,
  num.bin = 20,
  binning.method = "equal_width",
  verbose = TRUE,
  ...
)

# S3 method for class 'Assay'
FindVariableFeatures(
  object,
  selection.method = "vst",
  loess.span = 0.3,
  clip.max = "auto",
  mean.function = FastExpMean,
  dispersion.function = FastLogVMR,
  num.bin = 20,
  binning.method = "equal_width",
  nfeatures = 2000,
  mean.cutoff = c(0.1, 8),
  dispersion.cutoff = c(1, Inf),
  verbose = TRUE,
  ...
)

# S3 method for class 'SCTAssay'
FindVariableFeatures(object, nfeatures = 2000, ...)

# S3 method for class 'Seurat'
FindVariableFeatures(
  object,
  assay = NULL,
  selection.method = "vst",
  loess.span = 0.3,
  clip.max = "auto",
  mean.function = FastExpMean,
  dispersion.function = FastLogVMR,
  num.bin = 20,
  binning.method = "equal_width",
  nfeatures = 2000,
  mean.cutoff = c(0.1, 8),
  dispersion.cutoff = c(1, Inf),
  verbose = TRUE,
  ...
)
```

Example 7 (unknown):
```unknown
mean.var.plot
```

Example 8 (unknown):
```unknown
equal_width
```

Example 9 (unknown):
```unknown
equal_frequency
```

Example 10 (unknown):
```unknown
selection.method
```

Example 11 (unknown):
```unknown
'dispersion'
```

---

## Get nearest neighbors for given cell — TopNeighbors • Seurat

**URL:** http://127.0.0.1:9173/seurat/reference/topneighbors/index.html

**Contents:**
- Get nearest neighbors for given cell
- Arguments
- Value
- Contents

Return a vector of cell names of the nearest n cells.

Number of neighbors to return

Returns a vector of cell names

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/objects.R
```

Example 2 (unknown):
```unknown
TopNeighbors.Rd
```

Example 3 (unknown):
```unknown
TopNeighbors(object, cell, n = 5)
```

Example 4 (r):
```r
TopNeighbors(object, cell, n = 5)
```

Example 5 (r):
```r
TopNeighbors(object, cell, n = 5)
```

---

## Finds markers that are conserved between the groups — FindConservedMarkers • Seurat

**URL:** http://127.0.0.1:9173/seurat/reference/findconservedmarkers/index.html

**Contents:**
- Finds markers that are conserved between the groups
- Arguments
- Value
- Examples
- Contents

Finds markers that are conserved between the groups

Identity class to define markers for

A second identity class for comparison. If NULL (default) - use all other cells for comparison.

of assay to fetch data for (default is RNA)

Slot to pull data from; note that if test.use is "negbinom", "poisson", or "DESeq2", slot will be set to "counts"

Minimum number of cells in one of the groups

method for combining p-values. Should be a function from the metap package (NOTE: pass the function, not a string)

Print a progress bar once expression testing begins

parameters to pass to FindMarkers

data.frame containing a ranked list of putative conserved markers, and associated statistics (p-values within each group and a combined p-value (such as Fishers combined p-value or others from the metap package), percentage of cells expressing the marker, average differences). Name of group is appended to each associated output column (e.g. CTRL_p_val). If only one group is tested in the grouping.var, max and combined p-values are not returned.

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/differential_expression.R
```

Example 2 (unknown):
```unknown
FindConservedMarkers.Rd
```

Example 3 (unknown):
```unknown
FindConservedMarkers(
  object,
  ident.1,
  ident.2 = NULL,
  grouping.var,
  assay = "RNA",
  slot = "data",
  min.cells.group = 3,
  meta.method = metap::minimump,
  verbose = TRUE,
  ...
)
```

Example 4 (r):
```r
FindConservedMarkers(
  object,
  ident.1,
  ident.2 = NULL,
  grouping.var,
  assay = "RNA",
  slot = "data",
  min.cells.group = 3,
  meta.method = metap::minimump,
  verbose = TRUE,
  ...
)
```

Example 5 (r):
```r
FindConservedMarkers(
  object,
  ident.1,
  ident.2 = NULL,
  grouping.var,
  assay = "RNA",
  slot = "data",
  min.cells.group = 3,
  meta.method = metap::minimump,
  verbose = TRUE,
  ...
)
```

Example 6 (unknown):
```unknown
if (FALSE) { # \dontrun{
data("pbmc_small")
pbmc_small
# Create a simulated grouping variable
pbmc_small[['groups']] <- sample(x = c('g1', 'g2'), size = ncol(x = pbmc_small), replace = TRUE)
FindConservedMarkers(pbmc_small, ident.1 = 0, ident.2 = 1, grouping.var = "groups")
} # }
```

Example 7 (r):
```r
if (FALSE) { # \dontrun{
data("pbmc_small")
pbmc_small
# Create a simulated grouping variable
pbmc_small[['groups']] <- sample(x = c('g1', 'g2'), size = ncol(x = pbmc_small), replace = TRUE)
FindConservedMarkers(pbmc_small, ident.1 = 0, ident.2 = 1, grouping.var = "groups")
} # }
```

Example 8 (r):
```r
if (FALSE) { # \dontrun{
data("pbmc_small")
pbmc_small
# Create a simulated grouping variable
pbmc_small[['groups']] <- sample(x = c('g1', 'g2'), size = ncol(x = pbmc_small), replace = TRUE)
FindConservedMarkers(pbmc_small, ident.1 = 0, ident.2 = 1, grouping.var = "groups")
} # }
```

---

## (Shared) Nearest-neighbor graph construction — FindNeighbors • Seurat

**URL:** http://127.0.0.1:9173/reference_findneighbors.html

**Contents:**
- (Shared) Nearest-neighbor graph construction
- Arguments
- Value
- Examples
- Contents

Computes the k.param nearest neighbors for a given dataset. Can also optionally (via compute.SNN), construct a shared nearest neighbor graph by calculating the neighborhood overlap (Jaccard index) between every cell and its k.param nearest neighbors.

Arguments passed to other methods

Matrix of data to query against object. If missing, defaults to object.

Boolean value of whether the provided matrix is a distance matrix; note, for objects of class dist, this parameter will be set automatically

Defines k for the k-nearest neighbor algorithm

Return result as Neighbor object. Not used with distance matrix input.

also compute the shared nearest neighbor graph

Sets the cutoff for acceptable Jaccard index when computing the neighborhood overlap for the SNN construction. Any edges with values less than or equal to this will be set to 0 and removed from the SNN graph. Essentially sets the stringency of pruning (0 — no pruning, 1 — prune everything).

Method for nearest neighbor finding. Options include: rann, annoy

More trees gives higher precision when using annoy approximate nearest neighbor search

Distance metric for annoy. Options include: euclidean, cosine, manhattan, and hamming

Error bound when performing nearest neighbor search using RANN; default of 0.0 implies exact nearest neighbor search

Whether or not to print output to the console

Take L2Norm of the data

Include cached index in returned Neighbor object (only relevant if return.neighbor = TRUE)

Precomputed index. Useful if querying new data against existing index to avoid recomputing.

Features to use as input for building the (S)NN; used only when dims is NULL

Reduction to use as input for building the (S)NN

Dimensions of reduction to use as input

Assay to use in construction of (S)NN; used only when dims is NULL

Plot SNN graph on tSNE coordinates

Optional naming parameter for stored (S)NN graph (or Neighbor object, if return.neighbor = TRUE). Default is assay.name_(s)nn. To store both the neighbor graph and the shared nearest neighbor (SNN) graph, you must supply a vector containing two names to the graph.name parameter. The first element in the vector will be used to store the nearest neighbor (NN) graph, and the second element used to store the SNN graph. If only one name is supplied, only the NN graph is stored.

This function can either return a Neighbor object with the KNN information or a list of Graph objects with the KNN and SNN depending on the settings of return.neighbor and compute.SNN. When running on a Seurat object, this returns the Seurat object with the Graphs or Neighbor objects stored in their respective slots. Names of the Graph or Neighbor object can be found with Graphs or Neighbors.

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/generics.R
```

Example 2 (unknown):
```unknown
R/clustering.R
```

Example 3 (unknown):
```unknown
FindNeighbors.Rd
```

Example 4 (unknown):
```unknown
compute.SNN
```

Example 5 (python):
```python
FindNeighbors(object, ...)

# Default S3 method
FindNeighbors(
  object,
  query = NULL,
  distance.matrix = FALSE,
  k.param = 20,
  return.neighbor = FALSE,
  compute.SNN = !return.neighbor,
  prune.SNN = 1/15,
  nn.method = "annoy",
  n.trees = 50,
  annoy.metric = "euclidean",
  nn.eps = 0,
  verbose = TRUE,
  l2.norm = FALSE,
  cache.index = FALSE,
  index = NULL,
  ...
)

# S3 method for class 'Assay'
FindNeighbors(
  object,
  features = NULL,
  k.param = 20,
  return.neighbor = FALSE,
  compute.SNN = !return.neighbor,
  prune.SNN = 1/15,
  nn.method = "annoy",
  n.trees = 50,
  annoy.metric = "euclidean",
  nn.eps = 0,
  verbose = TRUE,
  l2.norm = FALSE,
  cache.index = FALSE,
  ...
)

# S3 method for class 'dist'
FindNeighbors(
  object,
  k.param = 20,
  return.neighbor = FALSE,
  compute.SNN = !return.neighbor,
  prune.SNN = 1/15,
  nn.method = "annoy",
  n.trees = 50,
  annoy.metric = "euclidean",
  nn.eps = 0,
  verbose = TRUE,
  l2.norm = FALSE,
  cache.index = FALSE,
  ...
)

# S3 method for class 'Seurat'
FindNeighbors(
  object,
  reduction = "pca",
  dims = 1:10,
  assay = NULL,
  features = NULL,
  k.param = 20,
  return.neighbor = FALSE,
  compute.SNN = !return.neighbor,
  prune.SNN = 1/15,
  nn.method = "annoy",
  n.trees = 50,
  annoy.metric = "euclidean",
  nn.eps = 0,
  verbose = TRUE,
  do.plot = FALSE,
  graph.name = NULL,
  l2.norm = FALSE,
  cache.index = FALSE,
  ...
)
```

Example 6 (r):
```r
FindNeighbors(object, ...)

# Default S3 method
FindNeighbors(
  object,
  query = NULL,
  distance.matrix = FALSE,
  k.param = 20,
  return.neighbor = FALSE,
  compute.SNN = !return.neighbor,
  prune.SNN = 1/15,
  nn.method = "annoy",
  n.trees = 50,
  annoy.metric = "euclidean",
  nn.eps = 0,
  verbose = TRUE,
  l2.norm = FALSE,
  cache.index = FALSE,
  index = NULL,
  ...
)

# S3 method for class 'Assay'
FindNeighbors(
  object,
  features = NULL,
  k.param = 20,
  return.neighbor = FALSE,
  compute.SNN = !return.neighbor,
  prune.SNN = 1/15,
  nn.method = "annoy",
  n.trees = 50,
  annoy.metric = "euclidean",
  nn.eps = 0,
  verbose = TRUE,
  l2.norm = FALSE,
  cache.index = FALSE,
  ...
)

# S3 method for class 'dist'
FindNeighbors(
  object,
  k.param = 20,
  return.neighbor = FALSE,
  compute.SNN = !return.neighbor,
  prune.SNN = 1/15,
  nn.method = "annoy",
  n.trees = 50,
  annoy.metric = "euclidean",
  nn.eps = 0,
  verbose = TRUE,
  l2.norm = FALSE,
  cache.index = FALSE,
  ...
)

# S3 method for class 'Seurat'
FindNeighbors(
  object,
  reduction = "pca",
  dims = 1:10,
  assay = NULL,
  features = NULL,
  k.param = 20,
  return.neighbor = FALSE,
  compute.SNN = !return.neighbor,
  prune.SNN = 1/15,
  nn.method = "annoy",
  n.trees = 50,
  annoy.metric = "euclidean",
  nn.eps = 0,
  verbose = TRUE,
  do.plot = FALSE,
  graph.name = NULL,
  l2.norm = FALSE,
  cache.index = FALSE,
  ...
)
```

Example 7 (r):
```r
FindNeighbors(object, ...)

# Default S3 method
FindNeighbors(
  object,
  query = NULL,
  distance.matrix = FALSE,
  k.param = 20,
  return.neighbor = FALSE,
  compute.SNN = !return.neighbor,
  prune.SNN = 1/15,
  nn.method = "annoy",
  n.trees = 50,
  annoy.metric = "euclidean",
  nn.eps = 0,
  verbose = TRUE,
  l2.norm = FALSE,
  cache.index = FALSE,
  index = NULL,
  ...
)

# S3 method for class 'Assay'
FindNeighbors(
  object,
  features = NULL,
  k.param = 20,
  return.neighbor = FALSE,
  compute.SNN = !return.neighbor,
  prune.SNN = 1/15,
  nn.method = "annoy",
  n.trees = 50,
  annoy.metric = "euclidean",
  nn.eps = 0,
  verbose = TRUE,
  l2.norm = FALSE,
  cache.index = FALSE,
  ...
)

# S3 method for class 'dist'
FindNeighbors(
  object,
  k.param = 20,
  return.neighbor = FALSE,
  compute.SNN = !return.neighbor,
  prune.SNN = 1/15,
  nn.method = "annoy",
  n.trees = 50,
  annoy.metric = "euclidean",
  nn.eps = 0,
  verbose = TRUE,
  l2.norm = FALSE,
  cache.index = FALSE,
  ...
)

# S3 method for class 'Seurat'
FindNeighbors(
  object,
  reduction = "pca",
  dims = 1:10,
  assay = NULL,
  features = NULL,
  k.param = 20,
  return.neighbor = FALSE,
  compute.SNN = !return.neighbor,
  prune.SNN = 1/15,
  nn.method = "annoy",
  n.trees = 50,
  annoy.metric = "euclidean",
  nn.eps = 0,
  verbose = TRUE,
  do.plot = FALSE,
  graph.name = NULL,
  l2.norm = FALSE,
  cache.index = FALSE,
  ...
)
```

Example 8 (unknown):
```unknown
return.neighbor
```

Example 9 (unknown):
```unknown
compute.SNN
```

Example 10 (python):
```python
data("pbmc_small")
pbmc_small
#> An object of class Seurat 
#> 230 features across 80 samples within 1 assay 
#> Active assay: RNA (230 features, 20 variable features)
#>  3 layers present: counts, data, scale.data
#>  2 dimensional reductions calculated: pca, tsne
# Compute an SNN on the gene expression level
pbmc_small <- FindNeighbors(pbmc_small, features = VariableFeatures(object = pbmc_small))
#> Computing nearest neighbor graph
#> Computing SNN

# More commonly, we build the SNN on a dimensionally reduced form of the data
# such as the first 10 principle components.

pbmc_small <- FindNeighbors(pbmc_small, reduction = "pca", dims = 1:10)
#> Computing nearest neighbor graph
#> Computing SNN
```

Example 11 (r):
```r
data("pbmc_small")
pbmc_small
#> An object of class Seurat 
#> 230 features across 80 samples within 1 assay 
#> Active assay: RNA (230 features, 20 variable features)
#>  3 layers present: counts, data, scale.data
#>  2 dimensional reductions calculated: pca, tsne
# Compute an SNN on the gene expression level
pbmc_small <- FindNeighbors(pbmc_small, features = VariableFeatures(object = pbmc_small))
#> Computing nearest neighbor graph
#> Computing SNN

# More commonly, we build the SNN on a dimensionally reduced form of the data
# such as the first 10 principle components.

pbmc_small <- FindNeighbors(pbmc_small, reduction = "pca", dims = 1:10)
#> Computing nearest neighbor graph
#> Computing SNN
```

Example 12 (r):
```r
data("pbmc_small")
pbmc_small
#> An object of class Seurat 
#> 230 features across 80 samples within 1 assay 
#> Active assay: RNA (230 features, 20 variable features)
#>  3 layers present: counts, data, scale.data
#>  2 dimensional reductions calculated: pca, tsne
# Compute an SNN on the gene expression level
pbmc_small <- FindNeighbors(pbmc_small, features = VariableFeatures(object = pbmc_small))
#> Computing nearest neighbor graph
#> Computing SNN

# More commonly, we build the SNN on a dimensionally reduced form of the data
# such as the first 10 principle components.

pbmc_small <- FindNeighbors(pbmc_small, reduction = "pca", dims = 1:10)
#> Computing nearest neighbor graph
#> Computing SNN
```

---

## Subset an AnchorSet object — subset.AnchorSet • Seurat

**URL:** http://127.0.0.1:9173/reference_subset.anchorset.html

**Contents:**
- Subset an AnchorSet object
- Arguments
- Value
- Contents

Subset an AnchorSet object

object to be subsetted.

Only anchor pairs with scores greater than this value are retained.

Remove any anchors formed between the provided pairs. E.g. list(c(1, 5), c(1, 2)) filters out any anchors between datasets 1 and 5 and datasets 1 and 2.

Provide a binary matrix specifying whether a dataset pair is allowable (1) or not (0). Should be a dataset x dataset matrix.

Grouping variable to determine allowable ident pairs

Remove any anchors formed between provided ident pairs. E.g. list(c("CD4", "CD8"), c("B-cell", "T-cell"))

Provide a binary matrix specifying whether an ident pair is allowable (1) or not (0). Should be an ident x ident symmetric matrix

further arguments to be passed to or from other methods.

Returns an AnchorSet object with specified anchors filtered out

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/objects.R
```

Example 2 (unknown):
```unknown
subset.AnchorSet.Rd
```

Example 3 (python):
```python
# S3 method for class 'AnchorSet'
subset(
  x,
  score.threshold = NULL,
  disallowed.dataset.pairs = NULL,
  dataset.matrix = NULL,
  group.by = NULL,
  disallowed.ident.pairs = NULL,
  ident.matrix = NULL,
  ...
)
```

Example 4 (r):
```r
# S3 method for class 'AnchorSet'
subset(
  x,
  score.threshold = NULL,
  disallowed.dataset.pairs = NULL,
  dataset.matrix = NULL,
  group.by = NULL,
  disallowed.ident.pairs = NULL,
  ident.matrix = NULL,
  ...
)
```

Example 5 (r):
```r
# S3 method for class 'AnchorSet'
subset(
  x,
  score.threshold = NULL,
  disallowed.dataset.pairs = NULL,
  dataset.matrix = NULL,
  group.by = NULL,
  disallowed.ident.pairs = NULL,
  ident.matrix = NULL,
  ...
)
```

Example 6 (unknown):
```unknown
list(c(1, 5), c(1, 2))
```

Example 7 (unknown):
```unknown
list(c("CD4", "CD8"), c("B-cell", "T-cell"))
```

---

## Read and Load MERFISH Input from Vizgen — ReadVizgen • Seurat

**URL:** http://127.0.0.1:9173/seurat/reference/readvizgen/index.html

**Contents:**
- Read and Load MERFISH Input from Vizgen
- Arguments
- Value
- Note
- Progress Updates with progressr
- Parallelization with future
- Contents

Read and load in MERFISH data from Vizgen-formatted files

Path to the directory with Vizgen MERFISH files; requires at least one of the following files present:

“cell_by_gene.csv”: used for reading count matrix

“cell_metadata.csv”: used for reading cell spatial coordinate matrices

“detected_transcripts.csv”: used for reading molecule spatial coordinate matrices

Optional file path for counts matrix; pass NA to suppress reading counts matrix

Optional file path for spatial metadata; pass NA to suppress reading spatial coordinates. If spatial is provided and type is “segmentations”, uses dirname(spatial) instead of data.dir to find HDF5 files

Optional file path for molecule coordinates file; pass NA to suppress reading spatial molecule information

Type of cell spatial coordinate matrices to read; choose one or more of:

“segmentations”: cell segmentation vertices; requires hdf5r to be installed and requires a directory “cell_boundaries” within data.dir. Within “cell_boundaries”, there must be one or more HDF5 file named “feature_data_##.hdf5”

“centroids”: cell centroids in micron coordinate space

“boxes”: cell box outlines in micron coordinate space

Type of molecule spatial coordinate matrices to read; choose one or more of:

“pixels”: molecule coordinates in pixel space

“microns”: molecule coordinates in micron space

Type of available metadata to read; choose zero or more of:

“volume”: estimated cell volume

A character to filter molecules by, pass NA to skip molecule filtering

Z-index to load; must be between 0 and 6, inclusive

Name to store expression matrix as

ReadVizgen: A list with some combination of the following values:

“transcripts”: a sparse matrix with expression data; cells are columns and features are rows

“segmentations”: a data frame with cell polygon outlines in three columns: “x”, “y”, and “cell”

“centroids”: a data frame with cell centroid coordinates in three columns: “x”, “y”, and “cell”

“boxes”: a data frame with cell box outlines in three columns: “x”, “y”, and “cell”

“microns”: a data frame with molecule micron coordinates in three columns: “x”, “y”, and “gene”

“pixels”: a data frame with molecule pixel coordinates in three columns: “x”, “y”, and “gene”

“metadata”: a data frame with the cell-level metadata requested by metadata

LoadVizgen: A Seurat object

This function requires the data.table package to be installed

This function uses progressr to render status updates and progress bars. To enable progress updates, wrap the function call in with_progress or run handlers(global = TRUE) before running this function. For more details about progressr, please read vignette("progressr-intro")

This function uses future to enable parallelization. Parallelization strategies can be set using plan. Common plans include “sequential” for non-parallelized processing or “multisession” for parallel evaluation using multiple R sessions; for other plans, see the “Implemented evaluation strategies” section of ?future::plan. For a more thorough introduction to future, see vignette("future-1-overview")

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/preprocessing.R
```

Example 2 (unknown):
```unknown
R/convenience.R
```

Example 3 (unknown):
```unknown
ReadVizgen.Rd
```

Example 4 (python):
```python
ReadVizgen(
  data.dir,
  transcripts = NULL,
  spatial = NULL,
  molecules = NULL,
  type = "segmentations",
  mol.type = "microns",
  metadata = NULL,
  filter = NA_character_,
  z = 3L
)

LoadVizgen(data.dir, fov, assay = "Vizgen", z = 3L)
```

Example 5 (r):
```r
ReadVizgen(
  data.dir,
  transcripts = NULL,
  spatial = NULL,
  molecules = NULL,
  type = "segmentations",
  mol.type = "microns",
  metadata = NULL,
  filter = NA_character_,
  z = 3L
)

LoadVizgen(data.dir, fov, assay = "Vizgen", z = 3L)
```

Example 6 (r):
```r
ReadVizgen(
  data.dir,
  transcripts = NULL,
  spatial = NULL,
  molecules = NULL,
  type = "segmentations",
  mol.type = "microns",
  metadata = NULL,
  filter = NA_character_,
  z = 3L
)

LoadVizgen(data.dir, fov, assay = "Vizgen", z = 3L)
```

Example 7 (unknown):
```unknown
cell_by_gene.csv
```

Example 8 (python):
```python
cell_metadata.csv
```

Example 9 (unknown):
```unknown
detected_transcripts.csv
```

Example 10 (unknown):
```unknown
dirname(spatial)
```

Example 11 (unknown):
```unknown
cell_boundaries
```

Example 12 (unknown):
```unknown
cell_boundaries
```

Example 13 (unknown):
```unknown
feature_data_##.hdf5
```

Example 14 (unknown):
```unknown
transcripts
```

Example 15 (unknown):
```unknown
segmentations
```

Example 16 (unknown):
```unknown
with_progress
```

Example 17 (unknown):
```unknown
handlers(global = TRUE)
```

Example 18 (unknown):
```unknown
vignette("progressr-intro")
```

Example 19 (unknown):
```unknown
multisession
```

Example 20 (unknown):
```unknown
?future::plan
```

Example 21 (unknown):
```unknown
vignette("future-1-overview")
```

---

## The TransferAnchorSet Class — TransferAnchorSet-class • Seurat

**URL:** http://127.0.0.1:9173/reference_transferanchorset-class.html

**Contents:**
- The TransferAnchorSet Class
- Contents

Inherits from the Anchorset class. Implemented mainly for method dispatch purposes. See AnchorSet for slot details.

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/objects.R
```

Example 2 (unknown):
```unknown
TransferAnchorSet-class.Rd
```

---

## Gene expression markers of identity classes — FindMarkers • Seurat

**URL:** http://127.0.0.1:9173/seurat/reference/findmarkers/index.html

**Contents:**
- Gene expression markers of identity classes
- Arguments
- Value
- Details
- References
- See also
- Examples
- Contents

Finds markers (differentially expressed genes) for identity classes

Arguments passed to other methods and to specific DE methods

Slot to pull data from; note that if test.use is "negbinom", "poisson", or "DESeq2", slot will be set to "counts"

Vector of cell names belonging to group 1

Vector of cell names belonging to group 2

Genes to test. Default is to use all genes

Limit testing to genes which show, on average, at least X-fold difference (log-scale) between the two groups of cells. Default is 0.1 Increasing logfc.threshold speeds up the function, but can miss weaker signals. If the slot parameter is "scale.data" no filtering is performed.

Denotes which test to use. Available options are:

"wilcox" : Identifies differentially expressed genes between two groups of cells using a Wilcoxon Rank Sum test (default); will use a fast implementation by Presto if installed

"wilcox_limma" : Identifies differentially expressed genes between two groups of cells using the limma implementation of the Wilcoxon Rank Sum test; set this option to reproduce results from Seurat v4

"bimod" : Likelihood-ratio test for single cell gene expression, (McDavid et al., Bioinformatics, 2013)

"roc" : Identifies 'markers' of gene expression using ROC analysis. For each gene, evaluates (using AUC) a classifier built on that gene alone, to classify between two groups of cells. An AUC value of 1 means that expression values for this gene alone can perfectly classify the two groupings (i.e. Each of the cells in cells.1 exhibit a higher level than each of the cells in cells.2). An AUC value of 0 also means there is perfect classification, but in the other direction. A value of 0.5 implies that the gene has no predictive power to classify the two groups. Returns a 'predictive power' (abs(AUC-0.5) * 2) ranked matrix of putative differentially expressed genes.

"t" : Identify differentially expressed genes between two groups of cells using the Student's t-test.

"negbinom" : Identifies differentially expressed genes between two groups of cells using a negative binomial generalized linear model. Use only for UMI-based datasets

"poisson" : Identifies differentially expressed genes between two groups of cells using a poisson generalized linear model. Use only for UMI-based datasets

"LR" : Uses a logistic regression framework to determine differentially expressed genes. Constructs a logistic regression model predicting group membership based on each feature individually and compares this to a null model with a likelihood ratio test.

"MAST" : Identifies differentially expressed genes between two groups of cells using a hurdle model tailored to scRNA-seq data. Utilizes the MAST package to run the DE testing.

"DESeq2" : Identifies differentially expressed genes between two groups of cells based on a model using DESeq2 which uses a negative binomial distribution (Love et al, Genome Biology, 2014).This test does not support pre-filtering of genes based on average difference (or percent detection rate) between cell groups. However, genes may be pre-filtered based on their minimum detection rate (min.pct) across both cell groups. To use this method, please install DESeq2, using the instructions at https://bioconductor.org/packages/release/bioc/html/DESeq2.html

only test genes that are detected in a minimum fraction of min.pct cells in either of the two populations. Meant to speed up the function by not testing genes that are very infrequently expressed. Default is 0.01

only test genes that show a minimum difference in the fraction of detection between the two groups. Set to -Inf by default

Print a progress bar once expression testing begins

Only return positive markers (FALSE by default)

Down sample each identity class to a max number. Default is no downsampling. Not activated by default (set to Inf)

Random seed for downsampling

Variables to test, used only when test.use is one of 'LR', 'negbinom', 'poisson', or 'MAST'

Minimum number of cells expressing the feature in at least one of the two groups, currently only used for poisson and negative binomial tests

Minimum number of cells in one of the groups

data.frame from FoldChange

Convert the sparse matrix to a dense form before running the DE test. This can provide speedups but might require higher memory; default is FALSE

Slot used to calculate fold-change - will also affect the default for mean.fxn, see below for more details.

Pseudocount to add to averaged expression values when calculating logFC. 1 by default.

Normalization method for fold change calculation when slot is “data”

Function to use for fold change or average difference calculation. The default depends on the the value of fc.slot:

"counts" : difference in the log of the mean counts, with pseudocount.

"data" : difference in the log of the average exponentiated data, with pseudocount. This adjusts for differences in sequencing depth between cells, and assumes that "data" has been log-normalized.

"scale.data" : difference in the means of scale.data.

Name of the fold change, average difference, or custom function column in the output data.frame. If NULL, the fold change column will be named according to the logarithm base (eg, "avg_log2FC"), or if using the scale.data slot "avg_diff".

The base with respect to which logarithms are computed.

Recalculate corrected UMI counts using minimum of the median UMIs when performing DE using multiple SCT objects; default is TRUE

Identity class to define markers for; pass an object of class phylo or 'clustertree' to find markers for a node in a cluster tree; passing 'clustertree' requires BuildClusterTree to have been run

A second identity class for comparison; if NULL, use all other cells for comparison; if an object of class phylo or 'clustertree' is passed to ident.1, must pass a node to find markers for

Regroup cells into a different identity class prior to performing differential expression (see example); "ident" to use Idents

Subset a particular identity class prior to regrouping. Only relevant if group.by is set (see example)

Assay to use in differential expression testing

Reduction to use in differential expression testing - will test for DE on cell embeddings

data.frame with a ranked list of putative markers as rows, and associated statistics as columns (p-values, ROC score, etc., depending on the test used (test.use)). The following columns are always present:

avg_logFC: log fold-chage of the average expression between the two groups. Positive values indicate that the gene is more highly expressed in the first group

pct.1: The percentage of cells where the gene is detected in the first group

pct.2: The percentage of cells where the gene is detected in the second group

p_val_adj: Adjusted p-value, based on bonferroni correction using all genes in the dataset

p-value adjustment is performed using bonferroni correction based on the total number of genes in the dataset. Other correction methods are not recommended, as Seurat pre-filters genes using the arguments above, reducing the number of tests performed. Lastly, as Aaron Lun has pointed out, p-values should be interpreted cautiously, as the genes used for clustering are the same genes tested for differential expression.

McDavid A, Finak G, Chattopadyay PK, et al. Data exploration, quality control and testing in single-cell qPCR-based gene expression experiments. Bioinformatics. 2013;29(4):461-467. doi:10.1093/bioinformatics/bts714

Trapnell C, et al. The dynamics and regulators of cell fate decisions are revealed by pseudotemporal ordering of single cells. Nature Biotechnology volume 32, pages 381-386 (2014)

Andrew McDavid, Greg Finak and Masanao Yajima (2017). MAST: Model-based Analysis of Single Cell Transcriptomics. R package version 1.2.1. https://github.com/RGLab/MAST/

Love MI, Huber W and Anders S (2014). "Moderated estimation of fold change and dispersion for RNA-seq data with DESeq2." Genome Biology. https://bioconductor.org/packages/release/bioc/html/DESeq2.html

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/generics.R
```

Example 2 (unknown):
```unknown
R/differential_expression.R
```

Example 3 (unknown):
```unknown
FindMarkers.Rd
```

Example 4 (python):
```python
FindMarkers(object, ...)

# Default S3 method
FindMarkers(
  object,
  slot = "data",
  cells.1 = NULL,
  cells.2 = NULL,
  features = NULL,
  logfc.threshold = 0.1,
  test.use = "wilcox",
  min.pct = 0.01,
  min.diff.pct = -Inf,
  verbose = TRUE,
  only.pos = FALSE,
  max.cells.per.ident = Inf,
  random.seed = 1,
  latent.vars = NULL,
  min.cells.feature = 3,
  min.cells.group = 3,
  fc.results = NULL,
  densify = FALSE,
  ...
)

# S3 method for class 'Assay'
FindMarkers(
  object,
  slot = "data",
  cells.1 = NULL,
  cells.2 = NULL,
  features = NULL,
  test.use = "wilcox",
  fc.slot = "data",
  pseudocount.use = 1,
  norm.method = NULL,
  mean.fxn = NULL,
  fc.name = NULL,
  base = 2,
  ...
)

# S3 method for class 'SCTAssay'
FindMarkers(
  object,
  cells.1 = NULL,
  cells.2 = NULL,
  features = NULL,
  test.use = "wilcox",
  pseudocount.use = 1,
  slot = "data",
  fc.slot = "data",
  mean.fxn = NULL,
  fc.name = NULL,
  base = 2,
  recorrect_umi = TRUE,
  ...
)

# S3 method for class 'DimReduc'
FindMarkers(
  object,
  cells.1 = NULL,
  cells.2 = NULL,
  features = NULL,
  logfc.threshold = 0.1,
  test.use = "wilcox",
  min.pct = 0.01,
  min.diff.pct = -Inf,
  verbose = TRUE,
  only.pos = FALSE,
  max.cells.per.ident = Inf,
  random.seed = 1,
  latent.vars = NULL,
  min.cells.feature = 3,
  min.cells.group = 3,
  densify = FALSE,
  mean.fxn = rowMeans,
  fc.name = NULL,
  ...
)

# S3 method for class 'Seurat'
FindMarkers(
  object,
  ident.1 = NULL,
  ident.2 = NULL,
  latent.vars = NULL,
  group.by = NULL,
  subset.ident = NULL,
  assay = NULL,
  reduction = NULL,
  ...
)
```

Example 5 (r):
```r
FindMarkers(object, ...)

# Default S3 method
FindMarkers(
  object,
  slot = "data",
  cells.1 = NULL,
  cells.2 = NULL,
  features = NULL,
  logfc.threshold = 0.1,
  test.use = "wilcox",
  min.pct = 0.01,
  min.diff.pct = -Inf,
  verbose = TRUE,
  only.pos = FALSE,
  max.cells.per.ident = Inf,
  random.seed = 1,
  latent.vars = NULL,
  min.cells.feature = 3,
  min.cells.group = 3,
  fc.results = NULL,
  densify = FALSE,
  ...
)

# S3 method for class 'Assay'
FindMarkers(
  object,
  slot = "data",
  cells.1 = NULL,
  cells.2 = NULL,
  features = NULL,
  test.use = "wilcox",
  fc.slot = "data",
  pseudocount.use = 1,
  norm.method = NULL,
  mean.fxn = NULL,
  fc.name = NULL,
  base = 2,
  ...
)

# S3 method for class 'SCTAssay'
FindMarkers(
  object,
  cells.1 = NULL,
  cells.2 = NULL,
  features = NULL,
  test.use = "wilcox",
  pseudocount.use = 1,
  slot = "data",
  fc.slot = "data",
  mean.fxn = NULL,
  fc.name = NULL,
  base = 2,
  recorrect_umi = TRUE,
  ...
)

# S3 method for class 'DimReduc'
FindMarkers(
  object,
  cells.1 = NULL,
  cells.2 = NULL,
  features = NULL,
  logfc.threshold = 0.1,
  test.use = "wilcox",
  min.pct = 0.01,
  min.diff.pct = -Inf,
  verbose = TRUE,
  only.pos = FALSE,
  max.cells.per.ident = Inf,
  random.seed = 1,
  latent.vars = NULL,
  min.cells.feature = 3,
  min.cells.group = 3,
  densify = FALSE,
  mean.fxn = rowMeans,
  fc.name = NULL,
  ...
)

# S3 method for class 'Seurat'
FindMarkers(
  object,
  ident.1 = NULL,
  ident.2 = NULL,
  latent.vars = NULL,
  group.by = NULL,
  subset.ident = NULL,
  assay = NULL,
  reduction = NULL,
  ...
)
```

Example 6 (r):
```r
FindMarkers(object, ...)

# Default S3 method
FindMarkers(
  object,
  slot = "data",
  cells.1 = NULL,
  cells.2 = NULL,
  features = NULL,
  logfc.threshold = 0.1,
  test.use = "wilcox",
  min.pct = 0.01,
  min.diff.pct = -Inf,
  verbose = TRUE,
  only.pos = FALSE,
  max.cells.per.ident = Inf,
  random.seed = 1,
  latent.vars = NULL,
  min.cells.feature = 3,
  min.cells.group = 3,
  fc.results = NULL,
  densify = FALSE,
  ...
)

# S3 method for class 'Assay'
FindMarkers(
  object,
  slot = "data",
  cells.1 = NULL,
  cells.2 = NULL,
  features = NULL,
  test.use = "wilcox",
  fc.slot = "data",
  pseudocount.use = 1,
  norm.method = NULL,
  mean.fxn = NULL,
  fc.name = NULL,
  base = 2,
  ...
)

# S3 method for class 'SCTAssay'
FindMarkers(
  object,
  cells.1 = NULL,
  cells.2 = NULL,
  features = NULL,
  test.use = "wilcox",
  pseudocount.use = 1,
  slot = "data",
  fc.slot = "data",
  mean.fxn = NULL,
  fc.name = NULL,
  base = 2,
  recorrect_umi = TRUE,
  ...
)

# S3 method for class 'DimReduc'
FindMarkers(
  object,
  cells.1 = NULL,
  cells.2 = NULL,
  features = NULL,
  logfc.threshold = 0.1,
  test.use = "wilcox",
  min.pct = 0.01,
  min.diff.pct = -Inf,
  verbose = TRUE,
  only.pos = FALSE,
  max.cells.per.ident = Inf,
  random.seed = 1,
  latent.vars = NULL,
  min.cells.feature = 3,
  min.cells.group = 3,
  densify = FALSE,
  mean.fxn = rowMeans,
  fc.name = NULL,
  ...
)

# S3 method for class 'Seurat'
FindMarkers(
  object,
  ident.1 = NULL,
  ident.2 = NULL,
  latent.vars = NULL,
  group.by = NULL,
  subset.ident = NULL,
  assay = NULL,
  reduction = NULL,
  ...
)
```

Example 7 (unknown):
```unknown
BuildClusterTree
```

Example 8 (python):
```python
if (FALSE) { # \dontrun{
data("pbmc_small")
# Find markers for cluster 2
markers <- FindMarkers(object = pbmc_small, ident.1 = 2)
head(x = markers)

# Take all cells in cluster 2, and find markers that separate cells in the 'g1' group (metadata
# variable 'group')
markers <- FindMarkers(pbmc_small, ident.1 = "g1", group.by = 'groups', subset.ident = "2")
head(x = markers)

# Pass 'clustertree' or an object of class phylo to ident.1 and
# a node to ident.2 as a replacement for FindMarkersNode
if (requireNamespace("ape", quietly = TRUE)) {
  pbmc_small <- BuildClusterTree(object = pbmc_small)
  markers <- FindMarkers(object = pbmc_small, ident.1 = 'clustertree', ident.2 = 5)
  head(x = markers)
}
} # }
```

Example 9 (r):
```r
if (FALSE) { # \dontrun{
data("pbmc_small")
# Find markers for cluster 2
markers <- FindMarkers(object = pbmc_small, ident.1 = 2)
head(x = markers)

# Take all cells in cluster 2, and find markers that separate cells in the 'g1' group (metadata
# variable 'group')
markers <- FindMarkers(pbmc_small, ident.1 = "g1", group.by = 'groups', subset.ident = "2")
head(x = markers)

# Pass 'clustertree' or an object of class phylo to ident.1 and
# a node to ident.2 as a replacement for FindMarkersNode
if (requireNamespace("ape", quietly = TRUE)) {
  pbmc_small <- BuildClusterTree(object = pbmc_small)
  markers <- FindMarkers(object = pbmc_small, ident.1 = 'clustertree', ident.2 = 5)
  head(x = markers)
}
} # }
```

Example 10 (r):
```r
if (FALSE) { # \dontrun{
data("pbmc_small")
# Find markers for cluster 2
markers <- FindMarkers(object = pbmc_small, ident.1 = 2)
head(x = markers)

# Take all cells in cluster 2, and find markers that separate cells in the 'g1' group (metadata
# variable 'group')
markers <- FindMarkers(pbmc_small, ident.1 = "g1", group.by = 'groups', subset.ident = "2")
head(x = markers)

# Pass 'clustertree' or an object of class phylo to ident.1 and
# a node to ident.2 as a replacement for FindMarkersNode
if (requireNamespace("ape", quietly = TRUE)) {
  pbmc_small <- BuildClusterTree(object = pbmc_small)
  markers <- FindMarkers(object = pbmc_small, ident.1 = 'clustertree', ident.2 = 5)
  head(x = markers)
}
} # }
```

---

## Run Supervised Latent Semantic Indexing — RunSLSI • Seurat

**URL:** http://127.0.0.1:9173/reference_runslsi.html

**Contents:**
- Run Supervised Latent Semantic Indexing
- Arguments
- Value
- Contents

Run a supervised LSI (SLSI) dimensionality reduction supervised by a cell-cell kernel. SLSI is used to capture a linear transformation of peaks that maximizes its dependency to the given cell-cell kernel.

Arguments passed to IRLBA irlba

Name of Assay SLSI is being run on

Total Number of SLSI components to compute and store

dimensional reduction key, specifies the string before the number for the dimension names

Graph used supervised by SLSI

Set a random seed. Setting NULL will not set a seed.

Features to compute SLSI on. If features=NULL, SLSI will be run using the variable features for the Assay5.

dimensional reduction name

Returns Seurat object with the SLSI calculation stored in the reductions slot

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/generics.R
```

Example 2 (unknown):
```unknown
R/dimensional_reduction.R
```

Example 3 (python):
```python
RunSLSI(object, ...)

# Default S3 method
RunSLSI(
  object,
  assay = NULL,
  n = 50,
  reduction.key = "SLSI_",
  graph = NULL,
  verbose = TRUE,
  seed.use = 42,
  ...
)

# S3 method for class 'Assay'
RunSLSI(
  object,
  assay = NULL,
  features = NULL,
  n = 50,
  reduction.key = "SLSI_",
  graph = NULL,
  verbose = TRUE,
  seed.use = 42,
  ...
)

# S3 method for class 'StdAssay'
RunSLSI(
  object,
  assay = NULL,
  features = NULL,
  n = 50,
  reduction.key = "SLSI_",
  graph = NULL,
  layer = "data",
  verbose = TRUE,
  seed.use = 42,
  ...
)

# S3 method for class 'Seurat'
RunSLSI(
  object,
  assay = NULL,
  features = NULL,
  n = 50,
  reduction.name = "slsi",
  reduction.key = "SLSI_",
  graph = NULL,
  verbose = TRUE,
  seed.use = 42,
  ...
)
```

Example 4 (r):
```r
RunSLSI(object, ...)

# Default S3 method
RunSLSI(
  object,
  assay = NULL,
  n = 50,
  reduction.key = "SLSI_",
  graph = NULL,
  verbose = TRUE,
  seed.use = 42,
  ...
)

# S3 method for class 'Assay'
RunSLSI(
  object,
  assay = NULL,
  features = NULL,
  n = 50,
  reduction.key = "SLSI_",
  graph = NULL,
  verbose = TRUE,
  seed.use = 42,
  ...
)

# S3 method for class 'StdAssay'
RunSLSI(
  object,
  assay = NULL,
  features = NULL,
  n = 50,
  reduction.key = "SLSI_",
  graph = NULL,
  layer = "data",
  verbose = TRUE,
  seed.use = 42,
  ...
)

# S3 method for class 'Seurat'
RunSLSI(
  object,
  assay = NULL,
  features = NULL,
  n = 50,
  reduction.name = "slsi",
  reduction.key = "SLSI_",
  graph = NULL,
  verbose = TRUE,
  seed.use = 42,
  ...
)
```

Example 5 (r):
```r
RunSLSI(object, ...)

# Default S3 method
RunSLSI(
  object,
  assay = NULL,
  n = 50,
  reduction.key = "SLSI_",
  graph = NULL,
  verbose = TRUE,
  seed.use = 42,
  ...
)

# S3 method for class 'Assay'
RunSLSI(
  object,
  assay = NULL,
  features = NULL,
  n = 50,
  reduction.key = "SLSI_",
  graph = NULL,
  verbose = TRUE,
  seed.use = 42,
  ...
)

# S3 method for class 'StdAssay'
RunSLSI(
  object,
  assay = NULL,
  features = NULL,
  n = 50,
  reduction.key = "SLSI_",
  graph = NULL,
  layer = "data",
  verbose = TRUE,
  seed.use = 42,
  ...
)

# S3 method for class 'Seurat'
RunSLSI(
  object,
  assay = NULL,
  features = NULL,
  n = 50,
  reduction.name = "slsi",
  reduction.key = "SLSI_",
  graph = NULL,
  verbose = TRUE,
  seed.use = 42,
  ...
)
```

---

## Select SCT integration features — SelectSCTIntegrationFeatures • Seurat

**URL:** http://127.0.0.1:9173/reference_selectsctintegrationfeatures.html

**Contents:**
- Select SCT integration features
- Arguments
- Contents

Select SCT integration features

Number of features to return for integration

Name of assay to use for integration feature selection

Arguments passed on to method

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/integration.R
```

Example 2 (unknown):
```unknown
SelectSCTIntegrationFeatures.Rd
```

Example 3 (unknown):
```unknown
SelectSCTIntegrationFeatures(
  object,
  nfeatures = 3000,
  assay = NULL,
  verbose = TRUE,
  ...
)
```

Example 4 (r):
```r
SelectSCTIntegrationFeatures(
  object,
  nfeatures = 3000,
  assay = NULL,
  verbose = TRUE,
  ...
)
```

Example 5 (r):
```r
SelectSCTIntegrationFeatures(
  object,
  nfeatures = 3000,
  assay = NULL,
  verbose = TRUE,
  ...
)
```

---

## Load in data from 10X — Read10X • Seurat

**URL:** http://127.0.0.1:9173/reference_read10x.html

**Contents:**
- Load in data from 10X
- Arguments
- Value
- Examples
- Contents

Enables easy loading of sparse data matrices provided by 10X genomics.

Directory containing the matrix.mtx, genes.tsv (or features.tsv), and barcodes.tsv files provided by 10X. A vector or named vector can be given in order to load several data directories. If a named vector is given, the cell barcode names will be prefixed with the name.

Specify which column of genes.tsv or features.tsv to use for gene names; default is 2

Specify which column of barcodes.tsv to use for cell names; default is 1

Make feature names unique (default TRUE)

Remove trailing "-1" if present in all cell barcodes.

If features.csv indicates the data has multiple data types, a list containing a sparse matrix of the data from each type will be returned. Otherwise a sparse matrix containing the expression data will be returned.

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/preprocessing.R
```

Example 2 (unknown):
```unknown
Read10X(
  data.dir,
  gene.column = 2,
  cell.column = 1,
  unique.features = TRUE,
  strip.suffix = FALSE
)
```

Example 3 (r):
```r
Read10X(
  data.dir,
  gene.column = 2,
  cell.column = 1,
  unique.features = TRUE,
  strip.suffix = FALSE
)
```

Example 4 (r):
```r
Read10X(
  data.dir,
  gene.column = 2,
  cell.column = 1,
  unique.features = TRUE,
  strip.suffix = FALSE
)
```

Example 5 (python):
```python
if (FALSE) { # \dontrun{
# For output from CellRanger < 3.0
data_dir <- 'path/to/data/directory'
list.files(data_dir) # Should show barcodes.tsv, genes.tsv, and matrix.mtx
expression_matrix <- Read10X(data.dir = data_dir)
seurat_object = CreateSeuratObject(counts = expression_matrix)

# For output from CellRanger >= 3.0 with multiple data types
data_dir <- 'path/to/data/directory'
list.files(data_dir) # Should show barcodes.tsv.gz, features.tsv.gz, and matrix.mtx.gz
data <- Read10X(data.dir = data_dir)
seurat_object = CreateSeuratObject(counts = data$`Gene Expression`)
seurat_object[['Protein']] = CreateAssayObject(counts = data$`Antibody Capture`)
} # }
```

Example 6 (r):
```r
if (FALSE) { # \dontrun{
# For output from CellRanger < 3.0
data_dir <- 'path/to/data/directory'
list.files(data_dir) # Should show barcodes.tsv, genes.tsv, and matrix.mtx
expression_matrix <- Read10X(data.dir = data_dir)
seurat_object = CreateSeuratObject(counts = expression_matrix)

# For output from CellRanger >= 3.0 with multiple data types
data_dir <- 'path/to/data/directory'
list.files(data_dir) # Should show barcodes.tsv.gz, features.tsv.gz, and matrix.mtx.gz
data <- Read10X(data.dir = data_dir)
seurat_object = CreateSeuratObject(counts = data$`Gene Expression`)
seurat_object[['Protein']] = CreateAssayObject(counts = data$`Antibody Capture`)
} # }
```

Example 7 (r):
```r
if (FALSE) { # \dontrun{
# For output from CellRanger < 3.0
data_dir <- 'path/to/data/directory'
list.files(data_dir) # Should show barcodes.tsv, genes.tsv, and matrix.mtx
expression_matrix <- Read10X(data.dir = data_dir)
seurat_object = CreateSeuratObject(counts = expression_matrix)

# For output from CellRanger >= 3.0 with multiple data types
data_dir <- 'path/to/data/directory'
list.files(data_dir) # Should show barcodes.tsv.gz, features.tsv.gz, and matrix.mtx.gz
data <- Read10X(data.dir = data_dir)
seurat_object = CreateSeuratObject(counts = data$`Gene Expression`)
seurat_object[['Protein']] = CreateAssayObject(counts = data$`Antibody Capture`)
} # }
```

---

## Seurat-CCA Integration — CCAIntegration • Seurat

**URL:** http://127.0.0.1:9173/seurat/reference/ccaintegration/index.html

**Contents:**
- Seurat-CCA Integration
- Arguments
- Examples
- Contents

Seurat-CCA Integration

Name of Assay in the Seurat object

Names of layers in assay

A DimReduc to correct

Name of new integrated dimensional reduction

A reference Seurat object

A vector of features to use for integration

Name of normalization method used: LogNormalize or SCT

Dimensions of dimensional reduction to use for integration

Number of anchors to filter

Name of scaled layer in Assay

Number of dimensions to return integrated values for

Number of neighbors to consider when weighting anchors

Dimension reduction to use when calculating anchor weights. This can be one of:

A string, specifying the name of a dimension reduction present in all objects to be integrated

A vector of strings, specifying the name of a dimension reduction to use for each object to be integrated

A vector of DimReduc objects, specifying the object to use for each object in the integration

NULL, in which case the full corrected space is used for computing anchor weights.

Controls the bandwidth of the Gaussian kernel for weighting

Specify the order of integration. Order of integration should be encoded in a matrix, where each row represents one of the pairwise integration steps. Negative numbers specify a dataset, positive numbers specify the integration results from a given row (the format of the merge matrix included in the hclust function output). For example: matrix(c(-2, 1, -3, -1), ncol = 2) gives:

Which would cause dataset 2 and 3 to be integrated first, then the resulting object integrated with dataset 1.

If NULL, the sample tree will be computed automatically.

Do not reorder objects based on size for each pairwise integration.

Arguments passed on to FindIntegrationAnchors

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/integration5.R
```

Example 2 (unknown):
```unknown
CCAIntegration.Rd
```

Example 3 (unknown):
```unknown
CCAIntegration(
  object = NULL,
  assay = NULL,
  layers = NULL,
  orig = NULL,
  new.reduction = "integrated.dr",
  reference = NULL,
  features = NULL,
  normalization.method = c("LogNormalize", "SCT"),
  dims = 1:30,
  k.filter = NA,
  scale.layer = "scale.data",
  dims.to.integrate = NULL,
  k.weight = 100,
  weight.reduction = NULL,
  sd.weight = 1,
  sample.tree = NULL,
  preserve.order = FALSE,
  verbose = TRUE,
  ...
)
```

Example 4 (r):
```r
CCAIntegration(
  object = NULL,
  assay = NULL,
  layers = NULL,
  orig = NULL,
  new.reduction = "integrated.dr",
  reference = NULL,
  features = NULL,
  normalization.method = c("LogNormalize", "SCT"),
  dims = 1:30,
  k.filter = NA,
  scale.layer = "scale.data",
  dims.to.integrate = NULL,
  k.weight = 100,
  weight.reduction = NULL,
  sd.weight = 1,
  sample.tree = NULL,
  preserve.order = FALSE,
  verbose = TRUE,
  ...
)
```

Example 5 (r):
```r
CCAIntegration(
  object = NULL,
  assay = NULL,
  layers = NULL,
  orig = NULL,
  new.reduction = "integrated.dr",
  reference = NULL,
  features = NULL,
  normalization.method = c("LogNormalize", "SCT"),
  dims = 1:30,
  k.filter = NA,
  scale.layer = "scale.data",
  dims.to.integrate = NULL,
  k.weight = 100,
  weight.reduction = NULL,
  sd.weight = 1,
  sample.tree = NULL,
  preserve.order = FALSE,
  verbose = TRUE,
  ...
)
```

Example 6 (unknown):
```unknown
matrix(c(-2, 1, -3, -1), ncol = 2)
```

Example 7 (unknown):
```unknown
[,1]  [,2]
       [1,]   -2   -3
       [2,]    1   -1
```

Example 8 (unknown):
```unknown
[,1]  [,2]
       [1,]   -2   -3
       [2,]    1   -1
```

Example 9 (unknown):
```unknown
[,1]  [,2]
       [1,]   -2   -3
       [2,]    1   -1
```

Example 10 (unknown):
```unknown
FindIntegrationAnchors
```

Example 11 (unknown):
```unknown
if (FALSE) { # \dontrun{
# Preprocessing
obj <- SeuratData::LoadData("pbmcsca")
obj[["RNA"]] <- split(obj[["RNA"]], f = obj$Method)
obj <- NormalizeData(obj)
obj <- FindVariableFeatures(obj)
obj <- ScaleData(obj)
obj <- RunPCA(obj)

# After preprocessing, we integrate layers.
obj <- IntegrateLayers(object = obj, method = CCAIntegration,
  orig.reduction = "pca", new.reduction = "integrated.cca",
  verbose = FALSE)

# Modifying parameters
# We can also specify parameters such as `k.anchor` to increase the strength of integration
obj <- IntegrateLayers(object = obj, method = CCAIntegration,
  orig.reduction = "pca", new.reduction = "integrated.cca",
  k.anchor = 20, verbose = FALSE)

# Integrating SCTransformed data
obj <- SCTransform(object = obj)
obj <- IntegrateLayers(object = obj, method = CCAIntegration,
  orig.reduction = "pca", new.reduction = "integrated.cca",
  assay = "SCT", verbose = FALSE)
} # }
```

Example 12 (r):
```r
if (FALSE) { # \dontrun{
# Preprocessing
obj <- SeuratData::LoadData("pbmcsca")
obj[["RNA"]] <- split(obj[["RNA"]], f = obj$Method)
obj <- NormalizeData(obj)
obj <- FindVariableFeatures(obj)
obj <- ScaleData(obj)
obj <- RunPCA(obj)

# After preprocessing, we integrate layers.
obj <- IntegrateLayers(object = obj, method = CCAIntegration,
  orig.reduction = "pca", new.reduction = "integrated.cca",
  verbose = FALSE)

# Modifying parameters
# We can also specify parameters such as `k.anchor` to increase the strength of integration
obj <- IntegrateLayers(object = obj, method = CCAIntegration,
  orig.reduction = "pca", new.reduction = "integrated.cca",
  k.anchor = 20, verbose = FALSE)

# Integrating SCTransformed data
obj <- SCTransform(object = obj)
obj <- IntegrateLayers(object = obj, method = CCAIntegration,
  orig.reduction = "pca", new.reduction = "integrated.cca",
  assay = "SCT", verbose = FALSE)
} # }
```

Example 13 (r):
```r
if (FALSE) { # \dontrun{
# Preprocessing
obj <- SeuratData::LoadData("pbmcsca")
obj[["RNA"]] <- split(obj[["RNA"]], f = obj$Method)
obj <- NormalizeData(obj)
obj <- FindVariableFeatures(obj)
obj <- ScaleData(obj)
obj <- RunPCA(obj)

# After preprocessing, we integrate layers.
obj <- IntegrateLayers(object = obj, method = CCAIntegration,
  orig.reduction = "pca", new.reduction = "integrated.cca",
  verbose = FALSE)

# Modifying parameters
# We can also specify parameters such as `k.anchor` to increase the strength of integration
obj <- IntegrateLayers(object = obj, method = CCAIntegration,
  orig.reduction = "pca", new.reduction = "integrated.cca",
  k.anchor = 20, verbose = FALSE)

# Integrating SCTransformed data
obj <- SCTransform(object = obj)
obj <- IntegrateLayers(object = obj, method = CCAIntegration,
  orig.reduction = "pca", new.reduction = "integrated.cca",
  assay = "SCT", verbose = FALSE)
} # }
```

---

## Load Slide-seq spatial data — ReadSlideSeq • Seurat

**URL:** http://127.0.0.1:9173/reference_readslideseq.html

**Contents:**
- Load Slide-seq spatial data
- Arguments
- Value
- See also
- Contents

Load Slide-seq spatial data

Path to csv file containing bead coordinate positions

Name of assay to associate image to

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/preprocessing.R
```

Example 2 (unknown):
```unknown
ReadSlideSeq.Rd
```

Example 3 (unknown):
```unknown
ReadSlideSeq(coord.file, assay = "Spatial")
```

Example 4 (r):
```r
ReadSlideSeq(coord.file, assay = "Spatial")
```

Example 5 (r):
```r
ReadSlideSeq(coord.file, assay = "Spatial")
```

---

## Select SCT integration features — SelectSCTIntegrationFeatures • Seurat

**URL:** http://127.0.0.1:9173/seurat/reference/selectsctintegrationfeatures/index.html

**Contents:**
- Select SCT integration features
- Arguments
- Contents

Select SCT integration features

Number of features to return for integration

Name of assay to use for integration feature selection

Arguments passed on to method

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/integration.R
```

Example 2 (unknown):
```unknown
SelectSCTIntegrationFeatures.Rd
```

Example 3 (unknown):
```unknown
SelectSCTIntegrationFeatures(
  object,
  nfeatures = 3000,
  assay = NULL,
  verbose = TRUE,
  ...
)
```

Example 4 (r):
```r
SelectSCTIntegrationFeatures(
  object,
  nfeatures = 3000,
  assay = NULL,
  verbose = TRUE,
  ...
)
```

Example 5 (r):
```r
SelectSCTIntegrationFeatures(
  object,
  nfeatures = 3000,
  assay = NULL,
  verbose = TRUE,
  ...
)
```

---

## Get SCT results from an Assay — SCTResults • Seurat

**URL:** http://127.0.0.1:9173/reference_sctresults.html

**Contents:**
- Get SCT results from an Assay
- Arguments
- Value
- Contents

Pull the SCTResults information from an SCTAssay object.

Arguments passed to other methods (not used)

Which slot to pull the SCT results from

Name of SCModel to pull result from. Available names can be retrieved with levels.

Assay in the Seurat object to pull from

Returns the value present in the requested slot for the requested group. If group is not specified, returns a list of slot results for each group unless there is only one group present (in which case it just returns the slot directly).

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/generics.R
```

Example 2 (unknown):
```unknown
R/objects.R
```

Example 3 (unknown):
```unknown
SCTResults.Rd
```

Example 4 (python):
```python
SCTResults(object, ...)

SCTResults(object, ...) <- value

# S3 method for class 'SCTModel'
SCTResults(object, slot, ...)

# S3 method for class 'SCTModel'
SCTResults(object, slot, ...) <- value

# S3 method for class 'SCTAssay'
SCTResults(object, slot, model = NULL, ...)

# S3 method for class 'SCTAssay'
SCTResults(object, slot, model = NULL, ...) <- value

# S3 method for class 'Seurat'
SCTResults(object, assay = "SCT", slot, model = NULL, ...)
```

Example 5 (r):
```r
SCTResults(object, ...)

SCTResults(object, ...) <- value

# S3 method for class 'SCTModel'
SCTResults(object, slot, ...)

# S3 method for class 'SCTModel'
SCTResults(object, slot, ...) <- value

# S3 method for class 'SCTAssay'
SCTResults(object, slot, model = NULL, ...)

# S3 method for class 'SCTAssay'
SCTResults(object, slot, model = NULL, ...) <- value

# S3 method for class 'Seurat'
SCTResults(object, assay = "SCT", slot, model = NULL, ...)
```

Example 6 (r):
```r
SCTResults(object, ...)

SCTResults(object, ...) <- value

# S3 method for class 'SCTModel'
SCTResults(object, slot, ...)

# S3 method for class 'SCTModel'
SCTResults(object, slot, ...) <- value

# S3 method for class 'SCTAssay'
SCTResults(object, slot, model = NULL, ...)

# S3 method for class 'SCTAssay'
SCTResults(object, slot, model = NULL, ...) <- value

# S3 method for class 'Seurat'
SCTResults(object, assay = "SCT", slot, model = NULL, ...)
```

---

## Prepare object to run differential expression on SCT assay with multiple models — PrepSCTFindMarkers • Seurat

**URL:** http://127.0.0.1:9173/reference_prepsctfindmarkers.html

**Contents:**
- Prepare object to run differential expression on SCT assay with multiple models
- Arguments
- Value
- Progress Updates with progressr
- Parallelization with future
- Examples
- Contents

Given a merged object with multiple SCT models, this function uses minimum of the median UMI (calculated using the raw UMI counts) of individual objects to reverse the individual SCT regression model using minimum of median UMI as the sequencing depth covariate. The counts slot of the SCT assay is replaced with recorrected counts and the data slot is replaced with log1p of recorrected counts.

Seurat object with SCT assays

Assay name where for SCT objects are stored; Default is 'SCT'

Print messages and progress

Returns a Seurat object with recorrected counts and data in the SCT assay.

This function uses progressr to render status updates and progress bars. To enable progress updates, wrap the function call in with_progress or run handlers(global = TRUE) before running this function. For more details about progressr, please read vignette("progressr-intro")

This function uses future to enable parallelization. Parallelization strategies can be set using plan. Common plans include “sequential” for non-parallelized processing or “multisession” for parallel evaluation using multiple R sessions; for other plans, see the “Implemented evaluation strategies” section of ?future::plan. For a more thorough introduction to future, see vignette("future-1-overview")

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/differential_expression.R
```

Example 2 (unknown):
```unknown
PrepSCTFindMarkers.Rd
```

Example 3 (unknown):
```unknown
PrepSCTFindMarkers(object, assay = "SCT", verbose = TRUE)
```

Example 4 (r):
```r
PrepSCTFindMarkers(object, assay = "SCT", verbose = TRUE)
```

Example 5 (r):
```r
PrepSCTFindMarkers(object, assay = "SCT", verbose = TRUE)
```

Example 6 (unknown):
```unknown
with_progress
```

Example 7 (unknown):
```unknown
handlers(global = TRUE)
```

Example 8 (unknown):
```unknown
vignette("progressr-intro")
```

Example 9 (unknown):
```unknown
multisession
```

Example 10 (unknown):
```unknown
?future::plan
```

Example 11 (unknown):
```unknown
vignette("future-1-overview")
```

Example 12 (python):
```python
data("pbmc_small")
pbmc_small1 <- SCTransform(object = pbmc_small, variable.features.n = 20, vst.flavor="v1")
#> Running SCTransform on assay: RNA
#> Calculating cell attributes from input UMI matrix: log_umi
#> Variance stabilizing transformation of count matrix of size 220 by 80
#> Model formula is y ~ log_umi
#> Get Negative Binomial regression parameters per gene
#> Using 220 genes, 80 cells
#> Second step: Get residuals using fitted parameters for 220 genes
#> Computing corrected count matrix for 220 genes
#> Calculating gene attributes
#> Wall clock passed: Time difference of 0.4680996 secs
#> Determine variable features
#> Centering data matrix
#> Place corrected count matrix in counts slot
#> Set default assay to SCT
pbmc_small2 <- SCTransform(object = pbmc_small, variable.features.n = 20, vst.flavor="v1")
#> Running SCTransform on assay: RNA
#> Calculating cell attributes from input UMI matrix: log_umi
#> Variance stabilizing transformation of count matrix of size 220 by 80
#> Model formula is y ~ log_umi
#> Get Negative Binomial regression parameters per gene
#> Using 220 genes, 80 cells
#> Second step: Get residuals using fitted parameters for 220 genes
#> Computing corrected count matrix for 220 genes
#> Calculating gene attributes
#> Wall clock passed: Time difference of 0.3564265 secs
#> Determine variable features
#> Centering data matrix
#> Place corrected count matrix in counts slot
#> Set default assay to SCT
pbmc_merged <- merge(x = pbmc_small1, y = pbmc_small2)
#> Warning: Some cell names are duplicated across objects provided. Renaming to enforce unique cell names.
pbmc_merged <- PrepSCTFindMarkers(object = pbmc_merged)
#> Found 2 SCT models. Recorrecting SCT counts using minimum median counts: 180
#> 
  |                                                  | 0 % ~calculating  
  |+++++++++++++++++++++++++                         | 50% ~00s          
  |++++++++++++++++++++++++++++++++++++++++++++++++++| 100% elapsed=01s  
markers <- FindMarkers(
  object = pbmc_merged,
  ident.1 = "0",
  ident.2 = "1",
  assay = "SCT"
)
pbmc_subset <- subset(pbmc_merged, idents = c("0", "1"))
markers_subset <- FindMarkers(
  object = pbmc_subset,
  ident.1 = "0",
  ident.2 = "1",
  assay = "SCT",
  recorrect_umi = FALSE
)
```

Example 13 (r):
```r
data("pbmc_small")
pbmc_small1 <- SCTransform(object = pbmc_small, variable.features.n = 20, vst.flavor="v1")
#> Running SCTransform on assay: RNA
#> Calculating cell attributes from input UMI matrix: log_umi
#> Variance stabilizing transformation of count matrix of size 220 by 80
#> Model formula is y ~ log_umi
#> Get Negative Binomial regression parameters per gene
#> Using 220 genes, 80 cells
#> Second step: Get residuals using fitted parameters for 220 genes
#> Computing corrected count matrix for 220 genes
#> Calculating gene attributes
#> Wall clock passed: Time difference of 0.4680996 secs
#> Determine variable features
#> Centering data matrix
#> Place corrected count matrix in counts slot
#> Set default assay to SCT
pbmc_small2 <- SCTransform(object = pbmc_small, variable.features.n = 20, vst.flavor="v1")
#> Running SCTransform on assay: RNA
#> Calculating cell attributes from input UMI matrix: log_umi
#> Variance stabilizing transformation of count matrix of size 220 by 80
#> Model formula is y ~ log_umi
#> Get Negative Binomial regression parameters per gene
#> Using 220 genes, 80 cells
#> Second step: Get residuals using fitted parameters for 220 genes
#> Computing corrected count matrix for 220 genes
#> Calculating gene attributes
#> Wall clock passed: Time difference of 0.3564265 secs
#> Determine variable features
#> Centering data matrix
#> Place corrected count matrix in counts slot
#> Set default assay to SCT
pbmc_merged <- merge(x = pbmc_small1, y = pbmc_small2)
#> Warning: Some cell names are duplicated across objects provided. Renaming to enforce unique cell names.
pbmc_merged <- PrepSCTFindMarkers(object = pbmc_merged)
#> Found 2 SCT models. Recorrecting SCT counts using minimum median counts: 180
#> 
  |                                                  | 0 % ~calculating  
  |+++++++++++++++++++++++++                         | 50% ~00s          
  |++++++++++++++++++++++++++++++++++++++++++++++++++| 100% elapsed=01s  
markers <- FindMarkers(
  object = pbmc_merged,
  ident.1 = "0",
  ident.2 = "1",
  assay = "SCT"
)
pbmc_subset <- subset(pbmc_merged, idents = c("0", "1"))
markers_subset <- FindMarkers(
  object = pbmc_subset,
  ident.1 = "0",
  ident.2 = "1",
  assay = "SCT",
  recorrect_umi = FALSE
)
```

Example 14 (r):
```r
data("pbmc_small")
pbmc_small1 <- SCTransform(object = pbmc_small, variable.features.n = 20, vst.flavor="v1")
#> Running SCTransform on assay: RNA
#> Calculating cell attributes from input UMI matrix: log_umi
#> Variance stabilizing transformation of count matrix of size 220 by 80
#> Model formula is y ~ log_umi
#> Get Negative Binomial regression parameters per gene
#> Using 220 genes, 80 cells
#> Second step: Get residuals using fitted parameters for 220 genes
#> Computing corrected count matrix for 220 genes
#> Calculating gene attributes
#> Wall clock passed: Time difference of 0.4680996 secs
#> Determine variable features
#> Centering data matrix
#> Place corrected count matrix in counts slot
#> Set default assay to SCT
pbmc_small2 <- SCTransform(object = pbmc_small, variable.features.n = 20, vst.flavor="v1")
#> Running SCTransform on assay: RNA
#> Calculating cell attributes from input UMI matrix: log_umi
#> Variance stabilizing transformation of count matrix of size 220 by 80
#> Model formula is y ~ log_umi
#> Get Negative Binomial regression parameters per gene
#> Using 220 genes, 80 cells
#> Second step: Get residuals using fitted parameters for 220 genes
#> Computing corrected count matrix for 220 genes
#> Calculating gene attributes
#> Wall clock passed: Time difference of 0.3564265 secs
#> Determine variable features
#> Centering data matrix
#> Place corrected count matrix in counts slot
#> Set default assay to SCT
pbmc_merged <- merge(x = pbmc_small1, y = pbmc_small2)
#> Warning: Some cell names are duplicated across objects provided. Renaming to enforce unique cell names.
pbmc_merged <- PrepSCTFindMarkers(object = pbmc_merged)
#> Found 2 SCT models. Recorrecting SCT counts using minimum median counts: 180
#> 
  |                                                  | 0 % ~calculating  
  |+++++++++++++++++++++++++                         | 50% ~00s          
  |++++++++++++++++++++++++++++++++++++++++++++++++++| 100% elapsed=01s  
markers <- FindMarkers(
  object = pbmc_merged,
  ident.1 = "0",
  ident.2 = "1",
  assay = "SCT"
)
pbmc_subset <- subset(pbmc_merged, idents = c("0", "1"))
markers_subset <- FindMarkers(
  object = pbmc_subset,
  ident.1 = "0",
  ident.2 = "1",
  assay = "SCT",
  recorrect_umi = FALSE
)
```

---

## The Neighbor Class — Neighbor-class • Seurat

**URL:** http://127.0.0.1:9173/reference_neighbor-class.html

**Contents:**
- The Neighbor Class
- See also
- Contents

For more details, please see the documentation in SeuratObject

SeuratObject::Neighbor-class

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/reexports.R
```

Example 2 (unknown):
```unknown
Neighbor-class.Rd
```

Example 3 (unknown):
```unknown
SeuratObject
```

Example 4 (unknown):
```unknown
SeuratObject::Neighbor-class
```

---

## Read 10X hdf5 file — Read10X_h5 • Seurat

**URL:** http://127.0.0.1:9173/reference_read10x_h5.html

**Contents:**
- Read 10X hdf5 file
- Arguments
- Value
- Contents

Read count matrix from 10X CellRanger hdf5 file. This can be used to read both scATAC-seq and scRNA-seq matrices.

Label row names with feature names rather than ID numbers.

Make feature names unique (default TRUE)

Returns a sparse matrix with rows and columns labeled. If multiple genomes are present, returns a list of sparse matrices (one per genome).

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/preprocessing.R
```

Example 2 (unknown):
```unknown
Read10X_h5.Rd
```

Example 3 (unknown):
```unknown
Read10X_h5(filename, use.names = TRUE, unique.features = TRUE)
```

Example 4 (r):
```r
Read10X_h5(filename, use.names = TRUE, unique.features = TRUE)
```

Example 5 (r):
```r
Read10X_h5(filename, use.names = TRUE, unique.features = TRUE)
```

---

## Calculate the mean of logged values — ExpMean • Seurat

**URL:** http://127.0.0.1:9173/reference_expmean.html

**Contents:**
- Calculate the mean of logged values
- Arguments
- Value
- Examples
- Contents

Calculate mean of logged values in non-log space (return answer in log-space)

Other arguments (not used)

Returns the mean in log-space

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/utilities.R
```

Example 2 (unknown):
```unknown
ExpMean(x, ...)
```

Example 3 (r):
```r
ExpMean(x, ...)
```

Example 4 (r):
```r
ExpMean(x, ...)
```

Example 5 (unknown):
```unknown
ExpMean(x = c(1, 2, 3))
#> [1] 2.308994
```

Example 6 (r):
```r
ExpMean(x = c(1, 2, 3))
#> [1] 2.308994
```

Example 7 (r):
```r
ExpMean(x = c(1, 2, 3))
#> [1] 2.308994
```

---

## Seurat-Joint PCA Integration — JointPCAIntegration • Seurat

**URL:** http://127.0.0.1:9173/reference_jointpcaintegration.html

**Contents:**
- Seurat-Joint PCA Integration
- Arguments
- Contents

Seurat-Joint PCA Integration

Name of Assay in the Seurat object

Names of layers in assay

A DimReduc to correct

Name of new integrated dimensional reduction

A reference Seurat object

A vector of features to use for integration

Name of normalization method used: LogNormalize or SCT

Dimensions of dimensional reduction to use for integration

How many neighbors (k) to use when picking anchors

Name of scaled layer in Assay

Number of dimensions to return integrated values for

Number of neighbors to consider when weighting anchors

Dimension reduction to use when calculating anchor weights. This can be one of:

A string, specifying the name of a dimension reduction present in all objects to be integrated

A vector of strings, specifying the name of a dimension reduction to use for each object to be integrated

A vector of DimReduc objects, specifying the object to use for each object in the integration

NULL, in which case the full corrected space is used for computing anchor weights.

Controls the bandwidth of the Gaussian kernel for weighting

Specify the order of integration. Order of integration should be encoded in a matrix, where each row represents one of the pairwise integration steps. Negative numbers specify a dataset, positive numbers specify the integration results from a given row (the format of the merge matrix included in the hclust function output). For example: matrix(c(-2, 1, -3, -1), ncol = 2) gives:

Which would cause dataset 2 and 3 to be integrated first, then the resulting object integrated with dataset 1.

If NULL, the sample tree will be computed automatically.

Do not reorder objects based on size for each pairwise integration.

Arguments passed on to FindIntegrationAnchors

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/integration5.R
```

Example 2 (unknown):
```unknown
JointPCAIntegration.Rd
```

Example 3 (unknown):
```unknown
JointPCAIntegration(
  object = NULL,
  assay = NULL,
  layers = NULL,
  orig = NULL,
  new.reduction = "integrated.dr",
  reference = NULL,
  features = NULL,
  normalization.method = c("LogNormalize", "SCT"),
  dims = 1:30,
  k.anchor = 20,
  scale.layer = "scale.data",
  dims.to.integrate = NULL,
  k.weight = 100,
  weight.reduction = NULL,
  sd.weight = 1,
  sample.tree = NULL,
  preserve.order = FALSE,
  verbose = TRUE,
  ...
)
```

Example 4 (r):
```r
JointPCAIntegration(
  object = NULL,
  assay = NULL,
  layers = NULL,
  orig = NULL,
  new.reduction = "integrated.dr",
  reference = NULL,
  features = NULL,
  normalization.method = c("LogNormalize", "SCT"),
  dims = 1:30,
  k.anchor = 20,
  scale.layer = "scale.data",
  dims.to.integrate = NULL,
  k.weight = 100,
  weight.reduction = NULL,
  sd.weight = 1,
  sample.tree = NULL,
  preserve.order = FALSE,
  verbose = TRUE,
  ...
)
```

Example 5 (r):
```r
JointPCAIntegration(
  object = NULL,
  assay = NULL,
  layers = NULL,
  orig = NULL,
  new.reduction = "integrated.dr",
  reference = NULL,
  features = NULL,
  normalization.method = c("LogNormalize", "SCT"),
  dims = 1:30,
  k.anchor = 20,
  scale.layer = "scale.data",
  dims.to.integrate = NULL,
  k.weight = 100,
  weight.reduction = NULL,
  sd.weight = 1,
  sample.tree = NULL,
  preserve.order = FALSE,
  verbose = TRUE,
  ...
)
```

Example 6 (unknown):
```unknown
matrix(c(-2, 1, -3, -1), ncol = 2)
```

Example 7 (unknown):
```unknown
[,1]  [,2]
       [1,]   -2   -3
       [2,]    1   -1
```

Example 8 (unknown):
```unknown
[,1]  [,2]
       [1,]   -2   -3
       [2,]    1   -1
```

Example 9 (unknown):
```unknown
[,1]  [,2]
       [1,]   -2   -3
       [2,]    1   -1
```

Example 10 (unknown):
```unknown
FindIntegrationAnchors
```

---

## Normalize Raw Data — LogNormalize • Seurat

**URL:** http://127.0.0.1:9173/seurat/reference/lognormalize/index.html

**Contents:**
- Normalize Raw Data
- Arguments
- Value
- Examples
- Contents

Matrix with the raw count data

Scale the data; default is 1e4

Margin to normalize over

Arguments passed to other methods

A matrix with the normalized and log-transformed data

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/generics.R
```

Example 2 (unknown):
```unknown
R/preprocessing.R
```

Example 3 (unknown):
```unknown
R/preprocessing5.R
```

Example 4 (unknown):
```unknown
LogNormalize.Rd
```

Example 5 (python):
```python
LogNormalize(data, scale.factor = 10000, margin = 2L, verbose = TRUE, ...)

# S3 method for class 'data.frame'
LogNormalize(data, scale.factor = 10000, margin = 2L, verbose = TRUE, ...)

# S3 method for class 'V3Matrix'
LogNormalize(data, scale.factor = 10000, margin = 2L, verbose = TRUE, ...)

# Default S3 method
LogNormalize(data, scale.factor = 10000, margin = 2L, verbose = TRUE, ...)
```

Example 6 (r):
```r
LogNormalize(data, scale.factor = 10000, margin = 2L, verbose = TRUE, ...)

# S3 method for class 'data.frame'
LogNormalize(data, scale.factor = 10000, margin = 2L, verbose = TRUE, ...)

# S3 method for class 'V3Matrix'
LogNormalize(data, scale.factor = 10000, margin = 2L, verbose = TRUE, ...)

# Default S3 method
LogNormalize(data, scale.factor = 10000, margin = 2L, verbose = TRUE, ...)
```

Example 7 (r):
```r
LogNormalize(data, scale.factor = 10000, margin = 2L, verbose = TRUE, ...)

# S3 method for class 'data.frame'
LogNormalize(data, scale.factor = 10000, margin = 2L, verbose = TRUE, ...)

# S3 method for class 'V3Matrix'
LogNormalize(data, scale.factor = 10000, margin = 2L, verbose = TRUE, ...)

# Default S3 method
LogNormalize(data, scale.factor = 10000, margin = 2L, verbose = TRUE, ...)
```

Example 8 (unknown):
```unknown
mat <- matrix(data = rbinom(n = 25, size = 5, prob = 0.2), nrow = 5)
mat
#>      [,1] [,2] [,3] [,4] [,5]
#> [1,]    0    0    2    2    0
#> [2,]    2    0    1    2    1
#> [3,]    3    0    1    0    0
#> [4,]    1    1    3    1    1
#> [5,]    1    1    1    0    2
mat_norm <- LogNormalize(data = mat)
mat_norm
#>          [,1]     [,2]     [,3]     [,4]     [,5]
#> [1,] 0.000000 0.000000 7.824446 8.294300 0.000000
#> [2,] 7.957927 0.000000 7.131699 8.294300 7.824446
#> [3,] 8.363276 0.000000 7.131699 0.000000 0.000000
#> [4,] 7.265130 8.517393 8.229778 7.601402 7.824446
#> [5,] 7.265130 8.517393 7.131699 0.000000 8.517393
```

Example 9 (r):
```r
mat <- matrix(data = rbinom(n = 25, size = 5, prob = 0.2), nrow = 5)
mat
#>      [,1] [,2] [,3] [,4] [,5]
#> [1,]    0    0    2    2    0
#> [2,]    2    0    1    2    1
#> [3,]    3    0    1    0    0
#> [4,]    1    1    3    1    1
#> [5,]    1    1    1    0    2
mat_norm <- LogNormalize(data = mat)
mat_norm
#>          [,1]     [,2]     [,3]     [,4]     [,5]
#> [1,] 0.000000 0.000000 7.824446 8.294300 0.000000
#> [2,] 7.957927 0.000000 7.131699 8.294300 7.824446
#> [3,] 8.363276 0.000000 7.131699 0.000000 0.000000
#> [4,] 7.265130 8.517393 8.229778 7.601402 7.824446
#> [5,] 7.265130 8.517393 7.131699 0.000000 8.517393
```

Example 10 (r):
```r
mat <- matrix(data = rbinom(n = 25, size = 5, prob = 0.2), nrow = 5)
mat
#>      [,1] [,2] [,3] [,4] [,5]
#> [1,]    0    0    2    2    0
#> [2,]    2    0    1    2    1
#> [3,]    3    0    1    0    0
#> [4,]    1    1    3    1    1
#> [5,]    1    1    1    0    2
mat_norm <- LogNormalize(data = mat)
mat_norm
#>          [,1]     [,2]     [,3]     [,4]     [,5]
#> [1,] 0.000000 0.000000 7.824446 8.294300 0.000000
#> [2,] 7.957927 0.000000 7.131699 8.294300 7.824446
#> [3,] 8.363276 0.000000 7.131699 0.000000 0.000000
#> [4,] 7.265130 8.517393 8.229778 7.601402 7.824446
#> [5,] 7.265130 8.517393 7.131699 0.000000 8.517393
```

---

## Single cell violin plot — VlnPlot • Seurat

**URL:** http://127.0.0.1:9173/seurat/reference/vlnplot/index.html

**Contents:**
- Single cell violin plot
- Arguments
- Value
- See also
- Examples
- Contents

Draws a violin plot of single cell data (gene expression, metrics, PC scores, etc.)

Features to plot (gene expression, metrics, PC scores, anything that can be retreived by FetchData)

Colors to use for plotting

Point size for points

Alpha value for points

Which classes to include in the plot (default is all)

Sort identity classes (on the x-axis) by the average expression of the attribute being potted, can also pass 'increasing' or 'decreasing' to change sort direction

Name of assay to use, defaults to the active assay

Group (color) cells in different ways (for example, orig.ident)

A factor in object metadata to split the plot by, pass 'ident' to split by cell identity

Adjust parameter for geom_violin

Set all the y-axis limits to the same values

plot the feature axis on log scale

Number of columns if multiple plots are displayed

Slot to pull expression data from (e.g. "counts" or "data")

Layer to pull expression data from (e.g. "counts" or "data")

plot each group of the split violin plots by multiple or single violin shapes.

Horizontally stack plots for each feature

Combine plots into a single patchworked ggplot object. If FALSE, return a list of ggplot

Color violins/ridges based on either 'feature' or 'ident'

flip plot orientation (identities on x-axis)

determine if adding a small noise for plotting

Convert points to raster format. Requires 'ggrastr' to be installed.

A patchworked ggplot object if combine = TRUE; otherwise, a list of ggplot objects

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/visualization.R
```

Example 2 (unknown):
```unknown
VlnPlot(
  object,
  features,
  cols = NULL,
  pt.size = NULL,
  alpha = 1,
  idents = NULL,
  sort = FALSE,
  assay = NULL,
  group.by = NULL,
  split.by = NULL,
  adjust = 1,
  y.max = NULL,
  same.y.lims = FALSE,
  log = FALSE,
  ncol = NULL,
  slot = deprecated(),
  layer = NULL,
  split.plot = FALSE,
  stack = FALSE,
  combine = TRUE,
  fill.by = "feature",
  flip = FALSE,
  add.noise = TRUE,
  raster = NULL
)
```

Example 3 (r):
```r
VlnPlot(
  object,
  features,
  cols = NULL,
  pt.size = NULL,
  alpha = 1,
  idents = NULL,
  sort = FALSE,
  assay = NULL,
  group.by = NULL,
  split.by = NULL,
  adjust = 1,
  y.max = NULL,
  same.y.lims = FALSE,
  log = FALSE,
  ncol = NULL,
  slot = deprecated(),
  layer = NULL,
  split.plot = FALSE,
  stack = FALSE,
  combine = TRUE,
  fill.by = "feature",
  flip = FALSE,
  add.noise = TRUE,
  raster = NULL
)
```

Example 4 (r):
```r
VlnPlot(
  object,
  features,
  cols = NULL,
  pt.size = NULL,
  alpha = 1,
  idents = NULL,
  sort = FALSE,
  assay = NULL,
  group.by = NULL,
  split.by = NULL,
  adjust = 1,
  y.max = NULL,
  same.y.lims = FALSE,
  log = FALSE,
  ncol = NULL,
  slot = deprecated(),
  layer = NULL,
  split.plot = FALSE,
  stack = FALSE,
  combine = TRUE,
  fill.by = "feature",
  flip = FALSE,
  add.noise = TRUE,
  raster = NULL
)
```

Example 5 (unknown):
```unknown
patchworked
```

Example 6 (unknown):
```unknown
patchworked
```

Example 7 (unknown):
```unknown
combine = TRUE
```

Example 8 (unknown):
```unknown
data("pbmc_small")
VlnPlot(object = pbmc_small, features = 'PC_1')

VlnPlot(object = pbmc_small, features = 'LYZ', split.by = 'groups')
#> The default behaviour of split.by has changed.
#> Separate violin plots are now plotted side-by-side.
#> To restore the old behaviour of a single split violin,
#> set split.plot = TRUE.
#>       
#> This message will be shown once per session.
```

Example 9 (r):
```r
data("pbmc_small")
VlnPlot(object = pbmc_small, features = 'PC_1')

VlnPlot(object = pbmc_small, features = 'LYZ', split.by = 'groups')
#> The default behaviour of split.by has changed.
#> Separate violin plots are now plotted side-by-side.
#> To restore the old behaviour of a single split violin,
#> set split.plot = TRUE.
#>       
#> This message will be shown once per session.
```

Example 10 (r):
```r
data("pbmc_small")
VlnPlot(object = pbmc_small, features = 'PC_1')

VlnPlot(object = pbmc_small, features = 'LYZ', split.by = 'groups')
#> The default behaviour of split.by has changed.
#> Separate violin plots are now plotted side-by-side.
#> To restore the old behaviour of a single split violin,
#> set split.plot = TRUE.
#>       
#> This message will be shown once per session.
```

---

## Run UMAP — RunUMAP • Seurat

**URL:** http://127.0.0.1:9173/reference_runumap.html

**Contents:**
- Run UMAP
- Arguments
- Value
- References
- Examples
- Contents

Runs the Uniform Manifold Approximation and Projection (UMAP) dimensional reduction technique. To run using umap.method="umap-learn", you must first install the umap-learn python package (e.g. via pip install umap-learn). Details on this package can be found here: https://github.com/lmcinnes/umap. For a more in depth discussion of the mathematics underlying UMAP, see the ArXiv paper here: https://arxiv.org/abs/1802.03426.

Arguments passed to other methods and UMAP

dimensional reduction key, specifies the string before the number for the dimension names. UMAP by default

Assay to pull data for when using features, or assay used to construct Graph if running UMAP on a Graph

DimReduc object that contains the umap model

whether UMAP will return the uwot model

UMAP implementation to run. Can be

Runs umap via the uwot R package

Runs umap via the uwot R package and return the learned umap model

Run the Seurat wrapper of the python umap-learn package

This determines the number of neighboring points used in local approximations of manifold structure. Larger values will result in more global structure being preserved at the loss of detailed local structure. In general this parameter should often be in the range 5 to 50.

The dimension of the space to embed into.

metric: This determines the choice of metric used to measure distance in the input space. A wide variety of metrics are already coded, and a user defined function can be passed as long as it has been JITd by numba.

he number of training epochs to be used in optimizing the low dimensional embedding. Larger values result in more accurate embeddings. If NULL is specified, a value will be selected based on the size of the input dataset (200 for large datasets, 500 for small).

The initial learning rate for the embedding optimization.

This controls how tightly the embedding is allowed compress points together. Larger values ensure embedded points are more evenly distributed, while smaller values allow the algorithm to optimize more accurately with regard to local structure. Sensible values are in the range 0.001 to 0.5.

The effective scale of embedded points. In combination with min.dist this determines how clustered/clumped the embedded points are.

Interpolate between (fuzzy) union and intersection as the set operation used to combine local fuzzy simplicial sets to obtain a global fuzzy simplicial sets. Both fuzzy set operations use the product t-norm. The value of this parameter should be between 0.0 and 1.0; a value of 1.0 will use a pure fuzzy union, while 0.0 will use a pure fuzzy intersection.

The local connectivity required - i.e. the number of nearest neighbors that should be assumed to be connected at a local level. The higher this value the more connected the manifold becomes locally. In practice this should be not more than the local intrinsic dimension of the manifold.

Weighting applied to negative samples in low dimensional embedding optimization. Values higher than one will result in greater weight being given to negative samples.

The number of negative samples to select per positive sample in the optimization process. Increasing this value will result in greater repulsive force being applied, greater optimization cost, but slightly more accuracy.

More specific parameters controlling the embedding. If NULL, these values are set automatically as determined by min. dist and spread. Parameter of differentiable approximation of right adjoint functor.

More specific parameters controlling the embedding. If NULL, these values are set automatically as determined by min. dist and spread. Parameter of differentiable approximation of right adjoint functor.

Set uwot::umap(fast_sgd = TRUE); see umap for more details

Set a random seed. By default, sets the seed to 42. Setting NULL will not set a seed

A dictionary of arguments to pass on to the metric, such as the p value for Minkowski distance. If NULL then no arguments are passed on.

Whether to use an angular random projection forest to initialize the approximate nearest neighbor search. This can be faster, but is mostly on useful for metric that use an angular style distance such as cosine, correlation etc. In the case of those metrics angular forests will be chosen automatically.

Whether to use the density-augmented objective of densMAP. Turning on this option generates an embedding where the local densities are encouraged to be correlated with those in the original space. Parameters below with the prefix ‘dens’ further control the behavior of this extension. Default is FALSE. Only compatible with 'umap-learn' method and version of umap-learn >= 0.5.0

Specific parameter which controls the regularization weight of the density correlation term in densMAP. Higher values prioritize density preservation over the UMAP objective, and vice versa for values closer to zero. Setting this parameter to zero is equivalent to running the original UMAP algorithm. Default value is 2.

Specific parameter which controls the fraction of epochs (between 0 and 1) where the density-augmented objective is used in densMAP. The first (1 - dens_frac) fraction of epochs optimize the original UMAP objective before introducing the density correlation term. Default is 0.3.

Specific parameter which specifies a small constant added to the variance of local radii in the embedding when calculating the density correlation objective to prevent numerical instability from dividing by a small number. Default is 0.1.

A dictionary of arguments to pass on to the densMAP optimization.

Which dimensions to use as input features, used only if features is NULL

Which dimensional reduction (PCA or ICA) to use for the UMAP input. Default is PCA

If set, run UMAP on this subset of features (instead of running on a set of reduced dimensions). Not set (NULL) by default; dims must be NULL to run on features

Name of graph on which to run UMAP

Name of knn output on which to run UMAP

The slot used to pull data for when using features. data slot is by default.

Name to store dimensional reduction under in the Seurat object

Returns a Seurat object containing a UMAP representation

McInnes, L, Healy, J, UMAP: Uniform Manifold Approximation and Projection for Dimension Reduction, ArXiv e-prints 1802.03426, 2018

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/generics.R
```

Example 2 (unknown):
```unknown
R/dimensional_reduction.R
```

Example 3 (unknown):
```unknown
umap.method="umap-learn"
```

Example 4 (unknown):
```unknown
pip install umap-learn
```

Example 5 (python):
```python
RunUMAP(object, ...)

# Default S3 method
RunUMAP(
  object,
  reduction.key = "UMAP_",
  assay = NULL,
  reduction.model = NULL,
  return.model = FALSE,
  umap.method = "uwot",
  n.neighbors = 30L,
  n.components = 2L,
  metric = "cosine",
  n.epochs = NULL,
  learning.rate = 1,
  min.dist = 0.3,
  spread = 1,
  set.op.mix.ratio = 1,
  local.connectivity = 1L,
  repulsion.strength = 1,
  negative.sample.rate = 5,
  a = NULL,
  b = NULL,
  uwot.sgd = FALSE,
  seed.use = 42,
  metric.kwds = NULL,
  angular.rp.forest = FALSE,
  densmap = FALSE,
  dens.lambda = 2,
  dens.frac = 0.3,
  dens.var.shift = 0.1,
  verbose = TRUE,
  ...
)

# S3 method for class 'Graph'
RunUMAP(
  object,
  assay = NULL,
  umap.method = "umap-learn",
  n.components = 2L,
  metric = "correlation",
  n.epochs = 0L,
  learning.rate = 1,
  min.dist = 0.3,
  spread = 1,
  repulsion.strength = 1,
  negative.sample.rate = 5L,
  a = NULL,
  b = NULL,
  uwot.sgd = FALSE,
  seed.use = 42L,
  metric.kwds = NULL,
  densmap = FALSE,
  densmap.kwds = NULL,
  verbose = TRUE,
  reduction.key = "UMAP_",
  ...
)

# S3 method for class 'Neighbor'
RunUMAP(object, reduction.model, ...)

# S3 method for class 'Seurat'
RunUMAP(
  object,
  dims = NULL,
  reduction = "pca",
  features = NULL,
  graph = NULL,
  assay = DefaultAssay(object = object),
  nn.name = NULL,
  slot = "data",
  umap.method = "uwot",
  reduction.model = NULL,
  return.model = FALSE,
  n.neighbors = 30L,
  n.components = 2L,
  metric = "cosine",
  n.epochs = NULL,
  learning.rate = 1,
  min.dist = 0.3,
  spread = 1,
  set.op.mix.ratio = 1,
  local.connectivity = 1L,
  repulsion.strength = 1,
  negative.sample.rate = 5L,
  a = NULL,
  b = NULL,
  uwot.sgd = FALSE,
  seed.use = 42L,
  metric.kwds = NULL,
  angular.rp.forest = FALSE,
  densmap = FALSE,
  dens.lambda = 2,
  dens.frac = 0.3,
  dens.var.shift = 0.1,
  verbose = TRUE,
  reduction.name = "umap",
  reduction.key = NULL,
  ...
)
```

Example 6 (r):
```r
RunUMAP(object, ...)

# Default S3 method
RunUMAP(
  object,
  reduction.key = "UMAP_",
  assay = NULL,
  reduction.model = NULL,
  return.model = FALSE,
  umap.method = "uwot",
  n.neighbors = 30L,
  n.components = 2L,
  metric = "cosine",
  n.epochs = NULL,
  learning.rate = 1,
  min.dist = 0.3,
  spread = 1,
  set.op.mix.ratio = 1,
  local.connectivity = 1L,
  repulsion.strength = 1,
  negative.sample.rate = 5,
  a = NULL,
  b = NULL,
  uwot.sgd = FALSE,
  seed.use = 42,
  metric.kwds = NULL,
  angular.rp.forest = FALSE,
  densmap = FALSE,
  dens.lambda = 2,
  dens.frac = 0.3,
  dens.var.shift = 0.1,
  verbose = TRUE,
  ...
)

# S3 method for class 'Graph'
RunUMAP(
  object,
  assay = NULL,
  umap.method = "umap-learn",
  n.components = 2L,
  metric = "correlation",
  n.epochs = 0L,
  learning.rate = 1,
  min.dist = 0.3,
  spread = 1,
  repulsion.strength = 1,
  negative.sample.rate = 5L,
  a = NULL,
  b = NULL,
  uwot.sgd = FALSE,
  seed.use = 42L,
  metric.kwds = NULL,
  densmap = FALSE,
  densmap.kwds = NULL,
  verbose = TRUE,
  reduction.key = "UMAP_",
  ...
)

# S3 method for class 'Neighbor'
RunUMAP(object, reduction.model, ...)

# S3 method for class 'Seurat'
RunUMAP(
  object,
  dims = NULL,
  reduction = "pca",
  features = NULL,
  graph = NULL,
  assay = DefaultAssay(object = object),
  nn.name = NULL,
  slot = "data",
  umap.method = "uwot",
  reduction.model = NULL,
  return.model = FALSE,
  n.neighbors = 30L,
  n.components = 2L,
  metric = "cosine",
  n.epochs = NULL,
  learning.rate = 1,
  min.dist = 0.3,
  spread = 1,
  set.op.mix.ratio = 1,
  local.connectivity = 1L,
  repulsion.strength = 1,
  negative.sample.rate = 5L,
  a = NULL,
  b = NULL,
  uwot.sgd = FALSE,
  seed.use = 42L,
  metric.kwds = NULL,
  angular.rp.forest = FALSE,
  densmap = FALSE,
  dens.lambda = 2,
  dens.frac = 0.3,
  dens.var.shift = 0.1,
  verbose = TRUE,
  reduction.name = "umap",
  reduction.key = NULL,
  ...
)
```

Example 7 (r):
```r
RunUMAP(object, ...)

# Default S3 method
RunUMAP(
  object,
  reduction.key = "UMAP_",
  assay = NULL,
  reduction.model = NULL,
  return.model = FALSE,
  umap.method = "uwot",
  n.neighbors = 30L,
  n.components = 2L,
  metric = "cosine",
  n.epochs = NULL,
  learning.rate = 1,
  min.dist = 0.3,
  spread = 1,
  set.op.mix.ratio = 1,
  local.connectivity = 1L,
  repulsion.strength = 1,
  negative.sample.rate = 5,
  a = NULL,
  b = NULL,
  uwot.sgd = FALSE,
  seed.use = 42,
  metric.kwds = NULL,
  angular.rp.forest = FALSE,
  densmap = FALSE,
  dens.lambda = 2,
  dens.frac = 0.3,
  dens.var.shift = 0.1,
  verbose = TRUE,
  ...
)

# S3 method for class 'Graph'
RunUMAP(
  object,
  assay = NULL,
  umap.method = "umap-learn",
  n.components = 2L,
  metric = "correlation",
  n.epochs = 0L,
  learning.rate = 1,
  min.dist = 0.3,
  spread = 1,
  repulsion.strength = 1,
  negative.sample.rate = 5L,
  a = NULL,
  b = NULL,
  uwot.sgd = FALSE,
  seed.use = 42L,
  metric.kwds = NULL,
  densmap = FALSE,
  densmap.kwds = NULL,
  verbose = TRUE,
  reduction.key = "UMAP_",
  ...
)

# S3 method for class 'Neighbor'
RunUMAP(object, reduction.model, ...)

# S3 method for class 'Seurat'
RunUMAP(
  object,
  dims = NULL,
  reduction = "pca",
  features = NULL,
  graph = NULL,
  assay = DefaultAssay(object = object),
  nn.name = NULL,
  slot = "data",
  umap.method = "uwot",
  reduction.model = NULL,
  return.model = FALSE,
  n.neighbors = 30L,
  n.components = 2L,
  metric = "cosine",
  n.epochs = NULL,
  learning.rate = 1,
  min.dist = 0.3,
  spread = 1,
  set.op.mix.ratio = 1,
  local.connectivity = 1L,
  repulsion.strength = 1,
  negative.sample.rate = 5L,
  a = NULL,
  b = NULL,
  uwot.sgd = FALSE,
  seed.use = 42L,
  metric.kwds = NULL,
  angular.rp.forest = FALSE,
  densmap = FALSE,
  dens.lambda = 2,
  dens.frac = 0.3,
  dens.var.shift = 0.1,
  verbose = TRUE,
  reduction.name = "umap",
  reduction.key = NULL,
  ...
)
```

Example 8 (unknown):
```unknown
uwot::umap(fast_sgd = TRUE)
```

Example 9 (unknown):
```unknown
if (FALSE) { # \dontrun{
data("pbmc_small")
pbmc_small
# Run UMAP map on first 5 PCs
pbmc_small <- RunUMAP(object = pbmc_small, dims = 1:5)
# Plot results
DimPlot(object = pbmc_small, reduction = 'umap')
} # }
```

Example 10 (r):
```r
if (FALSE) { # \dontrun{
data("pbmc_small")
pbmc_small
# Run UMAP map on first 5 PCs
pbmc_small <- RunUMAP(object = pbmc_small, dims = 1:5)
# Plot results
DimPlot(object = pbmc_small, reduction = 'umap')
} # }
```

Example 11 (r):
```r
if (FALSE) { # \dontrun{
data("pbmc_small")
pbmc_small
# Run UMAP map on first 5 PCs
pbmc_small <- RunUMAP(object = pbmc_small, dims = 1:5)
# Plot results
DimPlot(object = pbmc_small, reduction = 'umap')
} # }
```

---

## Read and Load Nanostring SMI data — ReadNanostring • Seurat

**URL:** http://127.0.0.1:9173/seurat/reference/readnanostring/index.html

**Contents:**
- Read and Load Nanostring SMI data
- Arguments
- Value
- Note
- Progress Updates with progressr
- Parallelization with future
- Contents

Read and Load Nanostring SMI data

Path to folder containing Nanostring SMI outputs

Path to Nanostring cell x gene matrix CSV

Contains metadata including cell center, area, and stain intensities

Path to molecules file

Path to segmentations CSV

Type of cell spatial coordinate matrices to read; choose one or more of:

“centroids”: cell centroids in pixel coordinate space

“segmentations”: cell segmentations in pixel coordinate space

Type of molecule spatial coordinate matrices to read; choose one or more of:

“pixels”: molecule coordinates in pixel space

Type of available metadata to read; choose zero or more of:

“Area”: number of pixels in cell segmentation

“Mean.MembraneStain”: mean membrane stain intensity

“Mean.DAPI”: mean DAPI stain intensity

“Mean.G”: mean green channel stain intensity

“Mean.Y”: mean yellow channel stain intensity

“Mean.R”: mean red channel stain intensity

“Max.MembraneStain”: max membrane stain intensity

“Max.DAPI”: max DAPI stain intensity

“Max.G”: max green channel stain intensity

“Max.Y”: max yellow stain intensity

“Max.R”: max red stain intensity

Filter molecules that match provided string

Filter genes from cell x gene matrix that match provided string

Only load in select FOVs. Nanostring SMI data contains 30 total FOVs.

If the counts matrix should be built from molecule coordinates for a specific segmentation; One of:

“Nuclear”: nuclear segmentations

“Cytoplasm”: cell cytoplasm segmentations

“Membrane”: cell membrane segmentations

If TRUE, only load molecules within a cell

Name to store expression matrix as

ReadNanostring: A list with some combination of the following values:

“matrix”: a sparse matrix with expression data; cells are columns and features are rows

“centroids”: a data frame with cell centroid coordinates in three columns: “x”, “y”, and “cell”

“pixels”: a data frame with molecule pixel coordinates in three columns: “x”, “y”, and “gene”

LoadNanostring: A Seurat object

This function requires the data.table package to be installed

This function uses progressr to render status updates and progress bars. To enable progress updates, wrap the function call in with_progress or run handlers(global = TRUE) before running this function. For more details about progressr, please read vignette("progressr-intro")

This function uses future to enable parallelization. Parallelization strategies can be set using plan. Common plans include “sequential” for non-parallelized processing or “multisession” for parallel evaluation using multiple R sessions; for other plans, see the “Implemented evaluation strategies” section of ?future::plan. For a more thorough introduction to future, see vignette("future-1-overview")

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/preprocessing.R
```

Example 2 (unknown):
```unknown
R/convenience.R
```

Example 3 (unknown):
```unknown
ReadNanostring.Rd
```

Example 4 (python):
```python
ReadNanostring(
  data.dir,
  mtx.file = NULL,
  metadata.file = NULL,
  molecules.file = NULL,
  segmentations.file = NULL,
  type = "centroids",
  mol.type = "pixels",
  metadata = NULL,
  mols.filter = NA_character_,
  genes.filter = NA_character_,
  fov.filter = NULL,
  subset.counts.matrix = NULL,
  cell.mols.only = TRUE
)

LoadNanostring(data.dir, fov, assay = "Nanostring")
```

Example 5 (r):
```r
ReadNanostring(
  data.dir,
  mtx.file = NULL,
  metadata.file = NULL,
  molecules.file = NULL,
  segmentations.file = NULL,
  type = "centroids",
  mol.type = "pixels",
  metadata = NULL,
  mols.filter = NA_character_,
  genes.filter = NA_character_,
  fov.filter = NULL,
  subset.counts.matrix = NULL,
  cell.mols.only = TRUE
)

LoadNanostring(data.dir, fov, assay = "Nanostring")
```

Example 6 (r):
```r
ReadNanostring(
  data.dir,
  mtx.file = NULL,
  metadata.file = NULL,
  molecules.file = NULL,
  segmentations.file = NULL,
  type = "centroids",
  mol.type = "pixels",
  metadata = NULL,
  mols.filter = NA_character_,
  genes.filter = NA_character_,
  fov.filter = NULL,
  subset.counts.matrix = NULL,
  cell.mols.only = TRUE
)

LoadNanostring(data.dir, fov, assay = "Nanostring")
```

Example 7 (unknown):
```unknown
ReadNanostring
```

Example 8 (unknown):
```unknown
LoadNanostring
```

Example 9 (unknown):
```unknown
with_progress
```

Example 10 (unknown):
```unknown
handlers(global = TRUE)
```

Example 11 (unknown):
```unknown
vignette("progressr-intro")
```

Example 12 (unknown):
```unknown
multisession
```

Example 13 (unknown):
```unknown
?future::plan
```

Example 14 (unknown):
```unknown
vignette("future-1-overview")
```

---

## Normalize raw data to fractions — RelativeCounts • Seurat

**URL:** http://127.0.0.1:9173/reference_relativecounts.html

**Contents:**
- Normalize raw data to fractions
- Arguments
- Value
- Examples
- Contents

Normalize count data to relative counts per cell by dividing by the total per cell. Optionally use a scale factor, e.g. for counts per million (CPM) use scale.factor = 1e6.

Matrix with the raw count data

Scale the result. Default is 1

Returns a matrix with the relative counts

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/preprocessing.R
```

Example 2 (unknown):
```unknown
RelativeCounts.Rd
```

Example 3 (unknown):
```unknown
scale.factor = 1e6
```

Example 4 (unknown):
```unknown
RelativeCounts(data, scale.factor = 1, verbose = TRUE)
```

Example 5 (r):
```r
RelativeCounts(data, scale.factor = 1, verbose = TRUE)
```

Example 6 (r):
```r
RelativeCounts(data, scale.factor = 1, verbose = TRUE)
```

Example 7 (python):
```python
mat <- matrix(data = rbinom(n = 25, size = 5, prob = 0.2), nrow = 5)
mat
#>      [,1] [,2] [,3] [,4] [,5]
#> [1,]    0    2    0    1    2
#> [2,]    1    3    0    1    0
#> [3,]    1    1    1    3    1
#> [4,]    2    1    1    1    0
#> [5,]    0    0    2    2    0
mat_norm <- RelativeCounts(data = mat)
mat_norm
#> 5 x 5 sparse Matrix of class "dgCMatrix"
#>                                         
#> [1,] .    0.2857143 .    0.125 0.6666667
#> [2,] 0.25 0.4285714 .    0.125 .        
#> [3,] 0.25 0.1428571 0.25 0.375 0.3333333
#> [4,] 0.50 0.1428571 0.25 0.125 .        
#> [5,] .    .         0.50 0.250 .
```

Example 8 (r):
```r
mat <- matrix(data = rbinom(n = 25, size = 5, prob = 0.2), nrow = 5)
mat
#>      [,1] [,2] [,3] [,4] [,5]
#> [1,]    0    2    0    1    2
#> [2,]    1    3    0    1    0
#> [3,]    1    1    1    3    1
#> [4,]    2    1    1    1    0
#> [5,]    0    0    2    2    0
mat_norm <- RelativeCounts(data = mat)
mat_norm
#> 5 x 5 sparse Matrix of class "dgCMatrix"
#>                                         
#> [1,] .    0.2857143 .    0.125 0.6666667
#> [2,] 0.25 0.4285714 .    0.125 .        
#> [3,] 0.25 0.1428571 0.25 0.375 0.3333333
#> [4,] 0.50 0.1428571 0.25 0.125 .        
#> [5,] .    .         0.50 0.250 .
```

Example 9 (r):
```r
mat <- matrix(data = rbinom(n = 25, size = 5, prob = 0.2), nrow = 5)
mat
#>      [,1] [,2] [,3] [,4] [,5]
#> [1,]    0    2    0    1    2
#> [2,]    1    3    0    1    0
#> [3,]    1    1    1    3    1
#> [4,]    2    1    1    1    0
#> [5,]    0    0    2    2    0
mat_norm <- RelativeCounts(data = mat)
mat_norm
#> 5 x 5 sparse Matrix of class "dgCMatrix"
#>                                         
#> [1,] .    0.2857143 .    0.125 0.6666667
#> [2,] 0.25 0.4285714 .    0.125 .        
#> [3,] 0.25 0.1428571 0.25 0.375 0.3333333
#> [4,] 0.50 0.1428571 0.25 0.125 .        
#> [5,] .    .         0.50 0.250 .
```

---

## Calculate the variance to mean ratio of logged values — LogVMR • Seurat

**URL:** http://127.0.0.1:9173/seurat/reference/logvmr/index.html

**Contents:**
- Calculate the variance to mean ratio of logged values
- Arguments
- Value
- Examples
- Contents

Calculate the variance to mean ratio (VMR) in non-logspace (return answer in log-space)

Other arguments (not used)

Returns the VMR in log-space

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/utilities.R
```

Example 2 (unknown):
```unknown
LogVMR(x, ...)
```

Example 3 (r):
```r
LogVMR(x, ...)
```

Example 4 (r):
```r
LogVMR(x, ...)
```

Example 5 (unknown):
```unknown
LogVMR(x = c(1, 2, 3))
#> [1] 2.187301
```

Example 6 (r):
```r
LogVMR(x = c(1, 2, 3))
#> [1] 2.187301
```

Example 7 (r):
```r
LogVMR(x = c(1, 2, 3))
#> [1] 2.187301
```

---

## Boxplot of correlation of a variable (e.g. number of UMIs) with expression data — GroupCorrelationPlot • Seurat

**URL:** http://127.0.0.1:9173/seurat/reference/groupcorrelationplot/index.html

**Contents:**
- Boxplot of correlation of a variable (e.g. number of UMIs) with expression data
- Arguments
- Value
- Contents

Boxplot of correlation of a variable (e.g. number of UMIs) with expression data

Assay where the feature grouping info and correlations are stored

Name of the column in meta.features where the feature grouping info is stored

Name of the column in meta.features where correlation info is stored

Returns a ggplot boxplot of correlations split by group

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/visualization.R
```

Example 2 (unknown):
```unknown
GroupCorrelationPlot.Rd
```

Example 3 (unknown):
```unknown
GroupCorrelationPlot(
  object,
  assay = NULL,
  feature.group = "feature.grp",
  cor = "nCount_RNA_cor"
)
```

Example 4 (r):
```r
GroupCorrelationPlot(
  object,
  assay = NULL,
  feature.group = "feature.grp",
  cor = "nCount_RNA_cor"
)
```

Example 5 (r):
```r
GroupCorrelationPlot(
  object,
  assay = NULL,
  feature.group = "feature.grp",
  cor = "nCount_RNA_cor"
)
```

---

## Plot the Barcode Distribution and Calculated Inflection Points — BarcodeInflectionsPlot • Seurat

**URL:** http://127.0.0.1:9173/seurat/reference/barcodeinflectionsplot/index.html

**Contents:**
- Plot the Barcode Distribution and Calculated Inflection Points
- Arguments
- Value
- Details
- See also
- Author
- Examples
- Contents

This function plots the calculated inflection points derived from the barcode-rank distribution.

Returns a `ggplot2` object showing the by-group inflection points and provided (or default) rank threshold values in grey.

See [CalculateBarcodeInflections()] to calculate inflection points and [SubsetByBarcodeInflections()] to subsequently subset the Seurat object.

CalculateBarcodeInflections SubsetByBarcodeInflections

Robert A. Amezquita, robert.amezquita@fredhutch.org

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/visualization.R
```

Example 2 (unknown):
```unknown
BarcodeInflectionsPlot.Rd
```

Example 3 (unknown):
```unknown
BarcodeInflectionsPlot(object)
```

Example 4 (r):
```r
BarcodeInflectionsPlot(object)
```

Example 5 (r):
```r
BarcodeInflectionsPlot(object)
```

Example 6 (unknown):
```unknown
CalculateBarcodeInflections
```

Example 7 (unknown):
```unknown
SubsetByBarcodeInflections
```

Example 8 (unknown):
```unknown
data("pbmc_small")
pbmc_small <- CalculateBarcodeInflections(pbmc_small, group.column = 'groups')
BarcodeInflectionsPlot(pbmc_small)
```

Example 9 (r):
```r
data("pbmc_small")
pbmc_small <- CalculateBarcodeInflections(pbmc_small, group.column = 'groups')
BarcodeInflectionsPlot(pbmc_small)
```

Example 10 (r):
```r
data("pbmc_small")
pbmc_small <- CalculateBarcodeInflections(pbmc_small, group.column = 'groups')
BarcodeInflectionsPlot(pbmc_small)
```

---

## Perform sctransform-based normalization — SCTransform • Seurat

**URL:** http://127.0.0.1:9173/reference_sctransform.html

**Contents:**
- Perform sctransform-based normalization
- Arguments
- Value
- See also
- Contents

This function calls sctransform::vst. The sctransform package is available at https://github.com/satijalab/sctransform. Use this function as an alternative to the NormalizeData, FindVariableFeatures, ScaleData workflow. Results are saved in a new assay (named SCT by default) with counts being (corrected) counts, data being log1p(counts), scale.data being pearson residuals; sctransform::vst intermediate results are saved in misc slot of new assay.

Additional parameters passed to sctransform::vst

A metadata with cell attributes

If not NULL, compute residuals for the object using the provided SCT model; supports only log_umi as the latent variable. If residual.features are not specified, compute for the top variable.features.n specified in the model which are also present in the object. If residual.features are specified, the variable features of the resulting SCT assay are set to the top variable.features.n in the model.

Place corrected UMI matrix in assay counts slot; default is TRUE

Number of subsampling cells used to build NB regression; default is 5000

Genes to calculate residual features for; default is NULL (all genes). If specified, will be set to VariableFeatures of the returned object.

Use this many features as variable features after ranking by residual variance; default is 3000. Only applied if residual.features is not set.

Instead of setting a fixed number of variable features, use this residual variance cutoff; this is only used when variable.features.n is set to NULL; default is 1.3. Only applied if residual.features is not set.

Variables to regress out in a second non-regularized linear

Extra data to regress out, should be cells x latent data regression. For example, percent.mito. Default is NULL

Whether to scale residuals to have unit variance; default is FALSE

Whether to center residuals to have mean zero; default is TRUE

Range to clip the residuals to; default is c(-sqrt(n/30), sqrt(n/30)), where n is the number of cells

When set to 'v2' sets method = glmGamPoi_offset, n_cells=2000, and exclude_poisson = TRUE which causes the model to learn theta and intercept only besides excluding poisson genes from learning and regularization

If set to TRUE the residual matrix for all genes is never created in full; useful for large data sets, but will take longer to run; this will also set return.only.var.genes to TRUE; default is FALSE

If set to TRUE the scale.data matrices in output assay are subset to contain only the variable genes; default is TRUE

Set a random seed. By default, sets the seed to 1448145. Setting NULL will not set a seed.

Whether to print messages and progress bars

Name of assay to pull the count data from; default is 'RNA'

Name for the new assay containing the normalized data; default is 'SCT'

Returns a Seurat object with a new assay (named SCT by default) with counts being (corrected) counts, data being log1p(counts), scale.data being pearson residuals; sctransform::vst intermediate results are saved in misc slot of the new assay.

correct_counts get_residuals

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/generics.R
```

Example 2 (unknown):
```unknown
R/preprocessing.R
```

Example 3 (unknown):
```unknown
R/preprocessing5.R
```

Example 4 (unknown):
```unknown
SCTransform.Rd
```

Example 5 (python):
```python
SCTransform(object, ...)

# Default S3 method
SCTransform(
  object,
  cell.attr,
  reference.SCT.model = NULL,
  do.correct.umi = TRUE,
  ncells = 5000,
  residual.features = NULL,
  variable.features.n = 3000,
  variable.features.rv.th = 1.3,
  vars.to.regress = NULL,
  latent.data = NULL,
  do.scale = FALSE,
  do.center = TRUE,
  clip.range = c(-sqrt(x = ncol(x = umi)/30), sqrt(x = ncol(x = umi)/30)),
  vst.flavor = "v2",
  conserve.memory = FALSE,
  return.only.var.genes = TRUE,
  seed.use = 1448145,
  verbose = TRUE,
  ...
)

# S3 method for class 'Assay'
SCTransform(
  object,
  cell.attr,
  reference.SCT.model = NULL,
  do.correct.umi = TRUE,
  ncells = 5000,
  residual.features = NULL,
  variable.features.n = 3000,
  variable.features.rv.th = 1.3,
  vars.to.regress = NULL,
  latent.data = NULL,
  do.scale = FALSE,
  do.center = TRUE,
  clip.range = c(-sqrt(x = ncol(x = object)/30), sqrt(x = ncol(x = object)/30)),
  vst.flavor = "v2",
  conserve.memory = FALSE,
  return.only.var.genes = TRUE,
  seed.use = 1448145,
  verbose = TRUE,
  ...
)

# S3 method for class 'Seurat'
SCTransform(
  object,
  assay = "RNA",
  new.assay.name = "SCT",
  reference.SCT.model = NULL,
  do.correct.umi = TRUE,
  ncells = 5000,
  residual.features = NULL,
  variable.features.n = 3000,
  variable.features.rv.th = 1.3,
  vars.to.regress = NULL,
  do.scale = FALSE,
  do.center = TRUE,
  clip.range = c(-sqrt(x = ncol(x = object[[assay]])/30), sqrt(x = ncol(x =
    object[[assay]])/30)),
  vst.flavor = "v2",
  conserve.memory = FALSE,
  return.only.var.genes = TRUE,
  seed.use = 1448145,
  verbose = TRUE,
  ...
)

# S3 method for class 'IterableMatrix'
SCTransform(
  object,
  cell.attr,
  reference.SCT.model = NULL,
  do.correct.umi = TRUE,
  ncells = 5000,
  residual.features = NULL,
  variable.features.n = 3000,
  variable.features.rv.th = 1.3,
  vars.to.regress = NULL,
  latent.data = NULL,
  do.scale = FALSE,
  do.center = TRUE,
  clip.range = c(-sqrt(x = ncol(x = object)/30), sqrt(x = ncol(x = object)/30)),
  vst.flavor = "v2",
  conserve.memory = FALSE,
  return.only.var.genes = TRUE,
  seed.use = 1448145,
  verbose = TRUE,
  ...
)
```

Example 6 (r):
```r
SCTransform(object, ...)

# Default S3 method
SCTransform(
  object,
  cell.attr,
  reference.SCT.model = NULL,
  do.correct.umi = TRUE,
  ncells = 5000,
  residual.features = NULL,
  variable.features.n = 3000,
  variable.features.rv.th = 1.3,
  vars.to.regress = NULL,
  latent.data = NULL,
  do.scale = FALSE,
  do.center = TRUE,
  clip.range = c(-sqrt(x = ncol(x = umi)/30), sqrt(x = ncol(x = umi)/30)),
  vst.flavor = "v2",
  conserve.memory = FALSE,
  return.only.var.genes = TRUE,
  seed.use = 1448145,
  verbose = TRUE,
  ...
)

# S3 method for class 'Assay'
SCTransform(
  object,
  cell.attr,
  reference.SCT.model = NULL,
  do.correct.umi = TRUE,
  ncells = 5000,
  residual.features = NULL,
  variable.features.n = 3000,
  variable.features.rv.th = 1.3,
  vars.to.regress = NULL,
  latent.data = NULL,
  do.scale = FALSE,
  do.center = TRUE,
  clip.range = c(-sqrt(x = ncol(x = object)/30), sqrt(x = ncol(x = object)/30)),
  vst.flavor = "v2",
  conserve.memory = FALSE,
  return.only.var.genes = TRUE,
  seed.use = 1448145,
  verbose = TRUE,
  ...
)

# S3 method for class 'Seurat'
SCTransform(
  object,
  assay = "RNA",
  new.assay.name = "SCT",
  reference.SCT.model = NULL,
  do.correct.umi = TRUE,
  ncells = 5000,
  residual.features = NULL,
  variable.features.n = 3000,
  variable.features.rv.th = 1.3,
  vars.to.regress = NULL,
  do.scale = FALSE,
  do.center = TRUE,
  clip.range = c(-sqrt(x = ncol(x = object[[assay]])/30), sqrt(x = ncol(x =
    object[[assay]])/30)),
  vst.flavor = "v2",
  conserve.memory = FALSE,
  return.only.var.genes = TRUE,
  seed.use = 1448145,
  verbose = TRUE,
  ...
)

# S3 method for class 'IterableMatrix'
SCTransform(
  object,
  cell.attr,
  reference.SCT.model = NULL,
  do.correct.umi = TRUE,
  ncells = 5000,
  residual.features = NULL,
  variable.features.n = 3000,
  variable.features.rv.th = 1.3,
  vars.to.regress = NULL,
  latent.data = NULL,
  do.scale = FALSE,
  do.center = TRUE,
  clip.range = c(-sqrt(x = ncol(x = object)/30), sqrt(x = ncol(x = object)/30)),
  vst.flavor = "v2",
  conserve.memory = FALSE,
  return.only.var.genes = TRUE,
  seed.use = 1448145,
  verbose = TRUE,
  ...
)
```

Example 7 (r):
```r
SCTransform(object, ...)

# Default S3 method
SCTransform(
  object,
  cell.attr,
  reference.SCT.model = NULL,
  do.correct.umi = TRUE,
  ncells = 5000,
  residual.features = NULL,
  variable.features.n = 3000,
  variable.features.rv.th = 1.3,
  vars.to.regress = NULL,
  latent.data = NULL,
  do.scale = FALSE,
  do.center = TRUE,
  clip.range = c(-sqrt(x = ncol(x = umi)/30), sqrt(x = ncol(x = umi)/30)),
  vst.flavor = "v2",
  conserve.memory = FALSE,
  return.only.var.genes = TRUE,
  seed.use = 1448145,
  verbose = TRUE,
  ...
)

# S3 method for class 'Assay'
SCTransform(
  object,
  cell.attr,
  reference.SCT.model = NULL,
  do.correct.umi = TRUE,
  ncells = 5000,
  residual.features = NULL,
  variable.features.n = 3000,
  variable.features.rv.th = 1.3,
  vars.to.regress = NULL,
  latent.data = NULL,
  do.scale = FALSE,
  do.center = TRUE,
  clip.range = c(-sqrt(x = ncol(x = object)/30), sqrt(x = ncol(x = object)/30)),
  vst.flavor = "v2",
  conserve.memory = FALSE,
  return.only.var.genes = TRUE,
  seed.use = 1448145,
  verbose = TRUE,
  ...
)

# S3 method for class 'Seurat'
SCTransform(
  object,
  assay = "RNA",
  new.assay.name = "SCT",
  reference.SCT.model = NULL,
  do.correct.umi = TRUE,
  ncells = 5000,
  residual.features = NULL,
  variable.features.n = 3000,
  variable.features.rv.th = 1.3,
  vars.to.regress = NULL,
  do.scale = FALSE,
  do.center = TRUE,
  clip.range = c(-sqrt(x = ncol(x = object[[assay]])/30), sqrt(x = ncol(x =
    object[[assay]])/30)),
  vst.flavor = "v2",
  conserve.memory = FALSE,
  return.only.var.genes = TRUE,
  seed.use = 1448145,
  verbose = TRUE,
  ...
)

# S3 method for class 'IterableMatrix'
SCTransform(
  object,
  cell.attr,
  reference.SCT.model = NULL,
  do.correct.umi = TRUE,
  ncells = 5000,
  residual.features = NULL,
  variable.features.n = 3000,
  variable.features.rv.th = 1.3,
  vars.to.regress = NULL,
  latent.data = NULL,
  do.scale = FALSE,
  do.center = TRUE,
  clip.range = c(-sqrt(x = ncol(x = object)/30), sqrt(x = ncol(x = object)/30)),
  vst.flavor = "v2",
  conserve.memory = FALSE,
  return.only.var.genes = TRUE,
  seed.use = 1448145,
  verbose = TRUE,
  ...
)
```

Example 8 (unknown):
```unknown
sctransform::vst
```

Example 9 (unknown):
```unknown
variable.features.n
```

Example 10 (unknown):
```unknown
c(-sqrt(n/30), sqrt(n/30))
```

Example 11 (unknown):
```unknown
correct_counts
```

Example 12 (unknown):
```unknown
get_residuals
```

---

## Find features with highest scores for a given dimensional reduction technique — TopFeatures • Seurat

**URL:** http://127.0.0.1:9173/seurat/reference/topfeatures/index.html

**Contents:**
- Find features with highest scores for a given dimensional reduction technique
- Arguments
- Value
- Examples
- Contents

Return a list of features with the strongest contribution to a set of components

Number of features to return

Use the projected feature loadings

Return an equal number of features with both + and - scores.

Extra parameters passed to Loadings

Returns a vector of features

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/objects.R
```

Example 2 (unknown):
```unknown
TopFeatures.Rd
```

Example 3 (unknown):
```unknown
TopFeatures(
  object,
  dim = 1,
  nfeatures = 20,
  projected = FALSE,
  balanced = FALSE,
  ...
)
```

Example 4 (r):
```r
TopFeatures(
  object,
  dim = 1,
  nfeatures = 20,
  projected = FALSE,
  balanced = FALSE,
  ...
)
```

Example 5 (r):
```r
TopFeatures(
  object,
  dim = 1,
  nfeatures = 20,
  projected = FALSE,
  balanced = FALSE,
  ...
)
```

Example 6 (python):
```python
data("pbmc_small")
pbmc_small
#> An object of class Seurat 
#> 230 features across 80 samples within 1 assay 
#> Active assay: RNA (230 features, 20 variable features)
#>  3 layers present: counts, data, scale.data
#>  2 dimensional reductions calculated: pca, tsne
TopFeatures(object = pbmc_small[["pca"]], dim = 1)
#>  [1] "HLA-DPB1"      "HLA-DQA1"      "S100A9"        "S100A8"       
#>  [5] "GNLY"          "RP11-290F20.3" "CD1C"          "AKR1C3"       
#>  [9] "IGLL5"         "VDAC3"         "PARVB"         "RUFY1"        
#> [13] "PGRMC1"        "MYL9"          "TREML1"        "CA2"          
#> [17] "TUBB1"         "PPBP"          "PF4"           "SDPR"         
# After projection:
TopFeatures(object = pbmc_small[["pca"]], dim = 1,  projected = TRUE)
#>  [1] "HLA-DPB1"      "HLA-DQA1"      "S100A9"        "S100A8"       
#>  [5] "GNLY"          "RP11-290F20.3" "CD1C"          "AKR1C3"       
#>  [9] "IGLL5"         "VDAC3"         "PARVB"         "RUFY1"        
#> [13] "PGRMC1"        "MYL9"          "TREML1"        "CA2"          
#> [17] "TUBB1"         "PPBP"          "PF4"           "SDPR"
```

Example 7 (r):
```r
data("pbmc_small")
pbmc_small
#> An object of class Seurat 
#> 230 features across 80 samples within 1 assay 
#> Active assay: RNA (230 features, 20 variable features)
#>  3 layers present: counts, data, scale.data
#>  2 dimensional reductions calculated: pca, tsne
TopFeatures(object = pbmc_small[["pca"]], dim = 1)
#>  [1] "HLA-DPB1"      "HLA-DQA1"      "S100A9"        "S100A8"       
#>  [5] "GNLY"          "RP11-290F20.3" "CD1C"          "AKR1C3"       
#>  [9] "IGLL5"         "VDAC3"         "PARVB"         "RUFY1"        
#> [13] "PGRMC1"        "MYL9"          "TREML1"        "CA2"          
#> [17] "TUBB1"         "PPBP"          "PF4"           "SDPR"         
# After projection:
TopFeatures(object = pbmc_small[["pca"]], dim = 1,  projected = TRUE)
#>  [1] "HLA-DPB1"      "HLA-DQA1"      "S100A9"        "S100A8"       
#>  [5] "GNLY"          "RP11-290F20.3" "CD1C"          "AKR1C3"       
#>  [9] "IGLL5"         "VDAC3"         "PARVB"         "RUFY1"        
#> [13] "PGRMC1"        "MYL9"          "TREML1"        "CA2"          
#> [17] "TUBB1"         "PPBP"          "PF4"           "SDPR"
```

Example 8 (r):
```r
data("pbmc_small")
pbmc_small
#> An object of class Seurat 
#> 230 features across 80 samples within 1 assay 
#> Active assay: RNA (230 features, 20 variable features)
#>  3 layers present: counts, data, scale.data
#>  2 dimensional reductions calculated: pca, tsne
TopFeatures(object = pbmc_small[["pca"]], dim = 1)
#>  [1] "HLA-DPB1"      "HLA-DQA1"      "S100A9"        "S100A8"       
#>  [5] "GNLY"          "RP11-290F20.3" "CD1C"          "AKR1C3"       
#>  [9] "IGLL5"         "VDAC3"         "PARVB"         "RUFY1"        
#> [13] "PGRMC1"        "MYL9"          "TREML1"        "CA2"          
#> [17] "TUBB1"         "PPBP"          "PF4"           "SDPR"         
# After projection:
TopFeatures(object = pbmc_small[["pca"]], dim = 1,  projected = TRUE)
#>  [1] "HLA-DPB1"      "HLA-DQA1"      "S100A9"        "S100A8"       
#>  [5] "GNLY"          "RP11-290F20.3" "CD1C"          "AKR1C3"       
#>  [9] "IGLL5"         "VDAC3"         "PARVB"         "RUFY1"        
#> [13] "PGRMC1"        "MYL9"          "TREML1"        "CA2"          
#> [17] "TUBB1"         "PPBP"          "PF4"           "SDPR"
```

---

## The STARmap class — STARmap-class • Seurat

**URL:** http://127.0.0.1:9173/seurat/reference/starmap-class/index.html

**Contents:**
- The STARmap class
- Slots
- Contents

Name of assay to associate image data with; will give this image priority for visualization when the assay is set as the active/default assay in a Seurat object

A one-length character vector with the object's key; keys must be one or more alphanumeric characters followed by an underscore “_” (regex pattern “^[a-zA-Z][a-zA-Z0-9]*_$”)

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/objects.R
```

Example 2 (unknown):
```unknown
STARmap-class.Rd
```

Example 3 (unknown):
```unknown
^[a-zA-Z][a-zA-Z0-9]*_$
```

---

## The Neighbor Class — Neighbor-class • Seurat

**URL:** http://127.0.0.1:9173/seurat/reference/neighbor-class/index.html

**Contents:**
- The Neighbor Class
- See also
- Contents

For more details, please see the documentation in SeuratObject

SeuratObject::Neighbor-class

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/reexports.R
```

Example 2 (unknown):
```unknown
Neighbor-class.Rd
```

Example 3 (unknown):
```unknown
SeuratObject
```

Example 4 (unknown):
```unknown
SeuratObject::Neighbor-class
```

---

## Run the mark variogram computation on a given position matrix and expression matrix. — RunMarkVario • Seurat

**URL:** http://127.0.0.1:9173/seurat/reference/runmarkvario/index.html

**Contents:**
- Run the mark variogram computation on a given position matrix and expression matrix.
- Arguments
- Contents

Wraps the functionality of markvario from the spatstat package.

A 2 column matrix giving the spatial locations of each of the data points also in data

Matrix containing the data used as "marks" (e.g. gene expression)

Arguments passed to markvario

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/preprocessing.R
```

Example 2 (unknown):
```unknown
RunMarkVario.Rd
```

Example 3 (unknown):
```unknown
RunMarkVario(spatial.location, data, ...)
```

Example 4 (r):
```r
RunMarkVario(spatial.location, data, ...)
```

Example 5 (r):
```r
RunMarkVario(spatial.location, data, ...)
```

---

## Score cell cycle phases — CellCycleScoring • Seurat

**URL:** http://127.0.0.1:9173/reference_cellcyclescoring.html

**Contents:**
- Score cell cycle phases
- Arguments
- Value
- See also
- Examples
- Contents

Score cell cycle phases

A vector of features associated with S phase

A vector of features associated with G2M phase

Number of control features selected from the same bin per analyzed feature supplied to AddModuleScore. Defaults to value equivalent to minimum number of features present in 's.features' and 'g2m.features'.

If true, sets identity to phase assignments Stashes old identities in 'old.ident'

Arguments to be passed to AddModuleScore

A Seurat object with the following columns added to object meta data: S.Score, G2M.Score, and Phase

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/utilities.R
```

Example 2 (unknown):
```unknown
CellCycleScoring.Rd
```

Example 3 (unknown):
```unknown
CellCycleScoring(
  object,
  s.features,
  g2m.features,
  ctrl = NULL,
  set.ident = FALSE,
  ...
)
```

Example 4 (r):
```r
CellCycleScoring(
  object,
  s.features,
  g2m.features,
  ctrl = NULL,
  set.ident = FALSE,
  ...
)
```

Example 5 (r):
```r
CellCycleScoring(
  object,
  s.features,
  g2m.features,
  ctrl = NULL,
  set.ident = FALSE,
  ...
)
```

Example 6 (unknown):
```unknown
AddModuleScore
```

Example 7 (unknown):
```unknown
AddModuleScore
```

Example 8 (unknown):
```unknown
AddModuleScore
```

Example 9 (unknown):
```unknown
if (FALSE) { # \dontrun{
data("pbmc_small")
# pbmc_small doesn't have any cell-cycle genes
# To run CellCycleScoring, please use a dataset with cell-cycle genes
# An example is available at http://satijalab.org/seurat/cell_cycle_vignette.html
pbmc_small <- CellCycleScoring(
  object = pbmc_small,
  g2m.features = cc.genes$g2m.genes,
  s.features = cc.genes$s.genes
)
head(x = pbmc_small@meta.data)
} # }
```

Example 10 (r):
```r
if (FALSE) { # \dontrun{
data("pbmc_small")
# pbmc_small doesn't have any cell-cycle genes
# To run CellCycleScoring, please use a dataset with cell-cycle genes
# An example is available at http://satijalab.org/seurat/cell_cycle_vignette.html
pbmc_small <- CellCycleScoring(
  object = pbmc_small,
  g2m.features = cc.genes$g2m.genes,
  s.features = cc.genes$s.genes
)
head(x = pbmc_small@meta.data)
} # }
```

Example 11 (r):
```r
if (FALSE) { # \dontrun{
data("pbmc_small")
# pbmc_small doesn't have any cell-cycle genes
# To run CellCycleScoring, please use a dataset with cell-cycle genes
# An example is available at http://satijalab.org/seurat/cell_cycle_vignette.html
pbmc_small <- CellCycleScoring(
  object = pbmc_small,
  g2m.features = cc.genes$g2m.genes,
  s.features = cc.genes$s.genes
)
head(x = pbmc_small@meta.data)
} # }
```

---

## Add info to anchor matrix — AnnotateAnchors • Seurat

**URL:** http://127.0.0.1:9173/seurat/reference/annotateanchors/index.html

**Contents:**
- Add info to anchor matrix
- Arguments
- Value
- Contents

Add info to anchor matrix

Variables to pull for each object via FetchData

Slot to pull feature data for

Arguments passed to other methods

List of Seurat objects

Specify the Assay per object if annotating with expression data

Reference object used in FindTransferAnchors

Query object used in FindTransferAnchors

Returns the anchor dataframe with additional columns for annotation metadata

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/generics.R
```

Example 2 (unknown):
```unknown
R/integration.R
```

Example 3 (unknown):
```unknown
AnnotateAnchors.Rd
```

Example 4 (python):
```python
AnnotateAnchors(anchors, vars, slot, ...)

# Default S3 method
AnnotateAnchors(
  anchors,
  vars = NULL,
  slot = NULL,
  object.list,
  assay = NULL,
  ...
)

# S3 method for class 'IntegrationAnchorSet'
AnnotateAnchors(
  anchors,
  vars = NULL,
  slot = NULL,
  object.list = NULL,
  assay = NULL,
  ...
)

# S3 method for class 'TransferAnchorSet'
AnnotateAnchors(
  anchors,
  vars = NULL,
  slot = NULL,
  reference = NULL,
  query = NULL,
  assay = NULL,
  ...
)
```

Example 5 (r):
```r
AnnotateAnchors(anchors, vars, slot, ...)

# Default S3 method
AnnotateAnchors(
  anchors,
  vars = NULL,
  slot = NULL,
  object.list,
  assay = NULL,
  ...
)

# S3 method for class 'IntegrationAnchorSet'
AnnotateAnchors(
  anchors,
  vars = NULL,
  slot = NULL,
  object.list = NULL,
  assay = NULL,
  ...
)

# S3 method for class 'TransferAnchorSet'
AnnotateAnchors(
  anchors,
  vars = NULL,
  slot = NULL,
  reference = NULL,
  query = NULL,
  assay = NULL,
  ...
)
```

Example 6 (r):
```r
AnnotateAnchors(anchors, vars, slot, ...)

# Default S3 method
AnnotateAnchors(
  anchors,
  vars = NULL,
  slot = NULL,
  object.list,
  assay = NULL,
  ...
)

# S3 method for class 'IntegrationAnchorSet'
AnnotateAnchors(
  anchors,
  vars = NULL,
  slot = NULL,
  object.list = NULL,
  assay = NULL,
  ...
)

# S3 method for class 'TransferAnchorSet'
AnnotateAnchors(
  anchors,
  vars = NULL,
  slot = NULL,
  reference = NULL,
  query = NULL,
  assay = NULL,
  ...
)
```

Example 7 (unknown):
```unknown
FindTransferAnchors
```

Example 8 (unknown):
```unknown
FindTransferAnchors
```

---

## Load a 10x Genomics Visium Spatial Experiment into a Seurat object — Load10X_Spatial • Seurat

**URL:** http://127.0.0.1:9173/seurat/reference/load10x_spatial/index.html

**Contents:**
- Load a 10x Genomics Visium Spatial Experiment into a Seurat object
- Arguments
- Value
- Examples
- Contents

Load a 10x Genomics Visium Spatial Experiment into a Seurat object

Directory containing the H5 file specified by filename and the image data in a subdirectory called spatial

Name of H5 file containing the feature barcode matrix

Name of the initial assay

Name for the stored image of the tissue slice

Specifies the bin sizes to read in - defaults to c(16, 8)

Only keep spots that have been determined to be over tissue

Converts all feature names to upper case. Can be useful when analyses require comparisons between human and mouse gene names for example.

VisiumV1/VisiumV2 instance(s) - if a vector is passed in it should be co-indexed with `bin.size`

Arguments passed to Read10X_h5

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/preprocessing.R
```

Example 2 (unknown):
```unknown
Load10X_Spatial.Rd
```

Example 3 (unknown):
```unknown
Load10X_Spatial(
  data.dir,
  filename = "filtered_feature_bc_matrix.h5",
  assay = "Spatial",
  slice = "slice1",
  bin.size = NULL,
  filter.matrix = TRUE,
  to.upper = FALSE,
  image = NULL,
  ...
)
```

Example 4 (r):
```r
Load10X_Spatial(
  data.dir,
  filename = "filtered_feature_bc_matrix.h5",
  assay = "Spatial",
  slice = "slice1",
  bin.size = NULL,
  filter.matrix = TRUE,
  to.upper = FALSE,
  image = NULL,
  ...
)
```

Example 5 (r):
```r
Load10X_Spatial(
  data.dir,
  filename = "filtered_feature_bc_matrix.h5",
  assay = "Spatial",
  slice = "slice1",
  bin.size = NULL,
  filter.matrix = TRUE,
  to.upper = FALSE,
  image = NULL,
  ...
)
```

Example 6 (unknown):
```unknown
if (FALSE) { # \dontrun{
data_dir <- 'path/to/data/directory'
list.files(data_dir) # Should show filtered_feature_bc_matrix.h5
Load10X_Spatial(data.dir = data_dir)
} # }
```

Example 7 (r):
```r
if (FALSE) { # \dontrun{
data_dir <- 'path/to/data/directory'
list.files(data_dir) # Should show filtered_feature_bc_matrix.h5
Load10X_Spatial(data.dir = data_dir)
} # }
```

Example 8 (r):
```r
if (FALSE) { # \dontrun{
data_dir <- 'path/to/data/directory'
list.files(data_dir) # Should show filtered_feature_bc_matrix.h5
Load10X_Spatial(data.dir = data_dir)
} # }
```

---

## Metric for evaluating mapping success — MappingScore • Seurat

**URL:** http://127.0.0.1:9173/reference_mappingscore.html

**Contents:**
- Metric for evaluating mapping success
- Arguments
- Value
- Contents

This metric was designed to help identify query cells that aren't well represented in the reference dataset. The intuition for the score is that we are going to project the query cells into a reference-defined space and then project them back onto the query. By comparing the neighborhoods before and after projection, we identify cells who's local neighborhoods are the most affected by this transformation. This could be because there is a population of query cells that aren't present in the reference or the state of the cells in the query is significantly different from the equivalent cell type in the reference.

AnchorSet object or just anchor matrix from the Anchorset object returned from FindTransferAnchors

Reserved for internal use

Combined object (ref + query) from the Anchorset object returned

Neighbors object computed on query cells

Reference embeddings matrix

Query embeddings matrix

Number of anchors to use in projection steps when computing weights

Number of dimensions to use when working with low dimensional projections of the data

Number of cells to average over when computing transition probabilities

Number of cells to average over when determining the kernel bandwidth from the SNN graph

Amount of pruning to apply to edges in SNN graph

Option to the scoring function when computing distances to subtract the distance to the first nearest neighbor

Nearest neighbor method to use (annoy or RANN)

More trees gives higher precision when using annoy approximate nearest neighbor search

Query weights matrix for reuse

Display messages/progress

Returns a vector of cell scores

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/generics.R
```

Example 2 (unknown):
```unknown
R/integration.R
```

Example 3 (unknown):
```unknown
MappingScore.Rd
```

Example 4 (python):
```python
MappingScore(anchors, ...)

# Default S3 method
MappingScore(
  anchors,
  combined.object,
  query.neighbors,
  ref.embeddings,
  query.embeddings,
  kanchors = 50,
  ndim = 50,
  ksmooth = 100,
  ksnn = 20,
  snn.prune = 0,
  subtract.first.nn = TRUE,
  nn.method = "annoy",
  n.trees = 50,
  query.weights = NULL,
  verbose = TRUE,
  ...
)

# S3 method for class 'AnchorSet'
MappingScore(
  anchors,
  kanchors = 50,
  ndim = 50,
  ksmooth = 100,
  ksnn = 20,
  snn.prune = 0,
  subtract.first.nn = TRUE,
  nn.method = "annoy",
  n.trees = 50,
  query.weights = NULL,
  verbose = TRUE,
  ...
)
```

Example 5 (r):
```r
MappingScore(anchors, ...)

# Default S3 method
MappingScore(
  anchors,
  combined.object,
  query.neighbors,
  ref.embeddings,
  query.embeddings,
  kanchors = 50,
  ndim = 50,
  ksmooth = 100,
  ksnn = 20,
  snn.prune = 0,
  subtract.first.nn = TRUE,
  nn.method = "annoy",
  n.trees = 50,
  query.weights = NULL,
  verbose = TRUE,
  ...
)

# S3 method for class 'AnchorSet'
MappingScore(
  anchors,
  kanchors = 50,
  ndim = 50,
  ksmooth = 100,
  ksnn = 20,
  snn.prune = 0,
  subtract.first.nn = TRUE,
  nn.method = "annoy",
  n.trees = 50,
  query.weights = NULL,
  verbose = TRUE,
  ...
)
```

Example 6 (r):
```r
MappingScore(anchors, ...)

# Default S3 method
MappingScore(
  anchors,
  combined.object,
  query.neighbors,
  ref.embeddings,
  query.embeddings,
  kanchors = 50,
  ndim = 50,
  ksmooth = 100,
  ksnn = 20,
  snn.prune = 0,
  subtract.first.nn = TRUE,
  nn.method = "annoy",
  n.trees = 50,
  query.weights = NULL,
  verbose = TRUE,
  ...
)

# S3 method for class 'AnchorSet'
MappingScore(
  anchors,
  kanchors = 50,
  ndim = 50,
  ksmooth = 100,
  ksnn = 20,
  snn.prune = 0,
  subtract.first.nn = TRUE,
  nn.method = "annoy",
  n.trees = 50,
  query.weights = NULL,
  verbose = TRUE,
  ...
)
```

---

## Scale and/or center matrix rowwise — FastRowScale • Seurat

**URL:** http://127.0.0.1:9173/reference_fastrowscale.html

**Contents:**
- Scale and/or center matrix rowwise
- Arguments
- Value
- Contents

Performs row scaling and/or centering. Equivalent to using t(scale(t(mat))) in R except in the case of NA values.

a logical value indicating whether to center the rows

a logical value indicating whether to scale the rows

clip all values greater than scale_max to scale_max. Don't clip if Inf.

Returns the center/scaled matrix

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/utilities.R
```

Example 2 (unknown):
```unknown
FastRowScale.Rd
```

Example 3 (unknown):
```unknown
FastRowScale(mat, center = TRUE, scale = TRUE, scale_max = 10)
```

Example 4 (r):
```r
FastRowScale(mat, center = TRUE, scale = TRUE, scale_max = 10)
```

Example 5 (r):
```r
FastRowScale(mat, center = TRUE, scale = TRUE, scale_max = 10)
```

---

## The ModalityWeights Class — ModalityWeights-class • Seurat

**URL:** http://127.0.0.1:9173/seurat/reference/modalityweights-class/index.html

**Contents:**
- The ModalityWeights Class
- Slots
- Contents

The ModalityWeights class is an intermediate data storage class that stores the modality weight and other related information needed for performing downstream analyses - namely data integration (FindModalityWeights) and data transfer (FindMultiModalNeighbors).

A list of modality weights value from all modalities

Names of assays for the list of dimensional reductions

A list of parameters used in the FindModalityWeights

a list of score matrices representing cross and within-modality prediction score, and kernel value

Store log of parameters that were used

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/objects.R
```

Example 2 (unknown):
```unknown
ModalityWeights-class.Rd
```

Example 3 (unknown):
```unknown
FindModalityWeights
```

Example 4 (unknown):
```unknown
FindMultiModalNeighbors
```

Example 5 (unknown):
```unknown
modality.weight.list
```

Example 6 (unknown):
```unknown
modality.assay
```

Example 7 (unknown):
```unknown
score.matrix
```

---

## Get image scale factors — ScaleFactors • Seurat

**URL:** http://127.0.0.1:9173/seurat/reference/scalefactors/index.html

**Contents:**
- Get image scale factors
- Arguments
- Value
- Note
- Contents

Get image scale factors

An object to get scale factors from

Arguments passed to other methods

Spot full resolution scale factor

Fiducial full resolution scale factor

High resolutoin scale factor

Low resolution scale factor

An object of class scalefactors

scalefactors objects can be created with scalefactors()

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/generics.R
```

Example 2 (unknown):
```unknown
R/objects.R
```

Example 3 (unknown):
```unknown
ScaleFactors.Rd
```

Example 4 (python):
```python
ScaleFactors(object, ...)

scalefactors(spot, fiducial, hires, lowres)

# S3 method for class 'VisiumV1'
ScaleFactors(object, ...)

# S3 method for class 'VisiumV2'
ScaleFactors(object, ...)
```

Example 5 (r):
```r
ScaleFactors(object, ...)

scalefactors(spot, fiducial, hires, lowres)

# S3 method for class 'VisiumV1'
ScaleFactors(object, ...)

# S3 method for class 'VisiumV2'
ScaleFactors(object, ...)
```

Example 6 (r):
```r
ScaleFactors(object, ...)

scalefactors(spot, fiducial, hires, lowres)

# S3 method for class 'VisiumV1'
ScaleFactors(object, ...)

# S3 method for class 'VisiumV2'
ScaleFactors(object, ...)
```

Example 7 (unknown):
```unknown
scalefactors
```

Example 8 (unknown):
```unknown
scalefactors
```

Example 9 (unknown):
```unknown
scalefactors()
```

---

## Integrate embeddings from the integrated sketched.assay — ProjectIntegration • Seurat

**URL:** http://127.0.0.1:9173/reference_projectintegration.html

**Contents:**
- Integrate embeddings from the integrated sketched.assay
- Arguments
- Value
- Details
- Contents

The main steps of this procedure are outlined below. For a more detailed description of the methodology, please see Hao, et al Biorxiv 2022: doi:10.1101/2022.02.24.481684

A Seurat object with all cells for one dataset

Assay name for sketched-cell expression (default is 'sketch')

Assay name for original expression (default is 'RNA')

Dimensional reduction name for batch-corrected embeddings in the sketched object (default is 'integrated_dr')

Features used for atomic sketch integration

Names of layers for correction.

Name to save new reduction as; defaults to paste0(reduction, '.orig')

Key for new dimensional reduction; defaults to creating one from reduction.name

Methods to construct sketch-cell representation for all cells (default is 'sketch'). Can be one of:

“sketch”: Use random sketched data slot

“data”: Use data slot

Sketch ratio of data slot when dictionary.method is set to “sketch”; defaults to 0.8

Names of sketched layers, defaults to all layers of “object[[assay]]”

A positive integer. The seed for the random number generator, defaults to 123.

Print progress and message

Returns a Seurat object with an integrated dimensional reduction

First learn a atom dictionary representation to reconstruct each cell. Then, using this dictionary representation, reconstruct the embeddings of each cell from the integrated atoms.

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/integration.R
```

Example 2 (unknown):
```unknown
ProjectIntegration.Rd
```

Example 3 (unknown):
```unknown
ProjectIntegration(
  object,
  sketched.assay = "sketch",
  assay = "RNA",
  reduction = "integrated_dr",
  features = NULL,
  layers = "data",
  reduction.name = NULL,
  reduction.key = NULL,
  method = c("sketch", "data"),
  ratio = 0.8,
  sketched.layers = NULL,
  seed = 123,
  verbose = TRUE
)
```

Example 4 (r):
```r
ProjectIntegration(
  object,
  sketched.assay = "sketch",
  assay = "RNA",
  reduction = "integrated_dr",
  features = NULL,
  layers = "data",
  reduction.name = NULL,
  reduction.key = NULL,
  method = c("sketch", "data"),
  ratio = 0.8,
  sketched.layers = NULL,
  seed = 123,
  verbose = TRUE
)
```

Example 5 (r):
```r
ProjectIntegration(
  object,
  sketched.assay = "sketch",
  assay = "RNA",
  reduction = "integrated_dr",
  features = NULL,
  layers = "data",
  reduction.name = NULL,
  reduction.key = NULL,
  method = c("sketch", "data"),
  ratio = 0.8,
  sketched.layers = NULL,
  seed = 123,
  verbose = TRUE
)
```

Example 6 (unknown):
```unknown
paste0(reduction, '.orig')
```

Example 7 (unknown):
```unknown
reduction.name
```

Example 8 (unknown):
```unknown
dictionary.method
```

Example 9 (unknown):
```unknown
object[[assay]]
```

---

## Polygon DimPlot — PolyDimPlot • Seurat

**URL:** http://127.0.0.1:9173/seurat/reference/polydimplot/index.html

**Contents:**
- Polygon DimPlot
- Arguments
- Value
- Contents

Plot cells as polygons, rather than single points. Color cells by identity, or a categorical variable in metadata

A grouping variable present in the metadata. Default is to use the groupings present in the current cell identities (Idents(object = object))

Vector of cells to plot (default is all cells)

Name of the polygon dataframe in the misc slot

Flip x and y coordinates

Returns a ggplot object

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/visualization.R
```

Example 2 (unknown):
```unknown
PolyDimPlot.Rd
```

Example 3 (unknown):
```unknown
PolyDimPlot(
  object,
  group.by = NULL,
  cells = NULL,
  poly.data = "spatial",
  flip.coords = FALSE
)
```

Example 4 (r):
```r
PolyDimPlot(
  object,
  group.by = NULL,
  cells = NULL,
  poly.data = "spatial",
  flip.coords = FALSE
)
```

Example 5 (r):
```r
PolyDimPlot(
  object,
  group.by = NULL,
  cells = NULL,
  poly.data = "spatial",
  flip.coords = FALSE
)
```

Example 6 (unknown):
```unknown
Idents(object = object)
```

---

## The IntegrationData Class — IntegrationData-class • Seurat

**URL:** http://127.0.0.1:9173/seurat/reference/integrationdata-class/index.html

**Contents:**
- The IntegrationData Class
- Slots
- Contents

The IntegrationData object is an intermediate storage container used internally throughout the integration procedure to hold bits of data that are useful downstream.

List of neighborhood information for cells (outputs of RANN::nn2)

The offsets used to enable cell look up in downstream functions

Number of cells in each object in the object.list

Sample tree used for ordering multi-dataset integration

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/objects.R
```

Example 2 (unknown):
```unknown
IntegrationData-class.Rd
```

Example 3 (unknown):
```unknown
integration.matrix
```

Example 4 (unknown):
```unknown
objects.ncell
```

Example 5 (unknown):
```unknown
sample.tree
```

---

## Run Linear Discriminant Analysis — RunLDA • Seurat

**URL:** http://127.0.0.1:9173/reference_runlda.html

**Contents:**
- Run Linear Discriminant Analysis
- Arguments
- Contents

Run Linear Discriminant Analysis

Function to perform Linear Discriminant Analysis.

An object of class Seurat.

Arguments passed to other methods

Meta data column with target gene class labels.

Assay to use for performing Linear Discriminant Analysis (LDA).

Print the top genes associated with high/low loadings for the PCs

Number of LDA dimensions to print.

Number of features to print for each LDA component.

Value for random seed

Features to compute LDA on

dimensional reduction name, lda by default

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/generics.R
```

Example 2 (unknown):
```unknown
R/mixscape.R
```

Example 3 (python):
```python
RunLDA(object, ...)

# Default S3 method
RunLDA(
  object,
  labels,
  assay = NULL,
  verbose = TRUE,
  ndims.print = 1:5,
  nfeatures.print = 30,
  reduction.key = "LDA_",
  seed = 42,
  ...
)

# S3 method for class 'Assay'
RunLDA(
  object,
  assay = NULL,
  labels,
  features = NULL,
  verbose = TRUE,
  ndims.print = 1:5,
  nfeatures.print = 30,
  reduction.key = "LDA_",
  seed = 42,
  ...
)

# S3 method for class 'Seurat'
RunLDA(
  object,
  assay = NULL,
  labels,
  features = NULL,
  reduction.name = "lda",
  reduction.key = "LDA_",
  seed = 42,
  verbose = TRUE,
  ndims.print = 1:5,
  nfeatures.print = 30,
  ...
)
```

Example 4 (r):
```r
RunLDA(object, ...)

# Default S3 method
RunLDA(
  object,
  labels,
  assay = NULL,
  verbose = TRUE,
  ndims.print = 1:5,
  nfeatures.print = 30,
  reduction.key = "LDA_",
  seed = 42,
  ...
)

# S3 method for class 'Assay'
RunLDA(
  object,
  assay = NULL,
  labels,
  features = NULL,
  verbose = TRUE,
  ndims.print = 1:5,
  nfeatures.print = 30,
  reduction.key = "LDA_",
  seed = 42,
  ...
)

# S3 method for class 'Seurat'
RunLDA(
  object,
  assay = NULL,
  labels,
  features = NULL,
  reduction.name = "lda",
  reduction.key = "LDA_",
  seed = 42,
  verbose = TRUE,
  ndims.print = 1:5,
  nfeatures.print = 30,
  ...
)
```

Example 5 (r):
```r
RunLDA(object, ...)

# Default S3 method
RunLDA(
  object,
  labels,
  assay = NULL,
  verbose = TRUE,
  ndims.print = 1:5,
  nfeatures.print = 30,
  reduction.key = "LDA_",
  seed = 42,
  ...
)

# S3 method for class 'Assay'
RunLDA(
  object,
  assay = NULL,
  labels,
  features = NULL,
  verbose = TRUE,
  ndims.print = 1:5,
  nfeatures.print = 30,
  reduction.key = "LDA_",
  seed = 42,
  ...
)

# S3 method for class 'Seurat'
RunLDA(
  object,
  assay = NULL,
  labels,
  features = NULL,
  reduction.name = "lda",
  reduction.key = "LDA_",
  seed = 42,
  verbose = TRUE,
  ndims.print = 1:5,
  nfeatures.print = 30,
  ...
)
```

---

## Perform Canonical Correlation Analysis — RunCCA • Seurat

**URL:** http://127.0.0.1:9173/reference_runcca.html

**Contents:**
- Perform Canonical Correlation Analysis
- Arguments
- Value
- See also
- Examples
- Contents

Runs a canonical correlation analysis using a diagonal implementation of CCA. For details about stored CCA calculation parameters, see PrintCCAParams.

Second Seurat object.

Extra parameters (passed onto MergeSeurat in case with two objects passed, passed onto ScaleData in case with single object and rescale.groups set to TRUE)

Standardize matrices - scales columns to have unit variance and mean 0

Number of canonical vectors to calculate

Random seed to set. If NULL, does not set a seed

Show progress messages

Assays to pull from in the first and second objects, respectively

Set of genes to use in CCA. Default is the union of both the variable features sets present in both objects.

Renormalize raw data after merging the objects. If FALSE, merge the data matrices also.

Rescale the datasets prior to CCA. If FALSE, uses existing data in the scale data slots.

Also compute the gene loadings. NOTE - this will scale every gene in the dataset which may impose a high memory cost.

Returns a combined Seurat object with the CCA results stored.

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/generics.R
```

Example 2 (unknown):
```unknown
R/dimensional_reduction.R
```

Example 3 (unknown):
```unknown
PrintCCAParams
```

Example 4 (python):
```python
RunCCA(object1, object2, ...)

# Default S3 method
RunCCA(
  object1,
  object2,
  standardize = TRUE,
  num.cc = 20,
  seed.use = 42,
  verbose = FALSE,
  ...
)

# S3 method for class 'Seurat'
RunCCA(
  object1,
  object2,
  assay1 = NULL,
  assay2 = NULL,
  num.cc = 20,
  features = NULL,
  renormalize = FALSE,
  rescale = FALSE,
  compute.gene.loadings = TRUE,
  add.cell.id1 = NULL,
  add.cell.id2 = NULL,
  verbose = TRUE,
  ...
)
```

Example 5 (r):
```r
RunCCA(object1, object2, ...)

# Default S3 method
RunCCA(
  object1,
  object2,
  standardize = TRUE,
  num.cc = 20,
  seed.use = 42,
  verbose = FALSE,
  ...
)

# S3 method for class 'Seurat'
RunCCA(
  object1,
  object2,
  assay1 = NULL,
  assay2 = NULL,
  num.cc = 20,
  features = NULL,
  renormalize = FALSE,
  rescale = FALSE,
  compute.gene.loadings = TRUE,
  add.cell.id1 = NULL,
  add.cell.id2 = NULL,
  verbose = TRUE,
  ...
)
```

Example 6 (r):
```r
RunCCA(object1, object2, ...)

# Default S3 method
RunCCA(
  object1,
  object2,
  standardize = TRUE,
  num.cc = 20,
  seed.use = 42,
  verbose = FALSE,
  ...
)

# S3 method for class 'Seurat'
RunCCA(
  object1,
  object2,
  assay1 = NULL,
  assay2 = NULL,
  num.cc = 20,
  features = NULL,
  renormalize = FALSE,
  rescale = FALSE,
  compute.gene.loadings = TRUE,
  add.cell.id1 = NULL,
  add.cell.id2 = NULL,
  verbose = TRUE,
  ...
)
```

Example 7 (unknown):
```unknown
merge.Seurat
```

Example 8 (python):
```python
if (FALSE) { # \dontrun{
data("pbmc_small")
pbmc_small
# As CCA requires two datasets, we will split our test object into two just for this example
pbmc1 <- subset(pbmc_small, cells = colnames(pbmc_small)[1:40])
pbmc2 <- subset(pbmc_small, cells = colnames(x = pbmc_small)[41:80])
pbmc1[["group"]] <- "group1"
pbmc2[["group"]] <- "group2"
pbmc_cca <- RunCCA(object1 = pbmc1, object2 = pbmc2)
# Print results
print(x = pbmc_cca[["cca"]])
} # }
```

Example 9 (r):
```r
if (FALSE) { # \dontrun{
data("pbmc_small")
pbmc_small
# As CCA requires two datasets, we will split our test object into two just for this example
pbmc1 <- subset(pbmc_small, cells = colnames(pbmc_small)[1:40])
pbmc2 <- subset(pbmc_small, cells = colnames(x = pbmc_small)[41:80])
pbmc1[["group"]] <- "group1"
pbmc2[["group"]] <- "group2"
pbmc_cca <- RunCCA(object1 = pbmc1, object2 = pbmc2)
# Print results
print(x = pbmc_cca[["cca"]])
} # }
```

Example 10 (r):
```r
if (FALSE) { # \dontrun{
data("pbmc_small")
pbmc_small
# As CCA requires two datasets, we will split our test object into two just for this example
pbmc1 <- subset(pbmc_small, cells = colnames(pbmc_small)[1:40])
pbmc2 <- subset(pbmc_small, cells = colnames(x = pbmc_small)[41:80])
pbmc1[["group"]] <- "group1"
pbmc2[["group"]] <- "group2"
pbmc_cca <- RunCCA(object1 = pbmc1, object2 = pbmc2)
# Print results
print(x = pbmc_cca[["cca"]])
} # }
```

---

## The AnchorSet Class — AnchorSet-class • Seurat

**URL:** http://127.0.0.1:9173/reference_anchorset-class.html

**Contents:**
- The AnchorSet Class
- Slots
- Contents

The AnchorSet class is an intermediate data storage class that stores the anchors and other related information needed for performing downstream analyses - namely data integration (IntegrateData) and data transfer (TransferData).

List of objects used to create anchors

List of cell names in the reference dataset - needed when performing data transfer.

Position of reference object/s in object.list

List of cell names in the query dataset - needed when performing data transfer

The anchor matrix. This contains the cell indices of both anchor pair cells, the anchor score, and the index of the original dataset in the object.list for cell1 and cell2 of the anchor.

The offsets used to enable cell look up in downstream functions

The weight dimensional reduction used to calculate weight matrix

The features used when performing anchor finding.

List containing Neighbor objects for reuse later (e.g. mapping)

Store log of parameters that were used

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/objects.R
```

Example 2 (unknown):
```unknown
AnchorSet-class.Rd
```

Example 3 (unknown):
```unknown
IntegrateData
```

Example 4 (unknown):
```unknown
TransferData
```

Example 5 (unknown):
```unknown
object.list
```

Example 6 (unknown):
```unknown
reference.cells
```

Example 7 (unknown):
```unknown
reference.objects
```

Example 8 (unknown):
```unknown
query.cells
```

Example 9 (unknown):
```unknown
weight.reduction
```

Example 10 (unknown):
```unknown
anchor.features
```

---

## Load in data from 10X — Read10X • Seurat

**URL:** http://127.0.0.1:9173/seurat/reference/read10x/index.html

**Contents:**
- Load in data from 10X
- Arguments
- Value
- Examples
- Contents

Enables easy loading of sparse data matrices provided by 10X genomics.

Directory containing the matrix.mtx, genes.tsv (or features.tsv), and barcodes.tsv files provided by 10X. A vector or named vector can be given in order to load several data directories. If a named vector is given, the cell barcode names will be prefixed with the name.

Specify which column of genes.tsv or features.tsv to use for gene names; default is 2

Specify which column of barcodes.tsv to use for cell names; default is 1

Make feature names unique (default TRUE)

Remove trailing "-1" if present in all cell barcodes.

If features.csv indicates the data has multiple data types, a list containing a sparse matrix of the data from each type will be returned. Otherwise a sparse matrix containing the expression data will be returned.

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/preprocessing.R
```

Example 2 (unknown):
```unknown
Read10X(
  data.dir,
  gene.column = 2,
  cell.column = 1,
  unique.features = TRUE,
  strip.suffix = FALSE
)
```

Example 3 (r):
```r
Read10X(
  data.dir,
  gene.column = 2,
  cell.column = 1,
  unique.features = TRUE,
  strip.suffix = FALSE
)
```

Example 4 (r):
```r
Read10X(
  data.dir,
  gene.column = 2,
  cell.column = 1,
  unique.features = TRUE,
  strip.suffix = FALSE
)
```

Example 5 (python):
```python
if (FALSE) { # \dontrun{
# For output from CellRanger < 3.0
data_dir <- 'path/to/data/directory'
list.files(data_dir) # Should show barcodes.tsv, genes.tsv, and matrix.mtx
expression_matrix <- Read10X(data.dir = data_dir)
seurat_object = CreateSeuratObject(counts = expression_matrix)

# For output from CellRanger >= 3.0 with multiple data types
data_dir <- 'path/to/data/directory'
list.files(data_dir) # Should show barcodes.tsv.gz, features.tsv.gz, and matrix.mtx.gz
data <- Read10X(data.dir = data_dir)
seurat_object = CreateSeuratObject(counts = data$`Gene Expression`)
seurat_object[['Protein']] = CreateAssayObject(counts = data$`Antibody Capture`)
} # }
```

Example 6 (r):
```r
if (FALSE) { # \dontrun{
# For output from CellRanger < 3.0
data_dir <- 'path/to/data/directory'
list.files(data_dir) # Should show barcodes.tsv, genes.tsv, and matrix.mtx
expression_matrix <- Read10X(data.dir = data_dir)
seurat_object = CreateSeuratObject(counts = expression_matrix)

# For output from CellRanger >= 3.0 with multiple data types
data_dir <- 'path/to/data/directory'
list.files(data_dir) # Should show barcodes.tsv.gz, features.tsv.gz, and matrix.mtx.gz
data <- Read10X(data.dir = data_dir)
seurat_object = CreateSeuratObject(counts = data$`Gene Expression`)
seurat_object[['Protein']] = CreateAssayObject(counts = data$`Antibody Capture`)
} # }
```

Example 7 (r):
```r
if (FALSE) { # \dontrun{
# For output from CellRanger < 3.0
data_dir <- 'path/to/data/directory'
list.files(data_dir) # Should show barcodes.tsv, genes.tsv, and matrix.mtx
expression_matrix <- Read10X(data.dir = data_dir)
seurat_object = CreateSeuratObject(counts = expression_matrix)

# For output from CellRanger >= 3.0 with multiple data types
data_dir <- 'path/to/data/directory'
list.files(data_dir) # Should show barcodes.tsv.gz, features.tsv.gz, and matrix.mtx.gz
data <- Read10X(data.dir = data_dir)
seurat_object = CreateSeuratObject(counts = data$`Gene Expression`)
seurat_object[['Protein']] = CreateAssayObject(counts = data$`Antibody Capture`)
} # }
```

---

## Load the Annoy index file — LoadAnnoyIndex • Seurat

**URL:** http://127.0.0.1:9173/reference_loadannoyindex.html

**Contents:**
- Load the Annoy index file
- Arguments
- Value
- Contents

Load the Annoy index file

Path to file with annoy index

Returns the Neighbor object with the index stored

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/utilities.R
```

Example 2 (unknown):
```unknown
LoadAnnoyIndex.Rd
```

Example 3 (unknown):
```unknown
LoadAnnoyIndex(object, file)
```

Example 4 (r):
```r
LoadAnnoyIndex(object, file)
```

Example 5 (r):
```r
LoadAnnoyIndex(object, file)
```

---

## Compute the correlation of features broken down by groups with another covariate — GroupCorrelation • Seurat

**URL:** http://127.0.0.1:9173/reference_groupcorrelation.html

**Contents:**
- Compute the correlation of features broken down by groups with another covariate
- Arguments
- Value
- Contents

Compute the correlation of features broken down by groups with another covariate

Assay to pull the data from

Slot in the assay to pull feature expression data from (counts, data, or scale.data)

Variable with which to correlate the features

Compute the gene groups based off the data in this assay.

Only compute for genes in at least this many cells

Number of groups to split into

Display the group correlation boxplot (via GroupCorrelationPlot)

A Seurat object with the correlation stored in metafeatures

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/utilities.R
```

Example 2 (unknown):
```unknown
GroupCorrelation.Rd
```

Example 3 (unknown):
```unknown
GroupCorrelation(
  object,
  assay = NULL,
  slot = "scale.data",
  var = NULL,
  group.assay = NULL,
  min.cells = 5,
  ngroups = 6,
  do.plot = TRUE
)
```

Example 4 (r):
```r
GroupCorrelation(
  object,
  assay = NULL,
  slot = "scale.data",
  var = NULL,
  group.assay = NULL,
  min.cells = 5,
  ngroups = 6,
  do.plot = TRUE
)
```

Example 5 (r):
```r
GroupCorrelation(
  object,
  assay = NULL,
  slot = "scale.data",
  var = NULL,
  group.assay = NULL,
  min.cells = 5,
  ngroups = 6,
  do.plot = TRUE
)
```

Example 6 (unknown):
```unknown
GroupCorrelationPlot
```

---

## JackStraw Plot — JackStrawPlot • Seurat

**URL:** http://127.0.0.1:9173/seurat/reference/jackstrawplot/index.html

**Contents:**
- JackStraw Plot
- Arguments
- Value
- Details
- See also
- Author
- Examples
- Contents

Plots the results of the JackStraw analysis for PCA significance. For each PC, plots a QQ-plot comparing the distribution of p-values for all genes across each PC, compared with a uniform distribution. Also determines a p-value for the overall significance of each PC (see Details).

Vector of colors, each color corresponds to an individual PC. This may also be a single character or numeric value corresponding to a palette as specified by brewer.pal.info. By default, ggplot2 assigns colors. We also include a number of palettes from the pals package. See DiscretePalette for details.

reduction to pull jackstraw info from

X-axis maximum on each QQ plot.

Y-axis maximum on each QQ plot.

Significant PCs should show a p-value distribution (black curve) that is strongly skewed to the left compared to the null distribution (dashed line) The p-value for each PC is based on a proportion test comparing the number of genes with a p-value below a particular threshold (score.thresh), compared with the proportion of genes expected under a uniform distribution of p-values.

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/visualization.R
```

Example 2 (unknown):
```unknown
JackStrawPlot.Rd
```

Example 3 (unknown):
```unknown
JackStrawPlot(
  object,
  dims = 1:5,
  cols = NULL,
  reduction = "pca",
  xmax = 0.1,
  ymax = 0.3
)
```

Example 4 (r):
```r
JackStrawPlot(
  object,
  dims = 1:5,
  cols = NULL,
  reduction = "pca",
  xmax = 0.1,
  ymax = 0.3
)
```

Example 5 (r):
```r
JackStrawPlot(
  object,
  dims = 1:5,
  cols = NULL,
  reduction = "pca",
  xmax = 0.1,
  ymax = 0.3
)
```

Example 6 (unknown):
```unknown
brewer.pal.info
```

Example 7 (unknown):
```unknown
DiscretePalette
```

Example 8 (unknown):
```unknown
ScoreJackStraw
```

Example 9 (unknown):
```unknown
data("pbmc_small")
JackStrawPlot(object = pbmc_small)
#> Warning: Removed 83 rows containing missing values or values outside the scale range (`geom_point()`).
```

Example 10 (r):
```r
data("pbmc_small")
JackStrawPlot(object = pbmc_small)
#> Warning: Removed 83 rows containing missing values or values outside the scale range (`geom_point()`).
```

Example 11 (r):
```r
data("pbmc_small")
JackStrawPlot(object = pbmc_small)
#> Warning: Removed 83 rows containing missing values or values outside the scale range (`geom_point()`).
```

---

## Sample UMI — SampleUMI • Seurat

**URL:** http://127.0.0.1:9173/reference_sampleumi.html

**Contents:**
- Sample UMI
- Arguments
- Value
- Examples
- Contents

Downsample each cell to a specified number of UMIs. Includes an option to upsample cells below specified UMI as well.

Matrix with the raw count data

Number of UMIs to sample to

Upsamples all cells with fewer than max.umi

Display the progress bar

Matrix with downsampled data

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/preprocessing.R
```

Example 2 (unknown):
```unknown
SampleUMI.Rd
```

Example 3 (unknown):
```unknown
SampleUMI(data, max.umi = 1000, upsample = FALSE, verbose = FALSE)
```

Example 4 (r):
```r
SampleUMI(data, max.umi = 1000, upsample = FALSE, verbose = FALSE)
```

Example 5 (r):
```r
SampleUMI(data, max.umi = 1000, upsample = FALSE, verbose = FALSE)
```

Example 6 (python):
```python
data("pbmc_small")
counts = as.matrix(x = GetAssayData(object = pbmc_small, assay = "RNA", slot = "counts"))
downsampled = SampleUMI(data = counts)
head(x = downsampled)
#> 6 x 80 sparse Matrix of class "dgCMatrix"
#>   [[ suppressing 80 column names ‘ATGCCAGAACGACT’, ‘CATGGCCTGTGCAT’, ‘GAACCTGATGAACC’ ... ]]
#>                                                                                
#> MS4A1    . . . . . . . . . .  2  2  4 4  2  3 3  4  2  3 .  . .  . 1 . . . .  .
#> CD79B    1 . . . . . . . . 1  2  4  3 3  2  3 1  2  2  5 .  . .  . . . . . .  1
#> CD79A    . . . . . . . . . .  .  5  2 2  5  8 1  5  5 12 .  . 1  . . . . 1 .  .
#> HLA-DRA  . 1 . . 1 1 . 1 . . 14 28 18 7 15 28 7 26 10 16 7 22 . 10 6 . 4 3 7 13
#> TCL1A    . . . . . . . . . .  3  .  2 4  .  . 3  3  3  2 .  . .  . . . . . .  .
#> HLA-DQB1 1 . . . . . . . . .  1  6  2 2  2  8 2  2  1  2 .  3 .  . . . 1 . 1  .
#>                                                                              
#> MS4A1    . . . . . . . . . . . . . . . . . . . .  .  . . . .  .  .  . . .   .
#> CD79B    1 . 2 . . . . . . . . . . . . . . . . .  1  . 1 1 2  2  .  . 3 .   .
#> CD79A    . . . . . . . . . . . . . . . . . . . .  .  . . . .  .  .  . . .   .
#> HLA-DRA  . 1 . . 1 . 1 1 . . . . . . . 1 1 1 . . 10 10 4 1 6 28 10 13 5 8 108
#> TCL1A    . . . . . . . . . . . . . . . . . . . .  .  . . . .  .  .  . . .   .
#> HLA-DQB1 . . . . . . . . . . . . . . . . . . . .  .  1 1 . 2  .  .  1 1 .  21
#>                                                          
#> MS4A1     .  .  .   .  .  .  1  .   . . . . . . . . . . .
#> CD79B     .  .  4   1  .  .  .  .   . . . . . . . . . . .
#> CD79A     .  .  8   .  .  .  .  1   . . . . . . . . . . .
#> HLA-DRA  93 41 42 138 77 76 15 19 104 1 . . . 2 1 1 . 2 7
#> TCL1A     .  .  4   .  .  .  .  .   . . . . . . . . . . .
#> HLA-DQB1 21  3  5  11 11 10  1  2  11 . . . . . . . . . 1
```

Example 7 (r):
```r
data("pbmc_small")
counts = as.matrix(x = GetAssayData(object = pbmc_small, assay = "RNA", slot = "counts"))
downsampled = SampleUMI(data = counts)
head(x = downsampled)
#> 6 x 80 sparse Matrix of class "dgCMatrix"
#>   [[ suppressing 80 column names ‘ATGCCAGAACGACT’, ‘CATGGCCTGTGCAT’, ‘GAACCTGATGAACC’ ... ]]
#>                                                                                
#> MS4A1    . . . . . . . . . .  2  2  4 4  2  3 3  4  2  3 .  . .  . 1 . . . .  .
#> CD79B    1 . . . . . . . . 1  2  4  3 3  2  3 1  2  2  5 .  . .  . . . . . .  1
#> CD79A    . . . . . . . . . .  .  5  2 2  5  8 1  5  5 12 .  . 1  . . . . 1 .  .
#> HLA-DRA  . 1 . . 1 1 . 1 . . 14 28 18 7 15 28 7 26 10 16 7 22 . 10 6 . 4 3 7 13
#> TCL1A    . . . . . . . . . .  3  .  2 4  .  . 3  3  3  2 .  . .  . . . . . .  .
#> HLA-DQB1 1 . . . . . . . . .  1  6  2 2  2  8 2  2  1  2 .  3 .  . . . 1 . 1  .
#>                                                                              
#> MS4A1    . . . . . . . . . . . . . . . . . . . .  .  . . . .  .  .  . . .   .
#> CD79B    1 . 2 . . . . . . . . . . . . . . . . .  1  . 1 1 2  2  .  . 3 .   .
#> CD79A    . . . . . . . . . . . . . . . . . . . .  .  . . . .  .  .  . . .   .
#> HLA-DRA  . 1 . . 1 . 1 1 . . . . . . . 1 1 1 . . 10 10 4 1 6 28 10 13 5 8 108
#> TCL1A    . . . . . . . . . . . . . . . . . . . .  .  . . . .  .  .  . . .   .
#> HLA-DQB1 . . . . . . . . . . . . . . . . . . . .  .  1 1 . 2  .  .  1 1 .  21
#>                                                          
#> MS4A1     .  .  .   .  .  .  1  .   . . . . . . . . . . .
#> CD79B     .  .  4   1  .  .  .  .   . . . . . . . . . . .
#> CD79A     .  .  8   .  .  .  .  1   . . . . . . . . . . .
#> HLA-DRA  93 41 42 138 77 76 15 19 104 1 . . . 2 1 1 . 2 7
#> TCL1A     .  .  4   .  .  .  .  .   . . . . . . . . . . .
#> HLA-DQB1 21  3  5  11 11 10  1  2  11 . . . . . . . . . 1
```

Example 8 (r):
```r
data("pbmc_small")
counts = as.matrix(x = GetAssayData(object = pbmc_small, assay = "RNA", slot = "counts"))
downsampled = SampleUMI(data = counts)
head(x = downsampled)
#> 6 x 80 sparse Matrix of class "dgCMatrix"
#>   [[ suppressing 80 column names ‘ATGCCAGAACGACT’, ‘CATGGCCTGTGCAT’, ‘GAACCTGATGAACC’ ... ]]
#>                                                                                
#> MS4A1    . . . . . . . . . .  2  2  4 4  2  3 3  4  2  3 .  . .  . 1 . . . .  .
#> CD79B    1 . . . . . . . . 1  2  4  3 3  2  3 1  2  2  5 .  . .  . . . . . .  1
#> CD79A    . . . . . . . . . .  .  5  2 2  5  8 1  5  5 12 .  . 1  . . . . 1 .  .
#> HLA-DRA  . 1 . . 1 1 . 1 . . 14 28 18 7 15 28 7 26 10 16 7 22 . 10 6 . 4 3 7 13
#> TCL1A    . . . . . . . . . .  3  .  2 4  .  . 3  3  3  2 .  . .  . . . . . .  .
#> HLA-DQB1 1 . . . . . . . . .  1  6  2 2  2  8 2  2  1  2 .  3 .  . . . 1 . 1  .
#>                                                                              
#> MS4A1    . . . . . . . . . . . . . . . . . . . .  .  . . . .  .  .  . . .   .
#> CD79B    1 . 2 . . . . . . . . . . . . . . . . .  1  . 1 1 2  2  .  . 3 .   .
#> CD79A    . . . . . . . . . . . . . . . . . . . .  .  . . . .  .  .  . . .   .
#> HLA-DRA  . 1 . . 1 . 1 1 . . . . . . . 1 1 1 . . 10 10 4 1 6 28 10 13 5 8 108
#> TCL1A    . . . . . . . . . . . . . . . . . . . .  .  . . . .  .  .  . . .   .
#> HLA-DQB1 . . . . . . . . . . . . . . . . . . . .  .  1 1 . 2  .  .  1 1 .  21
#>                                                          
#> MS4A1     .  .  .   .  .  .  1  .   . . . . . . . . . . .
#> CD79B     .  .  4   1  .  .  .  .   . . . . . . . . . . .
#> CD79A     .  .  8   .  .  .  .  1   . . . . . . . . . . .
#> HLA-DRA  93 41 42 138 77 76 15 19 104 1 . . . 2 1 1 . 2 7
#> TCL1A     .  .  4   .  .  .  .  .   . . . . . . . . . . .
#> HLA-DQB1 21  3  5  11 11 10  1  2  11 . . . . . . . . . 1
```

---

## Get the intensity and/or luminance of a color — contrast-theory • Seurat

**URL:** http://127.0.0.1:9173/seurat/reference/contrast-theory/index.html

**Contents:**
- Get the intensity and/or luminance of a color
- Source
- Arguments
- Value
- Examples
- Contents

Get the intensity and/or luminance of a color

https://stackoverflow.com/questions/3942878/how-to-decide-font-color-in-white-or-black-depending-on-background-color

A vector of intensities/luminances for each color

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/visualization.R
```

Example 2 (unknown):
```unknown
contrast-theory.Rd
```

Example 3 (unknown):
```unknown
Intensity(color)

Luminance(color)
```

Example 4 (r):
```r
Intensity(color)

Luminance(color)
```

Example 5 (r):
```r
Intensity(color)

Luminance(color)
```

Example 6 (unknown):
```unknown
Intensity(color = c('black', 'white', '#E76BF3'))
#>   black   white #E76BF3 
#>    0.00  255.00  159.58 

Luminance(color = c('black', 'white', '#E76BF3'))
#>     black     white   #E76BF3 
#> 0.0000000 1.0000000 0.3397538
```

Example 7 (r):
```r
Intensity(color = c('black', 'white', '#E76BF3'))
#>   black   white #E76BF3 
#>    0.00  255.00  159.58 

Luminance(color = c('black', 'white', '#E76BF3'))
#>     black     white   #E76BF3 
#> 0.0000000 1.0000000 0.3397538
```

Example 8 (r):
```r
Intensity(color = c('black', 'white', '#E76BF3'))
#>   black   white #E76BF3 
#>    0.00  255.00  159.58 

Luminance(color = c('black', 'white', '#E76BF3'))
#>     black     white   #E76BF3 
#> 0.0000000 1.0000000 0.3397538
```

---

## Aggregate expression of multiple features into a single feature — MetaFeature • Seurat

**URL:** http://127.0.0.1:9173/reference_metafeature.html

**Contents:**
- Aggregate expression of multiple features into a single feature
- Arguments
- Value
- Examples
- Contents

Calculates relative contribution of each feature to each cell for given set of features.

List of features to aggregate

Name of column in metadata to store metafeature

List of cells to use (default all cells)

Which slot to take data from (default data)

Returns a Seurat object with metafeature stored in objct metadata

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/utilities.R
```

Example 2 (unknown):
```unknown
MetaFeature.Rd
```

Example 3 (unknown):
```unknown
MetaFeature(
  object,
  features,
  meta.name = "metafeature",
  cells = NULL,
  assay = NULL,
  slot = "data"
)
```

Example 4 (r):
```r
MetaFeature(
  object,
  features,
  meta.name = "metafeature",
  cells = NULL,
  assay = NULL,
  slot = "data"
)
```

Example 5 (r):
```r
MetaFeature(
  object,
  features,
  meta.name = "metafeature",
  cells = NULL,
  assay = NULL,
  slot = "data"
)
```

Example 6 (unknown):
```unknown
data("pbmc_small")
pbmc_small <- MetaFeature(
  object = pbmc_small,
  features = c("LTB", "EAF2"),
  meta.name = 'var.aggregate'
)
head(pbmc_small[[]])
#>                   orig.ident nCount_RNA nFeature_RNA RNA_snn_res.0.8
#> ATGCCAGAACGACT SeuratProject         70           47               0
#> CATGGCCTGTGCAT SeuratProject         85           52               0
#> GAACCTGATGAACC SeuratProject         87           50               1
#> TGACTGGATTCTCA SeuratProject        127           56               0
#> AGTCAGACTGCACA SeuratProject        173           53               0
#> TCTGATACACGTGT SeuratProject         70           48               0
#>                letter.idents groups RNA_snn_res.1 var.aggregate
#> ATGCCAGAACGACT             A     g2             0    0.01322615
#> CATGGCCTGTGCAT             A     g1             0    0.01464857
#> GAACCTGATGAACC             B     g2             0    0.01558293
#> TGACTGGATTCTCA             A     g2             0    0.01512254
#> AGTCAGACTGCACA             A     g2             0    0.01125977
#> TCTGATACACGTGT             A     g1             0    0.01385247
```

Example 7 (r):
```r
data("pbmc_small")
pbmc_small <- MetaFeature(
  object = pbmc_small,
  features = c("LTB", "EAF2"),
  meta.name = 'var.aggregate'
)
head(pbmc_small[[]])
#>                   orig.ident nCount_RNA nFeature_RNA RNA_snn_res.0.8
#> ATGCCAGAACGACT SeuratProject         70           47               0
#> CATGGCCTGTGCAT SeuratProject         85           52               0
#> GAACCTGATGAACC SeuratProject         87           50               1
#> TGACTGGATTCTCA SeuratProject        127           56               0
#> AGTCAGACTGCACA SeuratProject        173           53               0
#> TCTGATACACGTGT SeuratProject         70           48               0
#>                letter.idents groups RNA_snn_res.1 var.aggregate
#> ATGCCAGAACGACT             A     g2             0    0.01322615
#> CATGGCCTGTGCAT             A     g1             0    0.01464857
#> GAACCTGATGAACC             B     g2             0    0.01558293
#> TGACTGGATTCTCA             A     g2             0    0.01512254
#> AGTCAGACTGCACA             A     g2             0    0.01125977
#> TCTGATACACGTGT             A     g1             0    0.01385247
```

Example 8 (r):
```r
data("pbmc_small")
pbmc_small <- MetaFeature(
  object = pbmc_small,
  features = c("LTB", "EAF2"),
  meta.name = 'var.aggregate'
)
head(pbmc_small[[]])
#>                   orig.ident nCount_RNA nFeature_RNA RNA_snn_res.0.8
#> ATGCCAGAACGACT SeuratProject         70           47               0
#> CATGGCCTGTGCAT SeuratProject         85           52               0
#> GAACCTGATGAACC SeuratProject         87           50               1
#> TGACTGGATTCTCA SeuratProject        127           56               0
#> AGTCAGACTGCACA SeuratProject        173           53               0
#> TCTGATACACGTGT SeuratProject         70           48               0
#>                letter.idents groups RNA_snn_res.1 var.aggregate
#> ATGCCAGAACGACT             A     g2             0    0.01322615
#> CATGGCCTGTGCAT             A     g1             0    0.01464857
#> GAACCTGATGAACC             B     g2             0    0.01558293
#> TGACTGGATTCTCA             A     g2             0    0.01512254
#> AGTCAGACTGCACA             A     g2             0    0.01125977
#> TCTGATACACGTGT             A     g1             0    0.01385247
```

---

## Save the Annoy index — SaveAnnoyIndex • Seurat

**URL:** http://127.0.0.1:9173/reference_saveannoyindex.html

**Contents:**
- Save the Annoy index
- Arguments
- Contents

A Neighbor object with the annoy index stored

Path to file to write index to

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/utilities.R
```

Example 2 (unknown):
```unknown
SaveAnnoyIndex.Rd
```

Example 3 (unknown):
```unknown
SaveAnnoyIndex(object, file)
```

Example 4 (r):
```r
SaveAnnoyIndex(object, file)
```

Example 5 (r):
```r
SaveAnnoyIndex(object, file)
```

---

## Apply a ceiling and floor to all values in a matrix — MinMax • Seurat

**URL:** http://127.0.0.1:9173/seurat/reference/minmax/index.html

**Contents:**
- Apply a ceiling and floor to all values in a matrix
- Arguments
- Value
- Examples
- Contents

Apply a ceiling and floor to all values in a matrix

all values below this min value will be replaced with min

all values above this max value will be replaced with max

Returns matrix after performing these floor and ceil operations

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/utilities.R
```

Example 2 (unknown):
```unknown
MinMax(data, min, max)
```

Example 3 (r):
```r
MinMax(data, min, max)
```

Example 4 (r):
```r
MinMax(data, min, max)
```

Example 5 (unknown):
```unknown
mat <- matrix(data = rbinom(n = 25, size = 20, prob = 0.2 ), nrow = 5)
mat
#>      [,1] [,2] [,3] [,4] [,5]
#> [1,]    3    6    3    4    5
#> [2,]    4    5    6    5    4
#> [3,]    4    5    5    1    6
#> [4,]    4    2    5    4    4
#> [5,]    2    5    4    5    3
MinMax(data = mat, min = 4, max = 5)
#>      [,1] [,2] [,3] [,4] [,5]
#> [1,]    4    5    4    4    5
#> [2,]    4    5    5    5    4
#> [3,]    4    5    5    4    5
#> [4,]    4    4    5    4    4
#> [5,]    4    5    4    5    4
```

Example 6 (r):
```r
mat <- matrix(data = rbinom(n = 25, size = 20, prob = 0.2 ), nrow = 5)
mat
#>      [,1] [,2] [,3] [,4] [,5]
#> [1,]    3    6    3    4    5
#> [2,]    4    5    6    5    4
#> [3,]    4    5    5    1    6
#> [4,]    4    2    5    4    4
#> [5,]    2    5    4    5    3
MinMax(data = mat, min = 4, max = 5)
#>      [,1] [,2] [,3] [,4] [,5]
#> [1,]    4    5    4    4    5
#> [2,]    4    5    5    5    4
#> [3,]    4    5    5    4    5
#> [4,]    4    4    5    4    4
#> [5,]    4    5    4    5    4
```

Example 7 (r):
```r
mat <- matrix(data = rbinom(n = 25, size = 20, prob = 0.2 ), nrow = 5)
mat
#>      [,1] [,2] [,3] [,4] [,5]
#> [1,]    3    6    3    4    5
#> [2,]    4    5    6    5    4
#> [3,]    4    5    5    1    6
#> [4,]    4    2    5    4    4
#> [5,]    2    5    4    5    3
MinMax(data = mat, min = 4, max = 5)
#>      [,1] [,2] [,3] [,4] [,5]
#> [1,]    4    5    4    4    5
#> [2,]    4    5    5    5    4
#> [3,]    4    5    5    4    5
#> [4,]    4    4    5    4    4
#> [5,]    4    5    4    5    4
```

---

## Color dimensional reduction plot by tree split — ColorDimSplit • Seurat

**URL:** http://127.0.0.1:9173/reference_colordimsplit.html

**Contents:**
- Color dimensional reduction plot by tree split
- Arguments
- Value
- See also
- Examples
- Contents

Returns a DimPlot colored based on whether the cells fall in clusters to the left or to the right of a node split in the cluster tree.

Node in cluster tree on which to base the split

Color for the left side of the split

Color for the right side of the split

Color for all other cells

Arguments passed on to DimPlot

Dimensions to plot, must be a two-length numeric vector specifying x- and y-dimensions

Vector of cells to plot (default is all cells)

Vector of colors, each color corresponds to an identity class. This may also be a single character or numeric value corresponding to a palette as specified by brewer.pal.info. By default, ggplot2 assigns colors. We also include a number of palettes from the pals package. See DiscretePalette for details.

Adjust point size for plotting

Which dimensionality reduction to use. If not specified, first searches for umap, then tsne, then pca

Name of one or more metadata columns to group (color) cells by (for example, orig.ident); pass 'ident' to group by identity class

A factor in object metadata to split the plot by, pass 'ident' to split by cell identity

If NULL, all points are circles (default). You can specify any cell attribute (that can be pulled with FetchData) allowing for both different colors and different shapes on cells. Only applicable if raster = FALSE.

Specify the order of plotting for the idents. This can be useful for crowded plots if points of interest are being buried. Provide either a full list of valid idents or a subset to be plotted last (on top)

Whether to randomly shuffle the order of points. This can be useful for crowded plots if points of interest are being buried. (default is FALSE)

Sets the seed if randomly shuffling the order of points.

Whether to label the clusters

Sets the color of the label text

Whether to put a box around the label text (geom_text vs geom_label)

Alpha value for plotting (default is 1)

Adjust stroke (outline) size of points

A list of character or numeric vectors of cells to highlight. If only one group of cells desired, can simply pass a vector instead of a list. If set, colors selected cells to the color(s) in cols.highlight and other cells black (white if dark.theme = TRUE); will also resize to the size(s) passed to sizes.highlight

A vector of colors to highlight the cells as; will repeat to the length groups in cells.highlight

Size of highlighted cells; will repeat to the length groups in cells.highlight. If sizes.highlight = TRUE size of all points will be this value.

Color value for NA points when using custom scale

Number of columns for display when combining plots

Combine plots into a single patchworked ggplot object. If FALSE, return a list of ggplot objects

Convert points to raster format, default is NULL which automatically rasterizes if plotting more than 100,000 cells

Pixel resolution for rasterized plots, passed to geom_scattermore(). Default is c(512, 512).

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/visualization.R
```

Example 2 (unknown):
```unknown
ColorDimSplit.Rd
```

Example 3 (unknown):
```unknown
ColorDimSplit(
  object,
  node,
  left.color = "red",
  right.color = "blue",
  other.color = "grey50",
  ...
)
```

Example 4 (r):
```r
ColorDimSplit(
  object,
  node,
  left.color = "red",
  right.color = "blue",
  other.color = "grey50",
  ...
)
```

Example 5 (r):
```r
ColorDimSplit(
  object,
  node,
  left.color = "red",
  right.color = "blue",
  other.color = "grey50",
  ...
)
```

Example 6 (unknown):
```unknown
brewer.pal.info
```

Example 7 (unknown):
```unknown
DiscretePalette
```

Example 8 (unknown):
```unknown
raster = FALSE
```

Example 9 (unknown):
```unknown
label.color
```

Example 10 (unknown):
```unknown
stroke.size
```

Example 11 (unknown):
```unknown
cells.highlight
```

Example 12 (unknown):
```unknown
cols.highlight
```

Example 13 (unknown):
```unknown
sizes.highlight
```

Example 14 (unknown):
```unknown
cols.highlight
```

Example 15 (unknown):
```unknown
sizes.highlight
```

Example 16 (unknown):
```unknown
sizes.highlight = TRUE
```

Example 17 (unknown):
```unknown
patchworked
```

Example 18 (unknown):
```unknown
if (FALSE) { # \dontrun{
if (requireNamespace("ape", quietly = TRUE)) {
  data("pbmc_small")
  pbmc_small <- BuildClusterTree(object = pbmc_small, verbose = FALSE)
  PlotClusterTree(pbmc_small)
  ColorDimSplit(pbmc_small, node = 5)
}
} # }
```

Example 19 (r):
```r
if (FALSE) { # \dontrun{
if (requireNamespace("ape", quietly = TRUE)) {
  data("pbmc_small")
  pbmc_small <- BuildClusterTree(object = pbmc_small, verbose = FALSE)
  PlotClusterTree(pbmc_small)
  ColorDimSplit(pbmc_small, node = 5)
}
} # }
```

Example 20 (r):
```r
if (FALSE) { # \dontrun{
if (requireNamespace("ape", quietly = TRUE)) {
  data("pbmc_small")
  pbmc_small <- BuildClusterTree(object = pbmc_small, verbose = FALSE)
  PlotClusterTree(pbmc_small)
  ColorDimSplit(pbmc_small, node = 5)
}
} # }
```

---

## Seurat-RPCA Integration — RPCAIntegration • Seurat

**URL:** http://127.0.0.1:9173/seurat/reference/rpcaintegration/index.html

**Contents:**
- Seurat-RPCA Integration
- Arguments
- Examples
- Contents

Seurat-RPCA Integration

Name of Assay in the Seurat object

Names of layers in assay

A DimReduc to correct

Name of new integrated dimensional reduction

A reference Seurat object

A vector of features to use for integration

Name of normalization method used: LogNormalize or SCT

Dimensions of dimensional reduction to use for integration

Number of anchors to filter

Name of scaled layer in Assay

Number of dimensions to return integrated values for

Number of neighbors to consider when weighting anchors

Dimension reduction to use when calculating anchor weights. This can be one of:

A string, specifying the name of a dimension reduction present in all objects to be integrated

A vector of strings, specifying the name of a dimension reduction to use for each object to be integrated

A vector of DimReduc objects, specifying the object to use for each object in the integration

NULL, in which case the full corrected space is used for computing anchor weights.

Controls the bandwidth of the Gaussian kernel for weighting

Specify the order of integration. Order of integration should be encoded in a matrix, where each row represents one of the pairwise integration steps. Negative numbers specify a dataset, positive numbers specify the integration results from a given row (the format of the merge matrix included in the hclust function output). For example: matrix(c(-2, 1, -3, -1), ncol = 2) gives:

Which would cause dataset 2 and 3 to be integrated first, then the resulting object integrated with dataset 1.

If NULL, the sample tree will be computed automatically.

Do not reorder objects based on size for each pairwise integration.

Arguments passed on to FindIntegrationAnchors

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/integration5.R
```

Example 2 (unknown):
```unknown
RPCAIntegration.Rd
```

Example 3 (unknown):
```unknown
RPCAIntegration(
  object = NULL,
  assay = NULL,
  layers = NULL,
  orig = NULL,
  new.reduction = "integrated.dr",
  reference = NULL,
  features = NULL,
  normalization.method = c("LogNormalize", "SCT"),
  dims = 1:30,
  k.filter = NA,
  scale.layer = "scale.data",
  dims.to.integrate = NULL,
  k.weight = 100,
  weight.reduction = NULL,
  sd.weight = 1,
  sample.tree = NULL,
  preserve.order = FALSE,
  verbose = TRUE,
  ...
)
```

Example 4 (r):
```r
RPCAIntegration(
  object = NULL,
  assay = NULL,
  layers = NULL,
  orig = NULL,
  new.reduction = "integrated.dr",
  reference = NULL,
  features = NULL,
  normalization.method = c("LogNormalize", "SCT"),
  dims = 1:30,
  k.filter = NA,
  scale.layer = "scale.data",
  dims.to.integrate = NULL,
  k.weight = 100,
  weight.reduction = NULL,
  sd.weight = 1,
  sample.tree = NULL,
  preserve.order = FALSE,
  verbose = TRUE,
  ...
)
```

Example 5 (r):
```r
RPCAIntegration(
  object = NULL,
  assay = NULL,
  layers = NULL,
  orig = NULL,
  new.reduction = "integrated.dr",
  reference = NULL,
  features = NULL,
  normalization.method = c("LogNormalize", "SCT"),
  dims = 1:30,
  k.filter = NA,
  scale.layer = "scale.data",
  dims.to.integrate = NULL,
  k.weight = 100,
  weight.reduction = NULL,
  sd.weight = 1,
  sample.tree = NULL,
  preserve.order = FALSE,
  verbose = TRUE,
  ...
)
```

Example 6 (unknown):
```unknown
matrix(c(-2, 1, -3, -1), ncol = 2)
```

Example 7 (unknown):
```unknown
[,1]  [,2]
       [1,]   -2   -3
       [2,]    1   -1
```

Example 8 (unknown):
```unknown
[,1]  [,2]
       [1,]   -2   -3
       [2,]    1   -1
```

Example 9 (unknown):
```unknown
[,1]  [,2]
       [1,]   -2   -3
       [2,]    1   -1
```

Example 10 (unknown):
```unknown
FindIntegrationAnchors
```

Example 11 (unknown):
```unknown
if (FALSE) { # \dontrun{
# Preprocessing
obj <- SeuratData::LoadData("pbmcsca")
obj[["RNA"]] <- split(obj[["RNA"]], f = obj$Method)
obj <- NormalizeData(obj)
obj <- FindVariableFeatures(obj)
obj <- ScaleData(obj)
obj <- RunPCA(obj)

# After preprocessing, we run integration
obj <- IntegrateLayers(object = obj, method = RPCAIntegration,
  orig.reduction = "pca", new.reduction = 'integrated.rpca',
  verbose = FALSE)

# Reference-based Integration
# Here, we use the first layer as a reference for integraion
# Thus, we only identify anchors between the reference and the rest of the datasets,
# saving computational resources
obj <- IntegrateLayers(object = obj, method = RPCAIntegration,
  orig.reduction = "pca", new.reduction = 'integrated.rpca',
  reference = 1, verbose = FALSE)

# Modifying parameters
# We can also specify parameters such as `k.anchor` to increase the strength of
# integration
obj <- IntegrateLayers(object = obj, method = RPCAIntegration,
  orig.reduction = "pca", new.reduction = 'integrated.rpca',
  k.anchor = 20, verbose = FALSE)

# Integrating SCTransformed data
obj <- SCTransform(object = obj)
obj <- IntegrateLayers(object = obj, method = RPCAIntegration,
  orig.reduction = "pca", new.reduction = 'integrated.rpca',
  assay = "SCT", verbose = FALSE)
} # }
```

Example 12 (r):
```r
if (FALSE) { # \dontrun{
# Preprocessing
obj <- SeuratData::LoadData("pbmcsca")
obj[["RNA"]] <- split(obj[["RNA"]], f = obj$Method)
obj <- NormalizeData(obj)
obj <- FindVariableFeatures(obj)
obj <- ScaleData(obj)
obj <- RunPCA(obj)

# After preprocessing, we run integration
obj <- IntegrateLayers(object = obj, method = RPCAIntegration,
  orig.reduction = "pca", new.reduction = 'integrated.rpca',
  verbose = FALSE)

# Reference-based Integration
# Here, we use the first layer as a reference for integraion
# Thus, we only identify anchors between the reference and the rest of the datasets,
# saving computational resources
obj <- IntegrateLayers(object = obj, method = RPCAIntegration,
  orig.reduction = "pca", new.reduction = 'integrated.rpca',
  reference = 1, verbose = FALSE)

# Modifying parameters
# We can also specify parameters such as `k.anchor` to increase the strength of
# integration
obj <- IntegrateLayers(object = obj, method = RPCAIntegration,
  orig.reduction = "pca", new.reduction = 'integrated.rpca',
  k.anchor = 20, verbose = FALSE)

# Integrating SCTransformed data
obj <- SCTransform(object = obj)
obj <- IntegrateLayers(object = obj, method = RPCAIntegration,
  orig.reduction = "pca", new.reduction = 'integrated.rpca',
  assay = "SCT", verbose = FALSE)
} # }
```

Example 13 (r):
```r
if (FALSE) { # \dontrun{
# Preprocessing
obj <- SeuratData::LoadData("pbmcsca")
obj[["RNA"]] <- split(obj[["RNA"]], f = obj$Method)
obj <- NormalizeData(obj)
obj <- FindVariableFeatures(obj)
obj <- ScaleData(obj)
obj <- RunPCA(obj)

# After preprocessing, we run integration
obj <- IntegrateLayers(object = obj, method = RPCAIntegration,
  orig.reduction = "pca", new.reduction = 'integrated.rpca',
  verbose = FALSE)

# Reference-based Integration
# Here, we use the first layer as a reference for integraion
# Thus, we only identify anchors between the reference and the rest of the datasets,
# saving computational resources
obj <- IntegrateLayers(object = obj, method = RPCAIntegration,
  orig.reduction = "pca", new.reduction = 'integrated.rpca',
  reference = 1, verbose = FALSE)

# Modifying parameters
# We can also specify parameters such as `k.anchor` to increase the strength of
# integration
obj <- IntegrateLayers(object = obj, method = RPCAIntegration,
  orig.reduction = "pca", new.reduction = 'integrated.rpca',
  k.anchor = 20, verbose = FALSE)

# Integrating SCTransformed data
obj <- SCTransform(object = obj)
obj <- IntegrateLayers(object = obj, method = RPCAIntegration,
  orig.reduction = "pca", new.reduction = 'integrated.rpca',
  assay = "SCT", verbose = FALSE)
} # }
```

---

## Spatial Cluster Plots — ImageDimPlot • Seurat

**URL:** http://127.0.0.1:9173/seurat/reference/imagedimplot/index.html

**Contents:**
- Spatial Cluster Plots
- Arguments
- Value
- Contents

Visualize clusters or other categorical groupings in a spatial context

A vector of segmentation boundaries per image to plot; can be a character vector, a named character vector, or a named list. Names should be the names of FOVs and values should be the names of segmentation boundaries

Name of one or more metadata columns to group (color) cells by (for example, orig.ident); pass 'ident' to group by identity class

A factor in object metadata to split the plot by, pass 'ident' to split by cell identity

Vector of colors, each color corresponds to an identity class. This may also be a single character or numeric value corresponding to a palette as specified by brewer.pal.info. By default, ggplot2 assigns colors. We also include a number of palettes from the pals package. See DiscretePalette for details.

Randomly shuffle colors when a palette or vector of colors is provided to cols

Point size for cells when plotting centroids

A vector of molecules to plot

Point size for molecules

A vector of color for molecules. The "Set1" palette from RColorBrewer is used by default.

Alpha value for molecules, should be between 0 and 1

Max number of each molecule specified in `molecules` to plot

Alpha value for plotting (default is 1)

Color of cell segmentation border; pass NA to suppress borders for segmentation-based plots

Thickness of cell segmentation borders; pass NA to suppress borders for centroid-based plots

Color value for NA points when using custom scale

Set plot background to black

Crop the plots to area with cells only

Vector of cells to plot (default is all cells)

Overlay boundaries from a single image to create a single plot; if TRUE, then boundaries are stacked in the order they're given (first is lowest)

Keep axes and panel background

Combine plots into a single patchwork ggplot object.If FALSE, return a list of ggplot objects

Plot cartesian coordinates with fixed aspect ratio

Flag to flip X and Y axes. Default is TRUE.

If combine = TRUE, a patchwork ggplot object; otherwise, a list of ggplot objects

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/visualization.R
```

Example 2 (unknown):
```unknown
ImageDimPlot.Rd
```

Example 3 (unknown):
```unknown
ImageDimPlot(
  object,
  fov = NULL,
  boundaries = NULL,
  group.by = NULL,
  split.by = NULL,
  cols = NULL,
  shuffle.cols = FALSE,
  size = 0.5,
  molecules = NULL,
  mols.size = 0.1,
  mols.cols = NULL,
  mols.alpha = 1,
  nmols = 1000,
  alpha = 1,
  border.color = "white",
  border.size = NULL,
  na.value = "grey50",
  dark.background = TRUE,
  crop = FALSE,
  cells = NULL,
  overlap = FALSE,
  axes = FALSE,
  combine = TRUE,
  coord.fixed = TRUE,
  flip_xy = TRUE
)
```

Example 4 (r):
```r
ImageDimPlot(
  object,
  fov = NULL,
  boundaries = NULL,
  group.by = NULL,
  split.by = NULL,
  cols = NULL,
  shuffle.cols = FALSE,
  size = 0.5,
  molecules = NULL,
  mols.size = 0.1,
  mols.cols = NULL,
  mols.alpha = 1,
  nmols = 1000,
  alpha = 1,
  border.color = "white",
  border.size = NULL,
  na.value = "grey50",
  dark.background = TRUE,
  crop = FALSE,
  cells = NULL,
  overlap = FALSE,
  axes = FALSE,
  combine = TRUE,
  coord.fixed = TRUE,
  flip_xy = TRUE
)
```

Example 5 (r):
```r
ImageDimPlot(
  object,
  fov = NULL,
  boundaries = NULL,
  group.by = NULL,
  split.by = NULL,
  cols = NULL,
  shuffle.cols = FALSE,
  size = 0.5,
  molecules = NULL,
  mols.size = 0.1,
  mols.cols = NULL,
  mols.alpha = 1,
  nmols = 1000,
  alpha = 1,
  border.color = "white",
  border.size = NULL,
  na.value = "grey50",
  dark.background = TRUE,
  crop = FALSE,
  cells = NULL,
  overlap = FALSE,
  axes = FALSE,
  combine = TRUE,
  coord.fixed = TRUE,
  flip_xy = TRUE
)
```

Example 6 (unknown):
```unknown
brewer.pal.info
```

Example 7 (unknown):
```unknown
DiscretePalette
```

Example 8 (unknown):
```unknown
combine = TRUE
```

---

## Integrate Layers — IntegrateLayers • Seurat

**URL:** http://127.0.0.1:9173/seurat/reference/integratelayers/index.html

**Contents:**
- Integrate Layers
- Arguments
- Value
- Integration Method Functions
- See also
- Contents

Integration method function

Name of dimensional reduction for correction

Name of assay for integration

A vector of features to use for integration

Names of normalized layers in assay

Name(s) of scaled layer(s) in assay

Arguments passed on to method

object with integration data added to it

The following integration method functions are available:

Writing integration method functions

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/integration5.R
```

Example 2 (unknown):
```unknown
IntegrateLayers.Rd
```

Example 3 (unknown):
```unknown
IntegrateLayers(
  object,
  method,
  orig.reduction = "pca",
  assay = NULL,
  features = NULL,
  layers = NULL,
  scale.layer = "scale.data",
  ...
)
```

Example 4 (r):
```r
IntegrateLayers(
  object,
  method,
  orig.reduction = "pca",
  assay = NULL,
  features = NULL,
  layers = NULL,
  scale.layer = "scale.data",
  ...
)
```

Example 5 (r):
```r
IntegrateLayers(
  object,
  method,
  orig.reduction = "pca",
  assay = NULL,
  features = NULL,
  layers = NULL,
  scale.layer = "scale.data",
  ...
)
```

Example 6 (unknown):
```unknown
CCAIntegration
```

Example 7 (unknown):
```unknown
HarmonyIntegration
```

Example 8 (unknown):
```unknown
JointPCAIntegration
```

Example 9 (unknown):
```unknown
RPCAIntegration
```

---

## Calculate pearson residuals of features not in the scale.data — GetResidual • Seurat

**URL:** http://127.0.0.1:9173/seurat/reference/getresidual/index.html

**Contents:**
- Calculate pearson residuals of features not in the scale.data
- Arguments
- Value
- See also
- Examples
- Contents

This function calls sctransform::get_residuals.

Name of features to add into the scale.data

Name of the assay of the seurat object generated by SCTransform

Name of the assay of the seurat object containing UMI matrix and the default is RNA

Numeric of length two specifying the min and max values the Pearson residual will be clipped to

Recalculate residuals for all features, even if they are already present. Useful if you want to change the clip.range.

For features where there is no feature model stored, return NA for residual value in scale.data when na.rm = FALSE. When na.rm is TRUE, only return residuals for features with a model stored for all cells.

Whether to print messages and progress bars

Returns a Seurat object containing Pearson residuals of added features in its scale.data

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/preprocessing.R
```

Example 2 (unknown):
```unknown
GetResidual.Rd
```

Example 3 (unknown):
```unknown
GetResidual(
  object,
  features,
  assay = NULL,
  umi.assay = "RNA",
  clip.range = NULL,
  replace.value = FALSE,
  na.rm = TRUE,
  verbose = TRUE
)
```

Example 4 (r):
```r
GetResidual(
  object,
  features,
  assay = NULL,
  umi.assay = "RNA",
  clip.range = NULL,
  replace.value = FALSE,
  na.rm = TRUE,
  verbose = TRUE
)
```

Example 5 (r):
```r
GetResidual(
  object,
  features,
  assay = NULL,
  umi.assay = "RNA",
  clip.range = NULL,
  replace.value = FALSE,
  na.rm = TRUE,
  verbose = TRUE
)
```

Example 6 (unknown):
```unknown
get_residuals
```

Example 7 (unknown):
```unknown
if (FALSE) { # \dontrun{
data("pbmc_small")
pbmc_small <- SCTransform(object = pbmc_small, variable.features.n = 20)
pbmc_small <- GetResidual(object = pbmc_small, features = c('MS4A1', 'TCL1A'))
} # }
```

Example 8 (r):
```r
if (FALSE) { # \dontrun{
data("pbmc_small")
pbmc_small <- SCTransform(object = pbmc_small, variable.features.n = 20)
pbmc_small <- GetResidual(object = pbmc_small, features = c('MS4A1', 'TCL1A'))
} # }
```

Example 9 (r):
```r
if (FALSE) { # \dontrun{
data("pbmc_small")
pbmc_small <- SCTransform(object = pbmc_small, variable.features.n = 20)
pbmc_small <- GetResidual(object = pbmc_small, features = c('MS4A1', 'TCL1A'))
} # }
```

---

## Rename Cells in an Object — RenameCells.SCTAssay • Seurat

**URL:** http://127.0.0.1:9173/reference_renamecells.html

**Contents:**
- Rename Cells in an Object
- Arguments
- See also
- Contents

Rename Cells in an Object

vector of new cell names

Arguments passed to other methods

SeuratObject::RenameCells

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/objects.R
```

Example 2 (unknown):
```unknown
RenameCells.Rd
```

Example 3 (python):
```python
# S3 method for class 'SCTAssay'
RenameCells(object, new.names = NULL, ...)

# S3 method for class 'SlideSeq'
RenameCells(object, new.names = NULL, ...)

# S3 method for class 'STARmap'
RenameCells(object, new.names = NULL, ...)

# S3 method for class 'VisiumV1'
RenameCells(object, new.names = NULL, ...)
```

Example 4 (r):
```r
# S3 method for class 'SCTAssay'
RenameCells(object, new.names = NULL, ...)

# S3 method for class 'SlideSeq'
RenameCells(object, new.names = NULL, ...)

# S3 method for class 'STARmap'
RenameCells(object, new.names = NULL, ...)

# S3 method for class 'VisiumV1'
RenameCells(object, new.names = NULL, ...)
```

Example 5 (r):
```r
# S3 method for class 'SCTAssay'
RenameCells(object, new.names = NULL, ...)

# S3 method for class 'SlideSeq'
RenameCells(object, new.names = NULL, ...)

# S3 method for class 'STARmap'
RenameCells(object, new.names = NULL, ...)

# S3 method for class 'VisiumV1'
RenameCells(object, new.names = NULL, ...)
```

Example 6 (unknown):
```unknown
SeuratObject::RenameCells
```

---

## Significant genes from a PCA — PCASigGenes • Seurat

**URL:** http://127.0.0.1:9173/reference_pcasiggenes.html

**Contents:**
- Significant genes from a PCA
- Arguments
- Value
- See also
- Examples
- Contents

Returns a set of genes, based on the JackStraw analysis, that have statistically significant associations with a set of PCs.

Use the full list of genes (from the projected PCA). Assumes that ProjectDim has been run. Currently, must be set to FALSE.

Maximum number of genes to return per PC. Used to avoid genes from one PC dominating the entire analysis.

A vector of genes whose p-values are statistically significant for at least one of the given PCs.

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/dimensional_reduction.R
```

Example 2 (unknown):
```unknown
PCASigGenes.Rd
```

Example 3 (unknown):
```unknown
PCASigGenes(
  object,
  pcs.use,
  pval.cut = 0.1,
  use.full = FALSE,
  max.per.pc = NULL
)
```

Example 4 (r):
```r
PCASigGenes(
  object,
  pcs.use,
  pval.cut = 0.1,
  use.full = FALSE,
  max.per.pc = NULL
)
```

Example 5 (r):
```r
PCASigGenes(
  object,
  pcs.use,
  pval.cut = 0.1,
  use.full = FALSE,
  max.per.pc = NULL
)
```

Example 6 (unknown):
```unknown
data("pbmc_small")
PCASigGenes(pbmc_small, pcs.use = 1:2)
#>  [1] "PPBP"     "VDAC3"    "CD1C"     "AKR1C3"   "PF4"      "MYL9"    
#>  [7] "GNLY"     "TREML1"   "CA2"      "SDPR"     "PGRMC1"   "S100A8"  
#> [13] "TUBB1"    "HLA-DQA1" "PARVB"    "RUFY1"    "HLA-DPB1" "S100A9"
```

Example 7 (r):
```r
data("pbmc_small")
PCASigGenes(pbmc_small, pcs.use = 1:2)
#>  [1] "PPBP"     "VDAC3"    "CD1C"     "AKR1C3"   "PF4"      "MYL9"    
#>  [7] "GNLY"     "TREML1"   "CA2"      "SDPR"     "PGRMC1"   "S100A8"  
#> [13] "TUBB1"    "HLA-DQA1" "PARVB"    "RUFY1"    "HLA-DPB1" "S100A9"
```

Example 8 (r):
```r
data("pbmc_small")
PCASigGenes(pbmc_small, pcs.use = 1:2)
#>  [1] "PPBP"     "VDAC3"    "CD1C"     "AKR1C3"   "PF4"      "MYL9"    
#>  [7] "GNLY"     "TREML1"   "CA2"      "SDPR"     "PGRMC1"   "S100A8"  
#> [13] "TUBB1"    "HLA-DQA1" "PARVB"    "RUFY1"    "HLA-DPB1" "S100A9"
```

---

## Dimensional reduction plot — DimPlot • Seurat

**URL:** http://127.0.0.1:9173/reference_dimplot.html

**Contents:**
- Dimensional reduction plot
- Arguments
- Value
- Note
- See also
- Examples
- Contents

Graphs the output of a dimensional reduction technique on a 2D scatter plot where each point is a cell and it's positioned based on the cell embeddings determined by the reduction technique. By default, cells are colored by their identity class (can be changed with the group.by parameter).

Dimensions to plot, must be a two-length numeric vector specifying x- and y-dimensions

Vector of cells to plot (default is all cells)

Vector of colors, each color corresponds to an identity class. This may also be a single character or numeric value corresponding to a palette as specified by brewer.pal.info. By default, ggplot2 assigns colors. We also include a number of palettes from the pals package. See DiscretePalette for details.

Adjust point size for plotting

Which dimensionality reduction to use. If not specified, first searches for umap, then tsne, then pca

Name of one or more metadata columns to group (color) cells by (for example, orig.ident); pass 'ident' to group by identity class

A factor in object metadata to split the plot by, pass 'ident' to split by cell identity

If NULL, all points are circles (default). You can specify any cell attribute (that can be pulled with FetchData) allowing for both different colors and different shapes on cells. Only applicable if raster = FALSE.

Specify the order of plotting for the idents. This can be useful for crowded plots if points of interest are being buried. Provide either a full list of valid idents or a subset to be plotted last (on top)

Whether to randomly shuffle the order of points. This can be useful for crowded plots if points of interest are being buried. (default is FALSE)

Sets the seed if randomly shuffling the order of points.

Whether to label the clusters

Sets the color of the label text

Whether to put a box around the label text (geom_text vs geom_label)

Alpha value for plotting (default is 1)

Adjust stroke (outline) size of points

A list of character or numeric vectors of cells to highlight. If only one group of cells desired, can simply pass a vector instead of a list. If set, colors selected cells to the color(s) in cols.highlight and other cells black (white if dark.theme = TRUE); will also resize to the size(s) passed to sizes.highlight

A vector of colors to highlight the cells as; will repeat to the length groups in cells.highlight

Size of highlighted cells; will repeat to the length groups in cells.highlight. If sizes.highlight = TRUE size of all points will be this value.

Color value for NA points when using custom scale

Number of columns for display when combining plots

Combine plots into a single patchworked ggplot object. If FALSE, return a list of ggplot objects

Convert points to raster format, default is NULL which automatically rasterizes if plotting more than 100,000 cells

Pixel resolution for rasterized plots, passed to geom_scattermore(). Default is c(512, 512).

Extra parameters passed to DimPlot

A patchworked ggplot object if combine = TRUE; otherwise, a list of ggplot objects

For the old do.hover and do.identify functionality, please see HoverLocator and CellSelector, respectively.

FeaturePlot HoverLocator CellSelector FetchData

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/visualization.R
```

Example 2 (unknown):
```unknown
R/convenience.R
```

Example 3 (unknown):
```unknown
DimPlot(
  object,
  dims = c(1, 2),
  cells = NULL,
  cols = NULL,
  pt.size = NULL,
  reduction = NULL,
  group.by = NULL,
  split.by = NULL,
  shape.by = NULL,
  order = NULL,
  shuffle = FALSE,
  seed = 1,
  label = FALSE,
  label.size = 4,
  label.color = "black",
  label.box = FALSE,
  repel = FALSE,
  alpha = 1,
  stroke.size = NULL,
  cells.highlight = NULL,
  cols.highlight = "#DE2D26",
  sizes.highlight = 1,
  na.value = "grey50",
  ncol = NULL,
  combine = TRUE,
  raster = NULL,
  raster.dpi = c(512, 512)
)

PCAPlot(object, ...)

TSNEPlot(object, ...)

UMAPPlot(object, ...)
```

Example 4 (r):
```r
DimPlot(
  object,
  dims = c(1, 2),
  cells = NULL,
  cols = NULL,
  pt.size = NULL,
  reduction = NULL,
  group.by = NULL,
  split.by = NULL,
  shape.by = NULL,
  order = NULL,
  shuffle = FALSE,
  seed = 1,
  label = FALSE,
  label.size = 4,
  label.color = "black",
  label.box = FALSE,
  repel = FALSE,
  alpha = 1,
  stroke.size = NULL,
  cells.highlight = NULL,
  cols.highlight = "#DE2D26",
  sizes.highlight = 1,
  na.value = "grey50",
  ncol = NULL,
  combine = TRUE,
  raster = NULL,
  raster.dpi = c(512, 512)
)

PCAPlot(object, ...)

TSNEPlot(object, ...)

UMAPPlot(object, ...)
```

Example 5 (r):
```r
DimPlot(
  object,
  dims = c(1, 2),
  cells = NULL,
  cols = NULL,
  pt.size = NULL,
  reduction = NULL,
  group.by = NULL,
  split.by = NULL,
  shape.by = NULL,
  order = NULL,
  shuffle = FALSE,
  seed = 1,
  label = FALSE,
  label.size = 4,
  label.color = "black",
  label.box = FALSE,
  repel = FALSE,
  alpha = 1,
  stroke.size = NULL,
  cells.highlight = NULL,
  cols.highlight = "#DE2D26",
  sizes.highlight = 1,
  na.value = "grey50",
  ncol = NULL,
  combine = TRUE,
  raster = NULL,
  raster.dpi = c(512, 512)
)

PCAPlot(object, ...)

TSNEPlot(object, ...)

UMAPPlot(object, ...)
```

Example 6 (unknown):
```unknown
brewer.pal.info
```

Example 7 (unknown):
```unknown
DiscretePalette
```

Example 8 (unknown):
```unknown
raster = FALSE
```

Example 9 (unknown):
```unknown
cols.highlight
```

Example 10 (unknown):
```unknown
sizes.highlight
```

Example 11 (unknown):
```unknown
sizes.highlight = TRUE
```

Example 12 (unknown):
```unknown
patchworked
```

Example 13 (unknown):
```unknown
patchworked
```

Example 14 (unknown):
```unknown
combine = TRUE
```

Example 15 (unknown):
```unknown
do.identify
```

Example 16 (unknown):
```unknown
HoverLocator
```

Example 17 (unknown):
```unknown
CellSelector
```

Example 18 (unknown):
```unknown
FeaturePlot
```

Example 19 (unknown):
```unknown
HoverLocator
```

Example 20 (unknown):
```unknown
CellSelector
```

Example 21 (unknown):
```unknown
data("pbmc_small")
DimPlot(object = pbmc_small)

DimPlot(object = pbmc_small, split.by = 'letter.idents')
```

Example 22 (r):
```r
data("pbmc_small")
DimPlot(object = pbmc_small)

DimPlot(object = pbmc_small, split.by = 'letter.idents')
```

Example 23 (r):
```r
data("pbmc_small")
DimPlot(object = pbmc_small)

DimPlot(object = pbmc_small, split.by = 'letter.idents')
```

---

## Read output from Parse Biosciences — ReadParseBio • Seurat

**URL:** http://127.0.0.1:9173/seurat/reference/readparsebio/index.html

**Contents:**
- Read output from Parse Biosciences
- Arguments
- Contents

Read output from Parse Biosciences

Directory containing the data files

Extra parameters passed to ReadMtx

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/convenience.R
```

Example 2 (unknown):
```unknown
ReadParseBio.Rd
```

Example 3 (unknown):
```unknown
ReadParseBio(data.dir, ...)
```

Example 4 (r):
```r
ReadParseBio(data.dir, ...)
```

Example 5 (r):
```r
ReadParseBio(data.dir, ...)
```

---

## Prepare object to run differential expression on SCT assay with multiple models — PrepSCTFindMarkers • Seurat

**URL:** http://127.0.0.1:9173/seurat/reference/prepsctfindmarkers/index.html

**Contents:**
- Prepare object to run differential expression on SCT assay with multiple models
- Arguments
- Value
- Progress Updates with progressr
- Parallelization with future
- Examples
- Contents

Given a merged object with multiple SCT models, this function uses minimum of the median UMI (calculated using the raw UMI counts) of individual objects to reverse the individual SCT regression model using minimum of median UMI as the sequencing depth covariate. The counts slot of the SCT assay is replaced with recorrected counts and the data slot is replaced with log1p of recorrected counts.

Seurat object with SCT assays

Assay name where for SCT objects are stored; Default is 'SCT'

Print messages and progress

Returns a Seurat object with recorrected counts and data in the SCT assay.

This function uses progressr to render status updates and progress bars. To enable progress updates, wrap the function call in with_progress or run handlers(global = TRUE) before running this function. For more details about progressr, please read vignette("progressr-intro")

This function uses future to enable parallelization. Parallelization strategies can be set using plan. Common plans include “sequential” for non-parallelized processing or “multisession” for parallel evaluation using multiple R sessions; for other plans, see the “Implemented evaluation strategies” section of ?future::plan. For a more thorough introduction to future, see vignette("future-1-overview")

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/differential_expression.R
```

Example 2 (unknown):
```unknown
PrepSCTFindMarkers.Rd
```

Example 3 (unknown):
```unknown
PrepSCTFindMarkers(object, assay = "SCT", verbose = TRUE)
```

Example 4 (r):
```r
PrepSCTFindMarkers(object, assay = "SCT", verbose = TRUE)
```

Example 5 (r):
```r
PrepSCTFindMarkers(object, assay = "SCT", verbose = TRUE)
```

Example 6 (unknown):
```unknown
with_progress
```

Example 7 (unknown):
```unknown
handlers(global = TRUE)
```

Example 8 (unknown):
```unknown
vignette("progressr-intro")
```

Example 9 (unknown):
```unknown
multisession
```

Example 10 (unknown):
```unknown
?future::plan
```

Example 11 (unknown):
```unknown
vignette("future-1-overview")
```

Example 12 (python):
```python
data("pbmc_small")
pbmc_small1 <- SCTransform(object = pbmc_small, variable.features.n = 20, vst.flavor="v1")
#> Running SCTransform on assay: RNA
#> Calculating cell attributes from input UMI matrix: log_umi
#> Variance stabilizing transformation of count matrix of size 220 by 80
#> Model formula is y ~ log_umi
#> Get Negative Binomial regression parameters per gene
#> Using 220 genes, 80 cells
#> Second step: Get residuals using fitted parameters for 220 genes
#> Computing corrected count matrix for 220 genes
#> Calculating gene attributes
#> Wall clock passed: Time difference of 0.4680996 secs
#> Determine variable features
#> Centering data matrix
#> Place corrected count matrix in counts slot
#> Set default assay to SCT
pbmc_small2 <- SCTransform(object = pbmc_small, variable.features.n = 20, vst.flavor="v1")
#> Running SCTransform on assay: RNA
#> Calculating cell attributes from input UMI matrix: log_umi
#> Variance stabilizing transformation of count matrix of size 220 by 80
#> Model formula is y ~ log_umi
#> Get Negative Binomial regression parameters per gene
#> Using 220 genes, 80 cells
#> Second step: Get residuals using fitted parameters for 220 genes
#> Computing corrected count matrix for 220 genes
#> Calculating gene attributes
#> Wall clock passed: Time difference of 0.3564265 secs
#> Determine variable features
#> Centering data matrix
#> Place corrected count matrix in counts slot
#> Set default assay to SCT
pbmc_merged <- merge(x = pbmc_small1, y = pbmc_small2)
#> Warning: Some cell names are duplicated across objects provided. Renaming to enforce unique cell names.
pbmc_merged <- PrepSCTFindMarkers(object = pbmc_merged)
#> Found 2 SCT models. Recorrecting SCT counts using minimum median counts: 180
#> 
  |                                                  | 0 % ~calculating  
  |+++++++++++++++++++++++++                         | 50% ~00s          
  |++++++++++++++++++++++++++++++++++++++++++++++++++| 100% elapsed=01s  
markers <- FindMarkers(
  object = pbmc_merged,
  ident.1 = "0",
  ident.2 = "1",
  assay = "SCT"
)
pbmc_subset <- subset(pbmc_merged, idents = c("0", "1"))
markers_subset <- FindMarkers(
  object = pbmc_subset,
  ident.1 = "0",
  ident.2 = "1",
  assay = "SCT",
  recorrect_umi = FALSE
)
```

Example 13 (r):
```r
data("pbmc_small")
pbmc_small1 <- SCTransform(object = pbmc_small, variable.features.n = 20, vst.flavor="v1")
#> Running SCTransform on assay: RNA
#> Calculating cell attributes from input UMI matrix: log_umi
#> Variance stabilizing transformation of count matrix of size 220 by 80
#> Model formula is y ~ log_umi
#> Get Negative Binomial regression parameters per gene
#> Using 220 genes, 80 cells
#> Second step: Get residuals using fitted parameters for 220 genes
#> Computing corrected count matrix for 220 genes
#> Calculating gene attributes
#> Wall clock passed: Time difference of 0.4680996 secs
#> Determine variable features
#> Centering data matrix
#> Place corrected count matrix in counts slot
#> Set default assay to SCT
pbmc_small2 <- SCTransform(object = pbmc_small, variable.features.n = 20, vst.flavor="v1")
#> Running SCTransform on assay: RNA
#> Calculating cell attributes from input UMI matrix: log_umi
#> Variance stabilizing transformation of count matrix of size 220 by 80
#> Model formula is y ~ log_umi
#> Get Negative Binomial regression parameters per gene
#> Using 220 genes, 80 cells
#> Second step: Get residuals using fitted parameters for 220 genes
#> Computing corrected count matrix for 220 genes
#> Calculating gene attributes
#> Wall clock passed: Time difference of 0.3564265 secs
#> Determine variable features
#> Centering data matrix
#> Place corrected count matrix in counts slot
#> Set default assay to SCT
pbmc_merged <- merge(x = pbmc_small1, y = pbmc_small2)
#> Warning: Some cell names are duplicated across objects provided. Renaming to enforce unique cell names.
pbmc_merged <- PrepSCTFindMarkers(object = pbmc_merged)
#> Found 2 SCT models. Recorrecting SCT counts using minimum median counts: 180
#> 
  |                                                  | 0 % ~calculating  
  |+++++++++++++++++++++++++                         | 50% ~00s          
  |++++++++++++++++++++++++++++++++++++++++++++++++++| 100% elapsed=01s  
markers <- FindMarkers(
  object = pbmc_merged,
  ident.1 = "0",
  ident.2 = "1",
  assay = "SCT"
)
pbmc_subset <- subset(pbmc_merged, idents = c("0", "1"))
markers_subset <- FindMarkers(
  object = pbmc_subset,
  ident.1 = "0",
  ident.2 = "1",
  assay = "SCT",
  recorrect_umi = FALSE
)
```

Example 14 (r):
```r
data("pbmc_small")
pbmc_small1 <- SCTransform(object = pbmc_small, variable.features.n = 20, vst.flavor="v1")
#> Running SCTransform on assay: RNA
#> Calculating cell attributes from input UMI matrix: log_umi
#> Variance stabilizing transformation of count matrix of size 220 by 80
#> Model formula is y ~ log_umi
#> Get Negative Binomial regression parameters per gene
#> Using 220 genes, 80 cells
#> Second step: Get residuals using fitted parameters for 220 genes
#> Computing corrected count matrix for 220 genes
#> Calculating gene attributes
#> Wall clock passed: Time difference of 0.4680996 secs
#> Determine variable features
#> Centering data matrix
#> Place corrected count matrix in counts slot
#> Set default assay to SCT
pbmc_small2 <- SCTransform(object = pbmc_small, variable.features.n = 20, vst.flavor="v1")
#> Running SCTransform on assay: RNA
#> Calculating cell attributes from input UMI matrix: log_umi
#> Variance stabilizing transformation of count matrix of size 220 by 80
#> Model formula is y ~ log_umi
#> Get Negative Binomial regression parameters per gene
#> Using 220 genes, 80 cells
#> Second step: Get residuals using fitted parameters for 220 genes
#> Computing corrected count matrix for 220 genes
#> Calculating gene attributes
#> Wall clock passed: Time difference of 0.3564265 secs
#> Determine variable features
#> Centering data matrix
#> Place corrected count matrix in counts slot
#> Set default assay to SCT
pbmc_merged <- merge(x = pbmc_small1, y = pbmc_small2)
#> Warning: Some cell names are duplicated across objects provided. Renaming to enforce unique cell names.
pbmc_merged <- PrepSCTFindMarkers(object = pbmc_merged)
#> Found 2 SCT models. Recorrecting SCT counts using minimum median counts: 180
#> 
  |                                                  | 0 % ~calculating  
  |+++++++++++++++++++++++++                         | 50% ~00s          
  |++++++++++++++++++++++++++++++++++++++++++++++++++| 100% elapsed=01s  
markers <- FindMarkers(
  object = pbmc_merged,
  ident.1 = "0",
  ident.2 = "1",
  assay = "SCT"
)
pbmc_subset <- subset(pbmc_merged, idents = c("0", "1"))
markers_subset <- FindMarkers(
  object = pbmc_subset,
  ident.1 = "0",
  ident.2 = "1",
  assay = "SCT",
  recorrect_umi = FALSE
)
```

---

## Fold Change — FoldChange • Seurat

**URL:** http://127.0.0.1:9173/seurat/reference/foldchange/index.html

**Contents:**
- Fold Change
- Arguments
- Value
- Details
- See also
- Examples
- Contents

Calculate log fold change and percentage of cells expressing each feature for different identity classes.

Arguments passed to other methods

Vector of cell names belonging to group 1

Vector of cell names belonging to group 2

Function to use for fold change or average difference calculation

Name of the fold change, average difference, or custom function column in the output data.frame

Features to calculate fold change for. If NULL, use all features

Slot to pull data from

Pseudocount to add to averaged expression values when calculating logFC.

The base with respect to which logarithms are computed.

Normalization method for mean function selection when slot is “data”

Identity class to calculate fold change for; pass an object of class phylo or 'clustertree' to calculate fold change for a node in a cluster tree; passing 'clustertree' requires BuildClusterTree to have been run

A second identity class for comparison; if NULL, use all other cells for comparison; if an object of class phylo or 'clustertree' is passed to ident.1, must pass a node to calculate fold change for

Regroup cells into a different identity class prior to calculating fold change (see example in FindMarkers)

Subset a particular identity class prior to regrouping. Only relevant if group.by is set (see example in FindMarkers)

Assay to use in fold change calculation

Reduction to use - will calculate average difference on cell embeddings

If the slot is scale.data or a reduction is specified, average difference is returned instead of log fold change and the column is named "avg_diff". Otherwise, log2 fold change is returned with column named "avg_log2_FC".

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/generics.R
```

Example 2 (unknown):
```unknown
R/differential_expression.R
```

Example 3 (unknown):
```unknown
FoldChange.Rd
```

Example 4 (python):
```python
FoldChange(object, ...)

# Default S3 method
FoldChange(object, cells.1, cells.2, mean.fxn, fc.name, features = NULL, ...)

# S3 method for class 'Assay'
FoldChange(
  object,
  cells.1,
  cells.2,
  features = NULL,
  slot = "data",
  pseudocount.use = 1,
  fc.name = NULL,
  mean.fxn = NULL,
  base = 2,
  norm.method = NULL,
  ...
)

# S3 method for class 'SCTAssay'
FoldChange(
  object,
  cells.1,
  cells.2,
  features = NULL,
  slot = "data",
  pseudocount.use = 1,
  fc.name = NULL,
  mean.fxn = NULL,
  base = 2,
  ...
)

# S3 method for class 'DimReduc'
FoldChange(
  object,
  cells.1,
  cells.2,
  features = NULL,
  slot = NULL,
  pseudocount.use = 1,
  fc.name = NULL,
  mean.fxn = NULL,
  ...
)

# S3 method for class 'Seurat'
FoldChange(
  object,
  ident.1 = NULL,
  ident.2 = NULL,
  group.by = NULL,
  subset.ident = NULL,
  assay = NULL,
  slot = "data",
  reduction = NULL,
  features = NULL,
  pseudocount.use = 1,
  mean.fxn = NULL,
  base = 2,
  fc.name = NULL,
  ...
)
```

Example 5 (r):
```r
FoldChange(object, ...)

# Default S3 method
FoldChange(object, cells.1, cells.2, mean.fxn, fc.name, features = NULL, ...)

# S3 method for class 'Assay'
FoldChange(
  object,
  cells.1,
  cells.2,
  features = NULL,
  slot = "data",
  pseudocount.use = 1,
  fc.name = NULL,
  mean.fxn = NULL,
  base = 2,
  norm.method = NULL,
  ...
)

# S3 method for class 'SCTAssay'
FoldChange(
  object,
  cells.1,
  cells.2,
  features = NULL,
  slot = "data",
  pseudocount.use = 1,
  fc.name = NULL,
  mean.fxn = NULL,
  base = 2,
  ...
)

# S3 method for class 'DimReduc'
FoldChange(
  object,
  cells.1,
  cells.2,
  features = NULL,
  slot = NULL,
  pseudocount.use = 1,
  fc.name = NULL,
  mean.fxn = NULL,
  ...
)

# S3 method for class 'Seurat'
FoldChange(
  object,
  ident.1 = NULL,
  ident.2 = NULL,
  group.by = NULL,
  subset.ident = NULL,
  assay = NULL,
  slot = "data",
  reduction = NULL,
  features = NULL,
  pseudocount.use = 1,
  mean.fxn = NULL,
  base = 2,
  fc.name = NULL,
  ...
)
```

Example 6 (r):
```r
FoldChange(object, ...)

# Default S3 method
FoldChange(object, cells.1, cells.2, mean.fxn, fc.name, features = NULL, ...)

# S3 method for class 'Assay'
FoldChange(
  object,
  cells.1,
  cells.2,
  features = NULL,
  slot = "data",
  pseudocount.use = 1,
  fc.name = NULL,
  mean.fxn = NULL,
  base = 2,
  norm.method = NULL,
  ...
)

# S3 method for class 'SCTAssay'
FoldChange(
  object,
  cells.1,
  cells.2,
  features = NULL,
  slot = "data",
  pseudocount.use = 1,
  fc.name = NULL,
  mean.fxn = NULL,
  base = 2,
  ...
)

# S3 method for class 'DimReduc'
FoldChange(
  object,
  cells.1,
  cells.2,
  features = NULL,
  slot = NULL,
  pseudocount.use = 1,
  fc.name = NULL,
  mean.fxn = NULL,
  ...
)

# S3 method for class 'Seurat'
FoldChange(
  object,
  ident.1 = NULL,
  ident.2 = NULL,
  group.by = NULL,
  subset.ident = NULL,
  assay = NULL,
  slot = "data",
  reduction = NULL,
  features = NULL,
  pseudocount.use = 1,
  mean.fxn = NULL,
  base = 2,
  fc.name = NULL,
  ...
)
```

Example 7 (unknown):
```unknown
BuildClusterTree
```

Example 8 (unknown):
```unknown
FindMarkers
```

Example 9 (unknown):
```unknown
FindMarkers
```

Example 10 (unknown):
```unknown
FindMarkers
```

Example 11 (unknown):
```unknown
if (FALSE) { # \dontrun{
data("pbmc_small")
FoldChange(pbmc_small, ident.1 = 1)
} # }
```

Example 12 (r):
```r
if (FALSE) { # \dontrun{
data("pbmc_small")
FoldChange(pbmc_small, ident.1 = 1)
} # }
```

Example 13 (r):
```r
if (FALSE) { # \dontrun{
data("pbmc_small")
FoldChange(pbmc_small, ident.1 = 1)
} # }
```

---

## Differential expression heatmap for mixscape — MixscapeHeatmap • Seurat

**URL:** http://127.0.0.1:9173/seurat/reference/mixscapeheatmap/index.html

**Contents:**
- Differential expression heatmap for mixscape
- Arguments
- Value
- Contents

Draws a heatmap of single cell feature expression with cells ordered by their mixscape ko probabilities.

Identity class to define markers for; pass an object of class phylo or 'clustertree' to find markers for a node in a cluster tree; passing 'clustertree' requires BuildClusterTree to have been run

A second identity class for comparison; if NULL, use all other cells for comparison; if an object of class phylo or 'clustertree' is passed to ident.1, must pass a node to find markers for

Plot an equal number of genes with both groups of cells.

Limit testing to genes which show, on average, at least X-fold difference (log-scale) between the two groups of cells. Default is 0.25. Increasing logfc.threshold speeds up the function, but can miss weaker signals.

Assay to use in differential expression testing

Total number of DE genes to plot.

Denotes which test to use. Available options are:

"wilcox" : Identifies differentially expressed genes between two groups of cells using a Wilcoxon Rank Sum test (default); will use a fast implementation by Presto if installed

"wilcox_limma" : Identifies differentially expressed genes between two groups of cells using the limma implementation of the Wilcoxon Rank Sum test; set this option to reproduce results from Seurat v4

"bimod" : Likelihood-ratio test for single cell gene expression, (McDavid et al., Bioinformatics, 2013)

"roc" : Identifies 'markers' of gene expression using ROC analysis. For each gene, evaluates (using AUC) a classifier built on that gene alone, to classify between two groups of cells. An AUC value of 1 means that expression values for this gene alone can perfectly classify the two groupings (i.e. Each of the cells in cells.1 exhibit a higher level than each of the cells in cells.2). An AUC value of 0 also means there is perfect classification, but in the other direction. A value of 0.5 implies that the gene has no predictive power to classify the two groups. Returns a 'predictive power' (abs(AUC-0.5) * 2) ranked matrix of putative differentially expressed genes.

"t" : Identify differentially expressed genes between two groups of cells using the Student's t-test.

"negbinom" : Identifies differentially expressed genes between two groups of cells using a negative binomial generalized linear model. Use only for UMI-based datasets

"poisson" : Identifies differentially expressed genes between two groups of cells using a poisson generalized linear model. Use only for UMI-based datasets

"LR" : Uses a logistic regression framework to determine differentially expressed genes. Constructs a logistic regression model predicting group membership based on each feature individually and compares this to a null model with a likelihood ratio test.

"MAST" : Identifies differentially expressed genes between two groups of cells using a hurdle model tailored to scRNA-seq data. Utilizes the MAST package to run the DE testing.

"DESeq2" : Identifies differentially expressed genes between two groups of cells based on a model using DESeq2 which uses a negative binomial distribution (Love et al, Genome Biology, 2014).This test does not support pre-filtering of genes based on average difference (or percent detection rate) between cell groups. However, genes may be pre-filtered based on their minimum detection rate (min.pct) across both cell groups. To use this method, please install DESeq2, using the instructions at https://bioconductor.org/packages/release/bioc/html/DESeq2.html

Number of cells per identity to plot.

Order cells on heatmap based on their mixscape knockout probability from highest to lowest score.

(Deprecated) Option to split densities based on mixscape classification. Please use mixscape.class instead

metadata column with mixscape classifications.

specify type of CRISPR perturbation expected for labeling mixscape classifications. Default is KO.

Name of the fold change, average difference, or custom function column in the output data.frame. Default is avg_log2FC

P-value cut-off for selection of significantly DE genes.

Arguments passed to other methods and to specific DE methods

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/mixscape.R
```

Example 2 (unknown):
```unknown
MixscapeHeatmap.Rd
```

Example 3 (python):
```python
MixscapeHeatmap(
  object,
  ident.1 = NULL,
  ident.2 = NULL,
  balanced = TRUE,
  logfc.threshold = 0.25,
  assay = "RNA",
  max.genes = 100,
  test.use = "wilcox",
  max.cells.group = NULL,
  order.by.prob = TRUE,
  group.by = NULL,
  mixscape.class = "mixscape_class",
  prtb.type = "KO",
  fc.name = "avg_log2FC",
  pval.cutoff = 0.05,
  ...
)
```

Example 4 (r):
```r
MixscapeHeatmap(
  object,
  ident.1 = NULL,
  ident.2 = NULL,
  balanced = TRUE,
  logfc.threshold = 0.25,
  assay = "RNA",
  max.genes = 100,
  test.use = "wilcox",
  max.cells.group = NULL,
  order.by.prob = TRUE,
  group.by = NULL,
  mixscape.class = "mixscape_class",
  prtb.type = "KO",
  fc.name = "avg_log2FC",
  pval.cutoff = 0.05,
  ...
)
```

Example 5 (r):
```r
MixscapeHeatmap(
  object,
  ident.1 = NULL,
  ident.2 = NULL,
  balanced = TRUE,
  logfc.threshold = 0.25,
  assay = "RNA",
  max.genes = 100,
  test.use = "wilcox",
  max.cells.group = NULL,
  order.by.prob = TRUE,
  group.by = NULL,
  mixscape.class = "mixscape_class",
  prtb.type = "KO",
  fc.name = "avg_log2FC",
  pval.cutoff = 0.05,
  ...
)
```

Example 6 (unknown):
```unknown
BuildClusterTree
```

---

## Discrete colour palettes from pals — DiscretePalette • Seurat

**URL:** http://127.0.0.1:9173/reference_discretepalette.html

**Contents:**
- Discrete colour palettes from pals
- Arguments
- Value
- Details
- Contents

These are included here because pals depends on a number of compiled packages, and this can lead to increases in run time for Travis, and generally should be avoided when possible.

Number of colours to be generated.

Options are "alphabet", "alphabet2", "glasbey", "polychrome", "stepped", and "parade". Can be omitted and the function will use the one based on the requested n.

Shuffle the colors in the selected palette.

These palettes are a much better default for data with many classes than the default ggplot2 palette.

Many thanks to Kevin Wright for writing the pals package.

Taken from the pals package (Licence: GPL-3). https://cran.r-project.org/package=pals Credit: Kevin Wright

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/visualization.R
```

Example 2 (unknown):
```unknown
DiscretePalette.Rd
```

Example 3 (unknown):
```unknown
DiscretePalette(n, palette = NULL, shuffle = FALSE)
```

Example 4 (r):
```r
DiscretePalette(n, palette = NULL, shuffle = FALSE)
```

Example 5 (r):
```r
DiscretePalette(n, palette = NULL, shuffle = FALSE)
```

---

## Run Principal Component Analysis — RunPCA • Seurat

**URL:** http://127.0.0.1:9173/seurat/reference/runpca/index.html

**Contents:**
- Run Principal Component Analysis
- Arguments
- Value
- Contents

Run a PCA dimensionality reduction. For details about stored PCA calculation parameters, see PrintPCAParams.

Arguments passed to other methods and IRLBA

Name of Assay PCA is being run on

Total Number of PCs to compute and store (50 by default)

By default computes the PCA on the cell x gene matrix. Setting to true will compute it on gene x cell matrix.

Weight the cell embeddings by the variance of each PC (weights the gene loadings if rev.pca is TRUE)

Print the top genes associated with high/low loadings for the PCs

PCs to print genes for

Number of genes to print for each PC

dimensional reduction key, specifies the string before the number for the dimension names. PC by default

Set a random seed. By default, sets the seed to 42. Setting NULL will not set a seed.

Use truncated singular value decomposition to approximate PCA

Features to compute PCA on. If features=NULL, PCA will be run using the variable features for the Assay. Note that the features must be present in the scaled data. Any requested features that are not scaled or have 0 variance will be dropped, and the PCA will be run using the remaining features.

dimensional reduction name, pca by default

Returns Seurat object with the PCA calculation stored in the reductions slot

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/generics.R
```

Example 2 (unknown):
```unknown
R/dimensional_reduction.R
```

Example 3 (unknown):
```unknown
PrintPCAParams
```

Example 4 (python):
```python
RunPCA(object, ...)

# Default S3 method
RunPCA(
  object,
  assay = NULL,
  npcs = 50,
  rev.pca = FALSE,
  weight.by.var = TRUE,
  verbose = TRUE,
  ndims.print = 1:5,
  nfeatures.print = 30,
  reduction.key = "PC_",
  seed.use = 42,
  approx = TRUE,
  ...
)

# S3 method for class 'Assay'
RunPCA(
  object,
  assay = NULL,
  features = NULL,
  npcs = 50,
  rev.pca = FALSE,
  weight.by.var = TRUE,
  verbose = TRUE,
  ndims.print = 1:5,
  nfeatures.print = 30,
  reduction.key = "PC_",
  seed.use = 42,
  ...
)

# S3 method for class 'Seurat'
RunPCA(
  object,
  assay = NULL,
  features = NULL,
  npcs = 50,
  rev.pca = FALSE,
  weight.by.var = TRUE,
  verbose = TRUE,
  ndims.print = 1:5,
  nfeatures.print = 30,
  reduction.name = "pca",
  reduction.key = "PC_",
  seed.use = 42,
  ...
)
```

Example 5 (r):
```r
RunPCA(object, ...)

# Default S3 method
RunPCA(
  object,
  assay = NULL,
  npcs = 50,
  rev.pca = FALSE,
  weight.by.var = TRUE,
  verbose = TRUE,
  ndims.print = 1:5,
  nfeatures.print = 30,
  reduction.key = "PC_",
  seed.use = 42,
  approx = TRUE,
  ...
)

# S3 method for class 'Assay'
RunPCA(
  object,
  assay = NULL,
  features = NULL,
  npcs = 50,
  rev.pca = FALSE,
  weight.by.var = TRUE,
  verbose = TRUE,
  ndims.print = 1:5,
  nfeatures.print = 30,
  reduction.key = "PC_",
  seed.use = 42,
  ...
)

# S3 method for class 'Seurat'
RunPCA(
  object,
  assay = NULL,
  features = NULL,
  npcs = 50,
  rev.pca = FALSE,
  weight.by.var = TRUE,
  verbose = TRUE,
  ndims.print = 1:5,
  nfeatures.print = 30,
  reduction.name = "pca",
  reduction.key = "PC_",
  seed.use = 42,
  ...
)
```

Example 6 (r):
```r
RunPCA(object, ...)

# Default S3 method
RunPCA(
  object,
  assay = NULL,
  npcs = 50,
  rev.pca = FALSE,
  weight.by.var = TRUE,
  verbose = TRUE,
  ndims.print = 1:5,
  nfeatures.print = 30,
  reduction.key = "PC_",
  seed.use = 42,
  approx = TRUE,
  ...
)

# S3 method for class 'Assay'
RunPCA(
  object,
  assay = NULL,
  features = NULL,
  npcs = 50,
  rev.pca = FALSE,
  weight.by.var = TRUE,
  verbose = TRUE,
  ndims.print = 1:5,
  nfeatures.print = 30,
  reduction.key = "PC_",
  seed.use = 42,
  ...
)

# S3 method for class 'Seurat'
RunPCA(
  object,
  assay = NULL,
  features = NULL,
  npcs = 50,
  rev.pca = FALSE,
  weight.by.var = TRUE,
  verbose = TRUE,
  ndims.print = 1:5,
  nfeatures.print = 30,
  reduction.name = "pca",
  reduction.key = "PC_",
  seed.use = 42,
  ...
)
```

---

## Set integration data — SetIntegrationData • Seurat

**URL:** http://127.0.0.1:9173/reference_setintegrationdata.html

**Contents:**
- Set integration data
- Arguments
- Value
- Contents

Name of integration object

Which slot in integration object to set

Returns a Seurat object

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/objects.R
```

Example 2 (unknown):
```unknown
SetIntegrationData.Rd
```

Example 3 (unknown):
```unknown
SetIntegrationData(object, integration.name, slot, new.data)
```

Example 4 (r):
```r
SetIntegrationData(object, integration.name, slot, new.data)
```

Example 5 (r):
```r
SetIntegrationData(object, integration.name, slot, new.data)
```

---

## Multimodal reference mapping • Seurat

**URL:** http://127.0.0.1:9173/seurat/archive/v4.3/multimodal_reference_mapping/index.html

**Contents:**
- Multimodal reference mapping
    - Compiled: March 27, 2023
- Intro: Seurat v4 Reference Mapping
- Example 1: Mapping human peripheral blood cells
  - A Multimodal PBMC Reference Dataset
  - Mapping
  - Explore the mapping results
  - Computing a new UMAP visualiztion
- Example 2: Mapping human bone marrow cells
  - A Multimodal BMNC Reference Dataset
  - Computing an sPCA transformation
  - Computing a cached neighbor index
  - Query dataset preprocessing
  - Mapping
  - Explore the mapping results
- Contents

This vignette introduces the process of mapping query datasets to annotated references in Seurat. In this example, we map one of the first scRNA-seq datasets released by 10X Genomics of 2,700 PBMC to our recently described CITE-seq reference of 162,000 PBMC measured with 228 antibodies. We chose this example to demonstrate how supervised analysis guided by a reference dataset can help to enumerate cell states that would be challenging to find with unsupervised analysis. In a second example, we demonstrate how to serially map Human Cell Atlas datasets of human BMNC profiled from different individuals onto a consistent reference.We have previously demonstrated how to use reference-mapping approach to annotate cell labels in a query dataset . In Seurat v4, we have substantially improved the speed and memory requirements for integrative tasks including reference mapping, and also include new functionality to project query cells onto a previously computed UMAP visualization.In this vignette, we demonstrate how to use a previously established reference to interpret an scRNA-seq query:Annotate each query cell based on a set of reference-defined cell statesProject each query cell onto a previously computed UMAP visualizationImpute the predicted levels of surface proteins that were measured in the CITE-seq referenceTo run this vignette please install Seurat v4, available on CRAN. Additionally, you will need to install the SeuratDisk package. install.packages("Seurat") remotes::install_github("mojaveazure/seurat-disk") library(Seurat) library(SeuratDisk) library(ggplot2) library(patchwork)

We have previously demonstrated how to use reference-mapping approach to annotate cell labels in a query dataset . In Seurat v4, we have substantially improved the speed and memory requirements for integrative tasks including reference mapping, and also include new functionality to project query cells onto a previously computed UMAP visualization.In this vignette, we demonstrate how to use a previously established reference to interpret an scRNA-seq query:Annotate each query cell based on a set of reference-defined cell statesProject each query cell onto a previously computed UMAP visualizationImpute the predicted levels of surface proteins that were measured in the CITE-seq referenceTo run this vignette please install Seurat v4, available on CRAN. Additionally, you will need to install the SeuratDisk package. install.packages("Seurat") remotes::install_github("mojaveazure/seurat-disk") library(Seurat) library(SeuratDisk) library(ggplot2) library(patchwork)

In this vignette, we demonstrate how to use a previously established reference to interpret an scRNA-seq query:Annotate each query cell based on a set of reference-defined cell statesProject each query cell onto a previously computed UMAP visualizationImpute the predicted levels of surface proteins that were measured in the CITE-seq referenceTo run this vignette please install Seurat v4, available on CRAN. Additionally, you will need to install the SeuratDisk package. install.packages("Seurat") remotes::install_github("mojaveazure/seurat-disk") library(Seurat) library(SeuratDisk) library(ggplot2) library(patchwork)

To run this vignette please install Seurat v4, available on CRAN. Additionally, you will need to install the SeuratDisk package. install.packages("Seurat") remotes::install_github("mojaveazure/seurat-disk") library(Seurat) library(SeuratDisk) library(ggplot2) library(patchwork)

We load the reference (download here) from our recent paper, and visualize the pre-computed UMAP. This reference is stored as an h5Seurat file, a format that enables on-disk storage of multimodal Seurat objects (more details on h5Seurat and SeuratDisk can be found here). reference <- LoadH5Seurat("../data/pbmc_multimodal.h5seurat") DimPlot(object = reference, reduction = "wnn.umap", group.by = "celltype.l2", label = TRUE, label.size = 3, repel = TRUE) + NoLegend()

To demonstrate mapping to this multimodal reference, we will use a dataset of 2,700 PBMCs generated by 10x Genomics and available via SeuratData. library(SeuratData) InstallData('pbmc3k')The reference was normalized using SCTransform(), so we use the same approach to normalize the query here. pbmc3k <- SCTransform(pbmc3k, verbose = FALSE)We then find anchors between reference and query. As described in the manuscript, we used a precomputed supervised PCA (spca) transformation for this example. We recommend the use of supervised PCA for CITE-seq datasets, and demonstrate how to compute this transformation on the next tab of this vignette. However, you can also use a standard PCA transformation. anchors <- FindTransferAnchors( reference = reference, query = pbmc3k, normalization.method = "SCT", reference.reduction = "spca", dims = 1:50 )We then transfer cell type labels and protein data from the reference to the query. Additionally, we project the query data onto the UMAP structure of the reference. pbmc3k <- MapQuery( anchorset = anchors, query = pbmc3k, reference = reference, refdata = list( celltype.l1 = "celltype.l1", celltype.l2 = "celltype.l2", predicted_ADT = "ADT" ), reference.reduction = "spca", reduction.model = "wnn.umap" )What is MapQuery doing?MapQuery() is a wrapper around three functions: TransferData(), IntegrateEmbeddings(), and ProjectUMAP(). TransferData() is used to transfer cell type labels and impute the ADT values. IntegrateEmbeddings() and ProjectUMAP() are used to project the query data onto the UMAP structure of the reference. The equivalent code for doing this with the intermediate functions is below: pbmc3k <- TransferData( anchorset = anchors, reference = reference, query = pbmc3k, refdata = list( celltype.l1 = "celltype.l1", celltype.l2 = "celltype.l2", predicted_ADT = "ADT") ) pbmc3k <- IntegrateEmbeddings( anchorset = anchors, reference = reference, query = pbmc3k, new.reduction.name = "ref.spca" ) pbmc3k <- ProjectUMAP( query = pbmc3k, query.reduction = "ref.spca", reference = reference, reference.reduction = "spca", reduction.model = "wnn.umap" )

The reference was normalized using SCTransform(), so we use the same approach to normalize the query here. pbmc3k <- SCTransform(pbmc3k, verbose = FALSE)We then find anchors between reference and query. As described in the manuscript, we used a precomputed supervised PCA (spca) transformation for this example. We recommend the use of supervised PCA for CITE-seq datasets, and demonstrate how to compute this transformation on the next tab of this vignette. However, you can also use a standard PCA transformation. anchors <- FindTransferAnchors( reference = reference, query = pbmc3k, normalization.method = "SCT", reference.reduction = "spca", dims = 1:50 )We then transfer cell type labels and protein data from the reference to the query. Additionally, we project the query data onto the UMAP structure of the reference. pbmc3k <- MapQuery( anchorset = anchors, query = pbmc3k, reference = reference, refdata = list( celltype.l1 = "celltype.l1", celltype.l2 = "celltype.l2", predicted_ADT = "ADT" ), reference.reduction = "spca", reduction.model = "wnn.umap" )What is MapQuery doing?MapQuery() is a wrapper around three functions: TransferData(), IntegrateEmbeddings(), and ProjectUMAP(). TransferData() is used to transfer cell type labels and impute the ADT values. IntegrateEmbeddings() and ProjectUMAP() are used to project the query data onto the UMAP structure of the reference. The equivalent code for doing this with the intermediate functions is below: pbmc3k <- TransferData( anchorset = anchors, reference = reference, query = pbmc3k, refdata = list( celltype.l1 = "celltype.l1", celltype.l2 = "celltype.l2", predicted_ADT = "ADT") ) pbmc3k <- IntegrateEmbeddings( anchorset = anchors, reference = reference, query = pbmc3k, new.reduction.name = "ref.spca" ) pbmc3k <- ProjectUMAP( query = pbmc3k, query.reduction = "ref.spca", reference = reference, reference.reduction = "spca", reduction.model = "wnn.umap" )

We then find anchors between reference and query. As described in the manuscript, we used a precomputed supervised PCA (spca) transformation for this example. We recommend the use of supervised PCA for CITE-seq datasets, and demonstrate how to compute this transformation on the next tab of this vignette. However, you can also use a standard PCA transformation. anchors <- FindTransferAnchors( reference = reference, query = pbmc3k, normalization.method = "SCT", reference.reduction = "spca", dims = 1:50 )We then transfer cell type labels and protein data from the reference to the query. Additionally, we project the query data onto the UMAP structure of the reference. pbmc3k <- MapQuery( anchorset = anchors, query = pbmc3k, reference = reference, refdata = list( celltype.l1 = "celltype.l1", celltype.l2 = "celltype.l2", predicted_ADT = "ADT" ), reference.reduction = "spca", reduction.model = "wnn.umap" )What is MapQuery doing?MapQuery() is a wrapper around three functions: TransferData(), IntegrateEmbeddings(), and ProjectUMAP(). TransferData() is used to transfer cell type labels and impute the ADT values. IntegrateEmbeddings() and ProjectUMAP() are used to project the query data onto the UMAP structure of the reference. The equivalent code for doing this with the intermediate functions is below: pbmc3k <- TransferData( anchorset = anchors, reference = reference, query = pbmc3k, refdata = list( celltype.l1 = "celltype.l1", celltype.l2 = "celltype.l2", predicted_ADT = "ADT") ) pbmc3k <- IntegrateEmbeddings( anchorset = anchors, reference = reference, query = pbmc3k, new.reduction.name = "ref.spca" ) pbmc3k <- ProjectUMAP( query = pbmc3k, query.reduction = "ref.spca", reference = reference, reference.reduction = "spca", reduction.model = "wnn.umap" )

We then transfer cell type labels and protein data from the reference to the query. Additionally, we project the query data onto the UMAP structure of the reference. pbmc3k <- MapQuery( anchorset = anchors, query = pbmc3k, reference = reference, refdata = list( celltype.l1 = "celltype.l1", celltype.l2 = "celltype.l2", predicted_ADT = "ADT" ), reference.reduction = "spca", reduction.model = "wnn.umap" )What is MapQuery doing?MapQuery() is a wrapper around three functions: TransferData(), IntegrateEmbeddings(), and ProjectUMAP(). TransferData() is used to transfer cell type labels and impute the ADT values. IntegrateEmbeddings() and ProjectUMAP() are used to project the query data onto the UMAP structure of the reference. The equivalent code for doing this with the intermediate functions is below: pbmc3k <- TransferData( anchorset = anchors, reference = reference, query = pbmc3k, refdata = list( celltype.l1 = "celltype.l1", celltype.l2 = "celltype.l2", predicted_ADT = "ADT") ) pbmc3k <- IntegrateEmbeddings( anchorset = anchors, reference = reference, query = pbmc3k, new.reduction.name = "ref.spca" ) pbmc3k <- ProjectUMAP( query = pbmc3k, query.reduction = "ref.spca", reference = reference, reference.reduction = "spca", reduction.model = "wnn.umap" )

MapQuery() is a wrapper around three functions: TransferData(), IntegrateEmbeddings(), and ProjectUMAP(). TransferData() is used to transfer cell type labels and impute the ADT values. IntegrateEmbeddings() and ProjectUMAP() are used to project the query data onto the UMAP structure of the reference. The equivalent code for doing this with the intermediate functions is below: pbmc3k <- TransferData( anchorset = anchors, reference = reference, query = pbmc3k, refdata = list( celltype.l1 = "celltype.l1", celltype.l2 = "celltype.l2", predicted_ADT = "ADT") ) pbmc3k <- IntegrateEmbeddings( anchorset = anchors, reference = reference, query = pbmc3k, new.reduction.name = "ref.spca" ) pbmc3k <- ProjectUMAP( query = pbmc3k, query.reduction = "ref.spca", reference = reference, reference.reduction = "spca", reduction.model = "wnn.umap" )

MapQuery() is a wrapper around three functions: TransferData(), IntegrateEmbeddings(), and ProjectUMAP(). TransferData() is used to transfer cell type labels and impute the ADT values. IntegrateEmbeddings() and ProjectUMAP() are used to project the query data onto the UMAP structure of the reference. The equivalent code for doing this with the intermediate functions is below: pbmc3k <- TransferData( anchorset = anchors, reference = reference, query = pbmc3k, refdata = list( celltype.l1 = "celltype.l1", celltype.l2 = "celltype.l2", predicted_ADT = "ADT") ) pbmc3k <- IntegrateEmbeddings( anchorset = anchors, reference = reference, query = pbmc3k, new.reduction.name = "ref.spca" ) pbmc3k <- ProjectUMAP( query = pbmc3k, query.reduction = "ref.spca", reference = reference, reference.reduction = "spca", reduction.model = "wnn.umap" )

We can now visualize the 2,700 query cells. They have been projected into a UMAP visualization defined by the reference, and each has received annotations at two levels of granularity (level 1, and level 2). p1 = DimPlot(pbmc3k, reduction = "ref.umap", group.by = "predicted.celltype.l1", label = TRUE, label.size = 3, repel = TRUE) + NoLegend() p2 = DimPlot(pbmc3k, reduction = "ref.umap", group.by = "predicted.celltype.l2", label = TRUE, label.size = 3 ,repel = TRUE) + NoLegend() p1 + p2The reference-mapped dataset helps us identify cell types that were previously blended in an unsupervised analysis of the query dataset. Just a few examples include plasmacytoid dendritic cells (pDC), hematopoietic stem and progenitor cells (HSPC), regulatory T cells (Treg), CD8 Naive T cells, cells, CD56+ NK cells, memory, and naive B cells, and plasmablasts.Each prediction is assigned a score between 0 and 1. FeaturePlot(pbmc3k, features = c("pDC", "CD16 Mono", "Treg"), reduction = "ref.umap", cols = c("lightgrey", "darkred"), ncol = 3) & theme(plot.title = element_text(size = 10))We can verify our predictions by exploring the expression of canonical marker genes. For example, CLEC4C and LIRA4 have been reported as markers of pDC identity, consistent with our predictions. Similarly, if we perform differential expression to identify markers of Tregs, we identify a set of canonical markers including RTKN2, CTLA4, FOXP3, and IL2RA. Idents(pbmc3k) <- 'predicted.celltype.l2' VlnPlot(pbmc3k, features = c("CLEC4C", "LILRA4"), sort = TRUE) + NoLegend() treg_markers <- FindMarkers(pbmc3k, ident.1 = "Treg", only.pos = TRUE, logfc.threshold = 0.1) print(head(treg_markers))## p_val avg_log2FC pct.1 pct.2 p_val_adj ## FOXP3 8.428389e-41 0.2002914 0.152 0.002 1.059617e-36 ## RP11-1399P15.1 1.702575e-21 0.4749271 0.273 0.021 2.140478e-17 ## RTKN2 3.890305e-17 0.2339929 0.121 0.005 4.890892e-13 ## TIGIT 3.773433e-16 0.5934260 0.424 0.065 4.743960e-12 ## F5 4.035005e-16 0.2318413 0.121 0.005 5.072808e-12 ## FRS2 2.983908e-15 0.1906088 0.152 0.009 3.751369e-11Finally, we can visualize the imputed levels of surface protein, which were inferred based on the CITE-seq reference. DefaultAssay(pbmc3k) <- 'predicted_ADT' # see a list of proteins: rownames(pbmc3k) FeaturePlot(pbmc3k, features = c("CD3-1", "CD45RA", "IgD"), reduction = "ref.umap", cols = c("lightgrey", "darkgreen"), ncol = 3)

The reference-mapped dataset helps us identify cell types that were previously blended in an unsupervised analysis of the query dataset. Just a few examples include plasmacytoid dendritic cells (pDC), hematopoietic stem and progenitor cells (HSPC), regulatory T cells (Treg), CD8 Naive T cells, cells, CD56+ NK cells, memory, and naive B cells, and plasmablasts.Each prediction is assigned a score between 0 and 1. FeaturePlot(pbmc3k, features = c("pDC", "CD16 Mono", "Treg"), reduction = "ref.umap", cols = c("lightgrey", "darkred"), ncol = 3) & theme(plot.title = element_text(size = 10))We can verify our predictions by exploring the expression of canonical marker genes. For example, CLEC4C and LIRA4 have been reported as markers of pDC identity, consistent with our predictions. Similarly, if we perform differential expression to identify markers of Tregs, we identify a set of canonical markers including RTKN2, CTLA4, FOXP3, and IL2RA. Idents(pbmc3k) <- 'predicted.celltype.l2' VlnPlot(pbmc3k, features = c("CLEC4C", "LILRA4"), sort = TRUE) + NoLegend() treg_markers <- FindMarkers(pbmc3k, ident.1 = "Treg", only.pos = TRUE, logfc.threshold = 0.1) print(head(treg_markers))## p_val avg_log2FC pct.1 pct.2 p_val_adj ## FOXP3 8.428389e-41 0.2002914 0.152 0.002 1.059617e-36 ## RP11-1399P15.1 1.702575e-21 0.4749271 0.273 0.021 2.140478e-17 ## RTKN2 3.890305e-17 0.2339929 0.121 0.005 4.890892e-13 ## TIGIT 3.773433e-16 0.5934260 0.424 0.065 4.743960e-12 ## F5 4.035005e-16 0.2318413 0.121 0.005 5.072808e-12 ## FRS2 2.983908e-15 0.1906088 0.152 0.009 3.751369e-11Finally, we can visualize the imputed levels of surface protein, which were inferred based on the CITE-seq reference. DefaultAssay(pbmc3k) <- 'predicted_ADT' # see a list of proteins: rownames(pbmc3k) FeaturePlot(pbmc3k, features = c("CD3-1", "CD45RA", "IgD"), reduction = "ref.umap", cols = c("lightgrey", "darkgreen"), ncol = 3)

The reference-mapped dataset helps us identify cell types that were previously blended in an unsupervised analysis of the query dataset. Just a few examples include plasmacytoid dendritic cells (pDC), hematopoietic stem and progenitor cells (HSPC), regulatory T cells (Treg), CD8 Naive T cells, cells, CD56+ NK cells, memory, and naive B cells, and plasmablasts.Each prediction is assigned a score between 0 and 1. FeaturePlot(pbmc3k, features = c("pDC", "CD16 Mono", "Treg"), reduction = "ref.umap", cols = c("lightgrey", "darkred"), ncol = 3) & theme(plot.title = element_text(size = 10))We can verify our predictions by exploring the expression of canonical marker genes. For example, CLEC4C and LIRA4 have been reported as markers of pDC identity, consistent with our predictions. Similarly, if we perform differential expression to identify markers of Tregs, we identify a set of canonical markers including RTKN2, CTLA4, FOXP3, and IL2RA. Idents(pbmc3k) <- 'predicted.celltype.l2' VlnPlot(pbmc3k, features = c("CLEC4C", "LILRA4"), sort = TRUE) + NoLegend() treg_markers <- FindMarkers(pbmc3k, ident.1 = "Treg", only.pos = TRUE, logfc.threshold = 0.1) print(head(treg_markers))## p_val avg_log2FC pct.1 pct.2 p_val_adj ## FOXP3 8.428389e-41 0.2002914 0.152 0.002 1.059617e-36 ## RP11-1399P15.1 1.702575e-21 0.4749271 0.273 0.021 2.140478e-17 ## RTKN2 3.890305e-17 0.2339929 0.121 0.005 4.890892e-13 ## TIGIT 3.773433e-16 0.5934260 0.424 0.065 4.743960e-12 ## F5 4.035005e-16 0.2318413 0.121 0.005 5.072808e-12 ## FRS2 2.983908e-15 0.1906088 0.152 0.009 3.751369e-11Finally, we can visualize the imputed levels of surface protein, which were inferred based on the CITE-seq reference. DefaultAssay(pbmc3k) <- 'predicted_ADT' # see a list of proteins: rownames(pbmc3k) FeaturePlot(pbmc3k, features = c("CD3-1", "CD45RA", "IgD"), reduction = "ref.umap", cols = c("lightgrey", "darkgreen"), ncol = 3)

Each prediction is assigned a score between 0 and 1. FeaturePlot(pbmc3k, features = c("pDC", "CD16 Mono", "Treg"), reduction = "ref.umap", cols = c("lightgrey", "darkred"), ncol = 3) & theme(plot.title = element_text(size = 10))We can verify our predictions by exploring the expression of canonical marker genes. For example, CLEC4C and LIRA4 have been reported as markers of pDC identity, consistent with our predictions. Similarly, if we perform differential expression to identify markers of Tregs, we identify a set of canonical markers including RTKN2, CTLA4, FOXP3, and IL2RA. Idents(pbmc3k) <- 'predicted.celltype.l2' VlnPlot(pbmc3k, features = c("CLEC4C", "LILRA4"), sort = TRUE) + NoLegend() treg_markers <- FindMarkers(pbmc3k, ident.1 = "Treg", only.pos = TRUE, logfc.threshold = 0.1) print(head(treg_markers))## p_val avg_log2FC pct.1 pct.2 p_val_adj ## FOXP3 8.428389e-41 0.2002914 0.152 0.002 1.059617e-36 ## RP11-1399P15.1 1.702575e-21 0.4749271 0.273 0.021 2.140478e-17 ## RTKN2 3.890305e-17 0.2339929 0.121 0.005 4.890892e-13 ## TIGIT 3.773433e-16 0.5934260 0.424 0.065 4.743960e-12 ## F5 4.035005e-16 0.2318413 0.121 0.005 5.072808e-12 ## FRS2 2.983908e-15 0.1906088 0.152 0.009 3.751369e-11Finally, we can visualize the imputed levels of surface protein, which were inferred based on the CITE-seq reference. DefaultAssay(pbmc3k) <- 'predicted_ADT' # see a list of proteins: rownames(pbmc3k) FeaturePlot(pbmc3k, features = c("CD3-1", "CD45RA", "IgD"), reduction = "ref.umap", cols = c("lightgrey", "darkgreen"), ncol = 3)

We can verify our predictions by exploring the expression of canonical marker genes. For example, CLEC4C and LIRA4 have been reported as markers of pDC identity, consistent with our predictions. Similarly, if we perform differential expression to identify markers of Tregs, we identify a set of canonical markers including RTKN2, CTLA4, FOXP3, and IL2RA. Idents(pbmc3k) <- 'predicted.celltype.l2' VlnPlot(pbmc3k, features = c("CLEC4C", "LILRA4"), sort = TRUE) + NoLegend() treg_markers <- FindMarkers(pbmc3k, ident.1 = "Treg", only.pos = TRUE, logfc.threshold = 0.1) print(head(treg_markers))## p_val avg_log2FC pct.1 pct.2 p_val_adj ## FOXP3 8.428389e-41 0.2002914 0.152 0.002 1.059617e-36 ## RP11-1399P15.1 1.702575e-21 0.4749271 0.273 0.021 2.140478e-17 ## RTKN2 3.890305e-17 0.2339929 0.121 0.005 4.890892e-13 ## TIGIT 3.773433e-16 0.5934260 0.424 0.065 4.743960e-12 ## F5 4.035005e-16 0.2318413 0.121 0.005 5.072808e-12 ## FRS2 2.983908e-15 0.1906088 0.152 0.009 3.751369e-11Finally, we can visualize the imputed levels of surface protein, which were inferred based on the CITE-seq reference. DefaultAssay(pbmc3k) <- 'predicted_ADT' # see a list of proteins: rownames(pbmc3k) FeaturePlot(pbmc3k, features = c("CD3-1", "CD45RA", "IgD"), reduction = "ref.umap", cols = c("lightgrey", "darkgreen"), ncol = 3)

We can verify our predictions by exploring the expression of canonical marker genes. For example, CLEC4C and LIRA4 have been reported as markers of pDC identity, consistent with our predictions. Similarly, if we perform differential expression to identify markers of Tregs, we identify a set of canonical markers including RTKN2, CTLA4, FOXP3, and IL2RA. Idents(pbmc3k) <- 'predicted.celltype.l2' VlnPlot(pbmc3k, features = c("CLEC4C", "LILRA4"), sort = TRUE) + NoLegend() treg_markers <- FindMarkers(pbmc3k, ident.1 = "Treg", only.pos = TRUE, logfc.threshold = 0.1) print(head(treg_markers))## p_val avg_log2FC pct.1 pct.2 p_val_adj ## FOXP3 8.428389e-41 0.2002914 0.152 0.002 1.059617e-36 ## RP11-1399P15.1 1.702575e-21 0.4749271 0.273 0.021 2.140478e-17 ## RTKN2 3.890305e-17 0.2339929 0.121 0.005 4.890892e-13 ## TIGIT 3.773433e-16 0.5934260 0.424 0.065 4.743960e-12 ## F5 4.035005e-16 0.2318413 0.121 0.005 5.072808e-12 ## FRS2 2.983908e-15 0.1906088 0.152 0.009 3.751369e-11Finally, we can visualize the imputed levels of surface protein, which were inferred based on the CITE-seq reference. DefaultAssay(pbmc3k) <- 'predicted_ADT' # see a list of proteins: rownames(pbmc3k) FeaturePlot(pbmc3k, features = c("CD3-1", "CD45RA", "IgD"), reduction = "ref.umap", cols = c("lightgrey", "darkgreen"), ncol = 3)

treg_markers <- FindMarkers(pbmc3k, ident.1 = "Treg", only.pos = TRUE, logfc.threshold = 0.1) print(head(treg_markers))## p_val avg_log2FC pct.1 pct.2 p_val_adj ## FOXP3 8.428389e-41 0.2002914 0.152 0.002 1.059617e-36 ## RP11-1399P15.1 1.702575e-21 0.4749271 0.273 0.021 2.140478e-17 ## RTKN2 3.890305e-17 0.2339929 0.121 0.005 4.890892e-13 ## TIGIT 3.773433e-16 0.5934260 0.424 0.065 4.743960e-12 ## F5 4.035005e-16 0.2318413 0.121 0.005 5.072808e-12 ## FRS2 2.983908e-15 0.1906088 0.152 0.009 3.751369e-11Finally, we can visualize the imputed levels of surface protein, which were inferred based on the CITE-seq reference. DefaultAssay(pbmc3k) <- 'predicted_ADT' # see a list of proteins: rownames(pbmc3k) FeaturePlot(pbmc3k, features = c("CD3-1", "CD45RA", "IgD"), reduction = "ref.umap", cols = c("lightgrey", "darkgreen"), ncol = 3)

Finally, we can visualize the imputed levels of surface protein, which were inferred based on the CITE-seq reference. DefaultAssay(pbmc3k) <- 'predicted_ADT' # see a list of proteins: rownames(pbmc3k) FeaturePlot(pbmc3k, features = c("CD3-1", "CD45RA", "IgD"), reduction = "ref.umap", cols = c("lightgrey", "darkgreen"), ncol = 3)

In the previous examples, we visualize the query cells after mapping to the reference-derived UMAP. Keeping a consistent visualization can assist with the interpretation of new datasets. However, if there are cell states that are present in the query dataset that are not represented in the reference, they will project to the most similar cell in the reference. This is the expected behavior and functionality as established by the UMAP package, but can potentially mask the presence of new cell types in the query which may be of interest.In our manuscript, we map a query dataset containing developing and differentiated neutrophils, which are not included in our reference. We find that computing a new UMAP (‘de novo visualization’) after merging the reference and query can help to identify these populations, as demonstrated in Supplementary Figure 8. In the ‘de novo’ visualization, unique cell states in the query remain separated. In this example, the 2,700 PBMC does not contain unique cell states, but we demonstrate how to compute this visualization below.We emphasize that if users are attempting to map datasets where the underlying samples are not PBMC, or contain cell types that are not present in the reference, computing a ‘de novo’ visualization is an important step in interpreting their dataset. #merge reference and query reference$id <- 'reference' 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', shuffle = TRUE)

In our manuscript, we map a query dataset containing developing and differentiated neutrophils, which are not included in our reference. We find that computing a new UMAP (‘de novo visualization’) after merging the reference and query can help to identify these populations, as demonstrated in Supplementary Figure 8. In the ‘de novo’ visualization, unique cell states in the query remain separated. In this example, the 2,700 PBMC does not contain unique cell states, but we demonstrate how to compute this visualization below.We emphasize that if users are attempting to map datasets where the underlying samples are not PBMC, or contain cell types that are not present in the reference, computing a ‘de novo’ visualization is an important step in interpreting their dataset. #merge reference and query reference$id <- 'reference' 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', shuffle = TRUE)

We emphasize that if users are attempting to map datasets where the underlying samples are not PBMC, or contain cell types that are not present in the reference, computing a ‘de novo’ visualization is an important step in interpreting their dataset. #merge reference and query reference$id <- 'reference' 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', shuffle = TRUE)

As a second example, we map a dataset of human bone marrow mononuclear (BMNC) cells from eight individual donors, produced by the Human Cell Atlas. As a reference, we use the CITE-seq reference of human BMNC that we analyzed using weighted-nearest neighbor analysis (WNN).This vignette exhibits the same reference-mapping functionality as the PBMC example on the previous tab. In addition, we also demonstrate:How to construct a supervised PCA (sPCA) transformationHow to serially map multiple datasets to the same referenceOptimization steps to further enhance to speed of mapping # Both datasets are available through SeuratData library(SeuratData) #load reference data InstallData("bmcite") bm <- LoadData(ds = "bmcite") #load query data InstallData('hcabm40k') hcabm40k <- LoadData(ds = "hcabm40k")The reference dataset contains a WNN graph, reflecting a weighted combination of the RNA and protein data in this CITE-seq experiment.We can compute a UMAP visualization based on this graph. We set return.model = TRUE, which will enable us to project query datasets onto this visualization. bm <- RunUMAP(bm, nn.name = "weighted.nn", reduction.name = "wnn.umap", reduction.key = "wnnUMAP_", return.model = TRUE) DimPlot(bm, group.by = "celltype.l2", reduction = "wnn.umap")

This vignette exhibits the same reference-mapping functionality as the PBMC example on the previous tab. In addition, we also demonstrate:How to construct a supervised PCA (sPCA) transformationHow to serially map multiple datasets to the same referenceOptimization steps to further enhance to speed of mapping # Both datasets are available through SeuratData library(SeuratData) #load reference data InstallData("bmcite") bm <- LoadData(ds = "bmcite") #load query data InstallData('hcabm40k') hcabm40k <- LoadData(ds = "hcabm40k")The reference dataset contains a WNN graph, reflecting a weighted combination of the RNA and protein data in this CITE-seq experiment.We can compute a UMAP visualization based on this graph. We set return.model = TRUE, which will enable us to project query datasets onto this visualization. bm <- RunUMAP(bm, nn.name = "weighted.nn", reduction.name = "wnn.umap", reduction.key = "wnnUMAP_", return.model = TRUE) DimPlot(bm, group.by = "celltype.l2", reduction = "wnn.umap")

The reference dataset contains a WNN graph, reflecting a weighted combination of the RNA and protein data in this CITE-seq experiment.We can compute a UMAP visualization based on this graph. We set return.model = TRUE, which will enable us to project query datasets onto this visualization. bm <- RunUMAP(bm, nn.name = "weighted.nn", reduction.name = "wnn.umap", reduction.key = "wnnUMAP_", return.model = TRUE) DimPlot(bm, group.by = "celltype.l2", reduction = "wnn.umap")

We can compute a UMAP visualization based on this graph. We set return.model = TRUE, which will enable us to project query datasets onto this visualization. bm <- RunUMAP(bm, nn.name = "weighted.nn", reduction.name = "wnn.umap", reduction.key = "wnnUMAP_", return.model = TRUE) DimPlot(bm, group.by = "celltype.l2", reduction = "wnn.umap")

As described in our manuscript, we first compute a ‘supervised’ PCA. This identifies the transformation of the transcriptome data that best encapsulates the structure of the WNN graph. This allows a weighted combination of the protein and RNA measurements to ‘supervise’ the PCA, and highlight the most relevant sources of variation. After computing this transformation, we can project it onto a query dataset. We can also compute and project a PCA projection, but recommend the use of sPCA when working with multimodal references that have been constructed with WNN analysis.The sPCA calculation is performed once, and then can be rapidly projected onto each query dataset. bm <- ScaleData(bm, assay = 'RNA') bm <- RunSPCA(bm, assay = 'RNA', graph = 'wsnn')

The sPCA calculation is performed once, and then can be rapidly projected onto each query dataset. bm <- ScaleData(bm, assay = 'RNA') bm <- RunSPCA(bm, assay = 'RNA', graph = 'wsnn')

Since we will be mapping multiple query samples to the same reference, we can cache particular steps that only involve the reference. This step is optional but will improve speed when mapping multiple samples.We compute the first 50 neighbors in the sPCA space of the reference. We store this information in the spca.annoy.neighbors object within the reference Seurat object and also cache the annoy index data structure (via cache.index = TRUE). bm <- FindNeighbors( object = bm, reduction = "spca", dims = 1:50, graph.name = "spca.annoy.neighbors", k.param = 50, cache.index = TRUE, return.neighbor = TRUE, l2.norm = TRUE )How can I save and load a cached annoy index?If you want to save and load a cached index for a Neighbor object generated with method = "annoy" and cache.index = TRUE, use the SaveAnnoyIndex()/LoadAnnoyIndex() functions. Importantly, this index cannot be saved normally to an RDS or RDA file, so it will not persist correctly across R session restarts or saveRDS/readRDS for the Seurat object containing it. Instead, use LoadAnnoyIndex() to add the Annoy index to the Neighbor object every time R restarts or you load the reference Seurat object from RDS. The file created by SaveAnnoyIndex() can be distributed along with a reference Seurat object, and added to the Neighbor object in the reference. bm[["spca.annoy.neighbors"]]## A Neighbor object containing the 50 nearest neighbors for 30672 cells SaveAnnoyIndex(object = bm[["spca.annoy.neighbors"]], file = "../data/reftmp.idx") bm[["spca.annoy.neighbors"]] <- LoadAnnoyIndex(object = bm[["spca.annoy.neighbors"]], file = "../data/reftmp.idx")

We compute the first 50 neighbors in the sPCA space of the reference. We store this information in the spca.annoy.neighbors object within the reference Seurat object and also cache the annoy index data structure (via cache.index = TRUE). bm <- FindNeighbors( object = bm, reduction = "spca", dims = 1:50, graph.name = "spca.annoy.neighbors", k.param = 50, cache.index = TRUE, return.neighbor = TRUE, l2.norm = TRUE )How can I save and load a cached annoy index?If you want to save and load a cached index for a Neighbor object generated with method = "annoy" and cache.index = TRUE, use the SaveAnnoyIndex()/LoadAnnoyIndex() functions. Importantly, this index cannot be saved normally to an RDS or RDA file, so it will not persist correctly across R session restarts or saveRDS/readRDS for the Seurat object containing it. Instead, use LoadAnnoyIndex() to add the Annoy index to the Neighbor object every time R restarts or you load the reference Seurat object from RDS. The file created by SaveAnnoyIndex() can be distributed along with a reference Seurat object, and added to the Neighbor object in the reference. bm[["spca.annoy.neighbors"]]## A Neighbor object containing the 50 nearest neighbors for 30672 cells SaveAnnoyIndex(object = bm[["spca.annoy.neighbors"]], file = "../data/reftmp.idx") bm[["spca.annoy.neighbors"]] <- LoadAnnoyIndex(object = bm[["spca.annoy.neighbors"]], file = "../data/reftmp.idx")

If you want to save and load a cached index for a Neighbor object generated with method = "annoy" and cache.index = TRUE, use the SaveAnnoyIndex()/LoadAnnoyIndex() functions. Importantly, this index cannot be saved normally to an RDS or RDA file, so it will not persist correctly across R session restarts or saveRDS/readRDS for the Seurat object containing it. Instead, use LoadAnnoyIndex() to add the Annoy index to the Neighbor object every time R restarts or you load the reference Seurat object from RDS. The file created by SaveAnnoyIndex() can be distributed along with a reference Seurat object, and added to the Neighbor object in the reference. bm[["spca.annoy.neighbors"]]## A Neighbor object containing the 50 nearest neighbors for 30672 cells SaveAnnoyIndex(object = bm[["spca.annoy.neighbors"]], file = "../data/reftmp.idx") bm[["spca.annoy.neighbors"]] <- LoadAnnoyIndex(object = bm[["spca.annoy.neighbors"]], file = "../data/reftmp.idx")

If you want to save and load a cached index for a Neighbor object generated with method = "annoy" and cache.index = TRUE, use the SaveAnnoyIndex()/LoadAnnoyIndex() functions. Importantly, this index cannot be saved normally to an RDS or RDA file, so it will not persist correctly across R session restarts or saveRDS/readRDS for the Seurat object containing it. Instead, use LoadAnnoyIndex() to add the Annoy index to the Neighbor object every time R restarts or you load the reference Seurat object from RDS. The file created by SaveAnnoyIndex() can be distributed along with a reference Seurat object, and added to the Neighbor object in the reference. bm[["spca.annoy.neighbors"]]## A Neighbor object containing the 50 nearest neighbors for 30672 cells SaveAnnoyIndex(object = bm[["spca.annoy.neighbors"]], file = "../data/reftmp.idx") bm[["spca.annoy.neighbors"]] <- LoadAnnoyIndex(object = bm[["spca.annoy.neighbors"]], file = "../data/reftmp.idx")

Here we will demonstrate mapping multiple donor bone marrow samples to the multimodal bone marrow reference. These query datasets are derived from the Human Cell Atlas (HCA) Immune Cell Atlas Bone marrow dataset and are available through SeuratData. This dataset is provided as a single merged object with 8 donors. We first split the data back into 8 separate Seurat objects, one for each original donor to map individually. library(dplyr) library(SeuratData) InstallData('hcabm40k') hcabm40k.batches <- SplitObject(hcabm40k, split.by = "orig.ident")We then normalize the query in the same manner as the reference. Here, the reference was normalized using log-normalization via NormalizeData(). If the reference had been normalized using SCTransform(), the query must be normalized with SCTransform() as well. hcabm40k.batches <- lapply(X = hcabm40k.batches, FUN = NormalizeData, verbose = FALSE)

We then normalize the query in the same manner as the reference. Here, the reference was normalized using log-normalization via NormalizeData(). If the reference had been normalized using SCTransform(), the query must be normalized with SCTransform() as well. hcabm40k.batches <- lapply(X = hcabm40k.batches, FUN = NormalizeData, verbose = FALSE)

We then find anchors between each donor query dataset and the multimodal reference. This command is optimized to minimize mapping time, by passing in a pre-computed set of reference neighbors, and turning off anchor filtration. anchors <- list() for (i in 1:length(hcabm40k.batches)) { anchors[[i]] <- FindTransferAnchors( reference = bm, query = hcabm40k.batches[[i]], k.filter = NA, reference.reduction = "spca", reference.neighbors = "spca.annoy.neighbors", dims = 1:50 ) }We then individually map each of the datasets. for (i in 1:length(hcabm40k.batches)) { hcabm40k.batches[[i]] <- MapQuery( anchorset = anchors[[i]], query = hcabm40k.batches[[i]], reference = bm, refdata = list( celltype = "celltype.l2", predicted_ADT = "ADT"), reference.reduction = "spca", reduction.model = "wnn.umap" ) }

We then individually map each of the datasets. for (i in 1:length(hcabm40k.batches)) { hcabm40k.batches[[i]] <- MapQuery( anchorset = anchors[[i]], query = hcabm40k.batches[[i]], reference = bm, refdata = list( celltype = "celltype.l2", predicted_ADT = "ADT"), reference.reduction = "spca", reduction.model = "wnn.umap" ) }

Now that mapping is complete, we can visualize the results for individual objects p1 <- DimPlot(hcabm40k.batches[[1]], reduction = 'ref.umap', group.by = 'predicted.celltype', label.size = 3) p2 <- DimPlot(hcabm40k.batches[[2]], reduction = 'ref.umap', group.by = 'predicted.celltype', label.size = 3) p1 + p2 + plot_layout(guides = "collect")We can also merge all the objects into one dataset. Note that they have all been integrated into a common space, defined by the reference. We can then visualize the results together. # Merge the batches hcabm40k <- merge(hcabm40k.batches[[1]], hcabm40k.batches[2:length(hcabm40k.batches)], merge.dr = "ref.umap") DimPlot(hcabm40k, reduction = "ref.umap", group.by = "predicted.celltype", label = TRUE, repel = TRUE, label.size = 3) + NoLegend()We can visualize gene expression, cluster prediction scores, and (imputed) surface protein levels in the query cells: p3 <- FeaturePlot(hcabm40k, features = c("rna_TRDC", "rna_MPO", "rna_AVP"), reduction = 'ref.umap', max.cutoff = 3, ncol = 3) # cell type prediction scores DefaultAssay(hcabm40k) <- 'prediction.score.celltype' p4 <- FeaturePlot(hcabm40k, features = c("CD16 Mono", "HSC", "Prog-RBC"), ncol = 3, cols = c("lightgrey", "darkred")) # imputed protein levels DefaultAssay(hcabm40k) <- 'predicted_ADT' p5 <- FeaturePlot(hcabm40k, features = c("CD45RA", "CD16", "CD161"), reduction = 'ref.umap', min.cutoff = 'q10', max.cutoff = 'q99', cols = c("lightgrey", "darkgreen") , ncol = 3) p3 / p4 / p5Session Info sessionInfo()## R version 4.2.0 (2022-04-22) ## Platform: x86_64-pc-linux-gnu (64-bit) ## Running under: Ubuntu 20.04.5 LTS ## ## Matrix products: default ## BLAS: /usr/lib/x86_64-linux-gnu/openblas-pthread/libblas.so.3 ## LAPACK: /usr/lib/x86_64-linux-gnu/openblas-pthread/liblapack.so.3 ## ## locale: ## [1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C ## [3] LC_TIME=en_US.UTF-8 LC_COLLATE=en_US.UTF-8 ## [5] LC_MONETARY=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8 ## [7] LC_PAPER=en_US.UTF-8 LC_NAME=C ## [9] LC_ADDRESS=C LC_TELEPHONE=C ## [11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C ## ## attached base packages: ## [1] stats graphics grDevices utils datasets methods base ## ## other attached packages: ## [1] dplyr_1.1.0 thp1.eccite.SeuratData_3.1.5 ## [3] stxBrain.SeuratData_0.1.1 ssHippo.SeuratData_3.1.4 ## [5] pbmcsca.SeuratData_3.0.0 pbmcMultiome.SeuratData_0.1.2 ## [7] pbmc3k.SeuratData_3.1.4 panc8.SeuratData_3.0.2 ## [9] ifnb.SeuratData_3.1.0 hcabm40k.SeuratData_3.0.0 ## [11] bmcite.SeuratData_0.3.0 SeuratData_0.2.2 ## [13] patchwork_1.1.2 ggplot2_3.4.1 ## [15] SeuratDisk_0.0.0.9020 SeuratObject_4.1.3 ## [17] Seurat_4.3.0 ## ## loaded via a namespace (and not attached): ## [1] systemfonts_1.0.4 plyr_1.8.8 igraph_1.4.1 ## [4] lazyeval_0.2.2 sp_1.6-0 splines_4.2.0 ## [7] listenv_0.9.0 scattermore_0.8 digest_0.6.31 ## [10] htmltools_0.5.4 fansi_1.0.4 magrittr_2.0.3 ## [13] memoise_2.0.1 tensor_1.5 cluster_2.1.3 ## [16] ROCR_1.0-11 limma_3.54.1 globals_0.16.2 ## [19] matrixStats_0.63.0 pkgdown_2.0.7 spatstat.sparse_3.0-0 ## [22] colorspace_2.1-0 rappdirs_0.3.3 ggrepel_0.9.3 ## [25] textshaping_0.3.6 xfun_0.37 crayon_1.5.2 ## [28] jsonlite_1.8.4 progressr_0.13.0 spatstat.data_3.0-0 ## [31] survival_3.3-1 zoo_1.8-11 glue_1.6.2 ## [34] polyclip_1.10-4 gtable_0.3.1 leiden_0.4.3 ## [37] future.apply_1.10.0 abind_1.4-5 scales_1.2.1 ## [40] spatstat.random_3.1-3 miniUI_0.1.1.1 Rcpp_1.0.10 ## [43] viridisLite_0.4.1 xtable_1.8-4 reticulate_1.28 ## [46] bit_4.0.5 htmlwidgets_1.6.1 httr_1.4.5 ## [49] RColorBrewer_1.1-3 ellipsis_0.3.2 ica_1.0-3 ## [52] pkgconfig_2.0.3 farver_2.1.1 sass_0.4.5 ## [55] uwot_0.1.14 deldir_1.0-6 utf8_1.2.3 ## [58] tidyselect_1.2.0 labeling_0.4.2 rlang_1.0.6 ## [61] reshape2_1.4.4 later_1.3.0 munsell_0.5.0 ## [64] tools_4.2.0 cachem_1.0.7 cli_3.6.0 ## [67] generics_0.1.3 ggridges_0.5.4 evaluate_0.20 ## [70] stringr_1.5.0 fastmap_1.1.1 yaml_2.3.7 ## [73] ragg_1.2.5 goftest_1.2-3 knitr_1.42 ## [76] bit64_4.0.5 fs_1.6.1 fitdistrplus_1.1-8 ## [79] purrr_1.0.1 RANN_2.6.1 pbapply_1.7-0 ## [82] future_1.31.0 nlme_3.1-157 mime_0.12 ## [85] hdf5r_1.3.8 compiler_4.2.0 plotly_4.10.1 ## [88] png_0.1-8 spatstat.utils_3.0-1 tibble_3.1.8 ## [91] bslib_0.4.2 stringi_1.7.12 highr_0.10 ## [94] desc_1.4.2 lattice_0.20-45 Matrix_1.5-3 ## [97] vctrs_0.5.2 pillar_1.8.1 lifecycle_1.0.3 ## [100] spatstat.geom_3.0-6 lmtest_0.9-40 jquerylib_0.1.4 ## [103] RcppAnnoy_0.0.20 data.table_1.14.8 cowplot_1.1.1 ## [106] irlba_2.3.5.1 httpuv_1.6.9 R6_2.5.1 ## [109] promises_1.2.0.1 KernSmooth_2.23-20 gridExtra_2.3 ## [112] parallelly_1.34.0 codetools_0.2-18 MASS_7.3-56 ## [115] rprojroot_2.0.3 withr_2.5.0 sctransform_0.3.5 ## [118] parallel_4.2.0 grid_4.2.0 tidyr_1.3.0 ## [121] rmarkdown_2.20 Rtsne_0.16 spatstat.explore_3.0-6 ## [124] shiny_1.7.4

We can also merge all the objects into one dataset. Note that they have all been integrated into a common space, defined by the reference. We can then visualize the results together. # Merge the batches hcabm40k <- merge(hcabm40k.batches[[1]], hcabm40k.batches[2:length(hcabm40k.batches)], merge.dr = "ref.umap") DimPlot(hcabm40k, reduction = "ref.umap", group.by = "predicted.celltype", label = TRUE, repel = TRUE, label.size = 3) + NoLegend()We can visualize gene expression, cluster prediction scores, and (imputed) surface protein levels in the query cells: p3 <- FeaturePlot(hcabm40k, features = c("rna_TRDC", "rna_MPO", "rna_AVP"), reduction = 'ref.umap', max.cutoff = 3, ncol = 3) # cell type prediction scores DefaultAssay(hcabm40k) <- 'prediction.score.celltype' p4 <- FeaturePlot(hcabm40k, features = c("CD16 Mono", "HSC", "Prog-RBC"), ncol = 3, cols = c("lightgrey", "darkred")) # imputed protein levels DefaultAssay(hcabm40k) <- 'predicted_ADT' p5 <- FeaturePlot(hcabm40k, features = c("CD45RA", "CD16", "CD161"), reduction = 'ref.umap', min.cutoff = 'q10', max.cutoff = 'q99', cols = c("lightgrey", "darkgreen") , ncol = 3) p3 / p4 / p5Session Info sessionInfo()## R version 4.2.0 (2022-04-22) ## Platform: x86_64-pc-linux-gnu (64-bit) ## Running under: Ubuntu 20.04.5 LTS ## ## Matrix products: default ## BLAS: /usr/lib/x86_64-linux-gnu/openblas-pthread/libblas.so.3 ## LAPACK: /usr/lib/x86_64-linux-gnu/openblas-pthread/liblapack.so.3 ## ## locale: ## [1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C ## [3] LC_TIME=en_US.UTF-8 LC_COLLATE=en_US.UTF-8 ## [5] LC_MONETARY=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8 ## [7] LC_PAPER=en_US.UTF-8 LC_NAME=C ## [9] LC_ADDRESS=C LC_TELEPHONE=C ## [11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C ## ## attached base packages: ## [1] stats graphics grDevices utils datasets methods base ## ## other attached packages: ## [1] dplyr_1.1.0 thp1.eccite.SeuratData_3.1.5 ## [3] stxBrain.SeuratData_0.1.1 ssHippo.SeuratData_3.1.4 ## [5] pbmcsca.SeuratData_3.0.0 pbmcMultiome.SeuratData_0.1.2 ## [7] pbmc3k.SeuratData_3.1.4 panc8.SeuratData_3.0.2 ## [9] ifnb.SeuratData_3.1.0 hcabm40k.SeuratData_3.0.0 ## [11] bmcite.SeuratData_0.3.0 SeuratData_0.2.2 ## [13] patchwork_1.1.2 ggplot2_3.4.1 ## [15] SeuratDisk_0.0.0.9020 SeuratObject_4.1.3 ## [17] Seurat_4.3.0 ## ## loaded via a namespace (and not attached): ## [1] systemfonts_1.0.4 plyr_1.8.8 igraph_1.4.1 ## [4] lazyeval_0.2.2 sp_1.6-0 splines_4.2.0 ## [7] listenv_0.9.0 scattermore_0.8 digest_0.6.31 ## [10] htmltools_0.5.4 fansi_1.0.4 magrittr_2.0.3 ## [13] memoise_2.0.1 tensor_1.5 cluster_2.1.3 ## [16] ROCR_1.0-11 limma_3.54.1 globals_0.16.2 ## [19] matrixStats_0.63.0 pkgdown_2.0.7 spatstat.sparse_3.0-0 ## [22] colorspace_2.1-0 rappdirs_0.3.3 ggrepel_0.9.3 ## [25] textshaping_0.3.6 xfun_0.37 crayon_1.5.2 ## [28] jsonlite_1.8.4 progressr_0.13.0 spatstat.data_3.0-0 ## [31] survival_3.3-1 zoo_1.8-11 glue_1.6.2 ## [34] polyclip_1.10-4 gtable_0.3.1 leiden_0.4.3 ## [37] future.apply_1.10.0 abind_1.4-5 scales_1.2.1 ## [40] spatstat.random_3.1-3 miniUI_0.1.1.1 Rcpp_1.0.10 ## [43] viridisLite_0.4.1 xtable_1.8-4 reticulate_1.28 ## [46] bit_4.0.5 htmlwidgets_1.6.1 httr_1.4.5 ## [49] RColorBrewer_1.1-3 ellipsis_0.3.2 ica_1.0-3 ## [52] pkgconfig_2.0.3 farver_2.1.1 sass_0.4.5 ## [55] uwot_0.1.14 deldir_1.0-6 utf8_1.2.3 ## [58] tidyselect_1.2.0 labeling_0.4.2 rlang_1.0.6 ## [61] reshape2_1.4.4 later_1.3.0 munsell_0.5.0 ## [64] tools_4.2.0 cachem_1.0.7 cli_3.6.0 ## [67] generics_0.1.3 ggridges_0.5.4 evaluate_0.20 ## [70] stringr_1.5.0 fastmap_1.1.1 yaml_2.3.7 ## [73] ragg_1.2.5 goftest_1.2-3 knitr_1.42 ## [76] bit64_4.0.5 fs_1.6.1 fitdistrplus_1.1-8 ## [79] purrr_1.0.1 RANN_2.6.1 pbapply_1.7-0 ## [82] future_1.31.0 nlme_3.1-157 mime_0.12 ## [85] hdf5r_1.3.8 compiler_4.2.0 plotly_4.10.1 ## [88] png_0.1-8 spatstat.utils_3.0-1 tibble_3.1.8 ## [91] bslib_0.4.2 stringi_1.7.12 highr_0.10 ## [94] desc_1.4.2 lattice_0.20-45 Matrix_1.5-3 ## [97] vctrs_0.5.2 pillar_1.8.1 lifecycle_1.0.3 ## [100] spatstat.geom_3.0-6 lmtest_0.9-40 jquerylib_0.1.4 ## [103] RcppAnnoy_0.0.20 data.table_1.14.8 cowplot_1.1.1 ## [106] irlba_2.3.5.1 httpuv_1.6.9 R6_2.5.1 ## [109] promises_1.2.0.1 KernSmooth_2.23-20 gridExtra_2.3 ## [112] parallelly_1.34.0 codetools_0.2-18 MASS_7.3-56 ## [115] rprojroot_2.0.3 withr_2.5.0 sctransform_0.3.5 ## [118] parallel_4.2.0 grid_4.2.0 tidyr_1.3.0 ## [121] rmarkdown_2.20 Rtsne_0.16 spatstat.explore_3.0-6 ## [124] shiny_1.7.4

We can also merge all the objects into one dataset. Note that they have all been integrated into a common space, defined by the reference. We can then visualize the results together. # Merge the batches hcabm40k <- merge(hcabm40k.batches[[1]], hcabm40k.batches[2:length(hcabm40k.batches)], merge.dr = "ref.umap") DimPlot(hcabm40k, reduction = "ref.umap", group.by = "predicted.celltype", label = TRUE, repel = TRUE, label.size = 3) + NoLegend()We can visualize gene expression, cluster prediction scores, and (imputed) surface protein levels in the query cells: p3 <- FeaturePlot(hcabm40k, features = c("rna_TRDC", "rna_MPO", "rna_AVP"), reduction = 'ref.umap', max.cutoff = 3, ncol = 3) # cell type prediction scores DefaultAssay(hcabm40k) <- 'prediction.score.celltype' p4 <- FeaturePlot(hcabm40k, features = c("CD16 Mono", "HSC", "Prog-RBC"), ncol = 3, cols = c("lightgrey", "darkred")) # imputed protein levels DefaultAssay(hcabm40k) <- 'predicted_ADT' p5 <- FeaturePlot(hcabm40k, features = c("CD45RA", "CD16", "CD161"), reduction = 'ref.umap', min.cutoff = 'q10', max.cutoff = 'q99', cols = c("lightgrey", "darkgreen") , ncol = 3) p3 / p4 / p5Session Info sessionInfo()## R version 4.2.0 (2022-04-22) ## Platform: x86_64-pc-linux-gnu (64-bit) ## Running under: Ubuntu 20.04.5 LTS ## ## Matrix products: default ## BLAS: /usr/lib/x86_64-linux-gnu/openblas-pthread/libblas.so.3 ## LAPACK: /usr/lib/x86_64-linux-gnu/openblas-pthread/liblapack.so.3 ## ## locale: ## [1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C ## [3] LC_TIME=en_US.UTF-8 LC_COLLATE=en_US.UTF-8 ## [5] LC_MONETARY=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8 ## [7] LC_PAPER=en_US.UTF-8 LC_NAME=C ## [9] LC_ADDRESS=C LC_TELEPHONE=C ## [11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C ## ## attached base packages: ## [1] stats graphics grDevices utils datasets methods base ## ## other attached packages: ## [1] dplyr_1.1.0 thp1.eccite.SeuratData_3.1.5 ## [3] stxBrain.SeuratData_0.1.1 ssHippo.SeuratData_3.1.4 ## [5] pbmcsca.SeuratData_3.0.0 pbmcMultiome.SeuratData_0.1.2 ## [7] pbmc3k.SeuratData_3.1.4 panc8.SeuratData_3.0.2 ## [9] ifnb.SeuratData_3.1.0 hcabm40k.SeuratData_3.0.0 ## [11] bmcite.SeuratData_0.3.0 SeuratData_0.2.2 ## [13] patchwork_1.1.2 ggplot2_3.4.1 ## [15] SeuratDisk_0.0.0.9020 SeuratObject_4.1.3 ## [17] Seurat_4.3.0 ## ## loaded via a namespace (and not attached): ## [1] systemfonts_1.0.4 plyr_1.8.8 igraph_1.4.1 ## [4] lazyeval_0.2.2 sp_1.6-0 splines_4.2.0 ## [7] listenv_0.9.0 scattermore_0.8 digest_0.6.31 ## [10] htmltools_0.5.4 fansi_1.0.4 magrittr_2.0.3 ## [13] memoise_2.0.1 tensor_1.5 cluster_2.1.3 ## [16] ROCR_1.0-11 limma_3.54.1 globals_0.16.2 ## [19] matrixStats_0.63.0 pkgdown_2.0.7 spatstat.sparse_3.0-0 ## [22] colorspace_2.1-0 rappdirs_0.3.3 ggrepel_0.9.3 ## [25] textshaping_0.3.6 xfun_0.37 crayon_1.5.2 ## [28] jsonlite_1.8.4 progressr_0.13.0 spatstat.data_3.0-0 ## [31] survival_3.3-1 zoo_1.8-11 glue_1.6.2 ## [34] polyclip_1.10-4 gtable_0.3.1 leiden_0.4.3 ## [37] future.apply_1.10.0 abind_1.4-5 scales_1.2.1 ## [40] spatstat.random_3.1-3 miniUI_0.1.1.1 Rcpp_1.0.10 ## [43] viridisLite_0.4.1 xtable_1.8-4 reticulate_1.28 ## [46] bit_4.0.5 htmlwidgets_1.6.1 httr_1.4.5 ## [49] RColorBrewer_1.1-3 ellipsis_0.3.2 ica_1.0-3 ## [52] pkgconfig_2.0.3 farver_2.1.1 sass_0.4.5 ## [55] uwot_0.1.14 deldir_1.0-6 utf8_1.2.3 ## [58] tidyselect_1.2.0 labeling_0.4.2 rlang_1.0.6 ## [61] reshape2_1.4.4 later_1.3.0 munsell_0.5.0 ## [64] tools_4.2.0 cachem_1.0.7 cli_3.6.0 ## [67] generics_0.1.3 ggridges_0.5.4 evaluate_0.20 ## [70] stringr_1.5.0 fastmap_1.1.1 yaml_2.3.7 ## [73] ragg_1.2.5 goftest_1.2-3 knitr_1.42 ## [76] bit64_4.0.5 fs_1.6.1 fitdistrplus_1.1-8 ## [79] purrr_1.0.1 RANN_2.6.1 pbapply_1.7-0 ## [82] future_1.31.0 nlme_3.1-157 mime_0.12 ## [85] hdf5r_1.3.8 compiler_4.2.0 plotly_4.10.1 ## [88] png_0.1-8 spatstat.utils_3.0-1 tibble_3.1.8 ## [91] bslib_0.4.2 stringi_1.7.12 highr_0.10 ## [94] desc_1.4.2 lattice_0.20-45 Matrix_1.5-3 ## [97] vctrs_0.5.2 pillar_1.8.1 lifecycle_1.0.3 ## [100] spatstat.geom_3.0-6 lmtest_0.9-40 jquerylib_0.1.4 ## [103] RcppAnnoy_0.0.20 data.table_1.14.8 cowplot_1.1.1 ## [106] irlba_2.3.5.1 httpuv_1.6.9 R6_2.5.1 ## [109] promises_1.2.0.1 KernSmooth_2.23-20 gridExtra_2.3 ## [112] parallelly_1.34.0 codetools_0.2-18 MASS_7.3-56 ## [115] rprojroot_2.0.3 withr_2.5.0 sctransform_0.3.5 ## [118] parallel_4.2.0 grid_4.2.0 tidyr_1.3.0 ## [121] rmarkdown_2.20 Rtsne_0.16 spatstat.explore_3.0-6 ## [124] shiny_1.7.4

We can visualize gene expression, cluster prediction scores, and (imputed) surface protein levels in the query cells: p3 <- FeaturePlot(hcabm40k, features = c("rna_TRDC", "rna_MPO", "rna_AVP"), reduction = 'ref.umap', max.cutoff = 3, ncol = 3) # cell type prediction scores DefaultAssay(hcabm40k) <- 'prediction.score.celltype' p4 <- FeaturePlot(hcabm40k, features = c("CD16 Mono", "HSC", "Prog-RBC"), ncol = 3, cols = c("lightgrey", "darkred")) # imputed protein levels DefaultAssay(hcabm40k) <- 'predicted_ADT' p5 <- FeaturePlot(hcabm40k, features = c("CD45RA", "CD16", "CD161"), reduction = 'ref.umap', min.cutoff = 'q10', max.cutoff = 'q99', cols = c("lightgrey", "darkgreen") , ncol = 3) p3 / p4 / p5Session Info sessionInfo()## R version 4.2.0 (2022-04-22) ## Platform: x86_64-pc-linux-gnu (64-bit) ## Running under: Ubuntu 20.04.5 LTS ## ## Matrix products: default ## BLAS: /usr/lib/x86_64-linux-gnu/openblas-pthread/libblas.so.3 ## LAPACK: /usr/lib/x86_64-linux-gnu/openblas-pthread/liblapack.so.3 ## ## locale: ## [1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C ## [3] LC_TIME=en_US.UTF-8 LC_COLLATE=en_US.UTF-8 ## [5] LC_MONETARY=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8 ## [7] LC_PAPER=en_US.UTF-8 LC_NAME=C ## [9] LC_ADDRESS=C LC_TELEPHONE=C ## [11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C ## ## attached base packages: ## [1] stats graphics grDevices utils datasets methods base ## ## other attached packages: ## [1] dplyr_1.1.0 thp1.eccite.SeuratData_3.1.5 ## [3] stxBrain.SeuratData_0.1.1 ssHippo.SeuratData_3.1.4 ## [5] pbmcsca.SeuratData_3.0.0 pbmcMultiome.SeuratData_0.1.2 ## [7] pbmc3k.SeuratData_3.1.4 panc8.SeuratData_3.0.2 ## [9] ifnb.SeuratData_3.1.0 hcabm40k.SeuratData_3.0.0 ## [11] bmcite.SeuratData_0.3.0 SeuratData_0.2.2 ## [13] patchwork_1.1.2 ggplot2_3.4.1 ## [15] SeuratDisk_0.0.0.9020 SeuratObject_4.1.3 ## [17] Seurat_4.3.0 ## ## loaded via a namespace (and not attached): ## [1] systemfonts_1.0.4 plyr_1.8.8 igraph_1.4.1 ## [4] lazyeval_0.2.2 sp_1.6-0 splines_4.2.0 ## [7] listenv_0.9.0 scattermore_0.8 digest_0.6.31 ## [10] htmltools_0.5.4 fansi_1.0.4 magrittr_2.0.3 ## [13] memoise_2.0.1 tensor_1.5 cluster_2.1.3 ## [16] ROCR_1.0-11 limma_3.54.1 globals_0.16.2 ## [19] matrixStats_0.63.0 pkgdown_2.0.7 spatstat.sparse_3.0-0 ## [22] colorspace_2.1-0 rappdirs_0.3.3 ggrepel_0.9.3 ## [25] textshaping_0.3.6 xfun_0.37 crayon_1.5.2 ## [28] jsonlite_1.8.4 progressr_0.13.0 spatstat.data_3.0-0 ## [31] survival_3.3-1 zoo_1.8-11 glue_1.6.2 ## [34] polyclip_1.10-4 gtable_0.3.1 leiden_0.4.3 ## [37] future.apply_1.10.0 abind_1.4-5 scales_1.2.1 ## [40] spatstat.random_3.1-3 miniUI_0.1.1.1 Rcpp_1.0.10 ## [43] viridisLite_0.4.1 xtable_1.8-4 reticulate_1.28 ## [46] bit_4.0.5 htmlwidgets_1.6.1 httr_1.4.5 ## [49] RColorBrewer_1.1-3 ellipsis_0.3.2 ica_1.0-3 ## [52] pkgconfig_2.0.3 farver_2.1.1 sass_0.4.5 ## [55] uwot_0.1.14 deldir_1.0-6 utf8_1.2.3 ## [58] tidyselect_1.2.0 labeling_0.4.2 rlang_1.0.6 ## [61] reshape2_1.4.4 later_1.3.0 munsell_0.5.0 ## [64] tools_4.2.0 cachem_1.0.7 cli_3.6.0 ## [67] generics_0.1.3 ggridges_0.5.4 evaluate_0.20 ## [70] stringr_1.5.0 fastmap_1.1.1 yaml_2.3.7 ## [73] ragg_1.2.5 goftest_1.2-3 knitr_1.42 ## [76] bit64_4.0.5 fs_1.6.1 fitdistrplus_1.1-8 ## [79] purrr_1.0.1 RANN_2.6.1 pbapply_1.7-0 ## [82] future_1.31.0 nlme_3.1-157 mime_0.12 ## [85] hdf5r_1.3.8 compiler_4.2.0 plotly_4.10.1 ## [88] png_0.1-8 spatstat.utils_3.0-1 tibble_3.1.8 ## [91] bslib_0.4.2 stringi_1.7.12 highr_0.10 ## [94] desc_1.4.2 lattice_0.20-45 Matrix_1.5-3 ## [97] vctrs_0.5.2 pillar_1.8.1 lifecycle_1.0.3 ## [100] spatstat.geom_3.0-6 lmtest_0.9-40 jquerylib_0.1.4 ## [103] RcppAnnoy_0.0.20 data.table_1.14.8 cowplot_1.1.1 ## [106] irlba_2.3.5.1 httpuv_1.6.9 R6_2.5.1 ## [109] promises_1.2.0.1 KernSmooth_2.23-20 gridExtra_2.3 ## [112] parallelly_1.34.0 codetools_0.2-18 MASS_7.3-56 ## [115] rprojroot_2.0.3 withr_2.5.0 sctransform_0.3.5 ## [118] parallel_4.2.0 grid_4.2.0 tidyr_1.3.0 ## [121] rmarkdown_2.20 Rtsne_0.16 spatstat.explore_3.0-6 ## [124] shiny_1.7.4

We can visualize gene expression, cluster prediction scores, and (imputed) surface protein levels in the query cells: p3 <- FeaturePlot(hcabm40k, features = c("rna_TRDC", "rna_MPO", "rna_AVP"), reduction = 'ref.umap', max.cutoff = 3, ncol = 3) # cell type prediction scores DefaultAssay(hcabm40k) <- 'prediction.score.celltype' p4 <- FeaturePlot(hcabm40k, features = c("CD16 Mono", "HSC", "Prog-RBC"), ncol = 3, cols = c("lightgrey", "darkred")) # imputed protein levels DefaultAssay(hcabm40k) <- 'predicted_ADT' p5 <- FeaturePlot(hcabm40k, features = c("CD45RA", "CD16", "CD161"), reduction = 'ref.umap', min.cutoff = 'q10', max.cutoff = 'q99', cols = c("lightgrey", "darkgreen") , ncol = 3) p3 / p4 / p5Session Info sessionInfo()## R version 4.2.0 (2022-04-22) ## Platform: x86_64-pc-linux-gnu (64-bit) ## Running under: Ubuntu 20.04.5 LTS ## ## Matrix products: default ## BLAS: /usr/lib/x86_64-linux-gnu/openblas-pthread/libblas.so.3 ## LAPACK: /usr/lib/x86_64-linux-gnu/openblas-pthread/liblapack.so.3 ## ## locale: ## [1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C ## [3] LC_TIME=en_US.UTF-8 LC_COLLATE=en_US.UTF-8 ## [5] LC_MONETARY=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8 ## [7] LC_PAPER=en_US.UTF-8 LC_NAME=C ## [9] LC_ADDRESS=C LC_TELEPHONE=C ## [11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C ## ## attached base packages: ## [1] stats graphics grDevices utils datasets methods base ## ## other attached packages: ## [1] dplyr_1.1.0 thp1.eccite.SeuratData_3.1.5 ## [3] stxBrain.SeuratData_0.1.1 ssHippo.SeuratData_3.1.4 ## [5] pbmcsca.SeuratData_3.0.0 pbmcMultiome.SeuratData_0.1.2 ## [7] pbmc3k.SeuratData_3.1.4 panc8.SeuratData_3.0.2 ## [9] ifnb.SeuratData_3.1.0 hcabm40k.SeuratData_3.0.0 ## [11] bmcite.SeuratData_0.3.0 SeuratData_0.2.2 ## [13] patchwork_1.1.2 ggplot2_3.4.1 ## [15] SeuratDisk_0.0.0.9020 SeuratObject_4.1.3 ## [17] Seurat_4.3.0 ## ## loaded via a namespace (and not attached): ## [1] systemfonts_1.0.4 plyr_1.8.8 igraph_1.4.1 ## [4] lazyeval_0.2.2 sp_1.6-0 splines_4.2.0 ## [7] listenv_0.9.0 scattermore_0.8 digest_0.6.31 ## [10] htmltools_0.5.4 fansi_1.0.4 magrittr_2.0.3 ## [13] memoise_2.0.1 tensor_1.5 cluster_2.1.3 ## [16] ROCR_1.0-11 limma_3.54.1 globals_0.16.2 ## [19] matrixStats_0.63.0 pkgdown_2.0.7 spatstat.sparse_3.0-0 ## [22] colorspace_2.1-0 rappdirs_0.3.3 ggrepel_0.9.3 ## [25] textshaping_0.3.6 xfun_0.37 crayon_1.5.2 ## [28] jsonlite_1.8.4 progressr_0.13.0 spatstat.data_3.0-0 ## [31] survival_3.3-1 zoo_1.8-11 glue_1.6.2 ## [34] polyclip_1.10-4 gtable_0.3.1 leiden_0.4.3 ## [37] future.apply_1.10.0 abind_1.4-5 scales_1.2.1 ## [40] spatstat.random_3.1-3 miniUI_0.1.1.1 Rcpp_1.0.10 ## [43] viridisLite_0.4.1 xtable_1.8-4 reticulate_1.28 ## [46] bit_4.0.5 htmlwidgets_1.6.1 httr_1.4.5 ## [49] RColorBrewer_1.1-3 ellipsis_0.3.2 ica_1.0-3 ## [52] pkgconfig_2.0.3 farver_2.1.1 sass_0.4.5 ## [55] uwot_0.1.14 deldir_1.0-6 utf8_1.2.3 ## [58] tidyselect_1.2.0 labeling_0.4.2 rlang_1.0.6 ## [61] reshape2_1.4.4 later_1.3.0 munsell_0.5.0 ## [64] tools_4.2.0 cachem_1.0.7 cli_3.6.0 ## [67] generics_0.1.3 ggridges_0.5.4 evaluate_0.20 ## [70] stringr_1.5.0 fastmap_1.1.1 yaml_2.3.7 ## [73] ragg_1.2.5 goftest_1.2-3 knitr_1.42 ## [76] bit64_4.0.5 fs_1.6.1 fitdistrplus_1.1-8 ## [79] purrr_1.0.1 RANN_2.6.1 pbapply_1.7-0 ## [82] future_1.31.0 nlme_3.1-157 mime_0.12 ## [85] hdf5r_1.3.8 compiler_4.2.0 plotly_4.10.1 ## [88] png_0.1-8 spatstat.utils_3.0-1 tibble_3.1.8 ## [91] bslib_0.4.2 stringi_1.7.12 highr_0.10 ## [94] desc_1.4.2 lattice_0.20-45 Matrix_1.5-3 ## [97] vctrs_0.5.2 pillar_1.8.1 lifecycle_1.0.3 ## [100] spatstat.geom_3.0-6 lmtest_0.9-40 jquerylib_0.1.4 ## [103] RcppAnnoy_0.0.20 data.table_1.14.8 cowplot_1.1.1 ## [106] irlba_2.3.5.1 httpuv_1.6.9 R6_2.5.1 ## [109] promises_1.2.0.1 KernSmooth_2.23-20 gridExtra_2.3 ## [112] parallelly_1.34.0 codetools_0.2-18 MASS_7.3-56 ## [115] rprojroot_2.0.3 withr_2.5.0 sctransform_0.3.5 ## [118] parallel_4.2.0 grid_4.2.0 tidyr_1.3.0 ## [121] rmarkdown_2.20 Rtsne_0.16 spatstat.explore_3.0-6 ## [124] shiny_1.7.4

Session Info sessionInfo()## R version 4.2.0 (2022-04-22) ## Platform: x86_64-pc-linux-gnu (64-bit) ## Running under: Ubuntu 20.04.5 LTS ## ## Matrix products: default ## BLAS: /usr/lib/x86_64-linux-gnu/openblas-pthread/libblas.so.3 ## LAPACK: /usr/lib/x86_64-linux-gnu/openblas-pthread/liblapack.so.3 ## ## locale: ## [1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C ## [3] LC_TIME=en_US.UTF-8 LC_COLLATE=en_US.UTF-8 ## [5] LC_MONETARY=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8 ## [7] LC_PAPER=en_US.UTF-8 LC_NAME=C ## [9] LC_ADDRESS=C LC_TELEPHONE=C ## [11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C ## ## attached base packages: ## [1] stats graphics grDevices utils datasets methods base ## ## other attached packages: ## [1] dplyr_1.1.0 thp1.eccite.SeuratData_3.1.5 ## [3] stxBrain.SeuratData_0.1.1 ssHippo.SeuratData_3.1.4 ## [5] pbmcsca.SeuratData_3.0.0 pbmcMultiome.SeuratData_0.1.2 ## [7] pbmc3k.SeuratData_3.1.4 panc8.SeuratData_3.0.2 ## [9] ifnb.SeuratData_3.1.0 hcabm40k.SeuratData_3.0.0 ## [11] bmcite.SeuratData_0.3.0 SeuratData_0.2.2 ## [13] patchwork_1.1.2 ggplot2_3.4.1 ## [15] SeuratDisk_0.0.0.9020 SeuratObject_4.1.3 ## [17] Seurat_4.3.0 ## ## loaded via a namespace (and not attached): ## [1] systemfonts_1.0.4 plyr_1.8.8 igraph_1.4.1 ## [4] lazyeval_0.2.2 sp_1.6-0 splines_4.2.0 ## [7] listenv_0.9.0 scattermore_0.8 digest_0.6.31 ## [10] htmltools_0.5.4 fansi_1.0.4 magrittr_2.0.3 ## [13] memoise_2.0.1 tensor_1.5 cluster_2.1.3 ## [16] ROCR_1.0-11 limma_3.54.1 globals_0.16.2 ## [19] matrixStats_0.63.0 pkgdown_2.0.7 spatstat.sparse_3.0-0 ## [22] colorspace_2.1-0 rappdirs_0.3.3 ggrepel_0.9.3 ## [25] textshaping_0.3.6 xfun_0.37 crayon_1.5.2 ## [28] jsonlite_1.8.4 progressr_0.13.0 spatstat.data_3.0-0 ## [31] survival_3.3-1 zoo_1.8-11 glue_1.6.2 ## [34] polyclip_1.10-4 gtable_0.3.1 leiden_0.4.3 ## [37] future.apply_1.10.0 abind_1.4-5 scales_1.2.1 ## [40] spatstat.random_3.1-3 miniUI_0.1.1.1 Rcpp_1.0.10 ## [43] viridisLite_0.4.1 xtable_1.8-4 reticulate_1.28 ## [46] bit_4.0.5 htmlwidgets_1.6.1 httr_1.4.5 ## [49] RColorBrewer_1.1-3 ellipsis_0.3.2 ica_1.0-3 ## [52] pkgconfig_2.0.3 farver_2.1.1 sass_0.4.5 ## [55] uwot_0.1.14 deldir_1.0-6 utf8_1.2.3 ## [58] tidyselect_1.2.0 labeling_0.4.2 rlang_1.0.6 ## [61] reshape2_1.4.4 later_1.3.0 munsell_0.5.0 ## [64] tools_4.2.0 cachem_1.0.7 cli_3.6.0 ## [67] generics_0.1.3 ggridges_0.5.4 evaluate_0.20 ## [70] stringr_1.5.0 fastmap_1.1.1 yaml_2.3.7 ## [73] ragg_1.2.5 goftest_1.2-3 knitr_1.42 ## [76] bit64_4.0.5 fs_1.6.1 fitdistrplus_1.1-8 ## [79] purrr_1.0.1 RANN_2.6.1 pbapply_1.7-0 ## [82] future_1.31.0 nlme_3.1-157 mime_0.12 ## [85] hdf5r_1.3.8 compiler_4.2.0 plotly_4.10.1 ## [88] png_0.1-8 spatstat.utils_3.0-1 tibble_3.1.8 ## [91] bslib_0.4.2 stringi_1.7.12 highr_0.10 ## [94] desc_1.4.2 lattice_0.20-45 Matrix_1.5-3 ## [97] vctrs_0.5.2 pillar_1.8.1 lifecycle_1.0.3 ## [100] spatstat.geom_3.0-6 lmtest_0.9-40 jquerylib_0.1.4 ## [103] RcppAnnoy_0.0.20 data.table_1.14.8 cowplot_1.1.1 ## [106] irlba_2.3.5.1 httpuv_1.6.9 R6_2.5.1 ## [109] promises_1.2.0.1 KernSmooth_2.23-20 gridExtra_2.3 ## [112] parallelly_1.34.0 codetools_0.2-18 MASS_7.3-56 ## [115] rprojroot_2.0.3 withr_2.5.0 sctransform_0.3.5 ## [118] parallel_4.2.0 grid_4.2.0 tidyr_1.3.0 ## [121] rmarkdown_2.20 Rtsne_0.16 spatstat.explore_3.0-6 ## [124] shiny_1.7.4

sessionInfo()## R version 4.2.0 (2022-04-22) ## Platform: x86_64-pc-linux-gnu (64-bit) ## Running under: Ubuntu 20.04.5 LTS ## ## Matrix products: default ## BLAS: /usr/lib/x86_64-linux-gnu/openblas-pthread/libblas.so.3 ## LAPACK: /usr/lib/x86_64-linux-gnu/openblas-pthread/liblapack.so.3 ## ## locale: ## [1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C ## [3] LC_TIME=en_US.UTF-8 LC_COLLATE=en_US.UTF-8 ## [5] LC_MONETARY=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8 ## [7] LC_PAPER=en_US.UTF-8 LC_NAME=C ## [9] LC_ADDRESS=C LC_TELEPHONE=C ## [11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C ## ## attached base packages: ## [1] stats graphics grDevices utils datasets methods base ## ## other attached packages: ## [1] dplyr_1.1.0 thp1.eccite.SeuratData_3.1.5 ## [3] stxBrain.SeuratData_0.1.1 ssHippo.SeuratData_3.1.4 ## [5] pbmcsca.SeuratData_3.0.0 pbmcMultiome.SeuratData_0.1.2 ## [7] pbmc3k.SeuratData_3.1.4 panc8.SeuratData_3.0.2 ## [9] ifnb.SeuratData_3.1.0 hcabm40k.SeuratData_3.0.0 ## [11] bmcite.SeuratData_0.3.0 SeuratData_0.2.2 ## [13] patchwork_1.1.2 ggplot2_3.4.1 ## [15] SeuratDisk_0.0.0.9020 SeuratObject_4.1.3 ## [17] Seurat_4.3.0 ## ## loaded via a namespace (and not attached): ## [1] systemfonts_1.0.4 plyr_1.8.8 igraph_1.4.1 ## [4] lazyeval_0.2.2 sp_1.6-0 splines_4.2.0 ## [7] listenv_0.9.0 scattermore_0.8 digest_0.6.31 ## [10] htmltools_0.5.4 fansi_1.0.4 magrittr_2.0.3 ## [13] memoise_2.0.1 tensor_1.5 cluster_2.1.3 ## [16] ROCR_1.0-11 limma_3.54.1 globals_0.16.2 ## [19] matrixStats_0.63.0 pkgdown_2.0.7 spatstat.sparse_3.0-0 ## [22] colorspace_2.1-0 rappdirs_0.3.3 ggrepel_0.9.3 ## [25] textshaping_0.3.6 xfun_0.37 crayon_1.5.2 ## [28] jsonlite_1.8.4 progressr_0.13.0 spatstat.data_3.0-0 ## [31] survival_3.3-1 zoo_1.8-11 glue_1.6.2 ## [34] polyclip_1.10-4 gtable_0.3.1 leiden_0.4.3 ## [37] future.apply_1.10.0 abind_1.4-5 scales_1.2.1 ## [40] spatstat.random_3.1-3 miniUI_0.1.1.1 Rcpp_1.0.10 ## [43] viridisLite_0.4.1 xtable_1.8-4 reticulate_1.28 ## [46] bit_4.0.5 htmlwidgets_1.6.1 httr_1.4.5 ## [49] RColorBrewer_1.1-3 ellipsis_0.3.2 ica_1.0-3 ## [52] pkgconfig_2.0.3 farver_2.1.1 sass_0.4.5 ## [55] uwot_0.1.14 deldir_1.0-6 utf8_1.2.3 ## [58] tidyselect_1.2.0 labeling_0.4.2 rlang_1.0.6 ## [61] reshape2_1.4.4 later_1.3.0 munsell_0.5.0 ## [64] tools_4.2.0 cachem_1.0.7 cli_3.6.0 ## [67] generics_0.1.3 ggridges_0.5.4 evaluate_0.20 ## [70] stringr_1.5.0 fastmap_1.1.1 yaml_2.3.7 ## [73] ragg_1.2.5 goftest_1.2-3 knitr_1.42 ## [76] bit64_4.0.5 fs_1.6.1 fitdistrplus_1.1-8 ## [79] purrr_1.0.1 RANN_2.6.1 pbapply_1.7-0 ## [82] future_1.31.0 nlme_3.1-157 mime_0.12 ## [85] hdf5r_1.3.8 compiler_4.2.0 plotly_4.10.1 ## [88] png_0.1-8 spatstat.utils_3.0-1 tibble_3.1.8 ## [91] bslib_0.4.2 stringi_1.7.12 highr_0.10 ## [94] desc_1.4.2 lattice_0.20-45 Matrix_1.5-3 ## [97] vctrs_0.5.2 pillar_1.8.1 lifecycle_1.0.3 ## [100] spatstat.geom_3.0-6 lmtest_0.9-40 jquerylib_0.1.4 ## [103] RcppAnnoy_0.0.20 data.table_1.14.8 cowplot_1.1.1 ## [106] irlba_2.3.5.1 httpuv_1.6.9 R6_2.5.1 ## [109] promises_1.2.0.1 KernSmooth_2.23-20 gridExtra_2.3 ## [112] parallelly_1.34.0 codetools_0.2-18 MASS_7.3-56 ## [115] rprojroot_2.0.3 withr_2.5.0 sctransform_0.3.5 ## [118] parallel_4.2.0 grid_4.2.0 tidyr_1.3.0 ## [121] rmarkdown_2.20 Rtsne_0.16 spatstat.explore_3.0-6 ## [124] shiny_1.7.4

Developed by Paul Hoffman, Satija Lab and Collaborators.

Developed by Paul Hoffman, Satija Lab and Collaborators.

Site built with pkgdown 2.0.7.

Site built with pkgdown 2.0.7.

**Examples:**

Example 1 (unknown):
```unknown
vignettes/multimodal_reference_mapping.Rmd
```

Example 2 (unknown):
```unknown
multimodal_reference_mapping.Rmd
```

Example 3 (unknown):
```unknown
install.packages("Seurat")
remotes::install_github("mojaveazure/seurat-disk")
```

Example 4 (r):
```r
install.packages("Seurat")
remotes::install_github("mojaveazure/seurat-disk")
```

Example 5 (r):
```r
install.packages("Seurat")
remotes::install_github("mojaveazure/seurat-disk")
```

Example 6 (unknown):
```unknown
library(Seurat)
library(SeuratDisk)
library(ggplot2)
library(patchwork)
```

Example 7 (r):
```r
library(Seurat)
library(SeuratDisk)
library(ggplot2)
library(patchwork)
```

Example 8 (r):
```r
library(Seurat)
library(SeuratDisk)
library(ggplot2)
library(patchwork)
```

Example 9 (unknown):
```unknown
reference <- LoadH5Seurat("../data/pbmc_multimodal.h5seurat")
```

Example 10 (r):
```r
reference <- LoadH5Seurat("../data/pbmc_multimodal.h5seurat")
```

Example 11 (r):
```r
reference <- LoadH5Seurat("../data/pbmc_multimodal.h5seurat")
```

Example 12 (unknown):
```unknown
DimPlot(object = reference, reduction = "wnn.umap", group.by = "celltype.l2", label = TRUE, label.size = 3, repel = TRUE) + NoLegend()
```

Example 13 (r):
```r
DimPlot(object = reference, reduction = "wnn.umap", group.by = "celltype.l2", label = TRUE, label.size = 3, repel = TRUE) + NoLegend()
```

Example 14 (r):
```r
DimPlot(object = reference, reduction = "wnn.umap", group.by = "celltype.l2", label = TRUE, label.size = 3, repel = TRUE) + NoLegend()
```

Example 15 (unknown):
```unknown
library(SeuratData)
InstallData('pbmc3k')
```

Example 16 (r):
```r
library(SeuratData)
InstallData('pbmc3k')
```

Example 17 (r):
```r
library(SeuratData)
InstallData('pbmc3k')
```

Example 18 (unknown):
```unknown
SCTransform()
```

Example 19 (unknown):
```unknown
pbmc3k <- SCTransform(pbmc3k, verbose = FALSE)
```

Example 20 (r):
```r
pbmc3k <- SCTransform(pbmc3k, verbose = FALSE)
```

Example 21 (r):
```r
pbmc3k <- SCTransform(pbmc3k, verbose = FALSE)
```

Example 22 (unknown):
```unknown
anchors <- FindTransferAnchors(
  reference = reference,
  query = pbmc3k,
  normalization.method = "SCT",
  reference.reduction = "spca",
  dims = 1:50
)
```

Example 23 (r):
```r
anchors <- FindTransferAnchors(
  reference = reference,
  query = pbmc3k,
  normalization.method = "SCT",
  reference.reduction = "spca",
  dims = 1:50
)
```

Example 24 (r):
```r
anchors <- FindTransferAnchors(
  reference = reference,
  query = pbmc3k,
  normalization.method = "SCT",
  reference.reduction = "spca",
  dims = 1:50
)
```

Example 25 (unknown):
```unknown
pbmc3k <- MapQuery(
  anchorset = anchors,
  query = pbmc3k,
  reference = reference,
  refdata = list(
    celltype.l1 = "celltype.l1",
    celltype.l2 = "celltype.l2",
    predicted_ADT = "ADT"
  ),
  reference.reduction = "spca", 
  reduction.model = "wnn.umap"
)
```

Example 26 (r):
```r
pbmc3k <- MapQuery(
  anchorset = anchors,
  query = pbmc3k,
  reference = reference,
  refdata = list(
    celltype.l1 = "celltype.l1",
    celltype.l2 = "celltype.l2",
    predicted_ADT = "ADT"
  ),
  reference.reduction = "spca", 
  reduction.model = "wnn.umap"
)
```

Example 27 (r):
```r
pbmc3k <- MapQuery(
  anchorset = anchors,
  query = pbmc3k,
  reference = reference,
  refdata = list(
    celltype.l1 = "celltype.l1",
    celltype.l2 = "celltype.l2",
    predicted_ADT = "ADT"
  ),
  reference.reduction = "spca", 
  reduction.model = "wnn.umap"
)
```

Example 28 (unknown):
```unknown
TransferData()
```

Example 29 (unknown):
```unknown
IntegrateEmbeddings()
```

Example 30 (unknown):
```unknown
ProjectUMAP()
```

Example 31 (unknown):
```unknown
TransferData()
```

Example 32 (unknown):
```unknown
IntegrateEmbeddings()
```

Example 33 (unknown):
```unknown
ProjectUMAP()
```

Example 34 (unknown):
```unknown
pbmc3k <- TransferData(
  anchorset = anchors, 
  reference = reference,
  query = pbmc3k,
  refdata = list(
    celltype.l1 = "celltype.l1",
    celltype.l2 = "celltype.l2",
    predicted_ADT = "ADT")
)
pbmc3k <- IntegrateEmbeddings(
  anchorset = anchors,
  reference = reference,
  query = pbmc3k, 
  new.reduction.name = "ref.spca"
)
pbmc3k <- ProjectUMAP(
  query = pbmc3k, 
  query.reduction = "ref.spca", 
  reference = reference, 
  reference.reduction = "spca", 
  reduction.model = "wnn.umap"
)
```

Example 35 (r):
```r
pbmc3k <- TransferData(
  anchorset = anchors, 
  reference = reference,
  query = pbmc3k,
  refdata = list(
    celltype.l1 = "celltype.l1",
    celltype.l2 = "celltype.l2",
    predicted_ADT = "ADT")
)
pbmc3k <- IntegrateEmbeddings(
  anchorset = anchors,
  reference = reference,
  query = pbmc3k, 
  new.reduction.name = "ref.spca"
)
pbmc3k <- ProjectUMAP(
  query = pbmc3k, 
  query.reduction = "ref.spca", 
  reference = reference, 
  reference.reduction = "spca", 
  reduction.model = "wnn.umap"
)
```

Example 36 (r):
```r
pbmc3k <- TransferData(
  anchorset = anchors, 
  reference = reference,
  query = pbmc3k,
  refdata = list(
    celltype.l1 = "celltype.l1",
    celltype.l2 = "celltype.l2",
    predicted_ADT = "ADT")
)
pbmc3k <- IntegrateEmbeddings(
  anchorset = anchors,
  reference = reference,
  query = pbmc3k, 
  new.reduction.name = "ref.spca"
)
pbmc3k <- ProjectUMAP(
  query = pbmc3k, 
  query.reduction = "ref.spca", 
  reference = reference, 
  reference.reduction = "spca", 
  reduction.model = "wnn.umap"
)
```

Example 37 (unknown):
```unknown
p1 = DimPlot(pbmc3k, reduction = "ref.umap", group.by = "predicted.celltype.l1", label = TRUE, label.size = 3, repel = TRUE) + NoLegend()
p2 = DimPlot(pbmc3k, reduction = "ref.umap", group.by = "predicted.celltype.l2", label = TRUE, label.size = 3 ,repel = TRUE) + NoLegend()
p1 + p2
```

Example 38 (r):
```r
p1 = DimPlot(pbmc3k, reduction = "ref.umap", group.by = "predicted.celltype.l1", label = TRUE, label.size = 3, repel = TRUE) + NoLegend()
p2 = DimPlot(pbmc3k, reduction = "ref.umap", group.by = "predicted.celltype.l2", label = TRUE, label.size = 3 ,repel = TRUE) + NoLegend()
p1 + p2
```

Example 39 (r):
```r
p1 = DimPlot(pbmc3k, reduction = "ref.umap", group.by = "predicted.celltype.l1", label = TRUE, label.size = 3, repel = TRUE) + NoLegend()
p2 = DimPlot(pbmc3k, reduction = "ref.umap", group.by = "predicted.celltype.l2", label = TRUE, label.size = 3 ,repel = TRUE) + NoLegend()
p1 + p2
```

Example 40 (unknown):
```unknown
FeaturePlot(pbmc3k, features = c("pDC", "CD16 Mono", "Treg"),  reduction = "ref.umap", cols = c("lightgrey", "darkred"), ncol = 3) & theme(plot.title = element_text(size = 10))
```

Example 41 (r):
```r
FeaturePlot(pbmc3k, features = c("pDC", "CD16 Mono", "Treg"),  reduction = "ref.umap", cols = c("lightgrey", "darkred"), ncol = 3) & theme(plot.title = element_text(size = 10))
```

Example 42 (r):
```r
FeaturePlot(pbmc3k, features = c("pDC", "CD16 Mono", "Treg"),  reduction = "ref.umap", cols = c("lightgrey", "darkred"), ncol = 3) & theme(plot.title = element_text(size = 10))
```

Example 43 (unknown):
```unknown
Idents(pbmc3k) <- 'predicted.celltype.l2'
VlnPlot(pbmc3k, features = c("CLEC4C", "LILRA4"), sort = TRUE) + NoLegend()
```

Example 44 (r):
```r
Idents(pbmc3k) <- 'predicted.celltype.l2'
VlnPlot(pbmc3k, features = c("CLEC4C", "LILRA4"), sort = TRUE) + NoLegend()
```

Example 45 (r):
```r
Idents(pbmc3k) <- 'predicted.celltype.l2'
VlnPlot(pbmc3k, features = c("CLEC4C", "LILRA4"), sort = TRUE) + NoLegend()
```

Example 46 (python):
```python
treg_markers <- FindMarkers(pbmc3k, ident.1 = "Treg", only.pos = TRUE, logfc.threshold = 0.1)
print(head(treg_markers))
```

Example 47 (r):
```r
treg_markers <- FindMarkers(pbmc3k, ident.1 = "Treg", only.pos = TRUE, logfc.threshold = 0.1)
print(head(treg_markers))
```

Example 48 (r):
```r
treg_markers <- FindMarkers(pbmc3k, ident.1 = "Treg", only.pos = TRUE, logfc.threshold = 0.1)
print(head(treg_markers))
```

Example 49 (unknown):
```unknown
##                       p_val avg_log2FC pct.1 pct.2    p_val_adj
## FOXP3          8.428389e-41  0.2002914 0.152 0.002 1.059617e-36
## RP11-1399P15.1 1.702575e-21  0.4749271 0.273 0.021 2.140478e-17
## RTKN2          3.890305e-17  0.2339929 0.121 0.005 4.890892e-13
## TIGIT          3.773433e-16  0.5934260 0.424 0.065 4.743960e-12
## F5             4.035005e-16  0.2318413 0.121 0.005 5.072808e-12
## FRS2           2.983908e-15  0.1906088 0.152 0.009 3.751369e-11
```

Example 50 (unknown):
```unknown
##                       p_val avg_log2FC pct.1 pct.2    p_val_adj
## FOXP3          8.428389e-41  0.2002914 0.152 0.002 1.059617e-36
## RP11-1399P15.1 1.702575e-21  0.4749271 0.273 0.021 2.140478e-17
## RTKN2          3.890305e-17  0.2339929 0.121 0.005 4.890892e-13
## TIGIT          3.773433e-16  0.5934260 0.424 0.065 4.743960e-12
## F5             4.035005e-16  0.2318413 0.121 0.005 5.072808e-12
## FRS2           2.983908e-15  0.1906088 0.152 0.009 3.751369e-11
```

Example 51 (unknown):
```unknown
DefaultAssay(pbmc3k) <- 'predicted_ADT'
# see a list of proteins: rownames(pbmc3k)
FeaturePlot(pbmc3k, features = c("CD3-1", "CD45RA", "IgD"), reduction = "ref.umap", cols = c("lightgrey", "darkgreen"), ncol = 3)
```

Example 52 (r):
```r
DefaultAssay(pbmc3k) <- 'predicted_ADT'
# see a list of proteins: rownames(pbmc3k)
FeaturePlot(pbmc3k, features = c("CD3-1", "CD45RA", "IgD"), reduction = "ref.umap", cols = c("lightgrey", "darkgreen"), ncol = 3)
```

Example 53 (r):
```r
DefaultAssay(pbmc3k) <- 'predicted_ADT'
# see a list of proteins: rownames(pbmc3k)
FeaturePlot(pbmc3k, features = c("CD3-1", "CD45RA", "IgD"), reduction = "ref.umap", cols = c("lightgrey", "darkgreen"), ncol = 3)
```

Example 54 (unknown):
```unknown
#merge reference and query
reference$id <- 'reference'
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', shuffle = TRUE)
```

Example 55 (r):
```r
#merge reference and query
reference$id <- 'reference'
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', shuffle = TRUE)
```

Example 56 (r):
```r
#merge reference and query
reference$id <- 'reference'
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', shuffle = TRUE)
```

Example 57 (unknown):
```unknown
# Both datasets are available through SeuratData
library(SeuratData)
#load reference data
InstallData("bmcite")
bm <- LoadData(ds = "bmcite")
#load query data
InstallData('hcabm40k')
hcabm40k <- LoadData(ds = "hcabm40k")
```

Example 58 (r):
```r
# Both datasets are available through SeuratData
library(SeuratData)
#load reference data
InstallData("bmcite")
bm <- LoadData(ds = "bmcite")
#load query data
InstallData('hcabm40k')
hcabm40k <- LoadData(ds = "hcabm40k")
```

Example 59 (r):
```r
# Both datasets are available through SeuratData
library(SeuratData)
#load reference data
InstallData("bmcite")
bm <- LoadData(ds = "bmcite")
#load query data
InstallData('hcabm40k')
hcabm40k <- LoadData(ds = "hcabm40k")
```

Example 60 (unknown):
```unknown
return.model = TRUE
```

Example 61 (unknown):
```unknown
bm <- RunUMAP(bm, nn.name = "weighted.nn", reduction.name = "wnn.umap", 
              reduction.key = "wnnUMAP_", return.model = TRUE)
DimPlot(bm, group.by = "celltype.l2", reduction = "wnn.umap")
```

Example 62 (r):
```r
bm <- RunUMAP(bm, nn.name = "weighted.nn", reduction.name = "wnn.umap", 
              reduction.key = "wnnUMAP_", return.model = TRUE)
DimPlot(bm, group.by = "celltype.l2", reduction = "wnn.umap")
```

Example 63 (r):
```r
bm <- RunUMAP(bm, nn.name = "weighted.nn", reduction.name = "wnn.umap", 
              reduction.key = "wnnUMAP_", return.model = TRUE)
DimPlot(bm, group.by = "celltype.l2", reduction = "wnn.umap")
```

Example 64 (unknown):
```unknown
bm <- ScaleData(bm, assay = 'RNA')
bm <- RunSPCA(bm, assay = 'RNA', graph = 'wsnn')
```

Example 65 (r):
```r
bm <- ScaleData(bm, assay = 'RNA')
bm <- RunSPCA(bm, assay = 'RNA', graph = 'wsnn')
```

Example 66 (r):
```r
bm <- ScaleData(bm, assay = 'RNA')
bm <- RunSPCA(bm, assay = 'RNA', graph = 'wsnn')
```

Example 67 (unknown):
```unknown
spca.annoy.neighbors
```

Example 68 (unknown):
```unknown
cache.index = TRUE
```

Example 69 (unknown):
```unknown
bm <- FindNeighbors(
  object = bm,
  reduction = "spca",
  dims = 1:50,
  graph.name = "spca.annoy.neighbors", 
  k.param = 50,
  cache.index = TRUE,
  return.neighbor = TRUE,
  l2.norm = TRUE
)
```

Example 70 (r):
```r
bm <- FindNeighbors(
  object = bm,
  reduction = "spca",
  dims = 1:50,
  graph.name = "spca.annoy.neighbors", 
  k.param = 50,
  cache.index = TRUE,
  return.neighbor = TRUE,
  l2.norm = TRUE
)
```

Example 71 (r):
```r
bm <- FindNeighbors(
  object = bm,
  reduction = "spca",
  dims = 1:50,
  graph.name = "spca.annoy.neighbors", 
  k.param = 50,
  cache.index = TRUE,
  return.neighbor = TRUE,
  l2.norm = TRUE
)
```

Example 72 (unknown):
```unknown
method = "annoy"
```

Example 73 (unknown):
```unknown
cache.index = TRUE
```

Example 74 (unknown):
```unknown
SaveAnnoyIndex()
```

Example 75 (unknown):
```unknown
LoadAnnoyIndex()
```

Example 76 (unknown):
```unknown
LoadAnnoyIndex()
```

Example 77 (unknown):
```unknown
SaveAnnoyIndex()
```

Example 78 (unknown):
```unknown
bm[["spca.annoy.neighbors"]]
```

Example 79 (r):
```r
bm[["spca.annoy.neighbors"]]
```

Example 80 (r):
```r
bm[["spca.annoy.neighbors"]]
```

Example 81 (unknown):
```unknown
## A Neighbor object containing the 50 nearest neighbors for 30672 cells
```

Example 82 (unknown):
```unknown
## A Neighbor object containing the 50 nearest neighbors for 30672 cells
```

Example 83 (unknown):
```unknown
SaveAnnoyIndex(object = bm[["spca.annoy.neighbors"]], file = "../data/reftmp.idx")
bm[["spca.annoy.neighbors"]] <- LoadAnnoyIndex(object = bm[["spca.annoy.neighbors"]], file = "../data/reftmp.idx")
```

Example 84 (r):
```r
SaveAnnoyIndex(object = bm[["spca.annoy.neighbors"]], file = "../data/reftmp.idx")
bm[["spca.annoy.neighbors"]] <- LoadAnnoyIndex(object = bm[["spca.annoy.neighbors"]], file = "../data/reftmp.idx")
```

Example 85 (r):
```r
SaveAnnoyIndex(object = bm[["spca.annoy.neighbors"]], file = "../data/reftmp.idx")
bm[["spca.annoy.neighbors"]] <- LoadAnnoyIndex(object = bm[["spca.annoy.neighbors"]], file = "../data/reftmp.idx")
```

Example 86 (unknown):
```unknown
library(dplyr)
library(SeuratData)
InstallData('hcabm40k')
hcabm40k.batches <- SplitObject(hcabm40k, split.by = "orig.ident")
```

Example 87 (r):
```r
library(dplyr)
library(SeuratData)
InstallData('hcabm40k')
hcabm40k.batches <- SplitObject(hcabm40k, split.by = "orig.ident")
```

Example 88 (r):
```r
library(dplyr)
library(SeuratData)
InstallData('hcabm40k')
hcabm40k.batches <- SplitObject(hcabm40k, split.by = "orig.ident")
```

Example 89 (unknown):
```unknown
NormalizeData()
```

Example 90 (unknown):
```unknown
SCTransform()
```

Example 91 (unknown):
```unknown
SCTransform()
```

Example 92 (unknown):
```unknown
hcabm40k.batches <- lapply(X = hcabm40k.batches, FUN = NormalizeData, verbose = FALSE)
```

Example 93 (r):
```r
hcabm40k.batches <- lapply(X = hcabm40k.batches, FUN = NormalizeData, verbose = FALSE)
```

Example 94 (r):
```r
hcabm40k.batches <- lapply(X = hcabm40k.batches, FUN = NormalizeData, verbose = FALSE)
```

Example 95 (unknown):
```unknown
anchors <- list()
for (i in 1:length(hcabm40k.batches)) {
  anchors[[i]] <- FindTransferAnchors(
    reference = bm,
    query = hcabm40k.batches[[i]],
    k.filter = NA,
    reference.reduction = "spca", 
    reference.neighbors = "spca.annoy.neighbors", 
    dims = 1:50
  )
}
```

Example 96 (r):
```r
anchors <- list()
for (i in 1:length(hcabm40k.batches)) {
  anchors[[i]] <- FindTransferAnchors(
    reference = bm,
    query = hcabm40k.batches[[i]],
    k.filter = NA,
    reference.reduction = "spca", 
    reference.neighbors = "spca.annoy.neighbors", 
    dims = 1:50
  )
}
```

Example 97 (r):
```r
anchors <- list()
for (i in 1:length(hcabm40k.batches)) {
  anchors[[i]] <- FindTransferAnchors(
    reference = bm,
    query = hcabm40k.batches[[i]],
    k.filter = NA,
    reference.reduction = "spca", 
    reference.neighbors = "spca.annoy.neighbors", 
    dims = 1:50
  )
}
```

Example 98 (unknown):
```unknown
for (i in 1:length(hcabm40k.batches)) {
  hcabm40k.batches[[i]] <- MapQuery(
    anchorset = anchors[[i]], 
    query = hcabm40k.batches[[i]],
    reference = bm, 
    refdata = list(
      celltype = "celltype.l2", 
      predicted_ADT = "ADT"),
    reference.reduction = "spca",
    reduction.model = "wnn.umap"
  )
}
```

Example 99 (r):
```r
for (i in 1:length(hcabm40k.batches)) {
  hcabm40k.batches[[i]] <- MapQuery(
    anchorset = anchors[[i]], 
    query = hcabm40k.batches[[i]],
    reference = bm, 
    refdata = list(
      celltype = "celltype.l2", 
      predicted_ADT = "ADT"),
    reference.reduction = "spca",
    reduction.model = "wnn.umap"
  )
}
```

Example 100 (r):
```r
for (i in 1:length(hcabm40k.batches)) {
  hcabm40k.batches[[i]] <- MapQuery(
    anchorset = anchors[[i]], 
    query = hcabm40k.batches[[i]],
    reference = bm, 
    refdata = list(
      celltype = "celltype.l2", 
      predicted_ADT = "ADT"),
    reference.reduction = "spca",
    reduction.model = "wnn.umap"
  )
}
```

Example 101 (unknown):
```unknown
p1 <- DimPlot(hcabm40k.batches[[1]], reduction = 'ref.umap', group.by = 'predicted.celltype', label.size = 3)
p2 <- DimPlot(hcabm40k.batches[[2]], reduction = 'ref.umap', group.by = 'predicted.celltype', label.size = 3)
p1 + p2 + plot_layout(guides = "collect")
```

Example 102 (r):
```r
p1 <- DimPlot(hcabm40k.batches[[1]], reduction = 'ref.umap', group.by = 'predicted.celltype', label.size = 3)
p2 <- DimPlot(hcabm40k.batches[[2]], reduction = 'ref.umap', group.by = 'predicted.celltype', label.size = 3)
p1 + p2 + plot_layout(guides = "collect")
```

Example 103 (r):
```r
p1 <- DimPlot(hcabm40k.batches[[1]], reduction = 'ref.umap', group.by = 'predicted.celltype', label.size = 3)
p2 <- DimPlot(hcabm40k.batches[[2]], reduction = 'ref.umap', group.by = 'predicted.celltype', label.size = 3)
p1 + p2 + plot_layout(guides = "collect")
```

Example 104 (unknown):
```unknown
# Merge the batches 
hcabm40k <- merge(hcabm40k.batches[[1]], hcabm40k.batches[2:length(hcabm40k.batches)], merge.dr = "ref.umap")
DimPlot(hcabm40k, reduction = "ref.umap", group.by =  "predicted.celltype", label = TRUE, repel = TRUE, label.size = 3) + NoLegend()
```

Example 105 (r):
```r
# Merge the batches 
hcabm40k <- merge(hcabm40k.batches[[1]], hcabm40k.batches[2:length(hcabm40k.batches)], merge.dr = "ref.umap")
DimPlot(hcabm40k, reduction = "ref.umap", group.by =  "predicted.celltype", label = TRUE, repel = TRUE, label.size = 3) + NoLegend()
```

Example 106 (r):
```r
# Merge the batches 
hcabm40k <- merge(hcabm40k.batches[[1]], hcabm40k.batches[2:length(hcabm40k.batches)], merge.dr = "ref.umap")
DimPlot(hcabm40k, reduction = "ref.umap", group.by =  "predicted.celltype", label = TRUE, repel = TRUE, label.size = 3) + NoLegend()
```

Example 107 (unknown):
```unknown
p3 <- FeaturePlot(hcabm40k, features = c("rna_TRDC", "rna_MPO", "rna_AVP"), reduction = 'ref.umap', 
                  max.cutoff = 3, ncol = 3)

# cell type prediction scores
DefaultAssay(hcabm40k) <- 'prediction.score.celltype'
p4 <- FeaturePlot(hcabm40k, features = c("CD16 Mono", "HSC", "Prog-RBC"), ncol = 3, 
                  cols = c("lightgrey", "darkred"))

# imputed protein levels
DefaultAssay(hcabm40k) <- 'predicted_ADT'
p5 <- FeaturePlot(hcabm40k, features = c("CD45RA", "CD16", "CD161"), reduction = 'ref.umap',
                  min.cutoff = 'q10', max.cutoff = 'q99', cols = c("lightgrey", "darkgreen") ,
                  ncol = 3)
p3 / p4 / p5
```

Example 108 (r):
```r
p3 <- FeaturePlot(hcabm40k, features = c("rna_TRDC", "rna_MPO", "rna_AVP"), reduction = 'ref.umap', 
                  max.cutoff = 3, ncol = 3)

# cell type prediction scores
DefaultAssay(hcabm40k) <- 'prediction.score.celltype'
p4 <- FeaturePlot(hcabm40k, features = c("CD16 Mono", "HSC", "Prog-RBC"), ncol = 3, 
                  cols = c("lightgrey", "darkred"))

# imputed protein levels
DefaultAssay(hcabm40k) <- 'predicted_ADT'
p5 <- FeaturePlot(hcabm40k, features = c("CD45RA", "CD16", "CD161"), reduction = 'ref.umap',
                  min.cutoff = 'q10', max.cutoff = 'q99', cols = c("lightgrey", "darkgreen") ,
                  ncol = 3)
p3 / p4 / p5
```

Example 109 (r):
```r
p3 <- FeaturePlot(hcabm40k, features = c("rna_TRDC", "rna_MPO", "rna_AVP"), reduction = 'ref.umap', 
                  max.cutoff = 3, ncol = 3)

# cell type prediction scores
DefaultAssay(hcabm40k) <- 'prediction.score.celltype'
p4 <- FeaturePlot(hcabm40k, features = c("CD16 Mono", "HSC", "Prog-RBC"), ncol = 3, 
                  cols = c("lightgrey", "darkred"))

# imputed protein levels
DefaultAssay(hcabm40k) <- 'predicted_ADT'
p5 <- FeaturePlot(hcabm40k, features = c("CD45RA", "CD16", "CD161"), reduction = 'ref.umap',
                  min.cutoff = 'q10', max.cutoff = 'q99', cols = c("lightgrey", "darkgreen") ,
                  ncol = 3)
p3 / p4 / p5
```

Example 110 (unknown):
```unknown
sessionInfo()
```

Example 111 (r):
```r
sessionInfo()
```

Example 112 (r):
```r
sessionInfo()
```

Example 113 (unknown):
```unknown
## R version 4.2.0 (2022-04-22)
## Platform: x86_64-pc-linux-gnu (64-bit)
## Running under: Ubuntu 20.04.5 LTS
## 
## Matrix products: default
## BLAS:   /usr/lib/x86_64-linux-gnu/openblas-pthread/libblas.so.3
## LAPACK: /usr/lib/x86_64-linux-gnu/openblas-pthread/liblapack.so.3
## 
## locale:
##  [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C              
##  [3] LC_TIME=en_US.UTF-8        LC_COLLATE=en_US.UTF-8    
##  [5] LC_MONETARY=en_US.UTF-8    LC_MESSAGES=en_US.UTF-8   
##  [7] LC_PAPER=en_US.UTF-8       LC_NAME=C                 
##  [9] LC_ADDRESS=C               LC_TELEPHONE=C            
## [11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C       
## 
## attached base packages:
## [1] stats     graphics  grDevices utils     datasets  methods   base     
## 
## other attached packages:
##  [1] dplyr_1.1.0                   thp1.eccite.SeuratData_3.1.5 
##  [3] stxBrain.SeuratData_0.1.1     ssHippo.SeuratData_3.1.4     
##  [5] pbmcsca.SeuratData_3.0.0      pbmcMultiome.SeuratData_0.1.2
##  [7] pbmc3k.SeuratData_3.1.4       panc8.SeuratData_3.0.2       
##  [9] ifnb.SeuratData_3.1.0         hcabm40k.SeuratData_3.0.0    
## [11] bmcite.SeuratData_0.3.0       SeuratData_0.2.2             
## [13] patchwork_1.1.2               ggplot2_3.4.1                
## [15] SeuratDisk_0.0.0.9020         SeuratObject_4.1.3           
## [17] Seurat_4.3.0                 
## 
## loaded via a namespace (and not attached):
##   [1] systemfonts_1.0.4      plyr_1.8.8             igraph_1.4.1          
##   [4] lazyeval_0.2.2         sp_1.6-0               splines_4.2.0         
##   [7] listenv_0.9.0          scattermore_0.8        digest_0.6.31         
##  [10] htmltools_0.5.4        fansi_1.0.4            magrittr_2.0.3        
##  [13] memoise_2.0.1          tensor_1.5             cluster_2.1.3         
##  [16] ROCR_1.0-11            limma_3.54.1           globals_0.16.2        
##  [19] matrixStats_0.63.0     pkgdown_2.0.7          spatstat.sparse_3.0-0 
##  [22] colorspace_2.1-0       rappdirs_0.3.3         ggrepel_0.9.3         
##  [25] textshaping_0.3.6      xfun_0.37              crayon_1.5.2          
##  [28] jsonlite_1.8.4         progressr_0.13.0       spatstat.data_3.0-0   
##  [31] survival_3.3-1         zoo_1.8-11             glue_1.6.2            
##  [34] polyclip_1.10-4        gtable_0.3.1           leiden_0.4.3          
##  [37] future.apply_1.10.0    abind_1.4-5            scales_1.2.1          
##  [40] spatstat.random_3.1-3  miniUI_0.1.1.1         Rcpp_1.0.10           
##  [43] viridisLite_0.4.1      xtable_1.8-4           reticulate_1.28       
##  [46] bit_4.0.5              htmlwidgets_1.6.1      httr_1.4.5            
##  [49] RColorBrewer_1.1-3     ellipsis_0.3.2         ica_1.0-3             
##  [52] pkgconfig_2.0.3        farver_2.1.1           sass_0.4.5            
##  [55] uwot_0.1.14            deldir_1.0-6           utf8_1.2.3            
##  [58] tidyselect_1.2.0       labeling_0.4.2         rlang_1.0.6           
##  [61] reshape2_1.4.4         later_1.3.0            munsell_0.5.0         
##  [64] tools_4.2.0            cachem_1.0.7           cli_3.6.0             
##  [67] generics_0.1.3         ggridges_0.5.4         evaluate_0.20         
##  [70] stringr_1.5.0          fastmap_1.1.1          yaml_2.3.7            
##  [73] ragg_1.2.5             goftest_1.2-3          knitr_1.42            
##  [76] bit64_4.0.5            fs_1.6.1               fitdistrplus_1.1-8    
##  [79] purrr_1.0.1            RANN_2.6.1             pbapply_1.7-0         
##  [82] future_1.31.0          nlme_3.1-157           mime_0.12             
##  [85] hdf5r_1.3.8            compiler_4.2.0         plotly_4.10.1         
##  [88] png_0.1-8              spatstat.utils_3.0-1   tibble_3.1.8          
##  [91] bslib_0.4.2            stringi_1.7.12         highr_0.10            
##  [94] desc_1.4.2             lattice_0.20-45        Matrix_1.5-3          
##  [97] vctrs_0.5.2            pillar_1.8.1           lifecycle_1.0.3       
## [100] spatstat.geom_3.0-6    lmtest_0.9-40          jquerylib_0.1.4       
## [103] RcppAnnoy_0.0.20       data.table_1.14.8      cowplot_1.1.1         
## [106] irlba_2.3.5.1          httpuv_1.6.9           R6_2.5.1              
## [109] promises_1.2.0.1       KernSmooth_2.23-20     gridExtra_2.3         
## [112] parallelly_1.34.0      codetools_0.2-18       MASS_7.3-56           
## [115] rprojroot_2.0.3        withr_2.5.0            sctransform_0.3.5     
## [118] parallel_4.2.0         grid_4.2.0             tidyr_1.3.0           
## [121] rmarkdown_2.20         Rtsne_0.16             spatstat.explore_3.0-6
## [124] shiny_1.7.4
```

Example 114 (unknown):
```unknown
## R version 4.2.0 (2022-04-22)
## Platform: x86_64-pc-linux-gnu (64-bit)
## Running under: Ubuntu 20.04.5 LTS
## 
## Matrix products: default
## BLAS:   /usr/lib/x86_64-linux-gnu/openblas-pthread/libblas.so.3
## LAPACK: /usr/lib/x86_64-linux-gnu/openblas-pthread/liblapack.so.3
## 
## locale:
##  [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C              
##  [3] LC_TIME=en_US.UTF-8        LC_COLLATE=en_US.UTF-8    
##  [5] LC_MONETARY=en_US.UTF-8    LC_MESSAGES=en_US.UTF-8   
##  [7] LC_PAPER=en_US.UTF-8       LC_NAME=C                 
##  [9] LC_ADDRESS=C               LC_TELEPHONE=C            
## [11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C       
## 
## attached base packages:
## [1] stats     graphics  grDevices utils     datasets  methods   base     
## 
## other attached packages:
##  [1] dplyr_1.1.0                   thp1.eccite.SeuratData_3.1.5 
##  [3] stxBrain.SeuratData_0.1.1     ssHippo.SeuratData_3.1.4     
##  [5] pbmcsca.SeuratData_3.0.0      pbmcMultiome.SeuratData_0.1.2
##  [7] pbmc3k.SeuratData_3.1.4       panc8.SeuratData_3.0.2       
##  [9] ifnb.SeuratData_3.1.0         hcabm40k.SeuratData_3.0.0    
## [11] bmcite.SeuratData_0.3.0       SeuratData_0.2.2             
## [13] patchwork_1.1.2               ggplot2_3.4.1                
## [15] SeuratDisk_0.0.0.9020         SeuratObject_4.1.3           
## [17] Seurat_4.3.0                 
## 
## loaded via a namespace (and not attached):
##   [1] systemfonts_1.0.4      plyr_1.8.8             igraph_1.4.1          
##   [4] lazyeval_0.2.2         sp_1.6-0               splines_4.2.0         
##   [7] listenv_0.9.0          scattermore_0.8        digest_0.6.31         
##  [10] htmltools_0.5.4        fansi_1.0.4            magrittr_2.0.3        
##  [13] memoise_2.0.1          tensor_1.5             cluster_2.1.3         
##  [16] ROCR_1.0-11            limma_3.54.1           globals_0.16.2        
##  [19] matrixStats_0.63.0     pkgdown_2.0.7          spatstat.sparse_3.0-0 
##  [22] colorspace_2.1-0       rappdirs_0.3.3         ggrepel_0.9.3         
##  [25] textshaping_0.3.6      xfun_0.37              crayon_1.5.2          
##  [28] jsonlite_1.8.4         progressr_0.13.0       spatstat.data_3.0-0   
##  [31] survival_3.3-1         zoo_1.8-11             glue_1.6.2            
##  [34] polyclip_1.10-4        gtable_0.3.1           leiden_0.4.3          
##  [37] future.apply_1.10.0    abind_1.4-5            scales_1.2.1          
##  [40] spatstat.random_3.1-3  miniUI_0.1.1.1         Rcpp_1.0.10           
##  [43] viridisLite_0.4.1      xtable_1.8-4           reticulate_1.28       
##  [46] bit_4.0.5              htmlwidgets_1.6.1      httr_1.4.5            
##  [49] RColorBrewer_1.1-3     ellipsis_0.3.2         ica_1.0-3             
##  [52] pkgconfig_2.0.3        farver_2.1.1           sass_0.4.5            
##  [55] uwot_0.1.14            deldir_1.0-6           utf8_1.2.3            
##  [58] tidyselect_1.2.0       labeling_0.4.2         rlang_1.0.6           
##  [61] reshape2_1.4.4         later_1.3.0            munsell_0.5.0         
##  [64] tools_4.2.0            cachem_1.0.7           cli_3.6.0             
##  [67] generics_0.1.3         ggridges_0.5.4         evaluate_0.20         
##  [70] stringr_1.5.0          fastmap_1.1.1          yaml_2.3.7            
##  [73] ragg_1.2.5             goftest_1.2-3          knitr_1.42            
##  [76] bit64_4.0.5            fs_1.6.1               fitdistrplus_1.1-8    
##  [79] purrr_1.0.1            RANN_2.6.1             pbapply_1.7-0         
##  [82] future_1.31.0          nlme_3.1-157           mime_0.12             
##  [85] hdf5r_1.3.8            compiler_4.2.0         plotly_4.10.1         
##  [88] png_0.1-8              spatstat.utils_3.0-1   tibble_3.1.8          
##  [91] bslib_0.4.2            stringi_1.7.12         highr_0.10            
##  [94] desc_1.4.2             lattice_0.20-45        Matrix_1.5-3          
##  [97] vctrs_0.5.2            pillar_1.8.1           lifecycle_1.0.3       
## [100] spatstat.geom_3.0-6    lmtest_0.9-40          jquerylib_0.1.4       
## [103] RcppAnnoy_0.0.20       data.table_1.14.8      cowplot_1.1.1         
## [106] irlba_2.3.5.1          httpuv_1.6.9           R6_2.5.1              
## [109] promises_1.2.0.1       KernSmooth_2.23-20     gridExtra_2.3         
## [112] parallelly_1.34.0      codetools_0.2-18       MASS_7.3-56           
## [115] rprojroot_2.0.3        withr_2.5.0            sctransform_0.3.5     
## [118] parallel_4.2.0         grid_4.2.0             tidyr_1.3.0           
## [121] rmarkdown_2.20         Rtsne_0.16             spatstat.explore_3.0-6
## [124] shiny_1.7.4
```

---

## Construct an assay for spatial niche analysis — BuildNicheAssay • Seurat

**URL:** http://127.0.0.1:9173/seurat/reference/buildnicheassay/index.html

**Contents:**
- Construct an assay for spatial niche analysis
- Arguments
- Value
- Contents

This function will construct a new assay where each feature is a cell label The values represents the sum of a particular cell label neighboring a given cell.

FOV object to gather cell positions from

Cell classifications to count in spatial neighborhood

Name for spatial neighborhoods assay

Name of output clusters

Number of neighbors to consider for each cell

Number of clusters to return based on the niche assay

Seurat object containing a new assay

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/utilities.R
```

Example 2 (unknown):
```unknown
BuildNicheAssay.Rd
```

Example 3 (unknown):
```unknown
BuildNicheAssay(
  object,
  fov,
  group.by,
  assay = "niche",
  cluster.name = "niches",
  neighbors.k = 20,
  niches.k = 4
)
```

Example 4 (r):
```r
BuildNicheAssay(
  object,
  fov,
  group.by,
  assay = "niche",
  cluster.name = "niches",
  neighbors.k = 20,
  niches.k = 4
)
```

Example 5 (r):
```r
BuildNicheAssay(
  object,
  fov,
  group.by,
  assay = "niche",
  cluster.name = "niches",
  neighbors.k = 20,
  niches.k = 4
)
```

---

## Add info to anchor matrix — AnnotateAnchors • Seurat

**URL:** http://127.0.0.1:9173/reference_annotateanchors.html

**Contents:**
- Add info to anchor matrix
- Arguments
- Value
- Contents

Add info to anchor matrix

Variables to pull for each object via FetchData

Slot to pull feature data for

Arguments passed to other methods

List of Seurat objects

Specify the Assay per object if annotating with expression data

Reference object used in FindTransferAnchors

Query object used in FindTransferAnchors

Returns the anchor dataframe with additional columns for annotation metadata

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/generics.R
```

Example 2 (unknown):
```unknown
R/integration.R
```

Example 3 (unknown):
```unknown
AnnotateAnchors.Rd
```

Example 4 (python):
```python
AnnotateAnchors(anchors, vars, slot, ...)

# Default S3 method
AnnotateAnchors(
  anchors,
  vars = NULL,
  slot = NULL,
  object.list,
  assay = NULL,
  ...
)

# S3 method for class 'IntegrationAnchorSet'
AnnotateAnchors(
  anchors,
  vars = NULL,
  slot = NULL,
  object.list = NULL,
  assay = NULL,
  ...
)

# S3 method for class 'TransferAnchorSet'
AnnotateAnchors(
  anchors,
  vars = NULL,
  slot = NULL,
  reference = NULL,
  query = NULL,
  assay = NULL,
  ...
)
```

Example 5 (r):
```r
AnnotateAnchors(anchors, vars, slot, ...)

# Default S3 method
AnnotateAnchors(
  anchors,
  vars = NULL,
  slot = NULL,
  object.list,
  assay = NULL,
  ...
)

# S3 method for class 'IntegrationAnchorSet'
AnnotateAnchors(
  anchors,
  vars = NULL,
  slot = NULL,
  object.list = NULL,
  assay = NULL,
  ...
)

# S3 method for class 'TransferAnchorSet'
AnnotateAnchors(
  anchors,
  vars = NULL,
  slot = NULL,
  reference = NULL,
  query = NULL,
  assay = NULL,
  ...
)
```

Example 6 (r):
```r
AnnotateAnchors(anchors, vars, slot, ...)

# Default S3 method
AnnotateAnchors(
  anchors,
  vars = NULL,
  slot = NULL,
  object.list,
  assay = NULL,
  ...
)

# S3 method for class 'IntegrationAnchorSet'
AnnotateAnchors(
  anchors,
  vars = NULL,
  slot = NULL,
  object.list = NULL,
  assay = NULL,
  ...
)

# S3 method for class 'TransferAnchorSet'
AnnotateAnchors(
  anchors,
  vars = NULL,
  slot = NULL,
  reference = NULL,
  query = NULL,
  assay = NULL,
  ...
)
```

Example 7 (unknown):
```unknown
FindTransferAnchors
```

Example 8 (unknown):
```unknown
FindTransferAnchors
```

---

## Read and Load Akoya CODEX data — ReadAkoya • Seurat

**URL:** http://127.0.0.1:9173/seurat/reference/readakoya/index.html

**Contents:**
- Read and Load Akoya CODEX data
- Arguments
- Value
- Note
- Progress Updates with progressr
- Contents

Read and Load Akoya CODEX data

Path to matrix generated by upstream processing.

Specify which type matrix is being provided.

“processor”: matrix generated by CODEX Processor

“inform”: matrix generated by inForm

“qupath”: matrix generated by QuPath

A pattern to filter features by; pass NA to skip feature filtering

When type is “inform”, the quantification level to read in

Name to store expression matrix as

ReadAkoya: A list with some combination of the following values

“matrix”: a sparse matrix with expression data; cells are columns and features are rows

“centroids”: a data frame with cell centroid coordinates in three columns: “x”, “y”, and “cell”

“metadata”: a data frame with cell-level meta data; includes all columns in filename that aren't in “matrix” or “centroids”

When type is “inform”, additional expression matrices are returned and named using their segmentation type (eg. “nucleus”, “membrane”). The “Entire Cell” segmentation type is returned in the “matrix” entry of the list

LoadAkoya: A Seurat object

This function requires the data.table package to be installed

This function uses progressr to render status updates and progress bars. To enable progress updates, wrap the function call in with_progress or run handlers(global = TRUE) before running this function. For more details about progressr, please read vignette("progressr-intro")

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/preprocessing.R
```

Example 2 (unknown):
```unknown
R/convenience.R
```

Example 3 (unknown):
```unknown
ReadAkoya.Rd
```

Example 4 (unknown):
```unknown
ReadAkoya(
  filename,
  type = c("inform", "processor", "qupath"),
  filter = "DAPI|Blank|Empty",
  inform.quant = c("mean", "total", "min", "max", "std")
)

LoadAkoya(
  filename,
  type = c("inform", "processor", "qupath"),
  fov,
  assay = "Akoya",
  ...
)
```

Example 5 (r):
```r
ReadAkoya(
  filename,
  type = c("inform", "processor", "qupath"),
  filter = "DAPI|Blank|Empty",
  inform.quant = c("mean", "total", "min", "max", "std")
)

LoadAkoya(
  filename,
  type = c("inform", "processor", "qupath"),
  fov,
  assay = "Akoya",
  ...
)
```

Example 6 (r):
```r
ReadAkoya(
  filename,
  type = c("inform", "processor", "qupath"),
  filter = "DAPI|Blank|Empty",
  inform.quant = c("mean", "total", "min", "max", "std")
)

LoadAkoya(
  filename,
  type = c("inform", "processor", "qupath"),
  fov,
  assay = "Akoya",
  ...
)
```

Example 7 (unknown):
```unknown
with_progress
```

Example 8 (unknown):
```unknown
handlers(global = TRUE)
```

Example 9 (unknown):
```unknown
vignette("progressr-intro")
```

---

## Add Azimuth Results — AddAzimuthResults • Seurat

**URL:** http://127.0.0.1:9173/reference_addazimuthresults.html

**Contents:**
- Add Azimuth Results
- Arguments
- Value
- Examples
- Contents

Add mapping and prediction scores, UMAP embeddings, and imputed assay (if available) from Azimuth to an existing or new Seurat object

Path to Azimuth mapping scores file

object with Azimuth results added

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/utilities.R
```

Example 2 (unknown):
```unknown
AddAzimuthResults.Rd
```

Example 3 (unknown):
```unknown
AddAzimuthResults(object = NULL, filename)
```

Example 4 (r):
```r
AddAzimuthResults(object = NULL, filename)
```

Example 5 (r):
```r
AddAzimuthResults(object = NULL, filename)
```

Example 6 (unknown):
```unknown
if (FALSE) { # \dontrun{
object <- AddAzimuthResults(object, filename = "azimuth_results.Rds")
} # }
```

Example 7 (r):
```r
if (FALSE) { # \dontrun{
object <- AddAzimuthResults(object, filename = "azimuth_results.Rds")
} # }
```

Example 8 (r):
```r
if (FALSE) { # \dontrun{
object <- AddAzimuthResults(object, filename = "azimuth_results.Rds")
} # }
```

---

## Get Spot Radius — Radius.SlideSeq • Seurat

**URL:** http://127.0.0.1:9173/reference_radius.html

**Contents:**
- Get Spot Radius
- Arguments
- See also
- Contents

Arguments passed to other methods

A factor to scale the radius by; one of: "hires", "lowres", or NULL for the unscaled value.

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/objects.R
```

Example 2 (python):
```python
# S3 method for class 'SlideSeq'
Radius(object, ...)

# S3 method for class 'STARmap'
Radius(object, ...)

# S3 method for class 'VisiumV1'
Radius(object, scale = "lowres", ...)

# S3 method for class 'VisiumV1'
Radius(object, scale = "lowres", ...)
```

Example 3 (r):
```r
# S3 method for class 'SlideSeq'
Radius(object, ...)

# S3 method for class 'STARmap'
Radius(object, ...)

# S3 method for class 'VisiumV1'
Radius(object, scale = "lowres", ...)

# S3 method for class 'VisiumV1'
Radius(object, scale = "lowres", ...)
```

Example 4 (r):
```r
# S3 method for class 'SlideSeq'
Radius(object, ...)

# S3 method for class 'STARmap'
Radius(object, ...)

# S3 method for class 'VisiumV1'
Radius(object, scale = "lowres", ...)

# S3 method for class 'VisiumV1'
Radius(object, scale = "lowres", ...)
```

Example 5 (unknown):
```unknown
SeuratObject::Radius
```

---

## Gene expression markers of identity classes — FindMarkers • Seurat

**URL:** http://127.0.0.1:9173/reference_findmarkers.html

**Contents:**
- Gene expression markers of identity classes
- Arguments
- Value
- Details
- References
- See also
- Examples
- Contents

Finds markers (differentially expressed genes) for identity classes

Arguments passed to other methods and to specific DE methods

Slot to pull data from; note that if test.use is "negbinom", "poisson", or "DESeq2", slot will be set to "counts"

Vector of cell names belonging to group 1

Vector of cell names belonging to group 2

Genes to test. Default is to use all genes

Limit testing to genes which show, on average, at least X-fold difference (log-scale) between the two groups of cells. Default is 0.1 Increasing logfc.threshold speeds up the function, but can miss weaker signals. If the slot parameter is "scale.data" no filtering is performed.

Denotes which test to use. Available options are:

"wilcox" : Identifies differentially expressed genes between two groups of cells using a Wilcoxon Rank Sum test (default); will use a fast implementation by Presto if installed

"wilcox_limma" : Identifies differentially expressed genes between two groups of cells using the limma implementation of the Wilcoxon Rank Sum test; set this option to reproduce results from Seurat v4

"bimod" : Likelihood-ratio test for single cell gene expression, (McDavid et al., Bioinformatics, 2013)

"roc" : Identifies 'markers' of gene expression using ROC analysis. For each gene, evaluates (using AUC) a classifier built on that gene alone, to classify between two groups of cells. An AUC value of 1 means that expression values for this gene alone can perfectly classify the two groupings (i.e. Each of the cells in cells.1 exhibit a higher level than each of the cells in cells.2). An AUC value of 0 also means there is perfect classification, but in the other direction. A value of 0.5 implies that the gene has no predictive power to classify the two groups. Returns a 'predictive power' (abs(AUC-0.5) * 2) ranked matrix of putative differentially expressed genes.

"t" : Identify differentially expressed genes between two groups of cells using the Student's t-test.

"negbinom" : Identifies differentially expressed genes between two groups of cells using a negative binomial generalized linear model. Use only for UMI-based datasets

"poisson" : Identifies differentially expressed genes between two groups of cells using a poisson generalized linear model. Use only for UMI-based datasets

"LR" : Uses a logistic regression framework to determine differentially expressed genes. Constructs a logistic regression model predicting group membership based on each feature individually and compares this to a null model with a likelihood ratio test.

"MAST" : Identifies differentially expressed genes between two groups of cells using a hurdle model tailored to scRNA-seq data. Utilizes the MAST package to run the DE testing.

"DESeq2" : Identifies differentially expressed genes between two groups of cells based on a model using DESeq2 which uses a negative binomial distribution (Love et al, Genome Biology, 2014).This test does not support pre-filtering of genes based on average difference (or percent detection rate) between cell groups. However, genes may be pre-filtered based on their minimum detection rate (min.pct) across both cell groups. To use this method, please install DESeq2, using the instructions at https://bioconductor.org/packages/release/bioc/html/DESeq2.html

only test genes that are detected in a minimum fraction of min.pct cells in either of the two populations. Meant to speed up the function by not testing genes that are very infrequently expressed. Default is 0.01

only test genes that show a minimum difference in the fraction of detection between the two groups. Set to -Inf by default

Print a progress bar once expression testing begins

Only return positive markers (FALSE by default)

Down sample each identity class to a max number. Default is no downsampling. Not activated by default (set to Inf)

Random seed for downsampling

Variables to test, used only when test.use is one of 'LR', 'negbinom', 'poisson', or 'MAST'

Minimum number of cells expressing the feature in at least one of the two groups, currently only used for poisson and negative binomial tests

Minimum number of cells in one of the groups

data.frame from FoldChange

Convert the sparse matrix to a dense form before running the DE test. This can provide speedups but might require higher memory; default is FALSE

Slot used to calculate fold-change - will also affect the default for mean.fxn, see below for more details.

Pseudocount to add to averaged expression values when calculating logFC. 1 by default.

Normalization method for fold change calculation when slot is “data”

Function to use for fold change or average difference calculation. The default depends on the the value of fc.slot:

"counts" : difference in the log of the mean counts, with pseudocount.

"data" : difference in the log of the average exponentiated data, with pseudocount. This adjusts for differences in sequencing depth between cells, and assumes that "data" has been log-normalized.

"scale.data" : difference in the means of scale.data.

Name of the fold change, average difference, or custom function column in the output data.frame. If NULL, the fold change column will be named according to the logarithm base (eg, "avg_log2FC"), or if using the scale.data slot "avg_diff".

The base with respect to which logarithms are computed.

Recalculate corrected UMI counts using minimum of the median UMIs when performing DE using multiple SCT objects; default is TRUE

Identity class to define markers for; pass an object of class phylo or 'clustertree' to find markers for a node in a cluster tree; passing 'clustertree' requires BuildClusterTree to have been run

A second identity class for comparison; if NULL, use all other cells for comparison; if an object of class phylo or 'clustertree' is passed to ident.1, must pass a node to find markers for

Regroup cells into a different identity class prior to performing differential expression (see example); "ident" to use Idents

Subset a particular identity class prior to regrouping. Only relevant if group.by is set (see example)

Assay to use in differential expression testing

Reduction to use in differential expression testing - will test for DE on cell embeddings

data.frame with a ranked list of putative markers as rows, and associated statistics as columns (p-values, ROC score, etc., depending on the test used (test.use)). The following columns are always present:

avg_logFC: log fold-chage of the average expression between the two groups. Positive values indicate that the gene is more highly expressed in the first group

pct.1: The percentage of cells where the gene is detected in the first group

pct.2: The percentage of cells where the gene is detected in the second group

p_val_adj: Adjusted p-value, based on bonferroni correction using all genes in the dataset

p-value adjustment is performed using bonferroni correction based on the total number of genes in the dataset. Other correction methods are not recommended, as Seurat pre-filters genes using the arguments above, reducing the number of tests performed. Lastly, as Aaron Lun has pointed out, p-values should be interpreted cautiously, as the genes used for clustering are the same genes tested for differential expression.

McDavid A, Finak G, Chattopadyay PK, et al. Data exploration, quality control and testing in single-cell qPCR-based gene expression experiments. Bioinformatics. 2013;29(4):461-467. doi:10.1093/bioinformatics/bts714

Trapnell C, et al. The dynamics and regulators of cell fate decisions are revealed by pseudotemporal ordering of single cells. Nature Biotechnology volume 32, pages 381-386 (2014)

Andrew McDavid, Greg Finak and Masanao Yajima (2017). MAST: Model-based Analysis of Single Cell Transcriptomics. R package version 1.2.1. https://github.com/RGLab/MAST/

Love MI, Huber W and Anders S (2014). "Moderated estimation of fold change and dispersion for RNA-seq data with DESeq2." Genome Biology. https://bioconductor.org/packages/release/bioc/html/DESeq2.html

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/generics.R
```

Example 2 (unknown):
```unknown
R/differential_expression.R
```

Example 3 (unknown):
```unknown
FindMarkers.Rd
```

Example 4 (python):
```python
FindMarkers(object, ...)

# Default S3 method
FindMarkers(
  object,
  slot = "data",
  cells.1 = NULL,
  cells.2 = NULL,
  features = NULL,
  logfc.threshold = 0.1,
  test.use = "wilcox",
  min.pct = 0.01,
  min.diff.pct = -Inf,
  verbose = TRUE,
  only.pos = FALSE,
  max.cells.per.ident = Inf,
  random.seed = 1,
  latent.vars = NULL,
  min.cells.feature = 3,
  min.cells.group = 3,
  fc.results = NULL,
  densify = FALSE,
  ...
)

# S3 method for class 'Assay'
FindMarkers(
  object,
  slot = "data",
  cells.1 = NULL,
  cells.2 = NULL,
  features = NULL,
  test.use = "wilcox",
  fc.slot = "data",
  pseudocount.use = 1,
  norm.method = NULL,
  mean.fxn = NULL,
  fc.name = NULL,
  base = 2,
  ...
)

# S3 method for class 'SCTAssay'
FindMarkers(
  object,
  cells.1 = NULL,
  cells.2 = NULL,
  features = NULL,
  test.use = "wilcox",
  pseudocount.use = 1,
  slot = "data",
  fc.slot = "data",
  mean.fxn = NULL,
  fc.name = NULL,
  base = 2,
  recorrect_umi = TRUE,
  ...
)

# S3 method for class 'DimReduc'
FindMarkers(
  object,
  cells.1 = NULL,
  cells.2 = NULL,
  features = NULL,
  logfc.threshold = 0.1,
  test.use = "wilcox",
  min.pct = 0.01,
  min.diff.pct = -Inf,
  verbose = TRUE,
  only.pos = FALSE,
  max.cells.per.ident = Inf,
  random.seed = 1,
  latent.vars = NULL,
  min.cells.feature = 3,
  min.cells.group = 3,
  densify = FALSE,
  mean.fxn = rowMeans,
  fc.name = NULL,
  ...
)

# S3 method for class 'Seurat'
FindMarkers(
  object,
  ident.1 = NULL,
  ident.2 = NULL,
  latent.vars = NULL,
  group.by = NULL,
  subset.ident = NULL,
  assay = NULL,
  reduction = NULL,
  ...
)
```

Example 5 (r):
```r
FindMarkers(object, ...)

# Default S3 method
FindMarkers(
  object,
  slot = "data",
  cells.1 = NULL,
  cells.2 = NULL,
  features = NULL,
  logfc.threshold = 0.1,
  test.use = "wilcox",
  min.pct = 0.01,
  min.diff.pct = -Inf,
  verbose = TRUE,
  only.pos = FALSE,
  max.cells.per.ident = Inf,
  random.seed = 1,
  latent.vars = NULL,
  min.cells.feature = 3,
  min.cells.group = 3,
  fc.results = NULL,
  densify = FALSE,
  ...
)

# S3 method for class 'Assay'
FindMarkers(
  object,
  slot = "data",
  cells.1 = NULL,
  cells.2 = NULL,
  features = NULL,
  test.use = "wilcox",
  fc.slot = "data",
  pseudocount.use = 1,
  norm.method = NULL,
  mean.fxn = NULL,
  fc.name = NULL,
  base = 2,
  ...
)

# S3 method for class 'SCTAssay'
FindMarkers(
  object,
  cells.1 = NULL,
  cells.2 = NULL,
  features = NULL,
  test.use = "wilcox",
  pseudocount.use = 1,
  slot = "data",
  fc.slot = "data",
  mean.fxn = NULL,
  fc.name = NULL,
  base = 2,
  recorrect_umi = TRUE,
  ...
)

# S3 method for class 'DimReduc'
FindMarkers(
  object,
  cells.1 = NULL,
  cells.2 = NULL,
  features = NULL,
  logfc.threshold = 0.1,
  test.use = "wilcox",
  min.pct = 0.01,
  min.diff.pct = -Inf,
  verbose = TRUE,
  only.pos = FALSE,
  max.cells.per.ident = Inf,
  random.seed = 1,
  latent.vars = NULL,
  min.cells.feature = 3,
  min.cells.group = 3,
  densify = FALSE,
  mean.fxn = rowMeans,
  fc.name = NULL,
  ...
)

# S3 method for class 'Seurat'
FindMarkers(
  object,
  ident.1 = NULL,
  ident.2 = NULL,
  latent.vars = NULL,
  group.by = NULL,
  subset.ident = NULL,
  assay = NULL,
  reduction = NULL,
  ...
)
```

Example 6 (r):
```r
FindMarkers(object, ...)

# Default S3 method
FindMarkers(
  object,
  slot = "data",
  cells.1 = NULL,
  cells.2 = NULL,
  features = NULL,
  logfc.threshold = 0.1,
  test.use = "wilcox",
  min.pct = 0.01,
  min.diff.pct = -Inf,
  verbose = TRUE,
  only.pos = FALSE,
  max.cells.per.ident = Inf,
  random.seed = 1,
  latent.vars = NULL,
  min.cells.feature = 3,
  min.cells.group = 3,
  fc.results = NULL,
  densify = FALSE,
  ...
)

# S3 method for class 'Assay'
FindMarkers(
  object,
  slot = "data",
  cells.1 = NULL,
  cells.2 = NULL,
  features = NULL,
  test.use = "wilcox",
  fc.slot = "data",
  pseudocount.use = 1,
  norm.method = NULL,
  mean.fxn = NULL,
  fc.name = NULL,
  base = 2,
  ...
)

# S3 method for class 'SCTAssay'
FindMarkers(
  object,
  cells.1 = NULL,
  cells.2 = NULL,
  features = NULL,
  test.use = "wilcox",
  pseudocount.use = 1,
  slot = "data",
  fc.slot = "data",
  mean.fxn = NULL,
  fc.name = NULL,
  base = 2,
  recorrect_umi = TRUE,
  ...
)

# S3 method for class 'DimReduc'
FindMarkers(
  object,
  cells.1 = NULL,
  cells.2 = NULL,
  features = NULL,
  logfc.threshold = 0.1,
  test.use = "wilcox",
  min.pct = 0.01,
  min.diff.pct = -Inf,
  verbose = TRUE,
  only.pos = FALSE,
  max.cells.per.ident = Inf,
  random.seed = 1,
  latent.vars = NULL,
  min.cells.feature = 3,
  min.cells.group = 3,
  densify = FALSE,
  mean.fxn = rowMeans,
  fc.name = NULL,
  ...
)

# S3 method for class 'Seurat'
FindMarkers(
  object,
  ident.1 = NULL,
  ident.2 = NULL,
  latent.vars = NULL,
  group.by = NULL,
  subset.ident = NULL,
  assay = NULL,
  reduction = NULL,
  ...
)
```

Example 7 (unknown):
```unknown
BuildClusterTree
```

Example 8 (python):
```python
if (FALSE) { # \dontrun{
data("pbmc_small")
# Find markers for cluster 2
markers <- FindMarkers(object = pbmc_small, ident.1 = 2)
head(x = markers)

# Take all cells in cluster 2, and find markers that separate cells in the 'g1' group (metadata
# variable 'group')
markers <- FindMarkers(pbmc_small, ident.1 = "g1", group.by = 'groups', subset.ident = "2")
head(x = markers)

# Pass 'clustertree' or an object of class phylo to ident.1 and
# a node to ident.2 as a replacement for FindMarkersNode
if (requireNamespace("ape", quietly = TRUE)) {
  pbmc_small <- BuildClusterTree(object = pbmc_small)
  markers <- FindMarkers(object = pbmc_small, ident.1 = 'clustertree', ident.2 = 5)
  head(x = markers)
}
} # }
```

Example 9 (r):
```r
if (FALSE) { # \dontrun{
data("pbmc_small")
# Find markers for cluster 2
markers <- FindMarkers(object = pbmc_small, ident.1 = 2)
head(x = markers)

# Take all cells in cluster 2, and find markers that separate cells in the 'g1' group (metadata
# variable 'group')
markers <- FindMarkers(pbmc_small, ident.1 = "g1", group.by = 'groups', subset.ident = "2")
head(x = markers)

# Pass 'clustertree' or an object of class phylo to ident.1 and
# a node to ident.2 as a replacement for FindMarkersNode
if (requireNamespace("ape", quietly = TRUE)) {
  pbmc_small <- BuildClusterTree(object = pbmc_small)
  markers <- FindMarkers(object = pbmc_small, ident.1 = 'clustertree', ident.2 = 5)
  head(x = markers)
}
} # }
```

Example 10 (r):
```r
if (FALSE) { # \dontrun{
data("pbmc_small")
# Find markers for cluster 2
markers <- FindMarkers(object = pbmc_small, ident.1 = 2)
head(x = markers)

# Take all cells in cluster 2, and find markers that separate cells in the 'g1' group (metadata
# variable 'group')
markers <- FindMarkers(pbmc_small, ident.1 = "g1", group.by = 'groups', subset.ident = "2")
head(x = markers)

# Pass 'clustertree' or an object of class phylo to ident.1 and
# a node to ident.2 as a replacement for FindMarkersNode
if (requireNamespace("ape", quietly = TRUE)) {
  pbmc_small <- BuildClusterTree(object = pbmc_small)
  markers <- FindMarkers(object = pbmc_small, ident.1 = 'clustertree', ident.2 = 5)
  head(x = markers)
}
} # }
```

---

## Find variable features — FindVariableFeatures • Seurat

**URL:** http://127.0.0.1:9173/reference_findvariablefeatures.html

**Contents:**
- Find variable features
- Arguments
- Details
- Contents

Identifies features that are outliers on a 'mean variability plot'.

Arguments passed to other methods

How to choose top variable features. Choose one of :

“vst”: First, fits a line to the relationship of log(variance) and log(mean) using local polynomial regression (loess). Then standardizes the feature values using the observed mean and expected variance (given by the fitted line). Feature variance is then calculated on the standardized values after clipping to a maximum (see clip.max parameter).

“mean.var.plot” (mvp): First, uses a function to calculate average expression (mean.function) and dispersion (dispersion.function) for each feature. Next, divides features into num.bin (default 20) bins based on their average expression, and calculates z-scores for dispersion within each bin. The purpose of this is to identify variable features while controlling for the strong relationship between variability and average expression

“dispersion” (disp): selects the genes with the highest dispersion values

(vst method) Loess span parameter used when fitting the variance-mean relationship

(vst method) After standardization values larger than clip.max will be set to clip.max; default is 'auto' which sets this value to the square root of the number of cells

Function to compute x-axis value (average expression). Default is to take the mean of the detected (i.e. non-zero) values

Function to compute y-axis value (dispersion). Default is to take the standard deviation of all values

Total number of bins to use in the scaled analysis (default is 20)

Specifies how the bins should be computed. Available methods are:

“equal_width”: each bin is of equal width along the x-axis (default)

“equal_frequency”: each bin contains an equal number of features (can increase statistical power to detect overdispersed features at high expression values, at the cost of reduced resolution along the x-axis)

show progress bar for calculations

Number of features to select as top variable features; only used when selection.method is set to 'dispersion' or 'vst'

A two-length numeric vector with low- and high-cutoffs for feature means

A two-length numeric vector with low- and high-cutoffs for feature dispersions

For the mean.var.plot method: Exact parameter settings may vary empirically from dataset to dataset, and based on visual inspection of the plot. Setting the y.cutoff parameter to 2 identifies features that are more than two standard deviations away from the average dispersion within a bin. The default X-axis function is the mean expression level, and for Y-axis it is the log(Variance/mean). All mean/variance calculations are not performed in log-space, but the results are reported in log-space - see relevant functions for exact details.

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/generics.R
```

Example 2 (unknown):
```unknown
R/preprocessing.R
```

Example 3 (unknown):
```unknown
FindVariableFeatures.Rd
```

Example 4 (python):
```python
FindVariableFeatures(object, ...)

# S3 method for class 'V3Matrix'
FindVariableFeatures(
  object,
  selection.method = "vst",
  loess.span = 0.3,
  clip.max = "auto",
  mean.function = FastExpMean,
  dispersion.function = FastLogVMR,
  num.bin = 20,
  binning.method = "equal_width",
  verbose = TRUE,
  ...
)

# S3 method for class 'Assay'
FindVariableFeatures(
  object,
  selection.method = "vst",
  loess.span = 0.3,
  clip.max = "auto",
  mean.function = FastExpMean,
  dispersion.function = FastLogVMR,
  num.bin = 20,
  binning.method = "equal_width",
  nfeatures = 2000,
  mean.cutoff = c(0.1, 8),
  dispersion.cutoff = c(1, Inf),
  verbose = TRUE,
  ...
)

# S3 method for class 'SCTAssay'
FindVariableFeatures(object, nfeatures = 2000, ...)

# S3 method for class 'Seurat'
FindVariableFeatures(
  object,
  assay = NULL,
  selection.method = "vst",
  loess.span = 0.3,
  clip.max = "auto",
  mean.function = FastExpMean,
  dispersion.function = FastLogVMR,
  num.bin = 20,
  binning.method = "equal_width",
  nfeatures = 2000,
  mean.cutoff = c(0.1, 8),
  dispersion.cutoff = c(1, Inf),
  verbose = TRUE,
  ...
)
```

Example 5 (r):
```r
FindVariableFeatures(object, ...)

# S3 method for class 'V3Matrix'
FindVariableFeatures(
  object,
  selection.method = "vst",
  loess.span = 0.3,
  clip.max = "auto",
  mean.function = FastExpMean,
  dispersion.function = FastLogVMR,
  num.bin = 20,
  binning.method = "equal_width",
  verbose = TRUE,
  ...
)

# S3 method for class 'Assay'
FindVariableFeatures(
  object,
  selection.method = "vst",
  loess.span = 0.3,
  clip.max = "auto",
  mean.function = FastExpMean,
  dispersion.function = FastLogVMR,
  num.bin = 20,
  binning.method = "equal_width",
  nfeatures = 2000,
  mean.cutoff = c(0.1, 8),
  dispersion.cutoff = c(1, Inf),
  verbose = TRUE,
  ...
)

# S3 method for class 'SCTAssay'
FindVariableFeatures(object, nfeatures = 2000, ...)

# S3 method for class 'Seurat'
FindVariableFeatures(
  object,
  assay = NULL,
  selection.method = "vst",
  loess.span = 0.3,
  clip.max = "auto",
  mean.function = FastExpMean,
  dispersion.function = FastLogVMR,
  num.bin = 20,
  binning.method = "equal_width",
  nfeatures = 2000,
  mean.cutoff = c(0.1, 8),
  dispersion.cutoff = c(1, Inf),
  verbose = TRUE,
  ...
)
```

Example 6 (r):
```r
FindVariableFeatures(object, ...)

# S3 method for class 'V3Matrix'
FindVariableFeatures(
  object,
  selection.method = "vst",
  loess.span = 0.3,
  clip.max = "auto",
  mean.function = FastExpMean,
  dispersion.function = FastLogVMR,
  num.bin = 20,
  binning.method = "equal_width",
  verbose = TRUE,
  ...
)

# S3 method for class 'Assay'
FindVariableFeatures(
  object,
  selection.method = "vst",
  loess.span = 0.3,
  clip.max = "auto",
  mean.function = FastExpMean,
  dispersion.function = FastLogVMR,
  num.bin = 20,
  binning.method = "equal_width",
  nfeatures = 2000,
  mean.cutoff = c(0.1, 8),
  dispersion.cutoff = c(1, Inf),
  verbose = TRUE,
  ...
)

# S3 method for class 'SCTAssay'
FindVariableFeatures(object, nfeatures = 2000, ...)

# S3 method for class 'Seurat'
FindVariableFeatures(
  object,
  assay = NULL,
  selection.method = "vst",
  loess.span = 0.3,
  clip.max = "auto",
  mean.function = FastExpMean,
  dispersion.function = FastLogVMR,
  num.bin = 20,
  binning.method = "equal_width",
  nfeatures = 2000,
  mean.cutoff = c(0.1, 8),
  dispersion.cutoff = c(1, Inf),
  verbose = TRUE,
  ...
)
```

Example 7 (unknown):
```unknown
mean.var.plot
```

Example 8 (unknown):
```unknown
equal_width
```

Example 9 (unknown):
```unknown
equal_frequency
```

Example 10 (unknown):
```unknown
selection.method
```

Example 11 (unknown):
```unknown
'dispersion'
```

---

## Analysis, visualization, and integration of Visium HD spatial datasets with Seurat • Seurat

**URL:** http://127.0.0.1:9173/articles_multimodal_reference_mapping.html

**Contents:**
- Multimodal reference mapping
    - Compiled: October 31, 2023
- Intro: Seurat v4 Reference Mapping
- Example 1: Mapping human peripheral blood cells
  - A Multimodal PBMC Reference Dataset
  - Mapping
  - Explore the mapping results
  - Computing a new UMAP visualiztion
- Example 2: Mapping human bone marrow cells
  - A Multimodal BMNC Reference Dataset
  - Computing an sPCA transformation
  - Computing a cached neighbor index
  - Query dataset preprocessing
  - Mapping
  - Explore the mapping results
- Contents

This vignette introduces the process of mapping query datasets to annotated references in Seurat. In this example, we map one of the first scRNA-seq datasets released by 10X Genomics of 2,700 PBMC to our recently described CITE-seq reference of 162,000 PBMC measured with 228 antibodies. We chose this example to demonstrate how supervised analysis guided by a reference dataset can help to enumerate cell states that would be challenging to find with unsupervised analysis. In a second example, we demonstrate how to serially map Human Cell Atlas datasets of human BMNC profiled from different individuals onto a consistent reference.

We have previously demonstrated how to use reference-mapping approach to annotate cell labels in a query dataset . In Seurat v4, we have substantially improved the speed and memory requirements for integrative tasks including reference mapping, and also include new functionality to project query cells onto a previously computed UMAP visualization.

In this vignette, we demonstrate how to use a previously established reference to interpret an scRNA-seq query:

To run this vignette please install Seurat v4, available on CRAN. Additionally, you will need to install the SeuratDisk package.

We load the reference from our recent paper, and visualize the pre-computed UMAP.

To demonstrate mapping to this multimodal reference, we will use a dataset of 2,700 PBMCs generated by 10x Genomics and available via SeuratData.

The reference was normalized using SCTransform(), so we use the same approach to normalize the query here.

We then find anchors between reference and query. As described in the manuscript, we used a precomputed supervised PCA (spca) transformation for this example. We recommend the use of supervised PCA for CITE-seq datasets, and demonstrate how to compute this transformation on the next tab of this vignette. However, you can also use a standard PCA transformation.

We then transfer cell type labels and protein data from the reference to the query. Additionally, we project the query data onto the UMAP structure of the reference.

What is MapQuery doing?

MapQuery() is a wrapper around three functions: TransferData(), IntegrateEmbeddings(), and ProjectUMAP(). TransferData() is used to transfer cell type labels and impute the ADT values. IntegrateEmbeddings() and ProjectUMAP() are used to project the query data onto the UMAP structure of the reference. The equivalent code for doing this with the intermediate functions is below:

We can now visualize the 2,700 query cells. They have been projected into a UMAP visualization defined by the reference, and each has received annotations at two levels of granularity (level 1, and level 2).

The reference-mapped dataset helps us identify cell types that were previously blended in an unsupervised analysis of the query dataset. Just a few examples include plasmacytoid dendritic cells (pDC), hematopoietic stem and progenitor cells (HSPC), regulatory T cells (Treg), CD8 Naive T cells, cells, CD56+ NK cells, memory, and naive B cells, and plasmablasts.

Each prediction is assigned a score between 0 and 1.

We can verify our predictions by exploring the expression of canonical marker genes. For example, CLEC4C and LIRA4 have been reported as markers of pDC identity, consistent with our predictions. Similarly, if we perform differential expression to identify markers of Tregs, we identify a set of canonical markers including RTKN2, CTLA4, FOXP3, and IL2RA.

Finally, we can visualize the imputed levels of surface protein, which were inferred based on the CITE-seq reference.

In the previous examples, we visualize the query cells after mapping to the reference-derived UMAP. Keeping a consistent visualization can assist with the interpretation of new datasets. However, if there are cell states that are present in the query dataset that are not represented in the reference, they will project to the most similar cell in the reference. This is the expected behavior and functionality as established by the UMAP package, but can potentially mask the presence of new cell types in the query which may be of interest.

In our manuscript, we map a query dataset containing developing and differentiated neutrophils, which are not included in our reference. We find that computing a new UMAP (‘de novo visualization’) after merging the reference and query can help to identify these populations, as demonstrated in Supplementary Figure 8. In the ‘de novo’ visualization, unique cell states in the query remain separated. In this example, the 2,700 PBMC does not contain unique cell states, but we demonstrate how to compute this visualization below.

We emphasize that if users are attempting to map datasets where the underlying samples are not PBMC, or contain cell types that are not present in the reference, computing a ‘de novo’ visualization is an important step in interpreting their dataset.

As a second example, we map a dataset of human bone marrow mononuclear (BMNC) cells from eight individual donors, produced by the Human Cell Atlas. As a reference, we use the CITE-seq reference of human BMNC that we analyzed using weighted-nearest neighbor analysis (WNN).

This vignette exhibits the same reference-mapping functionality as the PBMC example on the previous tab. In addition, we also demonstrate:

The reference dataset contains a WNN graph, reflecting a weighted combination of the RNA and protein data in this CITE-seq experiment.

We can compute a UMAP visualization based on this graph. We set return.model = TRUE, which will enable us to project query datasets onto this visualization.

As described in our manuscript, we first compute a ‘supervised’ PCA. This identifies the transformation of the transcriptome data that best encapsulates the structure of the WNN graph. This allows a weighted combination of the protein and RNA measurements to ‘supervise’ the PCA, and highlight the most relevant sources of variation. After computing this transformation, we can project it onto a query dataset. We can also compute and project a PCA projection, but recommend the use of sPCA when working with multimodal references that have been constructed with WNN analysis.

The sPCA calculation is performed once, and then can be rapidly projected onto each query dataset.

Since we will be mapping multiple query samples to the same reference, we can cache particular steps that only involve the reference. This step is optional but will improve speed when mapping multiple samples.

We compute the first 50 neighbors in the sPCA space of the reference. We store this information in the spca.annoy.neighbors object within the reference Seurat object and also cache the annoy index data structure (via cache.index = TRUE).

How can I save and load a cached annoy index?

If you want to save and load a cached index for a Neighbor object generated with method = "annoy" and cache.index = TRUE, use the SaveAnnoyIndex()/LoadAnnoyIndex() functions. Importantly, this index cannot be saved normally to an RDS or RDA file, so it will not persist correctly across R session restarts or saveRDS/readRDS for the Seurat object containing it. Instead, use LoadAnnoyIndex() to add the Annoy index to the Neighbor object every time R restarts or you load the reference Seurat object from RDS. The file created by SaveAnnoyIndex() can be distributed along with a reference Seurat object, and added to the Neighbor object in the reference.

Here we will demonstrate mapping multiple donor bone marrow samples to the multimodal bone marrow reference. These query datasets are derived from the Human Cell Atlas (HCA) Immune Cell Atlas Bone marrow dataset and are available through SeuratData. This dataset is provided as a single merged object with 8 donors. We first split the data back into 8 separate Seurat objects, one for each original donor to map individually.

We then normalize the query in the same manner as the reference. Here, the reference was normalized using log-normalization via NormalizeData(). If the reference had been normalized using SCTransform(), the query must be normalized with SCTransform() as well.

We then find anchors between each donor query dataset and the multimodal reference. This command is optimized to minimize mapping time, by passing in a pre-computed set of reference neighbors, and turning off anchor filtration.

We then individually map each of the datasets.

Now that mapping is complete, we can visualize the results for individual objects

We can also merge all the objects into one dataset. Note that they have all been integrated into a common space, defined by the reference. We can then visualize the results together.

We can visualize gene expression, cluster prediction scores, and (imputed) surface protein levels in the query cells:

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.0.7.

**Examples:**

Example 1 (unknown):
```unknown
vignettes/multimodal_reference_mapping.Rmd
```

Example 2 (unknown):
```unknown
multimodal_reference_mapping.Rmd
```

Example 3 (unknown):
```unknown
library(Seurat)
library(ggplot2)
library(patchwork)
```

Example 4 (r):
```r
library(Seurat)
library(ggplot2)
library(patchwork)
```

Example 5 (r):
```r
library(Seurat)
library(ggplot2)
library(patchwork)
```

Example 6 (unknown):
```unknown
options(SeuratData.repo.use = "http://seurat.nygenome.org")
```

Example 7 (r):
```r
options(SeuratData.repo.use = "http://seurat.nygenome.org")
```

Example 8 (r):
```r
options(SeuratData.repo.use = "http://seurat.nygenome.org")
```

Example 9 (unknown):
```unknown
reference <- readRDS("/brahms/hartmana/vignette_data/pbmc_multimodal_2023.rds")
```

Example 10 (r):
```r
reference <- readRDS("/brahms/hartmana/vignette_data/pbmc_multimodal_2023.rds")
```

Example 11 (r):
```r
reference <- readRDS("/brahms/hartmana/vignette_data/pbmc_multimodal_2023.rds")
```

Example 12 (unknown):
```unknown
DimPlot(object = reference, reduction = "wnn.umap", group.by = "celltype.l2", label = TRUE, label.size = 3, repel = TRUE) + NoLegend()
```

Example 13 (r):
```r
DimPlot(object = reference, reduction = "wnn.umap", group.by = "celltype.l2", label = TRUE, label.size = 3, repel = TRUE) + NoLegend()
```

Example 14 (r):
```r
DimPlot(object = reference, reduction = "wnn.umap", group.by = "celltype.l2", label = TRUE, label.size = 3, repel = TRUE) + NoLegend()
```

Example 15 (unknown):
```unknown
library(SeuratData)
InstallData('pbmc3k')

pbmc3k <- LoadData('pbmc3k')
pbmc3k <- UpdateSeuratObject(pbmc3k)
```

Example 16 (r):
```r
library(SeuratData)
InstallData('pbmc3k')

pbmc3k <- LoadData('pbmc3k')
pbmc3k <- UpdateSeuratObject(pbmc3k)
```

Example 17 (r):
```r
library(SeuratData)
InstallData('pbmc3k')

pbmc3k <- LoadData('pbmc3k')
pbmc3k <- UpdateSeuratObject(pbmc3k)
```

Example 18 (unknown):
```unknown
SCTransform()
```

Example 19 (unknown):
```unknown
pbmc3k <- SCTransform(pbmc3k, verbose = FALSE)
```

Example 20 (r):
```r
pbmc3k <- SCTransform(pbmc3k, verbose = FALSE)
```

Example 21 (r):
```r
pbmc3k <- SCTransform(pbmc3k, verbose = FALSE)
```

Example 22 (unknown):
```unknown
anchors <- FindTransferAnchors(
  reference = reference,
  query = pbmc3k,
  normalization.method = "SCT",
  reference.reduction = "spca",
  dims = 1:50
)
```

Example 23 (r):
```r
anchors <- FindTransferAnchors(
  reference = reference,
  query = pbmc3k,
  normalization.method = "SCT",
  reference.reduction = "spca",
  dims = 1:50
)
```

Example 24 (r):
```r
anchors <- FindTransferAnchors(
  reference = reference,
  query = pbmc3k,
  normalization.method = "SCT",
  reference.reduction = "spca",
  dims = 1:50
)
```

Example 25 (unknown):
```unknown
pbmc3k <- MapQuery(
  anchorset = anchors,
  query = pbmc3k,
  reference = reference,
  refdata = list(
    celltype.l1 = "celltype.l1",
    celltype.l2 = "celltype.l2",
    predicted_ADT = "ADT"
  ),
  reference.reduction = "spca", 
  reduction.model = "wnn.umap"
)
```

Example 26 (r):
```r
pbmc3k <- MapQuery(
  anchorset = anchors,
  query = pbmc3k,
  reference = reference,
  refdata = list(
    celltype.l1 = "celltype.l1",
    celltype.l2 = "celltype.l2",
    predicted_ADT = "ADT"
  ),
  reference.reduction = "spca", 
  reduction.model = "wnn.umap"
)
```

Example 27 (r):
```r
pbmc3k <- MapQuery(
  anchorset = anchors,
  query = pbmc3k,
  reference = reference,
  refdata = list(
    celltype.l1 = "celltype.l1",
    celltype.l2 = "celltype.l2",
    predicted_ADT = "ADT"
  ),
  reference.reduction = "spca", 
  reduction.model = "wnn.umap"
)
```

Example 28 (unknown):
```unknown
TransferData()
```

Example 29 (unknown):
```unknown
IntegrateEmbeddings()
```

Example 30 (unknown):
```unknown
ProjectUMAP()
```

Example 31 (unknown):
```unknown
TransferData()
```

Example 32 (unknown):
```unknown
IntegrateEmbeddings()
```

Example 33 (unknown):
```unknown
ProjectUMAP()
```

Example 34 (unknown):
```unknown
pbmc3k <- TransferData(
  anchorset = anchors, 
  reference = reference,
  query = pbmc3k,
  refdata = list(
    celltype.l1 = "celltype.l1",
    celltype.l2 = "celltype.l2",
    predicted_ADT = "ADT")
)
pbmc3k <- IntegrateEmbeddings(
  anchorset = anchors,
  reference = reference,
  query = pbmc3k, 
  new.reduction.name = "ref.spca"
)
pbmc3k <- ProjectUMAP(
  query = pbmc3k, 
  query.reduction = "ref.spca", 
  reference = reference, 
  reference.reduction = "spca", 
  reduction.model = "wnn.umap"
)
```

Example 35 (r):
```r
pbmc3k <- TransferData(
  anchorset = anchors, 
  reference = reference,
  query = pbmc3k,
  refdata = list(
    celltype.l1 = "celltype.l1",
    celltype.l2 = "celltype.l2",
    predicted_ADT = "ADT")
)
pbmc3k <- IntegrateEmbeddings(
  anchorset = anchors,
  reference = reference,
  query = pbmc3k, 
  new.reduction.name = "ref.spca"
)
pbmc3k <- ProjectUMAP(
  query = pbmc3k, 
  query.reduction = "ref.spca", 
  reference = reference, 
  reference.reduction = "spca", 
  reduction.model = "wnn.umap"
)
```

Example 36 (r):
```r
pbmc3k <- TransferData(
  anchorset = anchors, 
  reference = reference,
  query = pbmc3k,
  refdata = list(
    celltype.l1 = "celltype.l1",
    celltype.l2 = "celltype.l2",
    predicted_ADT = "ADT")
)
pbmc3k <- IntegrateEmbeddings(
  anchorset = anchors,
  reference = reference,
  query = pbmc3k, 
  new.reduction.name = "ref.spca"
)
pbmc3k <- ProjectUMAP(
  query = pbmc3k, 
  query.reduction = "ref.spca", 
  reference = reference, 
  reference.reduction = "spca", 
  reduction.model = "wnn.umap"
)
```

Example 37 (unknown):
```unknown
p1 = DimPlot(pbmc3k, reduction = "ref.umap", group.by = "predicted.celltype.l1", label = TRUE, label.size = 3, repel = TRUE) + NoLegend()
p2 = DimPlot(pbmc3k, reduction = "ref.umap", group.by = "predicted.celltype.l2", label = TRUE, label.size = 3 ,repel = TRUE) + NoLegend()
p1 + p2
```

Example 38 (r):
```r
p1 = DimPlot(pbmc3k, reduction = "ref.umap", group.by = "predicted.celltype.l1", label = TRUE, label.size = 3, repel = TRUE) + NoLegend()
p2 = DimPlot(pbmc3k, reduction = "ref.umap", group.by = "predicted.celltype.l2", label = TRUE, label.size = 3 ,repel = TRUE) + NoLegend()
p1 + p2
```

Example 39 (r):
```r
p1 = DimPlot(pbmc3k, reduction = "ref.umap", group.by = "predicted.celltype.l1", label = TRUE, label.size = 3, repel = TRUE) + NoLegend()
p2 = DimPlot(pbmc3k, reduction = "ref.umap", group.by = "predicted.celltype.l2", label = TRUE, label.size = 3 ,repel = TRUE) + NoLegend()
p1 + p2
```

Example 40 (unknown):
```unknown
FeaturePlot(pbmc3k, features = c("pDC", "CD16 Mono", "Treg"),  reduction = "ref.umap", cols = c("lightgrey", "darkred"), ncol = 3) & theme(plot.title = element_text(size = 10))
```

Example 41 (r):
```r
FeaturePlot(pbmc3k, features = c("pDC", "CD16 Mono", "Treg"),  reduction = "ref.umap", cols = c("lightgrey", "darkred"), ncol = 3) & theme(plot.title = element_text(size = 10))
```

Example 42 (r):
```r
FeaturePlot(pbmc3k, features = c("pDC", "CD16 Mono", "Treg"),  reduction = "ref.umap", cols = c("lightgrey", "darkred"), ncol = 3) & theme(plot.title = element_text(size = 10))
```

Example 43 (unknown):
```unknown
library(ggplot2)
plot <- FeaturePlot(pbmc3k, features = "CD16 Mono",  reduction = "ref.umap", cols = c("lightgrey", "darkred"))  + ggtitle("CD16 Mono") + theme(plot.title = element_text(hjust = 0.5, size = 30)) + labs(color = "Prediction Score") +  xlab("UMAP 1") + ylab("UMAP 2") + 
  theme(axis.title = element_text(size = 18), legend.text = element_text(size = 18), legend.title = element_text(size = 25)) 
ggsave(filename = "../output/images/multimodal_reference_mapping.jpg", height = 7, width = 12, plot = plot, quality = 50)
```

Example 44 (r):
```r
library(ggplot2)
plot <- FeaturePlot(pbmc3k, features = "CD16 Mono",  reduction = "ref.umap", cols = c("lightgrey", "darkred"))  + ggtitle("CD16 Mono") + theme(plot.title = element_text(hjust = 0.5, size = 30)) + labs(color = "Prediction Score") +  xlab("UMAP 1") + ylab("UMAP 2") + 
  theme(axis.title = element_text(size = 18), legend.text = element_text(size = 18), legend.title = element_text(size = 25)) 
ggsave(filename = "../output/images/multimodal_reference_mapping.jpg", height = 7, width = 12, plot = plot, quality = 50)
```

Example 45 (r):
```r
library(ggplot2)
plot <- FeaturePlot(pbmc3k, features = "CD16 Mono",  reduction = "ref.umap", cols = c("lightgrey", "darkred"))  + ggtitle("CD16 Mono") + theme(plot.title = element_text(hjust = 0.5, size = 30)) + labs(color = "Prediction Score") +  xlab("UMAP 1") + ylab("UMAP 2") + 
  theme(axis.title = element_text(size = 18), legend.text = element_text(size = 18), legend.title = element_text(size = 25)) 
ggsave(filename = "../output/images/multimodal_reference_mapping.jpg", height = 7, width = 12, plot = plot, quality = 50)
```

Example 46 (unknown):
```unknown
Idents(pbmc3k) <- 'predicted.celltype.l2'
VlnPlot(pbmc3k, features = c("CLEC4C", "LILRA4"), sort = TRUE) + NoLegend()
```

Example 47 (r):
```r
Idents(pbmc3k) <- 'predicted.celltype.l2'
VlnPlot(pbmc3k, features = c("CLEC4C", "LILRA4"), sort = TRUE) + NoLegend()
```

Example 48 (r):
```r
Idents(pbmc3k) <- 'predicted.celltype.l2'
VlnPlot(pbmc3k, features = c("CLEC4C", "LILRA4"), sort = TRUE) + NoLegend()
```

Example 49 (python):
```python
treg_markers <- FindMarkers(pbmc3k, ident.1 = "Treg", only.pos = TRUE, logfc.threshold = 0.1)
print(head(treg_markers))
```

Example 50 (r):
```r
treg_markers <- FindMarkers(pbmc3k, ident.1 = "Treg", only.pos = TRUE, logfc.threshold = 0.1)
print(head(treg_markers))
```

Example 51 (r):
```r
treg_markers <- FindMarkers(pbmc3k, ident.1 = "Treg", only.pos = TRUE, logfc.threshold = 0.1)
print(head(treg_markers))
```

Example 52 (unknown):
```unknown
##                       p_val avg_log2FC pct.1 pct.2    p_val_adj
## AC004854.4     4.795409e-26   7.800900 0.042 0.000 6.028789e-22
## RP11-297N6.4   4.795409e-26   7.800900 0.042 0.000 6.028789e-22
## RTKN2          4.795409e-26   7.800900 0.042 0.000 6.028789e-22
## CTD-2020K17.4  4.795409e-26   7.800900 0.042 0.000 6.028789e-22
## RP11-1399P15.1 2.782841e-18   4.172869 0.292 0.021 3.498588e-14
## IL2RA          1.808612e-14   4.137935 0.208 0.014 2.273787e-10
```

Example 53 (unknown):
```unknown
##                       p_val avg_log2FC pct.1 pct.2    p_val_adj
## AC004854.4     4.795409e-26   7.800900 0.042 0.000 6.028789e-22
## RP11-297N6.4   4.795409e-26   7.800900 0.042 0.000 6.028789e-22
## RTKN2          4.795409e-26   7.800900 0.042 0.000 6.028789e-22
## CTD-2020K17.4  4.795409e-26   7.800900 0.042 0.000 6.028789e-22
## RP11-1399P15.1 2.782841e-18   4.172869 0.292 0.021 3.498588e-14
## IL2RA          1.808612e-14   4.137935 0.208 0.014 2.273787e-10
```

Example 54 (unknown):
```unknown
DefaultAssay(pbmc3k) <- 'predicted_ADT'
# see a list of proteins: rownames(pbmc3k)
FeaturePlot(pbmc3k, features = c("CD3-1", "CD45RA", "IgD"), reduction = "ref.umap", cols = c("lightgrey", "darkgreen"), ncol = 3)
```

Example 55 (r):
```r
DefaultAssay(pbmc3k) <- 'predicted_ADT'
# see a list of proteins: rownames(pbmc3k)
FeaturePlot(pbmc3k, features = c("CD3-1", "CD45RA", "IgD"), reduction = "ref.umap", cols = c("lightgrey", "darkgreen"), ncol = 3)
```

Example 56 (r):
```r
DefaultAssay(pbmc3k) <- 'predicted_ADT'
# see a list of proteins: rownames(pbmc3k)
FeaturePlot(pbmc3k, features = c("CD3-1", "CD45RA", "IgD"), reduction = "ref.umap", cols = c("lightgrey", "darkgreen"), ncol = 3)
```

Example 57 (unknown):
```unknown
reference <- DietSeurat(reference, counts = FALSE, dimreducs = "spca")
pbmc3k <- DietSeurat(pbmc3k, counts = FALSE, dimreducs = "ref.spca")
```

Example 58 (r):
```r
reference <- DietSeurat(reference, counts = FALSE, dimreducs = "spca")
pbmc3k <- DietSeurat(pbmc3k, counts = FALSE, dimreducs = "ref.spca")
```

Example 59 (r):
```r
reference <- DietSeurat(reference, counts = FALSE, dimreducs = "spca")
pbmc3k <- DietSeurat(pbmc3k, counts = FALSE, dimreducs = "ref.spca")
```

Example 60 (unknown):
```unknown
#merge reference and query
reference$id <- 'reference'
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', shuffle = TRUE)
```

Example 61 (r):
```r
#merge reference and query
reference$id <- 'reference'
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', shuffle = TRUE)
```

Example 62 (r):
```r
#merge reference and query
reference$id <- 'reference'
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', shuffle = TRUE)
```

Example 63 (unknown):
```unknown
# Both datasets are available through SeuratData
library(SeuratData)
#load reference data
InstallData("bmcite")
bm <- LoadData(ds = "bmcite")
#load query data
InstallData('hcabm40k')
hcabm40k <- LoadData(ds = "hcabm40k")
```

Example 64 (r):
```r
# Both datasets are available through SeuratData
library(SeuratData)
#load reference data
InstallData("bmcite")
bm <- LoadData(ds = "bmcite")
#load query data
InstallData('hcabm40k')
hcabm40k <- LoadData(ds = "hcabm40k")
```

Example 65 (r):
```r
# Both datasets are available through SeuratData
library(SeuratData)
#load reference data
InstallData("bmcite")
bm <- LoadData(ds = "bmcite")
#load query data
InstallData('hcabm40k')
hcabm40k <- LoadData(ds = "hcabm40k")
```

Example 66 (unknown):
```unknown
return.model = TRUE
```

Example 67 (unknown):
```unknown
bm <- RunUMAP(bm, nn.name = "weighted.nn", reduction.name = "wnn.umap", 
              reduction.key = "wnnUMAP_", return.model = TRUE)
DimPlot(bm, group.by = "celltype.l2", reduction = "wnn.umap")
```

Example 68 (r):
```r
bm <- RunUMAP(bm, nn.name = "weighted.nn", reduction.name = "wnn.umap", 
              reduction.key = "wnnUMAP_", return.model = TRUE)
DimPlot(bm, group.by = "celltype.l2", reduction = "wnn.umap")
```

Example 69 (r):
```r
bm <- RunUMAP(bm, nn.name = "weighted.nn", reduction.name = "wnn.umap", 
              reduction.key = "wnnUMAP_", return.model = TRUE)
DimPlot(bm, group.by = "celltype.l2", reduction = "wnn.umap")
```

Example 70 (unknown):
```unknown
bm <- ScaleData(bm, assay = 'RNA')
bm <- RunSPCA(bm, assay = 'RNA', graph = 'wsnn')
```

Example 71 (r):
```r
bm <- ScaleData(bm, assay = 'RNA')
bm <- RunSPCA(bm, assay = 'RNA', graph = 'wsnn')
```

Example 72 (r):
```r
bm <- ScaleData(bm, assay = 'RNA')
bm <- RunSPCA(bm, assay = 'RNA', graph = 'wsnn')
```

Example 73 (unknown):
```unknown
spca.annoy.neighbors
```

Example 74 (unknown):
```unknown
cache.index = TRUE
```

Example 75 (unknown):
```unknown
bm <- FindNeighbors(
  object = bm,
  reduction = "spca",
  dims = 1:50,
  graph.name = "spca.annoy.neighbors", 
  k.param = 50,
  cache.index = TRUE,
  return.neighbor = TRUE,
  l2.norm = TRUE
)
```

Example 76 (r):
```r
bm <- FindNeighbors(
  object = bm,
  reduction = "spca",
  dims = 1:50,
  graph.name = "spca.annoy.neighbors", 
  k.param = 50,
  cache.index = TRUE,
  return.neighbor = TRUE,
  l2.norm = TRUE
)
```

Example 77 (r):
```r
bm <- FindNeighbors(
  object = bm,
  reduction = "spca",
  dims = 1:50,
  graph.name = "spca.annoy.neighbors", 
  k.param = 50,
  cache.index = TRUE,
  return.neighbor = TRUE,
  l2.norm = TRUE
)
```

Example 78 (unknown):
```unknown
method = "annoy"
```

Example 79 (unknown):
```unknown
cache.index = TRUE
```

Example 80 (unknown):
```unknown
SaveAnnoyIndex()
```

Example 81 (unknown):
```unknown
LoadAnnoyIndex()
```

Example 82 (unknown):
```unknown
LoadAnnoyIndex()
```

Example 83 (unknown):
```unknown
SaveAnnoyIndex()
```

Example 84 (unknown):
```unknown
bm[["spca.annoy.neighbors"]]
```

Example 85 (r):
```r
bm[["spca.annoy.neighbors"]]
```

Example 86 (r):
```r
bm[["spca.annoy.neighbors"]]
```

Example 87 (unknown):
```unknown
## A Neighbor object containing the 50 nearest neighbors for 30672 cells
```

Example 88 (unknown):
```unknown
## A Neighbor object containing the 50 nearest neighbors for 30672 cells
```

Example 89 (unknown):
```unknown
SaveAnnoyIndex(object = bm[["spca.annoy.neighbors"]], file = "/brahms/shared/vignette-data/reftmp.idx")
bm[["spca.annoy.neighbors"]] <- LoadAnnoyIndex(object = bm[["spca.annoy.neighbors"]], file = "/brahms/shared/vignette-data/reftmp.idx")
```

Example 90 (r):
```r
SaveAnnoyIndex(object = bm[["spca.annoy.neighbors"]], file = "/brahms/shared/vignette-data/reftmp.idx")
bm[["spca.annoy.neighbors"]] <- LoadAnnoyIndex(object = bm[["spca.annoy.neighbors"]], file = "/brahms/shared/vignette-data/reftmp.idx")
```

Example 91 (r):
```r
SaveAnnoyIndex(object = bm[["spca.annoy.neighbors"]], file = "/brahms/shared/vignette-data/reftmp.idx")
bm[["spca.annoy.neighbors"]] <- LoadAnnoyIndex(object = bm[["spca.annoy.neighbors"]], file = "/brahms/shared/vignette-data/reftmp.idx")
```

Example 92 (unknown):
```unknown
library(dplyr)
library(SeuratData)
InstallData('hcabm40k')
hcabm40k.batches <- SplitObject(hcabm40k, split.by = "orig.ident")
```

Example 93 (r):
```r
library(dplyr)
library(SeuratData)
InstallData('hcabm40k')
hcabm40k.batches <- SplitObject(hcabm40k, split.by = "orig.ident")
```

Example 94 (r):
```r
library(dplyr)
library(SeuratData)
InstallData('hcabm40k')
hcabm40k.batches <- SplitObject(hcabm40k, split.by = "orig.ident")
```

Example 95 (unknown):
```unknown
NormalizeData()
```

Example 96 (unknown):
```unknown
SCTransform()
```

Example 97 (unknown):
```unknown
SCTransform()
```

Example 98 (unknown):
```unknown
hcabm40k.batches <- lapply(X = hcabm40k.batches, FUN = NormalizeData, verbose = FALSE)
```

Example 99 (r):
```r
hcabm40k.batches <- lapply(X = hcabm40k.batches, FUN = NormalizeData, verbose = FALSE)
```

Example 100 (r):
```r
hcabm40k.batches <- lapply(X = hcabm40k.batches, FUN = NormalizeData, verbose = FALSE)
```

Example 101 (unknown):
```unknown
anchors <- list()
for (i in 1:length(hcabm40k.batches)) {
  anchors[[i]] <- FindTransferAnchors(
    reference = bm,
    query = hcabm40k.batches[[i]],
    k.filter = NA,
    reference.reduction = "spca", 
    reference.neighbors = "spca.annoy.neighbors", 
    dims = 1:50
  )
}
```

Example 102 (r):
```r
anchors <- list()
for (i in 1:length(hcabm40k.batches)) {
  anchors[[i]] <- FindTransferAnchors(
    reference = bm,
    query = hcabm40k.batches[[i]],
    k.filter = NA,
    reference.reduction = "spca", 
    reference.neighbors = "spca.annoy.neighbors", 
    dims = 1:50
  )
}
```

Example 103 (r):
```r
anchors <- list()
for (i in 1:length(hcabm40k.batches)) {
  anchors[[i]] <- FindTransferAnchors(
    reference = bm,
    query = hcabm40k.batches[[i]],
    k.filter = NA,
    reference.reduction = "spca", 
    reference.neighbors = "spca.annoy.neighbors", 
    dims = 1:50
  )
}
```

Example 104 (unknown):
```unknown
for (i in 1:length(hcabm40k.batches)) {
  hcabm40k.batches[[i]] <- MapQuery(
    anchorset = anchors[[i]], 
    query = hcabm40k.batches[[i]],
    reference = bm, 
    refdata = list(
      celltype = "celltype.l2", 
      predicted_ADT = "ADT"),
    reference.reduction = "spca",
    reduction.model = "wnn.umap"
  )
}
```

Example 105 (r):
```r
for (i in 1:length(hcabm40k.batches)) {
  hcabm40k.batches[[i]] <- MapQuery(
    anchorset = anchors[[i]], 
    query = hcabm40k.batches[[i]],
    reference = bm, 
    refdata = list(
      celltype = "celltype.l2", 
      predicted_ADT = "ADT"),
    reference.reduction = "spca",
    reduction.model = "wnn.umap"
  )
}
```

Example 106 (r):
```r
for (i in 1:length(hcabm40k.batches)) {
  hcabm40k.batches[[i]] <- MapQuery(
    anchorset = anchors[[i]], 
    query = hcabm40k.batches[[i]],
    reference = bm, 
    refdata = list(
      celltype = "celltype.l2", 
      predicted_ADT = "ADT"),
    reference.reduction = "spca",
    reduction.model = "wnn.umap"
  )
}
```

Example 107 (unknown):
```unknown
p1 <- DimPlot(hcabm40k.batches[[1]], reduction = 'ref.umap', group.by = 'predicted.celltype', label.size = 3)
p2 <- DimPlot(hcabm40k.batches[[2]], reduction = 'ref.umap', group.by = 'predicted.celltype', label.size = 3)
p1 + p2 + plot_layout(guides = "collect")
```

Example 108 (r):
```r
p1 <- DimPlot(hcabm40k.batches[[1]], reduction = 'ref.umap', group.by = 'predicted.celltype', label.size = 3)
p2 <- DimPlot(hcabm40k.batches[[2]], reduction = 'ref.umap', group.by = 'predicted.celltype', label.size = 3)
p1 + p2 + plot_layout(guides = "collect")
```

Example 109 (r):
```r
p1 <- DimPlot(hcabm40k.batches[[1]], reduction = 'ref.umap', group.by = 'predicted.celltype', label.size = 3)
p2 <- DimPlot(hcabm40k.batches[[2]], reduction = 'ref.umap', group.by = 'predicted.celltype', label.size = 3)
p1 + p2 + plot_layout(guides = "collect")
```

Example 110 (unknown):
```unknown
# Merge the batches 
hcabm40k <- merge(hcabm40k.batches[[1]], hcabm40k.batches[2:length(hcabm40k.batches)], merge.dr = "ref.umap")
DimPlot(hcabm40k, reduction = "ref.umap", group.by =  "predicted.celltype", label = TRUE, repel = TRUE, label.size = 3) + NoLegend()
```

Example 111 (r):
```r
# Merge the batches 
hcabm40k <- merge(hcabm40k.batches[[1]], hcabm40k.batches[2:length(hcabm40k.batches)], merge.dr = "ref.umap")
DimPlot(hcabm40k, reduction = "ref.umap", group.by =  "predicted.celltype", label = TRUE, repel = TRUE, label.size = 3) + NoLegend()
```

Example 112 (r):
```r
# Merge the batches 
hcabm40k <- merge(hcabm40k.batches[[1]], hcabm40k.batches[2:length(hcabm40k.batches)], merge.dr = "ref.umap")
DimPlot(hcabm40k, reduction = "ref.umap", group.by =  "predicted.celltype", label = TRUE, repel = TRUE, label.size = 3) + NoLegend()
```

Example 113 (unknown):
```unknown
p3 <- FeaturePlot(hcabm40k, features = c("rna_TRDC", "rna_MPO", "rna_AVP"), reduction = 'ref.umap', 
                  max.cutoff = 3, ncol = 3)

# cell type prediction scores
DefaultAssay(hcabm40k) <- 'prediction.score.celltype'
p4 <- FeaturePlot(hcabm40k, features = c("CD16 Mono", "HSC", "Prog-RBC"), ncol = 3, 
                  cols = c("lightgrey", "darkred"))

# imputed protein levels
DefaultAssay(hcabm40k) <- 'predicted_ADT'
p5 <- FeaturePlot(hcabm40k, features = c("CD45RA", "CD16", "CD161"), reduction = 'ref.umap',
                  min.cutoff = 'q10', max.cutoff = 'q99', cols = c("lightgrey", "darkgreen") ,
                  ncol = 3)
p3 / p4 / p5
```

Example 114 (r):
```r
p3 <- FeaturePlot(hcabm40k, features = c("rna_TRDC", "rna_MPO", "rna_AVP"), reduction = 'ref.umap', 
                  max.cutoff = 3, ncol = 3)

# cell type prediction scores
DefaultAssay(hcabm40k) <- 'prediction.score.celltype'
p4 <- FeaturePlot(hcabm40k, features = c("CD16 Mono", "HSC", "Prog-RBC"), ncol = 3, 
                  cols = c("lightgrey", "darkred"))

# imputed protein levels
DefaultAssay(hcabm40k) <- 'predicted_ADT'
p5 <- FeaturePlot(hcabm40k, features = c("CD45RA", "CD16", "CD161"), reduction = 'ref.umap',
                  min.cutoff = 'q10', max.cutoff = 'q99', cols = c("lightgrey", "darkgreen") ,
                  ncol = 3)
p3 / p4 / p5
```

Example 115 (r):
```r
p3 <- FeaturePlot(hcabm40k, features = c("rna_TRDC", "rna_MPO", "rna_AVP"), reduction = 'ref.umap', 
                  max.cutoff = 3, ncol = 3)

# cell type prediction scores
DefaultAssay(hcabm40k) <- 'prediction.score.celltype'
p4 <- FeaturePlot(hcabm40k, features = c("CD16 Mono", "HSC", "Prog-RBC"), ncol = 3, 
                  cols = c("lightgrey", "darkred"))

# imputed protein levels
DefaultAssay(hcabm40k) <- 'predicted_ADT'
p5 <- FeaturePlot(hcabm40k, features = c("CD45RA", "CD16", "CD161"), reduction = 'ref.umap',
                  min.cutoff = 'q10', max.cutoff = 'q99', cols = c("lightgrey", "darkgreen") ,
                  ncol = 3)
p3 / p4 / p5
```

Example 116 (unknown):
```unknown
sessionInfo()
```

Example 117 (r):
```r
sessionInfo()
```

Example 118 (r):
```r
sessionInfo()
```

Example 119 (unknown):
```unknown
## R version 4.2.2 Patched (2022-11-10 r83330)
## Platform: x86_64-pc-linux-gnu (64-bit)
## Running under: Ubuntu 20.04.6 LTS
## 
## Matrix products: default
## BLAS:   /usr/lib/x86_64-linux-gnu/blas/libblas.so.3.9.0
## LAPACK: /usr/lib/x86_64-linux-gnu/lapack/liblapack.so.3.9.0
## 
## locale:
##  [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C              
##  [3] LC_TIME=en_US.UTF-8        LC_COLLATE=en_US.UTF-8    
##  [5] LC_MONETARY=en_US.UTF-8    LC_MESSAGES=en_US.UTF-8   
##  [7] LC_PAPER=en_US.UTF-8       LC_NAME=C                 
##  [9] LC_ADDRESS=C               LC_TELEPHONE=C            
## [11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C       
## 
## attached base packages:
## [1] stats     graphics  grDevices utils     datasets  methods   base     
## 
## other attached packages:
##  [1] dplyr_1.1.3                   thp1.eccite.SeuratData_3.1.5 
##  [3] stxBrain.SeuratData_0.1.1     ssHippo.SeuratData_3.1.4     
##  [5] pbmcsca.SeuratData_3.0.0      pbmcref.SeuratData_1.0.0     
##  [7] pbmcMultiome.SeuratData_0.1.4 pbmc3k.SeuratData_3.1.4      
##  [9] panc8.SeuratData_3.0.2        ifnb.SeuratData_3.0.0        
## [11] hcabm40k.SeuratData_3.0.0     cbmc.SeuratData_3.1.4        
## [13] bmcite.SeuratData_0.3.0       SeuratData_0.2.2.9001        
## [15] patchwork_1.1.3               ggplot2_3.4.4                
## [17] Seurat_5.0.0                  SeuratObject_5.0.0           
## [19] sp_2.1-1                     
## 
## loaded via a namespace (and not attached):
##   [1] utf8_1.2.4                  spatstat.explore_3.2-5     
##   [3] reticulate_1.34.0           tidyselect_1.2.0           
##   [5] htmlwidgets_1.6.2           grid_4.2.2                 
##   [7] Rtsne_0.16                  munsell_0.5.0              
##   [9] codetools_0.2-19            ragg_1.2.5                 
##  [11] ica_1.0-3                   future_1.33.0              
##  [13] miniUI_0.1.1.1              withr_2.5.2                
##  [15] spatstat.random_3.2-1       colorspace_2.1-0           
##  [17] progressr_0.14.0            Biobase_2.58.0             
##  [19] highr_0.10                  knitr_1.45                 
##  [21] stats4_4.2.2                ROCR_1.0-11                
##  [23] tensor_1.5                  listenv_0.9.0              
##  [25] MatrixGenerics_1.10.0       labeling_0.4.3             
##  [27] GenomeInfoDbData_1.2.9      polyclip_1.10-6            
##  [29] farver_2.1.1                rprojroot_2.0.3            
##  [31] parallelly_1.36.0           vctrs_0.6.4                
##  [33] generics_0.1.3              xfun_0.40                  
##  [35] R6_2.5.1                    GenomeInfoDb_1.34.9        
##  [37] ggbeeswarm_0.7.1            bitops_1.0-7               
##  [39] spatstat.utils_3.0-4        cachem_1.0.8               
##  [41] DelayedArray_0.24.0         promises_1.2.1             
##  [43] scales_1.2.1                beeswarm_0.4.0             
##  [45] gtable_0.3.4                globals_0.16.2             
##  [47] goftest_1.2-3               spam_2.10-0                
##  [49] rlang_1.1.1                 systemfonts_1.0.4          
##  [51] splines_4.2.2               lazyeval_0.2.2             
##  [53] spatstat.geom_3.2-7         yaml_2.3.7                 
##  [55] reshape2_1.4.4              abind_1.4-5                
##  [57] httpuv_1.6.12               tools_4.2.2                
##  [59] ellipsis_0.3.2              jquerylib_0.1.4            
##  [61] RColorBrewer_1.1-3          BiocGenerics_0.44.0        
##  [63] ggridges_0.5.4              Rcpp_1.0.11                
##  [65] plyr_1.8.9                  sparseMatrixStats_1.10.0   
##  [67] zlibbioc_1.44.0             purrr_1.0.2                
##  [69] RCurl_1.98-1.12             deldir_1.0-9               
##  [71] pbapply_1.7-2               cowplot_1.1.1              
##  [73] S4Vectors_0.36.2            zoo_1.8-12                 
##  [75] SummarizedExperiment_1.28.0 ggrepel_0.9.4              
##  [77] cluster_2.1.4               fs_1.6.3                   
##  [79] magrittr_2.0.3              data.table_1.14.8          
##  [81] RSpectra_0.16-1             glmGamPoi_1.10.2           
##  [83] scattermore_1.2             lmtest_0.9-40              
##  [85] RANN_2.6.1                  fitdistrplus_1.1-11        
##  [87] matrixStats_1.0.0           mime_0.12                  
##  [89] evaluate_0.22               xtable_1.8-4               
##  [91] fastDummies_1.7.3           IRanges_2.32.0             
##  [93] gridExtra_2.3               compiler_4.2.2             
##  [95] tibble_3.2.1                KernSmooth_2.23-22         
##  [97] crayon_1.5.2                htmltools_0.5.6.1          
##  [99] later_1.3.1                 tidyr_1.3.0                
## [101] MASS_7.3-58.2               rappdirs_0.3.3             
## [103] Matrix_1.6-1.1              cli_3.6.1                  
## [105] parallel_4.2.2              dotCall64_1.1-0            
## [107] igraph_1.5.1                GenomicRanges_1.50.2       
## [109] pkgconfig_2.0.3             pkgdown_2.0.7              
## [111] plotly_4.10.3               spatstat.sparse_3.0-3      
## [113] vipor_0.4.5                 bslib_0.5.1                
## [115] XVector_0.38.0              stringr_1.5.0              
## [117] digest_0.6.33               sctransform_0.4.1          
## [119] RcppAnnoy_0.0.21            spatstat.data_3.0-3        
## [121] rmarkdown_2.25              leiden_0.4.3               
## [123] uwot_0.1.16                 DelayedMatrixStats_1.20.0  
## [125] shiny_1.7.5.1               lifecycle_1.0.3            
## [127] nlme_3.1-162                jsonlite_1.8.7             
## [129] limma_3.54.1                desc_1.4.2                 
## [131] viridisLite_0.4.2           fansi_1.0.5                
## [133] pillar_1.9.0                lattice_0.21-9             
## [135] ggrastr_1.0.1               fastmap_1.1.1              
## [137] httr_1.4.7                  survival_3.5-7             
## [139] glue_1.6.2                  png_0.1-8                  
## [141] presto_1.0.0                stringi_1.7.12             
## [143] sass_0.4.7                  textshaping_0.3.6          
## [145] RcppHNSW_0.5.0              memoise_2.0.1              
## [147] irlba_2.3.5.1               future.apply_1.11.0
```

Example 120 (unknown):
```unknown
## R version 4.2.2 Patched (2022-11-10 r83330)
## Platform: x86_64-pc-linux-gnu (64-bit)
## Running under: Ubuntu 20.04.6 LTS
## 
## Matrix products: default
## BLAS:   /usr/lib/x86_64-linux-gnu/blas/libblas.so.3.9.0
## LAPACK: /usr/lib/x86_64-linux-gnu/lapack/liblapack.so.3.9.0
## 
## locale:
##  [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C              
##  [3] LC_TIME=en_US.UTF-8        LC_COLLATE=en_US.UTF-8    
##  [5] LC_MONETARY=en_US.UTF-8    LC_MESSAGES=en_US.UTF-8   
##  [7] LC_PAPER=en_US.UTF-8       LC_NAME=C                 
##  [9] LC_ADDRESS=C               LC_TELEPHONE=C            
## [11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C       
## 
## attached base packages:
## [1] stats     graphics  grDevices utils     datasets  methods   base     
## 
## other attached packages:
##  [1] dplyr_1.1.3                   thp1.eccite.SeuratData_3.1.5 
##  [3] stxBrain.SeuratData_0.1.1     ssHippo.SeuratData_3.1.4     
##  [5] pbmcsca.SeuratData_3.0.0      pbmcref.SeuratData_1.0.0     
##  [7] pbmcMultiome.SeuratData_0.1.4 pbmc3k.SeuratData_3.1.4      
##  [9] panc8.SeuratData_3.0.2        ifnb.SeuratData_3.0.0        
## [11] hcabm40k.SeuratData_3.0.0     cbmc.SeuratData_3.1.4        
## [13] bmcite.SeuratData_0.3.0       SeuratData_0.2.2.9001        
## [15] patchwork_1.1.3               ggplot2_3.4.4                
## [17] Seurat_5.0.0                  SeuratObject_5.0.0           
## [19] sp_2.1-1                     
## 
## loaded via a namespace (and not attached):
##   [1] utf8_1.2.4                  spatstat.explore_3.2-5     
##   [3] reticulate_1.34.0           tidyselect_1.2.0           
##   [5] htmlwidgets_1.6.2           grid_4.2.2                 
##   [7] Rtsne_0.16                  munsell_0.5.0              
##   [9] codetools_0.2-19            ragg_1.2.5                 
##  [11] ica_1.0-3                   future_1.33.0              
##  [13] miniUI_0.1.1.1              withr_2.5.2                
##  [15] spatstat.random_3.2-1       colorspace_2.1-0           
##  [17] progressr_0.14.0            Biobase_2.58.0             
##  [19] highr_0.10                  knitr_1.45                 
##  [21] stats4_4.2.2                ROCR_1.0-11                
##  [23] tensor_1.5                  listenv_0.9.0              
##  [25] MatrixGenerics_1.10.0       labeling_0.4.3             
##  [27] GenomeInfoDbData_1.2.9      polyclip_1.10-6            
##  [29] farver_2.1.1                rprojroot_2.0.3            
##  [31] parallelly_1.36.0           vctrs_0.6.4                
##  [33] generics_0.1.3              xfun_0.40                  
##  [35] R6_2.5.1                    GenomeInfoDb_1.34.9        
##  [37] ggbeeswarm_0.7.1            bitops_1.0-7               
##  [39] spatstat.utils_3.0-4        cachem_1.0.8               
##  [41] DelayedArray_0.24.0         promises_1.2.1             
##  [43] scales_1.2.1                beeswarm_0.4.0             
##  [45] gtable_0.3.4                globals_0.16.2             
##  [47] goftest_1.2-3               spam_2.10-0                
##  [49] rlang_1.1.1                 systemfonts_1.0.4          
##  [51] splines_4.2.2               lazyeval_0.2.2             
##  [53] spatstat.geom_3.2-7         yaml_2.3.7                 
##  [55] reshape2_1.4.4              abind_1.4-5                
##  [57] httpuv_1.6.12               tools_4.2.2                
##  [59] ellipsis_0.3.2              jquerylib_0.1.4            
##  [61] RColorBrewer_1.1-3          BiocGenerics_0.44.0        
##  [63] ggridges_0.5.4              Rcpp_1.0.11                
##  [65] plyr_1.8.9                  sparseMatrixStats_1.10.0   
##  [67] zlibbioc_1.44.0             purrr_1.0.2                
##  [69] RCurl_1.98-1.12             deldir_1.0-9               
##  [71] pbapply_1.7-2               cowplot_1.1.1              
##  [73] S4Vectors_0.36.2            zoo_1.8-12                 
##  [75] SummarizedExperiment_1.28.0 ggrepel_0.9.4              
##  [77] cluster_2.1.4               fs_1.6.3                   
##  [79] magrittr_2.0.3              data.table_1.14.8          
##  [81] RSpectra_0.16-1             glmGamPoi_1.10.2           
##  [83] scattermore_1.2             lmtest_0.9-40              
##  [85] RANN_2.6.1                  fitdistrplus_1.1-11        
##  [87] matrixStats_1.0.0           mime_0.12                  
##  [89] evaluate_0.22               xtable_1.8-4               
##  [91] fastDummies_1.7.3           IRanges_2.32.0             
##  [93] gridExtra_2.3               compiler_4.2.2             
##  [95] tibble_3.2.1                KernSmooth_2.23-22         
##  [97] crayon_1.5.2                htmltools_0.5.6.1          
##  [99] later_1.3.1                 tidyr_1.3.0                
## [101] MASS_7.3-58.2               rappdirs_0.3.3             
## [103] Matrix_1.6-1.1              cli_3.6.1                  
## [105] parallel_4.2.2              dotCall64_1.1-0            
## [107] igraph_1.5.1                GenomicRanges_1.50.2       
## [109] pkgconfig_2.0.3             pkgdown_2.0.7              
## [111] plotly_4.10.3               spatstat.sparse_3.0-3      
## [113] vipor_0.4.5                 bslib_0.5.1                
## [115] XVector_0.38.0              stringr_1.5.0              
## [117] digest_0.6.33               sctransform_0.4.1          
## [119] RcppAnnoy_0.0.21            spatstat.data_3.0-3        
## [121] rmarkdown_2.25              leiden_0.4.3               
## [123] uwot_0.1.16                 DelayedMatrixStats_1.20.0  
## [125] shiny_1.7.5.1               lifecycle_1.0.3            
## [127] nlme_3.1-162                jsonlite_1.8.7             
## [129] limma_3.54.1                desc_1.4.2                 
## [131] viridisLite_0.4.2           fansi_1.0.5                
## [133] pillar_1.9.0                lattice_0.21-9             
## [135] ggrastr_1.0.1               fastmap_1.1.1              
## [137] httr_1.4.7                  survival_3.5-7             
## [139] glue_1.6.2                  png_0.1-8                  
## [141] presto_1.0.0                stringi_1.7.12             
## [143] sass_0.4.7                  textshaping_0.3.6          
## [145] RcppHNSW_0.5.0              memoise_2.0.1              
## [147] irlba_2.3.5.1               future.apply_1.11.0
```

---

## View variable features — VariableFeaturePlot • Seurat

**URL:** http://127.0.0.1:9173/seurat/reference/variablefeatureplot/index.html

**Contents:**
- View variable features
- Arguments
- Value
- See also
- Examples
- Contents

View variable features

Colors to specify non-variable/variable status

Size of the points on the plot

Plot the x-axis in log scale

Assay to pull variable features from

Convert points to raster format, default is NULL which will automatically use raster if the number of points plotted is greater than 100,000

Pixel resolution for rasterized plots, passed to geom_scattermore(). Default is c(512, 512).

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/visualization.R
```

Example 2 (unknown):
```unknown
VariableFeaturePlot.Rd
```

Example 3 (unknown):
```unknown
VariableFeaturePlot(
  object,
  cols = c("black", "red"),
  pt.size = 1,
  log = NULL,
  selection.method = NULL,
  assay = NULL,
  raster = NULL,
  raster.dpi = c(512, 512)
)
```

Example 4 (r):
```r
VariableFeaturePlot(
  object,
  cols = c("black", "red"),
  pt.size = 1,
  log = NULL,
  selection.method = NULL,
  assay = NULL,
  raster = NULL,
  raster.dpi = c(512, 512)
)
```

Example 5 (r):
```r
VariableFeaturePlot(
  object,
  cols = c("black", "red"),
  pt.size = 1,
  log = NULL,
  selection.method = NULL,
  assay = NULL,
  raster = NULL,
  raster.dpi = c(512, 512)
)
```

Example 6 (unknown):
```unknown
FindVariableFeatures
```

Example 7 (unknown):
```unknown
data("pbmc_small")
VariableFeaturePlot(object = pbmc_small)
```

Example 8 (r):
```r
data("pbmc_small")
VariableFeaturePlot(object = pbmc_small)
```

Example 9 (r):
```r
data("pbmc_small")
VariableFeaturePlot(object = pbmc_small)
```

---

## Slim down a Seurat object — DietSeurat • Seurat

**URL:** http://127.0.0.1:9173/seurat/reference/dietseurat/index.html

**Contents:**
- Slim down a Seurat object
- Arguments
- Value
- Contents

Keep only certain aspects of the Seurat object. Can be useful in functions that utilize merge as it reduces the amount of data in the merge

A vector or named list of layers to keep

Only keep a subset of features, defaults to all features

Only keep a subset of assays specified here

Only keep a subset of DimReducs specified here (if NULL, remove all DimReducs)

Only keep a subset of Graphs specified here (if NULL, remove all Graphs)

Preserve the misc slot; default is TRUE

Preserve the count matrices for the assays specified

Preserve the data matrices for the assays specified

Preserve the scale data matrices for the assays specified

object with only the sub-object specified retained

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/objects.R
```

Example 2 (unknown):
```unknown
DietSeurat.Rd
```

Example 3 (unknown):
```unknown
DietSeurat(
  object,
  layers = NULL,
  features = NULL,
  assays = NULL,
  dimreducs = NULL,
  graphs = NULL,
  misc = TRUE,
  counts = deprecated(),
  data = deprecated(),
  scale.data = deprecated(),
  ...
)
```

Example 4 (r):
```r
DietSeurat(
  object,
  layers = NULL,
  features = NULL,
  assays = NULL,
  dimreducs = NULL,
  graphs = NULL,
  misc = TRUE,
  counts = deprecated(),
  data = deprecated(),
  scale.data = deprecated(),
  ...
)
```

Example 5 (r):
```r
DietSeurat(
  object,
  layers = NULL,
  features = NULL,
  assays = NULL,
  dimreducs = NULL,
  graphs = NULL,
  misc = TRUE,
  counts = deprecated(),
  data = deprecated(),
  scale.data = deprecated(),
  ...
)
```

---

## Find cells with highest scores for a given dimensional reduction technique — TopCells • Seurat

**URL:** http://127.0.0.1:9173/reference_topcells.html

**Contents:**
- Find cells with highest scores for a given dimensional reduction technique
- Arguments
- Value
- Examples
- Contents

Return a list of genes with the strongest contribution to a set of components

Number of cells to return

Return an equal number of cells with both + and - scores.

Extra parameters passed to Embeddings

Returns a vector of cells

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/objects.R
```

Example 2 (unknown):
```unknown
TopCells.Rd
```

Example 3 (unknown):
```unknown
TopCells(object, dim = 1, ncells = 20, balanced = FALSE, ...)
```

Example 4 (r):
```r
TopCells(object, dim = 1, ncells = 20, balanced = FALSE, ...)
```

Example 5 (r):
```r
TopCells(object, dim = 1, ncells = 20, balanced = FALSE, ...)
```

Example 6 (python):
```python
data("pbmc_small")
pbmc_small
#> An object of class Seurat 
#> 230 features across 80 samples within 1 assay 
#> Active assay: RNA (230 features, 20 variable features)
#>  3 layers present: counts, data, scale.data
#>  2 dimensional reductions calculated: pca, tsne
head(TopCells(object = pbmc_small[["pca"]]))
#> [1] "ACGTGATGCCATGA" "ATACCACTCTAAGC" "ATTGCACTTGCTTT" "CTAGGTGATGGTTG"
#> [5] "GACATTCTCCACCT" "ATAGGAGAAACAGA"
# Can specify which dimension and how many cells to return
TopCells(object = pbmc_small[["pca"]], dim = 2, ncells = 5)
#> [1] "ACAGGTACTGGTGT" "GTTGACGATATCGG" "GGCATATGCTTATC" "CTAACGGAACCGAT"
#> [5] "CATTACACCAACTG"
```

Example 7 (r):
```r
data("pbmc_small")
pbmc_small
#> An object of class Seurat 
#> 230 features across 80 samples within 1 assay 
#> Active assay: RNA (230 features, 20 variable features)
#>  3 layers present: counts, data, scale.data
#>  2 dimensional reductions calculated: pca, tsne
head(TopCells(object = pbmc_small[["pca"]]))
#> [1] "ACGTGATGCCATGA" "ATACCACTCTAAGC" "ATTGCACTTGCTTT" "CTAGGTGATGGTTG"
#> [5] "GACATTCTCCACCT" "ATAGGAGAAACAGA"
# Can specify which dimension and how many cells to return
TopCells(object = pbmc_small[["pca"]], dim = 2, ncells = 5)
#> [1] "ACAGGTACTGGTGT" "GTTGACGATATCGG" "GGCATATGCTTATC" "CTAACGGAACCGAT"
#> [5] "CATTACACCAACTG"
```

Example 8 (r):
```r
data("pbmc_small")
pbmc_small
#> An object of class Seurat 
#> 230 features across 80 samples within 1 assay 
#> Active assay: RNA (230 features, 20 variable features)
#>  3 layers present: counts, data, scale.data
#>  2 dimensional reductions calculated: pca, tsne
head(TopCells(object = pbmc_small[["pca"]]))
#> [1] "ACGTGATGCCATGA" "ATACCACTCTAAGC" "ATTGCACTTGCTTT" "CTAGGTGATGGTTG"
#> [5] "GACATTCTCCACCT" "ATAGGAGAAACAGA"
# Can specify which dimension and how many cells to return
TopCells(object = pbmc_small[["pca"]], dim = 2, ncells = 5)
#> [1] "ACAGGTACTGGTGT" "GTTGACGATATCGG" "GGCATATGCTTATC" "CTAACGGAACCGAT"
#> [5] "CATTACACCAACTG"
```

---

## Load STARmap data — LoadSTARmap • Seurat

**URL:** http://127.0.0.1:9173/reference_loadstarmap.html

**Contents:**
- Load STARmap data
- Arguments
- Value
- See also
- Contents

location of data directory that contains the counts matrix, gene name, qhull, and centroid files.

name of file containing the counts matrix (csv)

name of file containing the gene names (csv)

name of file containing the hull coordinates (tsv)

name of file containing the centroid positions (tsv)

Name of assay to associate spatial data to

Name of "image" object storing spatial coordinates

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/preprocessing.R
```

Example 2 (unknown):
```unknown
LoadSTARmap.Rd
```

Example 3 (unknown):
```unknown
LoadSTARmap(
  data.dir,
  counts.file = "cell_barcode_count.csv",
  gene.file = "genes.csv",
  qhull.file = "qhulls.tsv",
  centroid.file = "centroids.tsv",
  assay = "Spatial",
  image = "image"
)
```

Example 4 (r):
```r
LoadSTARmap(
  data.dir,
  counts.file = "cell_barcode_count.csv",
  gene.file = "genes.csv",
  qhull.file = "qhulls.tsv",
  centroid.file = "centroids.tsv",
  assay = "Spatial",
  image = "image"
)
```

Example 5 (r):
```r
LoadSTARmap(
  data.dir,
  counts.file = "cell_barcode_count.csv",
  gene.file = "genes.csv",
  qhull.file = "qhulls.tsv",
  centroid.file = "centroids.tsv",
  assay = "Spatial",
  image = "image"
)
```

---

## Quickly Pick Relevant Dimensions — ElbowPlot • Seurat

**URL:** http://127.0.0.1:9173/seurat/reference/elbowplot/index.html

**Contents:**
- Quickly Pick Relevant Dimensions
- Arguments
- Value
- Examples
- Contents

Plots the standard deviations (or approximate singular values if running PCAFast) of the principle components for easy identification of an elbow in the graph. This elbow often corresponds well with the significant dims and is much faster to run than Jackstraw

Number of dimensions to plot standard deviation for

Reduction technique to plot standard deviation for

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/visualization.R
```

Example 2 (unknown):
```unknown
ElbowPlot.Rd
```

Example 3 (unknown):
```unknown
ElbowPlot(object, ndims = 20, reduction = "pca")
```

Example 4 (r):
```r
ElbowPlot(object, ndims = 20, reduction = "pca")
```

Example 5 (r):
```r
ElbowPlot(object, ndims = 20, reduction = "pca")
```

Example 6 (unknown):
```unknown
data("pbmc_small")
ElbowPlot(object = pbmc_small)
#> Warning: The object only has information for 19 reductions
```

Example 7 (r):
```r
data("pbmc_small")
ElbowPlot(object = pbmc_small)
#> Warning: The object only has information for 19 reductions
```

Example 8 (r):
```r
data("pbmc_small")
ElbowPlot(object = pbmc_small)
#> Warning: The object only has information for 19 reductions
```

---

## Get SCT results from an Assay — SCTResults • Seurat

**URL:** http://127.0.0.1:9173/seurat/reference/sctresults/index.html

**Contents:**
- Get SCT results from an Assay
- Arguments
- Value
- Contents

Pull the SCTResults information from an SCTAssay object.

Arguments passed to other methods (not used)

Which slot to pull the SCT results from

Name of SCModel to pull result from. Available names can be retrieved with levels.

Assay in the Seurat object to pull from

Returns the value present in the requested slot for the requested group. If group is not specified, returns a list of slot results for each group unless there is only one group present (in which case it just returns the slot directly).

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/generics.R
```

Example 2 (unknown):
```unknown
R/objects.R
```

Example 3 (unknown):
```unknown
SCTResults.Rd
```

Example 4 (python):
```python
SCTResults(object, ...)

SCTResults(object, ...) <- value

# S3 method for class 'SCTModel'
SCTResults(object, slot, ...)

# S3 method for class 'SCTModel'
SCTResults(object, slot, ...) <- value

# S3 method for class 'SCTAssay'
SCTResults(object, slot, model = NULL, ...)

# S3 method for class 'SCTAssay'
SCTResults(object, slot, model = NULL, ...) <- value

# S3 method for class 'Seurat'
SCTResults(object, assay = "SCT", slot, model = NULL, ...)
```

Example 5 (r):
```r
SCTResults(object, ...)

SCTResults(object, ...) <- value

# S3 method for class 'SCTModel'
SCTResults(object, slot, ...)

# S3 method for class 'SCTModel'
SCTResults(object, slot, ...) <- value

# S3 method for class 'SCTAssay'
SCTResults(object, slot, model = NULL, ...)

# S3 method for class 'SCTAssay'
SCTResults(object, slot, model = NULL, ...) <- value

# S3 method for class 'Seurat'
SCTResults(object, assay = "SCT", slot, model = NULL, ...)
```

Example 6 (r):
```r
SCTResults(object, ...)

SCTResults(object, ...) <- value

# S3 method for class 'SCTModel'
SCTResults(object, slot, ...)

# S3 method for class 'SCTModel'
SCTResults(object, slot, ...) <- value

# S3 method for class 'SCTAssay'
SCTResults(object, slot, model = NULL, ...)

# S3 method for class 'SCTAssay'
SCTResults(object, slot, model = NULL, ...) <- value

# S3 method for class 'Seurat'
SCTResults(object, assay = "SCT", slot, model = NULL, ...)
```

---

## The SCTModel Class — SCTAssay-class • Seurat

**URL:** http://127.0.0.1:9173/reference_sctassay-class.html

**Contents:**
- The SCTModel Class
- Arguments
- Value
- Slots
- Get and set SCT model names
- Creating an SCTAssay from an Assay
- See also
- Examples
- Contents

The SCTModel object is a model and parameters storage from SCTransform. It can be used to calculate Pearson residuals for new genes.

The SCTAssay object contains all the information found in an Assay object, with extra information from the results of SCTransform

New levels, must be in the same order as the levels present

levels: SCT model names

levels<-: x with updated SCT model names

A data.frame with feature attributes in SCTransform

A data.frame with cell attributes in SCTransform

A list of two numeric of length two specifying the min and max values the Pearson residual will be clipped to. One for vst and one for SCTransform

Name of the assay of the seurat object containing UMI matrix and the default is RNA

A formula used in SCTransform

other information used in SCTransform

Median UMI (or scale factor) used to calculate corrected counts

A list containing SCT models

SCT results are named by initial run of SCTransform in order to keep SCT parameters straight between runs. When working with merged SCTAssay objects, these model names are important. levels allows querying the models present. levels<- allows the changing of the names of the models present, useful when merging SCTAssay objects. Note: unlike normal levels<-, levels<-.SCTAssay allows complete changing of model names, not reordering.

Conversion from an Assay object to an SCTAssay object by is done by adding the additional slots to the object. If from has results generated by SCTransform from Seurat v3.0.0 to v3.1.1, the conversion will automagically fill the new slots with the data

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/objects.R
```

Example 2 (unknown):
```unknown
SCTAssay-class.Rd
```

Example 3 (unknown):
```unknown
SCTransform
```

Example 4 (python):
```python
# S3 method for class 'SCTAssay'
levels(x)

# S3 method for class 'SCTAssay'
levels(x) <- value
```

Example 5 (r):
```r
# S3 method for class 'SCTAssay'
levels(x)

# S3 method for class 'SCTAssay'
levels(x) <- value
```

Example 6 (r):
```r
# S3 method for class 'SCTAssay'
levels(x)

# S3 method for class 'SCTAssay'
levels(x) <- value
```

Example 7 (unknown):
```unknown
feature.attributes
```

Example 8 (unknown):
```unknown
cell.attributes
```

Example 9 (unknown):
```unknown
SCTModel.list
```

Example 10 (unknown):
```unknown
SCTransform
```

Example 11 (unknown):
```unknown
levels<-.SCTAssay
```

Example 12 (unknown):
```unknown
SCTransform
```

Example 13 (python):
```python
if (FALSE) { # \dontrun{
# SCTAssay objects are generated from SCTransform
pbmc_small <- SCTransform(pbmc_small)
} # }

if (FALSE) { # \dontrun{
# SCTAssay objects are generated from SCTransform
pbmc_small <- SCTransform(pbmc_small)
pbmc_small[["SCT"]]
} # }

if (FALSE) { # \dontrun{
# Query and change SCT model names
levels(pbmc_small[['SCT']])
levels(pbmc_small[['SCT']]) <- '3'
levels(pbmc_small[['SCT']])
} # }
```

Example 14 (r):
```r
if (FALSE) { # \dontrun{
# SCTAssay objects are generated from SCTransform
pbmc_small <- SCTransform(pbmc_small)
} # }

if (FALSE) { # \dontrun{
# SCTAssay objects are generated from SCTransform
pbmc_small <- SCTransform(pbmc_small)
pbmc_small[["SCT"]]
} # }

if (FALSE) { # \dontrun{
# Query and change SCT model names
levels(pbmc_small[['SCT']])
levels(pbmc_small[['SCT']]) <- '3'
levels(pbmc_small[['SCT']])
} # }
```

Example 15 (r):
```r
if (FALSE) { # \dontrun{
# SCTAssay objects are generated from SCTransform
pbmc_small <- SCTransform(pbmc_small)
} # }

if (FALSE) { # \dontrun{
# SCTAssay objects are generated from SCTransform
pbmc_small <- SCTransform(pbmc_small)
pbmc_small[["SCT"]]
} # }

if (FALSE) { # \dontrun{
# Query and change SCT model names
levels(pbmc_small[['SCT']])
levels(pbmc_small[['SCT']]) <- '3'
levels(pbmc_small[['SCT']])
} # }
```

---

## The ModalityWeights Class — ModalityWeights-class • Seurat

**URL:** http://127.0.0.1:9173/reference_modalityweights-class.html

**Contents:**
- The ModalityWeights Class
- Slots
- Contents

The ModalityWeights class is an intermediate data storage class that stores the modality weight and other related information needed for performing downstream analyses - namely data integration (FindModalityWeights) and data transfer (FindMultiModalNeighbors).

A list of modality weights value from all modalities

Names of assays for the list of dimensional reductions

A list of parameters used in the FindModalityWeights

a list of score matrices representing cross and within-modality prediction score, and kernel value

Store log of parameters that were used

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/objects.R
```

Example 2 (unknown):
```unknown
ModalityWeights-class.Rd
```

Example 3 (unknown):
```unknown
FindModalityWeights
```

Example 4 (unknown):
```unknown
FindMultiModalNeighbors
```

Example 5 (unknown):
```unknown
modality.weight.list
```

Example 6 (unknown):
```unknown
modality.assay
```

Example 7 (unknown):
```unknown
score.matrix
```

---

## Aggregate expression of multiple features into a single feature — MetaFeature • Seurat

**URL:** http://127.0.0.1:9173/seurat/reference/metafeature/index.html

**Contents:**
- Aggregate expression of multiple features into a single feature
- Arguments
- Value
- Examples
- Contents

Calculates relative contribution of each feature to each cell for given set of features.

List of features to aggregate

Name of column in metadata to store metafeature

List of cells to use (default all cells)

Which slot to take data from (default data)

Returns a Seurat object with metafeature stored in objct metadata

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/utilities.R
```

Example 2 (unknown):
```unknown
MetaFeature.Rd
```

Example 3 (unknown):
```unknown
MetaFeature(
  object,
  features,
  meta.name = "metafeature",
  cells = NULL,
  assay = NULL,
  slot = "data"
)
```

Example 4 (r):
```r
MetaFeature(
  object,
  features,
  meta.name = "metafeature",
  cells = NULL,
  assay = NULL,
  slot = "data"
)
```

Example 5 (r):
```r
MetaFeature(
  object,
  features,
  meta.name = "metafeature",
  cells = NULL,
  assay = NULL,
  slot = "data"
)
```

Example 6 (unknown):
```unknown
data("pbmc_small")
pbmc_small <- MetaFeature(
  object = pbmc_small,
  features = c("LTB", "EAF2"),
  meta.name = 'var.aggregate'
)
head(pbmc_small[[]])
#>                   orig.ident nCount_RNA nFeature_RNA RNA_snn_res.0.8
#> ATGCCAGAACGACT SeuratProject         70           47               0
#> CATGGCCTGTGCAT SeuratProject         85           52               0
#> GAACCTGATGAACC SeuratProject         87           50               1
#> TGACTGGATTCTCA SeuratProject        127           56               0
#> AGTCAGACTGCACA SeuratProject        173           53               0
#> TCTGATACACGTGT SeuratProject         70           48               0
#>                letter.idents groups RNA_snn_res.1 var.aggregate
#> ATGCCAGAACGACT             A     g2             0    0.01322615
#> CATGGCCTGTGCAT             A     g1             0    0.01464857
#> GAACCTGATGAACC             B     g2             0    0.01558293
#> TGACTGGATTCTCA             A     g2             0    0.01512254
#> AGTCAGACTGCACA             A     g2             0    0.01125977
#> TCTGATACACGTGT             A     g1             0    0.01385247
```

Example 7 (r):
```r
data("pbmc_small")
pbmc_small <- MetaFeature(
  object = pbmc_small,
  features = c("LTB", "EAF2"),
  meta.name = 'var.aggregate'
)
head(pbmc_small[[]])
#>                   orig.ident nCount_RNA nFeature_RNA RNA_snn_res.0.8
#> ATGCCAGAACGACT SeuratProject         70           47               0
#> CATGGCCTGTGCAT SeuratProject         85           52               0
#> GAACCTGATGAACC SeuratProject         87           50               1
#> TGACTGGATTCTCA SeuratProject        127           56               0
#> AGTCAGACTGCACA SeuratProject        173           53               0
#> TCTGATACACGTGT SeuratProject         70           48               0
#>                letter.idents groups RNA_snn_res.1 var.aggregate
#> ATGCCAGAACGACT             A     g2             0    0.01322615
#> CATGGCCTGTGCAT             A     g1             0    0.01464857
#> GAACCTGATGAACC             B     g2             0    0.01558293
#> TGACTGGATTCTCA             A     g2             0    0.01512254
#> AGTCAGACTGCACA             A     g2             0    0.01125977
#> TCTGATACACGTGT             A     g1             0    0.01385247
```

Example 8 (r):
```r
data("pbmc_small")
pbmc_small <- MetaFeature(
  object = pbmc_small,
  features = c("LTB", "EAF2"),
  meta.name = 'var.aggregate'
)
head(pbmc_small[[]])
#>                   orig.ident nCount_RNA nFeature_RNA RNA_snn_res.0.8
#> ATGCCAGAACGACT SeuratProject         70           47               0
#> CATGGCCTGTGCAT SeuratProject         85           52               0
#> GAACCTGATGAACC SeuratProject         87           50               1
#> TGACTGGATTCTCA SeuratProject        127           56               0
#> AGTCAGACTGCACA SeuratProject        173           53               0
#> TCTGATACACGTGT SeuratProject         70           48               0
#>                letter.idents groups RNA_snn_res.1 var.aggregate
#> ATGCCAGAACGACT             A     g2             0    0.01322615
#> CATGGCCTGTGCAT             A     g1             0    0.01464857
#> GAACCTGATGAACC             B     g2             0    0.01558293
#> TGACTGGATTCTCA             A     g2             0    0.01512254
#> AGTCAGACTGCACA             A     g2             0    0.01125977
#> TCTGATACACGTGT             A     g1             0    0.01385247
```

---

## Select integration features — SelectIntegrationFeatures5 • Seurat

**URL:** http://127.0.0.1:9173/seurat/reference/selectintegrationfeatures5/index.html

**Contents:**
- Select integration features
- Arguments
- Contents

Select integration features

Number of features to return for integration

Name of assay to use for integration feature selection

Which method to pull. For HVFInfo and VariableFeatures, choose one from one of the following:

“sctransform” or “sct”

“mean.var.plot”, “dispersion”, “mvp”, or “disp”

Name of layers to use for integration feature selection

Arguments passed on to method

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/integration.R
```

Example 2 (unknown):
```unknown
SelectIntegrationFeatures5.Rd
```

Example 3 (unknown):
```unknown
SelectIntegrationFeatures5(
  object,
  nfeatures = 2000,
  assay = NULL,
  method = NULL,
  layers = NULL,
  verbose = TRUE,
  ...
)
```

Example 4 (r):
```r
SelectIntegrationFeatures5(
  object,
  nfeatures = 2000,
  assay = NULL,
  method = NULL,
  layers = NULL,
  verbose = TRUE,
  ...
)
```

Example 5 (r):
```r
SelectIntegrationFeatures5(
  object,
  nfeatures = 2000,
  assay = NULL,
  method = NULL,
  layers = NULL,
  verbose = TRUE,
  ...
)
```

Example 6 (unknown):
```unknown
VariableFeatures
```

---

## Get nearest neighbors for given cell — TopNeighbors • Seurat

**URL:** http://127.0.0.1:9173/reference_topneighbors.html

**Contents:**
- Get nearest neighbors for given cell
- Arguments
- Value
- Contents

Return a vector of cell names of the nearest n cells.

Number of neighbors to return

Returns a vector of cell names

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/objects.R
```

Example 2 (unknown):
```unknown
TopNeighbors.Rd
```

Example 3 (unknown):
```unknown
TopNeighbors(object, cell, n = 5)
```

Example 4 (r):
```r
TopNeighbors(object, cell, n = 5)
```

Example 5 (r):
```r
TopNeighbors(object, cell, n = 5)
```

---

## The BridgeReferenceSet Class The BridgeReferenceSet is an output from PrepareBridgeReference — BridgeReferenceSet-class • Seurat

**URL:** http://127.0.0.1:9173/reference_bridgereferenceset-class.html

**Contents:**
- The BridgeReferenceSet Class The BridgeReferenceSet is an output from PrepareBridgeReference
- Slots
- Contents

The BridgeReferenceSet Class The BridgeReferenceSet is an output from PrepareBridgeReference

The multi-omic object

The Reference object only containing bridge representation assay

A list of parameters used in the PrepareBridgeReference

Store log of parameters that were used

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/objects.R
```

Example 2 (unknown):
```unknown
BridgeReferenceSet-class.Rd
```

---

## Seurat Themes — SeuratTheme • Seurat

**URL:** http://127.0.0.1:9173/reference_seurattheme.html

**Contents:**
- Seurat Themes
- Arguments
- Value
- See also
- Examples
- Contents

Various themes to be applied to ggplot2-based plots

The curated Seurat theme, consists of ...

A dark theme, axes and text turn to white, the background becomes black

Removes axis lines, text, and ticks

Sets axis and title font sizes

Set Seurat-style axes

A theme designed for spatial visualizations (eg PolyFeaturePlot, PolyDimPlot)

Restore a legend after removal

Rotate X axis text 45 degrees

Enlarges and emphasizes the title

Extra parameters to be passed to theme

X and Y axis text sizes

X and Y axis title sizes

A position to restore the legend to

A ggplot2 theme object

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/visualization.R
```

Example 2 (unknown):
```unknown
SeuratTheme.Rd
```

Example 3 (unknown):
```unknown
SeuratTheme
```

Example 4 (unknown):
```unknown
SpatialTheme
```

Example 5 (unknown):
```unknown
PolyFeaturePlot
```

Example 6 (unknown):
```unknown
PolyDimPlot
```

Example 7 (unknown):
```unknown
RestoreLegend
```

Example 8 (unknown):
```unknown
RotatedAxis
```

Example 9 (unknown):
```unknown
SeuratTheme()

CenterTitle(...)

DarkTheme(...)

FontSize(
  x.text = NULL,
  y.text = NULL,
  x.title = NULL,
  y.title = NULL,
  main = NULL,
  ...
)

NoAxes(..., keep.text = FALSE, keep.ticks = FALSE)

NoLegend(...)

NoGrid(...)

SeuratAxes(...)

SpatialTheme(...)

RestoreLegend(..., position = "right")

RotatedAxis(...)

BoldTitle(...)

WhiteBackground(...)
```

Example 10 (r):
```r
SeuratTheme()

CenterTitle(...)

DarkTheme(...)

FontSize(
  x.text = NULL,
  y.text = NULL,
  x.title = NULL,
  y.title = NULL,
  main = NULL,
  ...
)

NoAxes(..., keep.text = FALSE, keep.ticks = FALSE)

NoLegend(...)

NoGrid(...)

SeuratAxes(...)

SpatialTheme(...)

RestoreLegend(..., position = "right")

RotatedAxis(...)

BoldTitle(...)

WhiteBackground(...)
```

Example 11 (r):
```r
SeuratTheme()

CenterTitle(...)

DarkTheme(...)

FontSize(
  x.text = NULL,
  y.text = NULL,
  x.title = NULL,
  y.title = NULL,
  main = NULL,
  ...
)

NoAxes(..., keep.text = FALSE, keep.ticks = FALSE)

NoLegend(...)

NoGrid(...)

SeuratAxes(...)

SpatialTheme(...)

RestoreLegend(..., position = "right")

RotatedAxis(...)

BoldTitle(...)

WhiteBackground(...)
```

Example 12 (unknown):
```unknown
# Generate a plot with a dark theme
library(ggplot2)
df <- data.frame(x = rnorm(n = 100, mean = 20, sd = 2), y = rbinom(n = 100, size = 100, prob = 0.2))
p <- ggplot(data = df, mapping = aes(x = x, y = y)) + geom_point(mapping = aes(color = 'red'))
p + DarkTheme(legend.position = 'none')


# Generate a plot with no axes
library(ggplot2)
df <- data.frame(x = rnorm(n = 100, mean = 20, sd = 2), y = rbinom(n = 100, size = 100, prob = 0.2))
p <- ggplot(data = df, mapping = aes(x = x, y = y)) + geom_point(mapping = aes(color = 'red'))
p + NoAxes()


# Generate a plot with no legend
library(ggplot2)
df <- data.frame(x = rnorm(n = 100, mean = 20, sd = 2), y = rbinom(n = 100, size = 100, prob = 0.2))
p <- ggplot(data = df, mapping = aes(x = x, y = y)) + geom_point(mapping = aes(color = 'red'))
p + NoLegend()


# Generate a plot with no grid lines
library(ggplot2)
df <- data.frame(x = rnorm(n = 100, mean = 20, sd = 2), y = rbinom(n = 100, size = 100, prob = 0.2))
p <- ggplot(data = df, mapping = aes(x = x, y = y)) + geom_point(mapping = aes(color = 'red'))
p + NoGrid()
```

Example 13 (r):
```r
# Generate a plot with a dark theme
library(ggplot2)
df <- data.frame(x = rnorm(n = 100, mean = 20, sd = 2), y = rbinom(n = 100, size = 100, prob = 0.2))
p <- ggplot(data = df, mapping = aes(x = x, y = y)) + geom_point(mapping = aes(color = 'red'))
p + DarkTheme(legend.position = 'none')


# Generate a plot with no axes
library(ggplot2)
df <- data.frame(x = rnorm(n = 100, mean = 20, sd = 2), y = rbinom(n = 100, size = 100, prob = 0.2))
p <- ggplot(data = df, mapping = aes(x = x, y = y)) + geom_point(mapping = aes(color = 'red'))
p + NoAxes()


# Generate a plot with no legend
library(ggplot2)
df <- data.frame(x = rnorm(n = 100, mean = 20, sd = 2), y = rbinom(n = 100, size = 100, prob = 0.2))
p <- ggplot(data = df, mapping = aes(x = x, y = y)) + geom_point(mapping = aes(color = 'red'))
p + NoLegend()


# Generate a plot with no grid lines
library(ggplot2)
df <- data.frame(x = rnorm(n = 100, mean = 20, sd = 2), y = rbinom(n = 100, size = 100, prob = 0.2))
p <- ggplot(data = df, mapping = aes(x = x, y = y)) + geom_point(mapping = aes(color = 'red'))
p + NoGrid()
```

Example 14 (r):
```r
# Generate a plot with a dark theme
library(ggplot2)
df <- data.frame(x = rnorm(n = 100, mean = 20, sd = 2), y = rbinom(n = 100, size = 100, prob = 0.2))
p <- ggplot(data = df, mapping = aes(x = x, y = y)) + geom_point(mapping = aes(color = 'red'))
p + DarkTheme(legend.position = 'none')


# Generate a plot with no axes
library(ggplot2)
df <- data.frame(x = rnorm(n = 100, mean = 20, sd = 2), y = rbinom(n = 100, size = 100, prob = 0.2))
p <- ggplot(data = df, mapping = aes(x = x, y = y)) + geom_point(mapping = aes(color = 'red'))
p + NoAxes()


# Generate a plot with no legend
library(ggplot2)
df <- data.frame(x = rnorm(n = 100, mean = 20, sd = 2), y = rbinom(n = 100, size = 100, prob = 0.2))
p <- ggplot(data = df, mapping = aes(x = x, y = y)) + geom_point(mapping = aes(color = 'red'))
p + NoLegend()


# Generate a plot with no grid lines
library(ggplot2)
df <- data.frame(x = rnorm(n = 100, mean = 20, sd = 2), y = rbinom(n = 100, size = 100, prob = 0.2))
p <- ggplot(data = df, mapping = aes(x = x, y = y)) + geom_point(mapping = aes(color = 'red'))
p + NoGrid()
```

---

## The AnchorSet Class — AnchorSet-class • Seurat

**URL:** http://127.0.0.1:9173/seurat/reference/anchorset-class/index.html

**Contents:**
- The AnchorSet Class
- Slots
- Contents

The AnchorSet class is an intermediate data storage class that stores the anchors and other related information needed for performing downstream analyses - namely data integration (IntegrateData) and data transfer (TransferData).

List of objects used to create anchors

List of cell names in the reference dataset - needed when performing data transfer.

Position of reference object/s in object.list

List of cell names in the query dataset - needed when performing data transfer

The anchor matrix. This contains the cell indices of both anchor pair cells, the anchor score, and the index of the original dataset in the object.list for cell1 and cell2 of the anchor.

The offsets used to enable cell look up in downstream functions

The weight dimensional reduction used to calculate weight matrix

The features used when performing anchor finding.

List containing Neighbor objects for reuse later (e.g. mapping)

Store log of parameters that were used

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/objects.R
```

Example 2 (unknown):
```unknown
AnchorSet-class.Rd
```

Example 3 (unknown):
```unknown
IntegrateData
```

Example 4 (unknown):
```unknown
TransferData
```

Example 5 (unknown):
```unknown
object.list
```

Example 6 (unknown):
```unknown
reference.cells
```

Example 7 (unknown):
```unknown
reference.objects
```

Example 8 (unknown):
```unknown
query.cells
```

Example 9 (unknown):
```unknown
weight.reduction
```

Example 10 (unknown):
```unknown
anchor.features
```

---

## Run Graph Laplacian Eigendecomposition — RunGraphLaplacian • Seurat

**URL:** http://127.0.0.1:9173/seurat/reference/rungraphlaplacian/index.html

**Contents:**
- Run Graph Laplacian Eigendecomposition
- Arguments
- Value
- Contents

Run a graph laplacian dimensionality reduction. It is used as a low dimensional representation for a cell-cell graph. The input graph should be symmetric

Arguments passed to eigs_sym

dimensional reduction name, lap by default

dimensional reduction key, specifies the string before the number for the dimension names. LAP by default

Total Number of Eigenvectors to compute and store (50 by default)

Print message and process

Returns Seurat object with the Graph laplacian eigenvector calculation stored in the reductions slot

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/generics.R
```

Example 2 (unknown):
```unknown
R/integration.R
```

Example 3 (unknown):
```unknown
RunGraphLaplacian.Rd
```

Example 4 (python):
```python
RunGraphLaplacian(object, ...)

# S3 method for class 'Seurat'
RunGraphLaplacian(
  object,
  graph,
  reduction.name = "lap",
  reduction.key = "LAP_",
  n = 50,
  verbose = TRUE,
  ...
)

# Default S3 method
RunGraphLaplacian(object, n = 50, reduction.key = "LAP_", verbose = TRUE, ...)
```

Example 5 (r):
```r
RunGraphLaplacian(object, ...)

# S3 method for class 'Seurat'
RunGraphLaplacian(
  object,
  graph,
  reduction.name = "lap",
  reduction.key = "LAP_",
  n = 50,
  verbose = TRUE,
  ...
)

# Default S3 method
RunGraphLaplacian(object, n = 50, reduction.key = "LAP_", verbose = TRUE, ...)
```

Example 6 (r):
```r
RunGraphLaplacian(object, ...)

# S3 method for class 'Seurat'
RunGraphLaplacian(
  object,
  graph,
  reduction.name = "lap",
  reduction.key = "LAP_",
  n = 50,
  verbose = TRUE,
  ...
)

# Default S3 method
RunGraphLaplacian(object, n = 50, reduction.key = "LAP_", verbose = TRUE, ...)
```

---

## Run the mark variogram computation on a given position matrix and expression matrix. — RunMarkVario • Seurat

**URL:** http://127.0.0.1:9173/reference_runmarkvario.html

**Contents:**
- Run the mark variogram computation on a given position matrix and expression matrix.
- Arguments
- Contents

Wraps the functionality of markvario from the spatstat package.

A 2 column matrix giving the spatial locations of each of the data points also in data

Matrix containing the data used as "marks" (e.g. gene expression)

Arguments passed to markvario

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/preprocessing.R
```

Example 2 (unknown):
```unknown
RunMarkVario.Rd
```

Example 3 (unknown):
```unknown
RunMarkVario(spatial.location, data, ...)
```

Example 4 (r):
```r
RunMarkVario(spatial.location, data, ...)
```

Example 5 (r):
```r
RunMarkVario(spatial.location, data, ...)
```

---

## Find subclusters under one cluster — FindSubCluster • Seurat

**URL:** http://127.0.0.1:9173/seurat/reference/findsubcluster/index.html

**Contents:**
- Find subclusters under one cluster
- Arguments
- Value
- Contents

Find subclusters under one cluster

the cluster to be sub-clustered

Name of graph to use for the clustering algorithm

the name of sub cluster added in the meta.data

Value of the resolution parameter, use a value above (below) 1.0 if you want to obtain a larger (smaller) number of communities.

Algorithm for modularity optimization (1 = original Louvain algorithm; 2 = Louvain algorithm with multilevel refinement; 3 = SLM algorithm; 4 = Leiden algorithm).

return a object with sub cluster labels in the sub-cluster.name variable

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/clustering.R
```

Example 2 (unknown):
```unknown
FindSubCluster.Rd
```

Example 3 (unknown):
```unknown
FindSubCluster(
  object,
  cluster,
  graph.name,
  subcluster.name = "sub.cluster",
  resolution = 0.5,
  algorithm = 1
)
```

Example 4 (r):
```r
FindSubCluster(
  object,
  cluster,
  graph.name,
  subcluster.name = "sub.cluster",
  resolution = 0.5,
  algorithm = 1
)
```

Example 5 (r):
```r
FindSubCluster(
  object,
  cluster,
  graph.name,
  subcluster.name = "sub.cluster",
  resolution = 0.5,
  algorithm = 1
)
```

---

## Determine text color based on background color — BGTextColor • Seurat

**URL:** http://127.0.0.1:9173/reference_bgtextcolor.html

**Contents:**
- Determine text color based on background color
- Source
- Arguments
- Value
- Examples
- Contents

Determine text color based on background color

https://stackoverflow.com/questions/3942878/how-to-decide-font-color-in-white-or-black-depending-on-background-color

A vector of background colors; supports R color names and hexadecimal codes

Intensity threshold for light/dark cutoff; intensities greater than theshold yield dark, others yield light

Use W3C formula for calculating background text color; ignores threshold

A named vector of either dark or light, depending on background; names of vector are background

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/visualization.R
```

Example 2 (unknown):
```unknown
BGTextColor.Rd
```

Example 3 (unknown):
```unknown
BGTextColor(
  background,
  threshold = 186,
  w3c = FALSE,
  dark = "black",
  light = "white"
)
```

Example 4 (r):
```r
BGTextColor(
  background,
  threshold = 186,
  w3c = FALSE,
  dark = "black",
  light = "white"
)
```

Example 5 (r):
```r
BGTextColor(
  background,
  threshold = 186,
  w3c = FALSE,
  dark = "black",
  light = "white"
)
```

Example 6 (unknown):
```unknown
BGTextColor(background = c('black', 'white', '#E76BF3'))
#>   black   white #E76BF3 
#> "white" "black" "white"
```

Example 7 (r):
```r
BGTextColor(background = c('black', 'white', '#E76BF3'))
#>   black   white #E76BF3 
#> "white" "black" "white"
```

Example 8 (r):
```r
BGTextColor(background = c('black', 'white', '#E76BF3'))
#>   black   white #E76BF3 
#> "white" "black" "white"
```

---

## Single cell ridge plot — RidgePlot • Seurat

**URL:** http://127.0.0.1:9173/seurat/reference/ridgeplot/index.html

**Contents:**
- Single cell ridge plot
- Arguments
- Value
- Examples
- Contents

Draws a ridge plot of single cell data (gene expression, metrics, PC scores, etc.)

Features to plot (gene expression, metrics, PC scores, anything that can be retreived by FetchData)

Colors to use for plotting

Which classes to include in the plot (default is all)

Sort identity classes (on the x-axis) by the average expression of the attribute being potted, can also pass 'increasing' or 'decreasing' to change sort direction

Name of assay to use, defaults to the active assay

Group (color) cells in different ways (for example, orig.ident)

Set all the y-axis limits to the same values

plot the feature axis on log scale

Number of columns if multiple plots are displayed

Slot to pull expression data from (e.g. "counts" or "data")

Layer to pull expression data from (e.g. "counts" or "data")

Horizontally stack plots for each feature

Combine plots into a single patchworked ggplot object. If FALSE, return a list of ggplot

Color violins/ridges based on either 'feature' or 'ident'

A patchworked ggplot object if combine = TRUE; otherwise, a list of ggplot objects

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/visualization.R
```

Example 2 (unknown):
```unknown
RidgePlot.Rd
```

Example 3 (unknown):
```unknown
RidgePlot(
  object,
  features,
  cols = NULL,
  idents = NULL,
  sort = FALSE,
  assay = NULL,
  group.by = NULL,
  y.max = NULL,
  same.y.lims = FALSE,
  log = FALSE,
  ncol = NULL,
  slot = deprecated(),
  layer = "data",
  stack = FALSE,
  combine = TRUE,
  fill.by = "feature"
)
```

Example 4 (r):
```r
RidgePlot(
  object,
  features,
  cols = NULL,
  idents = NULL,
  sort = FALSE,
  assay = NULL,
  group.by = NULL,
  y.max = NULL,
  same.y.lims = FALSE,
  log = FALSE,
  ncol = NULL,
  slot = deprecated(),
  layer = "data",
  stack = FALSE,
  combine = TRUE,
  fill.by = "feature"
)
```

Example 5 (r):
```r
RidgePlot(
  object,
  features,
  cols = NULL,
  idents = NULL,
  sort = FALSE,
  assay = NULL,
  group.by = NULL,
  y.max = NULL,
  same.y.lims = FALSE,
  log = FALSE,
  ncol = NULL,
  slot = deprecated(),
  layer = "data",
  stack = FALSE,
  combine = TRUE,
  fill.by = "feature"
)
```

Example 6 (unknown):
```unknown
patchworked
```

Example 7 (unknown):
```unknown
patchworked
```

Example 8 (unknown):
```unknown
combine = TRUE
```

Example 9 (unknown):
```unknown
data("pbmc_small")
RidgePlot(object = pbmc_small, features = 'PC_1')
#> Picking joint bandwidth of 0.387
```

Example 10 (r):
```r
data("pbmc_small")
RidgePlot(object = pbmc_small, features = 'PC_1')
#> Picking joint bandwidth of 0.387
```

Example 11 (r):
```r
data("pbmc_small")
RidgePlot(object = pbmc_small, features = 'PC_1')
#> Picking joint bandwidth of 0.387
```

---

## Run a custom distance function on an input data matrix — CustomDistance • Seurat

**URL:** http://127.0.0.1:9173/reference_customdistance.html

**Contents:**
- Run a custom distance function on an input data matrix
- Arguments
- Value
- Author
- Examples
- Contents

Run a custom distance function on an input data matrix

A matrix to calculate distance on

A function to calculate distance

Extra parameters to my.function

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/utilities.R
```

Example 2 (unknown):
```unknown
CustomDistance.Rd
```

Example 3 (unknown):
```unknown
CustomDistance(my.mat, my.function, ...)
```

Example 4 (r):
```r
CustomDistance(my.mat, my.function, ...)
```

Example 5 (r):
```r
CustomDistance(my.mat, my.function, ...)
```

Example 6 (javascript):
```javascript
data("pbmc_small")
# Define custom distance matrix
manhattan.distance <- function(x, y) return(sum(abs(x-y)))

input.data <- GetAssayData(pbmc_small, assay.type = "RNA", slot = "scale.data")
#> Warning: The following arguments are not used: assay.type
#> Warning: The `slot` argument of `GetAssayData()` is deprecated as of SeuratObject 5.0.0.
#> ℹ Please use the `layer` argument instead.
cell.manhattan.dist <- CustomDistance(input.data, manhattan.distance)
```

Example 7 (r):
```r
data("pbmc_small")
# Define custom distance matrix
manhattan.distance <- function(x, y) return(sum(abs(x-y)))

input.data <- GetAssayData(pbmc_small, assay.type = "RNA", slot = "scale.data")
#> Warning: The following arguments are not used: assay.type
#> Warning: The `slot` argument of `GetAssayData()` is deprecated as of SeuratObject 5.0.0.
#> ℹ Please use the `layer` argument instead.
cell.manhattan.dist <- CustomDistance(input.data, manhattan.distance)
```

Example 8 (r):
```r
data("pbmc_small")
# Define custom distance matrix
manhattan.distance <- function(x, y) return(sum(abs(x-y)))

input.data <- GetAssayData(pbmc_small, assay.type = "RNA", slot = "scale.data")
#> Warning: The following arguments are not used: assay.type
#> Warning: The `slot` argument of `GetAssayData()` is deprecated as of SeuratObject 5.0.0.
#> ℹ Please use the `layer` argument instead.
cell.manhattan.dist <- CustomDistance(input.data, manhattan.distance)
```

---

## Demultiplex samples based on data from cell 'hashing' — HTODemux • Seurat

**URL:** http://127.0.0.1:9173/seurat/reference/htodemux/index.html

**Contents:**
- Demultiplex samples based on data from cell 'hashing'
- Arguments
- Value
- See also
- Examples
- Contents

Assign sample-of-origin for each cell, annotate doublets.

Seurat object. Assumes that the hash tag oligo (HTO) data has been added and normalized.

Name of the Hashtag assay (HTO by default)

The quantile of inferred 'negative' distribution for each hashtag - over which the cell is considered 'positive'. Default is 0.99

Initial number of clusters for hashtags. Default is the # of hashtag oligo names + 1 (to account for negatives)

nstarts value for k-means clustering (for kfunc = "kmeans"). 100 by default

Clustering function for initial hashtag grouping. Default is "clara" for fast k-medoids clustering on large applications, also support "kmeans" for kmeans clustering

Number of samples to be drawn from the dataset used for clustering, for kfunc = "clara"

Sets the random seed. If NULL, seed is not set

The Seurat object with the following demultiplexed information stored in the meta data:

Name of hashtag with the highest signal

Name of hashtag with the second highest signal

The difference between signals for hash.maxID and hash.secondID

Classification result, with doublets/multiplets named by the top two highest hashtags

Global classification result (singlet, doublet or negative)

Classification result where doublet IDs are collapsed

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/preprocessing.R
```

Example 2 (unknown):
```unknown
HTODemux.Rd
```

Example 3 (unknown):
```unknown
HTODemux(
  object,
  assay = "HTO",
  positive.quantile = 0.99,
  init = NULL,
  nstarts = 100,
  kfunc = "clara",
  nsamples = 100,
  seed = 42,
  verbose = TRUE
)
```

Example 4 (r):
```r
HTODemux(
  object,
  assay = "HTO",
  positive.quantile = 0.99,
  init = NULL,
  nstarts = 100,
  kfunc = "clara",
  nsamples = 100,
  seed = 42,
  verbose = TRUE
)
```

Example 5 (r):
```r
HTODemux(
  object,
  assay = "HTO",
  positive.quantile = 0.99,
  init = NULL,
  nstarts = 100,
  kfunc = "clara",
  nsamples = 100,
  seed = 42,
  verbose = TRUE
)
```

Example 6 (unknown):
```unknown
if (FALSE) { # \dontrun{
object <- HTODemux(object)
} # }
```

Example 7 (r):
```r
if (FALSE) { # \dontrun{
object <- HTODemux(object)
} # }
```

Example 8 (r):
```r
if (FALSE) { # \dontrun{
object <- HTODemux(object)
} # }
```

---

## Read Data From Vitessce — ReadVitessce • Seurat

**URL:** http://127.0.0.1:9173/reference_readvitessce.html

**Contents:**
- Read Data From Vitessce
- Arguments
- Value
- Note
- Progress Updates with progressr
- Examples
- Contents

Read in data from Vitessce-formatted JSON files

Path or URL to a Vitessce-formatted JSON file with expression data; should end in “.genes.json” or “.clusters.json”; pass NULL to skip

Path or URL to a Vitessce-formatted JSON file with cell/spot spatial coordinates; should end in “.cells.json”; pass NULL to skip

Path or URL to a Vitessce-formatted JSON file with molecule spatial coordinates; should end in “.molecules.json”; pass NULL to skip

Type of cell/spot spatial coordinates to return, choose one or more from:

“segmentations” cell/spot segmentations

“centroids” cell/spot centroids

A character to filter molecules by, pass NA to skip molecule filtering

Path to a directory containing Vitessce cells and clusters JSONs

Name to store expression matrix as

ReadVitessce: A list with some combination of the following values:

“counts”: if counts is not NULL, an expression matrix with cells as columns and features as rows

“centroids”: if coords is not NULL and type is contains“centroids”, a data frame with cell centroids in three columns: “x”, “y”, and “cell”

“segmentations”: if coords is not NULL and type contains “centroids”, a data frame with cell segmentations in three columns: “x”, “y” and “cell”

“molecules”: if molecules is not NULL, a data frame with molecule spatial coordinates in three columns: “x”, “y”, and “gene”

LoadHuBMAPCODEX: A Seurat object

This function requires the jsonlite package to be installed

This function uses progressr to render status updates and progress bars. To enable progress updates, wrap the function call in with_progress or run handlers(global = TRUE) before running this function. For more details about progressr, please read vignette("progressr-intro")

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/preprocessing.R
```

Example 2 (unknown):
```unknown
R/convenience.R
```

Example 3 (unknown):
```unknown
ReadVitessce.Rd
```

Example 4 (unknown):
```unknown
ReadVitessce(
  counts = NULL,
  coords = NULL,
  molecules = NULL,
  type = c("segmentations", "centroids"),
  filter = NA_character_
)

LoadHuBMAPCODEX(data.dir, fov, assay = "CODEX")
```

Example 5 (r):
```r
ReadVitessce(
  counts = NULL,
  coords = NULL,
  molecules = NULL,
  type = c("segmentations", "centroids"),
  filter = NA_character_
)

LoadHuBMAPCODEX(data.dir, fov, assay = "CODEX")
```

Example 6 (r):
```r
ReadVitessce(
  counts = NULL,
  coords = NULL,
  molecules = NULL,
  type = c("segmentations", "centroids"),
  filter = NA_character_
)

LoadHuBMAPCODEX(data.dir, fov, assay = "CODEX")
```

Example 7 (unknown):
```unknown
.genes.json
```

Example 8 (unknown):
```unknown
.clusters.json
```

Example 9 (unknown):
```unknown
.cells.json
```

Example 10 (unknown):
```unknown
.molecules.json
```

Example 11 (unknown):
```unknown
ReadVitessce
```

Example 12 (unknown):
```unknown
segmentations
```

Example 13 (unknown):
```unknown
LoadHuBMAPCODEX
```

Example 14 (unknown):
```unknown
with_progress
```

Example 15 (unknown):
```unknown
handlers(global = TRUE)
```

Example 16 (unknown):
```unknown
vignette("progressr-intro")
```

Example 17 (unknown):
```unknown
if (FALSE) { # \dontrun{
coords <- ReadVitessce(
  counts =
     "https://s3.amazonaws.com/vitessce-data/0.0.31/master_release/wang/wang.genes.json",
  coords =
     "https://s3.amazonaws.com/vitessce-data/0.0.31/master_release/wang/wang.cells.json",
  molecules =
     "https://s3.amazonaws.com/vitessce-data/0.0.31/master_release/wang/wang.molecules.json"
)
names(coords)
coords$counts[1:10, 1:10]
head(coords$centroids)
head(coords$segmentations)
head(coords$molecules)
} # }
```

Example 18 (r):
```r
if (FALSE) { # \dontrun{
coords <- ReadVitessce(
  counts =
     "https://s3.amazonaws.com/vitessce-data/0.0.31/master_release/wang/wang.genes.json",
  coords =
     "https://s3.amazonaws.com/vitessce-data/0.0.31/master_release/wang/wang.cells.json",
  molecules =
     "https://s3.amazonaws.com/vitessce-data/0.0.31/master_release/wang/wang.molecules.json"
)
names(coords)
coords$counts[1:10, 1:10]
head(coords$centroids)
head(coords$segmentations)
head(coords$molecules)
} # }
```

Example 19 (r):
```r
if (FALSE) { # \dontrun{
coords <- ReadVitessce(
  counts =
     "https://s3.amazonaws.com/vitessce-data/0.0.31/master_release/wang/wang.genes.json",
  coords =
     "https://s3.amazonaws.com/vitessce-data/0.0.31/master_release/wang/wang.cells.json",
  molecules =
     "https://s3.amazonaws.com/vitessce-data/0.0.31/master_release/wang/wang.molecules.json"
)
names(coords)
coords$counts[1:10, 1:10]
head(coords$centroids)
head(coords$segmentations)
head(coords$molecules)
} # }
```

---

## Integrate embeddings from the integrated sketched.assay — ProjectIntegration • Seurat

**URL:** http://127.0.0.1:9173/seurat/reference/projectintegration/index.html

**Contents:**
- Integrate embeddings from the integrated sketched.assay
- Arguments
- Value
- Details
- Contents

The main steps of this procedure are outlined below. For a more detailed description of the methodology, please see Hao, et al Biorxiv 2022: doi:10.1101/2022.02.24.481684

A Seurat object with all cells for one dataset

Assay name for sketched-cell expression (default is 'sketch')

Assay name for original expression (default is 'RNA')

Dimensional reduction name for batch-corrected embeddings in the sketched object (default is 'integrated_dr')

Features used for atomic sketch integration

Names of layers for correction.

Name to save new reduction as; defaults to paste0(reduction, '.orig')

Key for new dimensional reduction; defaults to creating one from reduction.name

Methods to construct sketch-cell representation for all cells (default is 'sketch'). Can be one of:

“sketch”: Use random sketched data slot

“data”: Use data slot

Sketch ratio of data slot when dictionary.method is set to “sketch”; defaults to 0.8

Names of sketched layers, defaults to all layers of “object[[assay]]”

A positive integer. The seed for the random number generator, defaults to 123.

Print progress and message

Returns a Seurat object with an integrated dimensional reduction

First learn a atom dictionary representation to reconstruct each cell. Then, using this dictionary representation, reconstruct the embeddings of each cell from the integrated atoms.

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/integration.R
```

Example 2 (unknown):
```unknown
ProjectIntegration.Rd
```

Example 3 (unknown):
```unknown
ProjectIntegration(
  object,
  sketched.assay = "sketch",
  assay = "RNA",
  reduction = "integrated_dr",
  features = NULL,
  layers = "data",
  reduction.name = NULL,
  reduction.key = NULL,
  method = c("sketch", "data"),
  ratio = 0.8,
  sketched.layers = NULL,
  seed = 123,
  verbose = TRUE
)
```

Example 4 (r):
```r
ProjectIntegration(
  object,
  sketched.assay = "sketch",
  assay = "RNA",
  reduction = "integrated_dr",
  features = NULL,
  layers = "data",
  reduction.name = NULL,
  reduction.key = NULL,
  method = c("sketch", "data"),
  ratio = 0.8,
  sketched.layers = NULL,
  seed = 123,
  verbose = TRUE
)
```

Example 5 (r):
```r
ProjectIntegration(
  object,
  sketched.assay = "sketch",
  assay = "RNA",
  reduction = "integrated_dr",
  features = NULL,
  layers = "data",
  reduction.name = NULL,
  reduction.key = NULL,
  method = c("sketch", "data"),
  ratio = 0.8,
  sketched.layers = NULL,
  seed = 123,
  verbose = TRUE
)
```

Example 6 (unknown):
```unknown
paste0(reduction, '.orig')
```

Example 7 (unknown):
```unknown
reduction.name
```

Example 8 (unknown):
```unknown
dictionary.method
```

Example 9 (unknown):
```unknown
object[[assay]]
```

---

## Match the case of character vectors — CaseMatch • Seurat

**URL:** http://127.0.0.1:9173/seurat/reference/casematch/index.html

**Contents:**
- Match the case of character vectors
- Arguments
- Value
- Examples
- Contents

Match the case of character vectors

A vector of search terms

A vector of characters whose case should be matched

Values from search present in match with the case of match

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/utilities.R
```

Example 2 (unknown):
```unknown
CaseMatch.Rd
```

Example 3 (unknown):
```unknown
CaseMatch(search, match)
```

Example 4 (r):
```r
CaseMatch(search, match)
```

Example 5 (r):
```r
CaseMatch(search, match)
```

Example 6 (unknown):
```unknown
data("pbmc_small")
cd_genes <- c('Cd79b', 'Cd19', 'Cd200')
CaseMatch(search = cd_genes, match = rownames(x = pbmc_small))
#>   Cd79b    Cd19   Cd200 
#> "CD79B"  "CD19" "CD200"
```

Example 7 (r):
```r
data("pbmc_small")
cd_genes <- c('Cd79b', 'Cd19', 'Cd200')
CaseMatch(search = cd_genes, match = rownames(x = pbmc_small))
#>   Cd79b    Cd19   Cd200 
#> "CD79B"  "CD19" "CD200"
```

Example 8 (r):
```r
data("pbmc_small")
cd_genes <- c('Cd79b', 'Cd19', 'Cd200')
CaseMatch(search = cd_genes, match = rownames(x = pbmc_small))
#>   Cd79b    Cd19   Cd200 
#> "CD79B"  "CD19" "CD200"
```

---

## Function to prepare data for Linear Discriminant Analysis. — PrepLDA • Seurat

**URL:** http://127.0.0.1:9173/reference_preplda.html

**Contents:**
- Function to prepare data for Linear Discriminant Analysis.
- Arguments
- Value
- Contents

This function performs unsupervised PCA on each mixscape class separately and projects each subspace onto all cells in the data.

An object of class Seurat.

Assay to use for selection of DE genes.

Assay to use for running Principle components analysis.

Meta data column with target gene class labels.

Name of non-targeting cell class.

Number of principle components to use.

Limit testing to genes which show, on average, at least X-fold difference (log-scale) between the two groups of cells. Default is 0.25. Increasing logfc.threshold speeds up the function, but can miss weaker signals.

Returns a list of the first 10 PCs from each projection.

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/mixscape.R
```

Example 2 (unknown):
```unknown
PrepLDA(
  object,
  de.assay = "RNA",
  pc.assay = "PRTB",
  labels = "gene",
  nt.label = "NT",
  npcs = 10,
  verbose = TRUE,
  logfc.threshold = 0.25
)
```

Example 3 (r):
```r
PrepLDA(
  object,
  de.assay = "RNA",
  pc.assay = "PRTB",
  labels = "gene",
  nt.label = "NT",
  npcs = 10,
  verbose = TRUE,
  logfc.threshold = 0.25
)
```

Example 4 (r):
```r
PrepLDA(
  object,
  de.assay = "RNA",
  pc.assay = "PRTB",
  labels = "gene",
  nt.label = "NT",
  npcs = 10,
  verbose = TRUE,
  logfc.threshold = 0.25
)
```

---

## Filter stray beads from Slide-seq puck — FilterSlideSeq • Seurat

**URL:** http://127.0.0.1:9173/seurat/reference/filterslideseq/index.html

**Contents:**
- Filter stray beads from Slide-seq puck
- Arguments
- Value
- Examples
- Contents

This function is useful for removing stray beads that fall outside the main Slide-seq puck area. Essentially, it's a circular filter where you set a center and radius defining a circle of beads to keep. If the center is not set, it will be estimated from the bead coordinates (removing the 1st and 99th quantile to avoid skewing the center by the stray beads). By default, this function will display a SpatialDimPlot showing which cells were removed for easy adjustment of the center and/or radius.

Seurat object with slide-seq data

Name of the image where the coordinates are stored

Vector specifying the x and y coordinates for the center of the inclusion circle

Radius of the circle of inclusion

Display a SpatialDimPlot with the cells being removed labeled.

Returns a Seurat object with only the subset of cells that pass the circular filter

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/objects.R
```

Example 2 (unknown):
```unknown
FilterSlideSeq.Rd
```

Example 3 (unknown):
```unknown
SpatialDimPlot
```

Example 4 (unknown):
```unknown
FilterSlideSeq(
  object,
  image = "image",
  center = NULL,
  radius = NULL,
  do.plot = TRUE
)
```

Example 5 (r):
```r
FilterSlideSeq(
  object,
  image = "image",
  center = NULL,
  radius = NULL,
  do.plot = TRUE
)
```

Example 6 (r):
```r
FilterSlideSeq(
  object,
  image = "image",
  center = NULL,
  radius = NULL,
  do.plot = TRUE
)
```

Example 7 (unknown):
```unknown
SpatialDimPlot
```

Example 8 (unknown):
```unknown
if (FALSE) { # \dontrun{
# This example uses the ssHippo dataset which you can download
# using the SeuratData package.
library(SeuratData)
data('ssHippo')
# perform filtering of beads
ssHippo.filtered <- FilterSlideSeq(ssHippo, radius = 2300)
# This radius looks to small so increase and repeat until satisfied
} # }
```

Example 9 (r):
```r
if (FALSE) { # \dontrun{
# This example uses the ssHippo dataset which you can download
# using the SeuratData package.
library(SeuratData)
data('ssHippo')
# perform filtering of beads
ssHippo.filtered <- FilterSlideSeq(ssHippo, radius = 2300)
# This radius looks to small so increase and repeat until satisfied
} # }
```

Example 10 (r):
```r
if (FALSE) { # \dontrun{
# This example uses the ssHippo dataset which you can download
# using the SeuratData package.
library(SeuratData)
data('ssHippo')
# perform filtering of beads
ssHippo.filtered <- FilterSlideSeq(ssHippo, radius = 2300)
# This radius looks to small so increase and repeat until satisfied
} # }
```

---

## Load the Annoy index file — LoadAnnoyIndex • Seurat

**URL:** http://127.0.0.1:9173/seurat/reference/loadannoyindex/index.html

**Contents:**
- Load the Annoy index file
- Arguments
- Value
- Contents

Load the Annoy index file

Path to file with annoy index

Returns the Neighbor object with the index stored

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/utilities.R
```

Example 2 (unknown):
```unknown
LoadAnnoyIndex.Rd
```

Example 3 (unknown):
```unknown
LoadAnnoyIndex(object, file)
```

Example 4 (r):
```r
LoadAnnoyIndex(object, file)
```

Example 5 (r):
```r
LoadAnnoyIndex(object, file)
```

---

## Construct a dictionary representation for each unimodal dataset — BridgeCellsRepresentation • Seurat

**URL:** http://127.0.0.1:9173/reference_bridgecellsrepresentation.html

**Contents:**
- Construct a dictionary representation for each unimodal dataset
- Arguments
- Value
- Contents

Construct a dictionary representation for each unimodal dataset

A list of Seurat objects

A multi-omic bridge Seurat which is used as the basis to represent unimodal datasets

A list of dimensional reductions from object.list used to be reconstructed by bridge.object

A list of dimensional reductions from bridge.object used to reconstruct object.reduction

Name of bridge graph laplacian dimensional reduction

Dimensions used for bridge graph laplacian dimensional reduction

Assay name used for bridge object reconstruction value (default is 'Bridge')

Whether to return all assays in the object.list. Only bridge assay is returned by default.

Whether to l2 normalize the dictionary representation

Print messages and progress

Returns a object list in which each object has a bridge cell derived assay

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/integration.R
```

Example 2 (unknown):
```unknown
BridgeCellsRepresentation.Rd
```

Example 3 (unknown):
```unknown
BridgeCellsRepresentation(
  object.list,
  bridge.object,
  object.reduction,
  bridge.reduction,
  laplacian.reduction = "lap",
  laplacian.dims = 1:50,
  bridge.assay.name = "Bridge",
  return.all.assays = FALSE,
  l2.norm = TRUE,
  verbose = TRUE
)
```

Example 4 (r):
```r
BridgeCellsRepresentation(
  object.list,
  bridge.object,
  object.reduction,
  bridge.reduction,
  laplacian.reduction = "lap",
  laplacian.dims = 1:50,
  bridge.assay.name = "Bridge",
  return.all.assays = FALSE,
  l2.norm = TRUE,
  verbose = TRUE
)
```

Example 5 (r):
```r
BridgeCellsRepresentation(
  object.list,
  bridge.object,
  object.reduction,
  bridge.reduction,
  laplacian.reduction = "lap",
  laplacian.dims = 1:50,
  bridge.assay.name = "Bridge",
  return.all.assays = FALSE,
  l2.norm = TRUE,
  verbose = TRUE
)
```

---

## Find subclusters under one cluster — FindSubCluster • Seurat

**URL:** http://127.0.0.1:9173/reference_findsubcluster.html

**Contents:**
- Find subclusters under one cluster
- Arguments
- Value
- Contents

Find subclusters under one cluster

the cluster to be sub-clustered

Name of graph to use for the clustering algorithm

the name of sub cluster added in the meta.data

Value of the resolution parameter, use a value above (below) 1.0 if you want to obtain a larger (smaller) number of communities.

Algorithm for modularity optimization (1 = original Louvain algorithm; 2 = Louvain algorithm with multilevel refinement; 3 = SLM algorithm; 4 = Leiden algorithm).

return a object with sub cluster labels in the sub-cluster.name variable

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/clustering.R
```

Example 2 (unknown):
```unknown
FindSubCluster.Rd
```

Example 3 (unknown):
```unknown
FindSubCluster(
  object,
  cluster,
  graph.name,
  subcluster.name = "sub.cluster",
  resolution = 0.5,
  algorithm = 1
)
```

Example 4 (r):
```r
FindSubCluster(
  object,
  cluster,
  graph.name,
  subcluster.name = "sub.cluster",
  resolution = 0.5,
  algorithm = 1
)
```

Example 5 (r):
```r
FindSubCluster(
  object,
  cluster,
  graph.name,
  subcluster.name = "sub.cluster",
  resolution = 0.5,
  algorithm = 1
)
```

---

## The JackStrawData Class — JackStrawData-class • Seurat

**URL:** http://127.0.0.1:9173/seurat/reference/jackstrawdata-class/index.html

**Contents:**
- The JackStrawData Class
- See also
- Contents

For more details, please see the documentation in SeuratObject

SeuratObject::JackStrawData-class

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/reexports.R
```

Example 2 (unknown):
```unknown
JackStrawData-class.Rd
```

Example 3 (unknown):
```unknown
SeuratObject
```

Example 4 (unknown):
```unknown
SeuratObject::JackStrawData-class
```

---

## Run Independent Component Analysis on gene expression — RunICA • Seurat

**URL:** http://127.0.0.1:9173/seurat/reference/runica/index.html

**Contents:**
- Run Independent Component Analysis on gene expression
- Arguments
- Contents

Run fastica algorithm from the ica package for ICA dimensionality reduction. For details about stored ICA calculation parameters, see PrintICAParams.

Additional arguments to be passed to fastica

Name of Assay ICA is being run on

Number of ICs to compute

By default, computes the dimensional reduction on the cell x feature matrix. Setting to true will compute it on the transpose (feature x cell matrix).

ICA function from ica package to run (options: icafast, icaimax, icajade)

Print the top genes associated with high/low loadings for the ICs

ICs to print genes for

Number of genes to print for each IC

dimensional reduction name

dimensional reduction key, specifies the string before the number for the dimension names.

Set a random seed. Setting NULL will not set a seed.

Features to compute ICA on

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/generics.R
```

Example 2 (unknown):
```unknown
R/dimensional_reduction.R
```

Example 3 (unknown):
```unknown
PrintICAParams
```

Example 4 (python):
```python
RunICA(object, ...)

# Default S3 method
RunICA(
  object,
  assay = NULL,
  nics = 50,
  rev.ica = FALSE,
  ica.function = "icafast",
  verbose = TRUE,
  ndims.print = 1:5,
  nfeatures.print = 30,
  reduction.name = "ica",
  reduction.key = "ica_",
  seed.use = 42,
  ...
)

# S3 method for class 'Assay'
RunICA(
  object,
  assay = NULL,
  features = NULL,
  nics = 50,
  rev.ica = FALSE,
  ica.function = "icafast",
  verbose = TRUE,
  ndims.print = 1:5,
  nfeatures.print = 30,
  reduction.name = "ica",
  reduction.key = "ica_",
  seed.use = 42,
  ...
)

# S3 method for class 'Seurat'
RunICA(
  object,
  assay = NULL,
  features = NULL,
  nics = 50,
  rev.ica = FALSE,
  ica.function = "icafast",
  verbose = TRUE,
  ndims.print = 1:5,
  nfeatures.print = 30,
  reduction.name = "ica",
  reduction.key = "IC_",
  seed.use = 42,
  ...
)
```

Example 5 (r):
```r
RunICA(object, ...)

# Default S3 method
RunICA(
  object,
  assay = NULL,
  nics = 50,
  rev.ica = FALSE,
  ica.function = "icafast",
  verbose = TRUE,
  ndims.print = 1:5,
  nfeatures.print = 30,
  reduction.name = "ica",
  reduction.key = "ica_",
  seed.use = 42,
  ...
)

# S3 method for class 'Assay'
RunICA(
  object,
  assay = NULL,
  features = NULL,
  nics = 50,
  rev.ica = FALSE,
  ica.function = "icafast",
  verbose = TRUE,
  ndims.print = 1:5,
  nfeatures.print = 30,
  reduction.name = "ica",
  reduction.key = "ica_",
  seed.use = 42,
  ...
)

# S3 method for class 'Seurat'
RunICA(
  object,
  assay = NULL,
  features = NULL,
  nics = 50,
  rev.ica = FALSE,
  ica.function = "icafast",
  verbose = TRUE,
  ndims.print = 1:5,
  nfeatures.print = 30,
  reduction.name = "ica",
  reduction.key = "IC_",
  seed.use = 42,
  ...
)
```

Example 6 (r):
```r
RunICA(object, ...)

# Default S3 method
RunICA(
  object,
  assay = NULL,
  nics = 50,
  rev.ica = FALSE,
  ica.function = "icafast",
  verbose = TRUE,
  ndims.print = 1:5,
  nfeatures.print = 30,
  reduction.name = "ica",
  reduction.key = "ica_",
  seed.use = 42,
  ...
)

# S3 method for class 'Assay'
RunICA(
  object,
  assay = NULL,
  features = NULL,
  nics = 50,
  rev.ica = FALSE,
  ica.function = "icafast",
  verbose = TRUE,
  ndims.print = 1:5,
  nfeatures.print = 30,
  reduction.name = "ica",
  reduction.key = "ica_",
  seed.use = 42,
  ...
)

# S3 method for class 'Seurat'
RunICA(
  object,
  assay = NULL,
  features = NULL,
  nics = 50,
  rev.ica = FALSE,
  ica.function = "icafast",
  verbose = TRUE,
  ndims.print = 1:5,
  nfeatures.print = 30,
  reduction.name = "ica",
  reduction.key = "IC_",
  seed.use = 42,
  ...
)
```

---

## Spatial Feature Plots — ImageFeaturePlot • Seurat

**URL:** http://127.0.0.1:9173/seurat/reference/imagefeatureplot/index.html

**Contents:**
- Spatial Feature Plots
- Arguments
- Value
- Contents

Visualize expression in a spatial context

Vector of features to plot. Features can come from:

An Assay feature (e.g. a gene name - "MS4A1")

A column name from meta.data (e.g. mitochondrial percentage - "percent.mito")

A column name from a DimReduc object corresponding to the cell embedding values (e.g. the PC 1 scores - "PC_1")

A vector of segmentation boundaries per image to plot; can be a character vector, a named character vector, or a named list. Names should be the names of FOVs and values should be the names of segmentation boundaries

The two colors to form the gradient over. Provide as string vector with the first color corresponding to low values, the second to high. Also accepts a Brewer color scale or vector of colors. Note: this will bin the data into number of colors provided. When blend is TRUE, takes anywhere from 1-3 colors:

Treated as color for double-negatives, will use default colors 2 and 3 for per-feature expression

Treated as colors for per-feature expression, will use default color 1 for double-negatives

First color used for double-negatives, colors 2 and 3 used for per-feature expression, all others ignored

Point size for cells when plotting centroids

Vector of minimum and maximum cutoff values for each feature, may specify quantile in the form of 'q##' where '##' is the quantile (eg, 'q1', 'q10')

A factor in object metadata to split the plot by, pass 'ident' to split by cell identity

A vector of molecules to plot

Point size for molecules

A vector of color for molecules. The "Set1" palette from RColorBrewer is used by default.

Max number of each molecule specified in `molecules` to plot

Alpha value for plotting (default is 1)

Color of cell segmentation border; pass NA to suppress borders for segmentation-based plots

Thickness of cell segmentation borders; pass NA to suppress borders for centroid-based plots

Set plot background to black

Scale and blend expression values to visualize coexpression of two features

The color cutoff from weak signal to strong signal; ranges from 0 to 1.

Crop the plots to area with cells only

Vector of cells to plot (default is all cells)

Set color scaling across multiple plots; choose from:

“feature”: Plots per-feature are scaled across splits

“all”: Plots per-feature are scaled across all features

“none”: Plots are not scaled; note: setting scale to “none” will result in color scales that are not comparable between plots

Ignored if blend = TRUE

Overlay boundaries from a single image to create a single plot; if TRUE, then boundaries are stacked in the order they're given (first is lowest)

Keep axes and panel background

Combine plots into a single patchworked ggplot object. If FALSE, return a list of ggplot objects

Plot cartesian coordinates with fixed aspect ratio

If combine = TRUE, a patchwork ggplot object; otherwise, a list of ggplot objects

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/visualization.R
```

Example 2 (unknown):
```unknown
ImageFeaturePlot.Rd
```

Example 3 (unknown):
```unknown
ImageFeaturePlot(
  object,
  features,
  fov = NULL,
  boundaries = NULL,
  cols = if (isTRUE(x = blend)) {
     c("lightgrey", "#ff0000", "#00ff00")
 } else {
   
     c("lightgrey", "firebrick1")
 },
  size = 0.5,
  min.cutoff = NA,
  max.cutoff = NA,
  split.by = NULL,
  molecules = NULL,
  mols.size = 0.1,
  mols.cols = NULL,
  nmols = 1000,
  alpha = 1,
  border.color = "white",
  border.size = NULL,
  dark.background = TRUE,
  blend = FALSE,
  blend.threshold = 0.5,
  crop = FALSE,
  cells = NULL,
  scale = c("feature", "all", "none"),
  overlap = FALSE,
  axes = FALSE,
  combine = TRUE,
  coord.fixed = TRUE
)
```

Example 4 (r):
```r
ImageFeaturePlot(
  object,
  features,
  fov = NULL,
  boundaries = NULL,
  cols = if (isTRUE(x = blend)) {
     c("lightgrey", "#ff0000", "#00ff00")
 } else {
   
     c("lightgrey", "firebrick1")
 },
  size = 0.5,
  min.cutoff = NA,
  max.cutoff = NA,
  split.by = NULL,
  molecules = NULL,
  mols.size = 0.1,
  mols.cols = NULL,
  nmols = 1000,
  alpha = 1,
  border.color = "white",
  border.size = NULL,
  dark.background = TRUE,
  blend = FALSE,
  blend.threshold = 0.5,
  crop = FALSE,
  cells = NULL,
  scale = c("feature", "all", "none"),
  overlap = FALSE,
  axes = FALSE,
  combine = TRUE,
  coord.fixed = TRUE
)
```

Example 5 (r):
```r
ImageFeaturePlot(
  object,
  features,
  fov = NULL,
  boundaries = NULL,
  cols = if (isTRUE(x = blend)) {
     c("lightgrey", "#ff0000", "#00ff00")
 } else {
   
     c("lightgrey", "firebrick1")
 },
  size = 0.5,
  min.cutoff = NA,
  max.cutoff = NA,
  split.by = NULL,
  molecules = NULL,
  mols.size = 0.1,
  mols.cols = NULL,
  nmols = 1000,
  alpha = 1,
  border.color = "white",
  border.size = NULL,
  dark.background = TRUE,
  blend = FALSE,
  blend.threshold = 0.5,
  crop = FALSE,
  cells = NULL,
  scale = c("feature", "all", "none"),
  overlap = FALSE,
  axes = FALSE,
  combine = TRUE,
  coord.fixed = TRUE
)
```

Example 6 (unknown):
```unknown
blend = TRUE
```

Example 7 (unknown):
```unknown
patchworked
```

Example 8 (unknown):
```unknown
combine = TRUE
```

---

## Function to plot perturbation score distributions. — PlotPerturbScore • Seurat

**URL:** http://127.0.0.1:9173/reference_plotperturbscore.html

**Contents:**
- Function to plot perturbation score distributions.
- Arguments
- Value
- Contents

Density plots to visualize perturbation scores calculated from RunMixscape function.

An object of class Seurat.

meta data column specifying all target gene names in the experiment.

Target gene name to visualize perturbation scores for.

meta data column specifying mixscape classifications.

Specify color of target gene class or knockout cell class. For control non-targeting and non-perturbed cells, colors are set to different shades of grey.

For datasets with more than one cell type. Set equal TRUE to visualize perturbation scores for each cell type separately.

Option to split densities based on mixscape classification (default) or original target gene classification. Default is set to NULL and plots cells by original class ID.

specify type of CRISPR perturbation expected for labeling mixscape classifications. Default is KO.

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/mixscape.R
```

Example 2 (unknown):
```unknown
PlotPerturbScore.Rd
```

Example 3 (python):
```python
PlotPerturbScore(
  object,
  target.gene.class = "gene",
  target.gene.ident = NULL,
  mixscape.class = "mixscape_class",
  col = "orange2",
  split.by = NULL,
  before.mixscape = FALSE,
  prtb.type = "KO"
)
```

Example 4 (r):
```r
PlotPerturbScore(
  object,
  target.gene.class = "gene",
  target.gene.ident = NULL,
  mixscape.class = "mixscape_class",
  col = "orange2",
  split.by = NULL,
  before.mixscape = FALSE,
  prtb.type = "KO"
)
```

Example 5 (r):
```r
PlotPerturbScore(
  object,
  target.gene.class = "gene",
  target.gene.ident = NULL,
  mixscape.class = "mixscape_class",
  col = "orange2",
  split.by = NULL,
  before.mixscape = FALSE,
  prtb.type = "KO"
)
```

---

## Metric for evaluating mapping success — MappingScore • Seurat

**URL:** http://127.0.0.1:9173/seurat/reference/mappingscore/index.html

**Contents:**
- Metric for evaluating mapping success
- Arguments
- Value
- Contents

This metric was designed to help identify query cells that aren't well represented in the reference dataset. The intuition for the score is that we are going to project the query cells into a reference-defined space and then project them back onto the query. By comparing the neighborhoods before and after projection, we identify cells who's local neighborhoods are the most affected by this transformation. This could be because there is a population of query cells that aren't present in the reference or the state of the cells in the query is significantly different from the equivalent cell type in the reference.

AnchorSet object or just anchor matrix from the Anchorset object returned from FindTransferAnchors

Reserved for internal use

Combined object (ref + query) from the Anchorset object returned

Neighbors object computed on query cells

Reference embeddings matrix

Query embeddings matrix

Number of anchors to use in projection steps when computing weights

Number of dimensions to use when working with low dimensional projections of the data

Number of cells to average over when computing transition probabilities

Number of cells to average over when determining the kernel bandwidth from the SNN graph

Amount of pruning to apply to edges in SNN graph

Option to the scoring function when computing distances to subtract the distance to the first nearest neighbor

Nearest neighbor method to use (annoy or RANN)

More trees gives higher precision when using annoy approximate nearest neighbor search

Query weights matrix for reuse

Display messages/progress

Returns a vector of cell scores

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/generics.R
```

Example 2 (unknown):
```unknown
R/integration.R
```

Example 3 (unknown):
```unknown
MappingScore.Rd
```

Example 4 (python):
```python
MappingScore(anchors, ...)

# Default S3 method
MappingScore(
  anchors,
  combined.object,
  query.neighbors,
  ref.embeddings,
  query.embeddings,
  kanchors = 50,
  ndim = 50,
  ksmooth = 100,
  ksnn = 20,
  snn.prune = 0,
  subtract.first.nn = TRUE,
  nn.method = "annoy",
  n.trees = 50,
  query.weights = NULL,
  verbose = TRUE,
  ...
)

# S3 method for class 'AnchorSet'
MappingScore(
  anchors,
  kanchors = 50,
  ndim = 50,
  ksmooth = 100,
  ksnn = 20,
  snn.prune = 0,
  subtract.first.nn = TRUE,
  nn.method = "annoy",
  n.trees = 50,
  query.weights = NULL,
  verbose = TRUE,
  ...
)
```

Example 5 (r):
```r
MappingScore(anchors, ...)

# Default S3 method
MappingScore(
  anchors,
  combined.object,
  query.neighbors,
  ref.embeddings,
  query.embeddings,
  kanchors = 50,
  ndim = 50,
  ksmooth = 100,
  ksnn = 20,
  snn.prune = 0,
  subtract.first.nn = TRUE,
  nn.method = "annoy",
  n.trees = 50,
  query.weights = NULL,
  verbose = TRUE,
  ...
)

# S3 method for class 'AnchorSet'
MappingScore(
  anchors,
  kanchors = 50,
  ndim = 50,
  ksmooth = 100,
  ksnn = 20,
  snn.prune = 0,
  subtract.first.nn = TRUE,
  nn.method = "annoy",
  n.trees = 50,
  query.weights = NULL,
  verbose = TRUE,
  ...
)
```

Example 6 (r):
```r
MappingScore(anchors, ...)

# Default S3 method
MappingScore(
  anchors,
  combined.object,
  query.neighbors,
  ref.embeddings,
  query.embeddings,
  kanchors = 50,
  ndim = 50,
  ksmooth = 100,
  ksnn = 20,
  snn.prune = 0,
  subtract.first.nn = TRUE,
  nn.method = "annoy",
  n.trees = 50,
  query.weights = NULL,
  verbose = TRUE,
  ...
)

# S3 method for class 'AnchorSet'
MappingScore(
  anchors,
  kanchors = 50,
  ndim = 50,
  ksmooth = 100,
  ksnn = 20,
  snn.prune = 0,
  subtract.first.nn = TRUE,
  nn.method = "annoy",
  n.trees = 50,
  query.weights = NULL,
  verbose = TRUE,
  ...
)
```

---

## Calculates a mixing metric — MixingMetric • Seurat

**URL:** http://127.0.0.1:9173/seurat/reference/mixingmetric/index.html

**Contents:**
- Calculates a mixing metric
- Arguments
- Value
- Contents

Here we compute a measure of how well mixed a composite dataset is. To compute, we first examine the local neighborhood for each cell (looking at max.k neighbors) and determine for each group (could be the dataset after integration) the k nearest neighbor and what rank that neighbor was in the overall neighborhood. We then take the median across all groups as the mixing metric per cell.

Grouping variable for dataset

Which dimensionally reduced space to use

Neighbor number to examine per group

Maximum size of local neighborhood to compute

Error bound on the neighbor finding algorithm (from RANN)

Displays progress bar

Returns a vector of values of the mixing metric for each cell

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/integration.R
```

Example 2 (unknown):
```unknown
MixingMetric.Rd
```

Example 3 (unknown):
```unknown
MixingMetric(
  object,
  grouping.var,
  reduction = "pca",
  dims = 1:2,
  k = 5,
  max.k = 300,
  eps = 0,
  verbose = TRUE
)
```

Example 4 (r):
```r
MixingMetric(
  object,
  grouping.var,
  reduction = "pca",
  dims = 1:2,
  k = 5,
  max.k = 300,
  eps = 0,
  verbose = TRUE
)
```

Example 5 (r):
```r
MixingMetric(
  object,
  grouping.var,
  reduction = "pca",
  dims = 1:2,
  k = 5,
  max.k = 300,
  eps = 0,
  verbose = TRUE
)
```

---

## L2-normalization — L2Dim • Seurat

**URL:** http://127.0.0.1:9173/reference_l2dim.html

**Contents:**
- L2-normalization
- Arguments
- Value
- Contents

Perform l2 normalization on given dimensional reduction

Dimensional reduction to normalize

name of new dimensional reduction to store (default is olddr.l2)

name of key for new dimensional reduction

Returns a Seurat object

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/dimensional_reduction.R
```

Example 2 (unknown):
```unknown
L2Dim(object, reduction, new.dr = NULL, new.key = NULL)
```

Example 3 (r):
```r
L2Dim(object, reduction, new.dr = NULL, new.key = NULL)
```

Example 4 (r):
```r
L2Dim(object, reduction, new.dr = NULL, new.key = NULL)
```

---

## Transfer data from sketch data to full data — TransferSketchLabels • Seurat

**URL:** http://127.0.0.1:9173/seurat/reference/transfersketchlabels/index.html

**Contents:**
- Transfer data from sketch data to full data
- Arguments
- Value
- Contents

This function transfers cell type labels from a sketched dataset to a full dataset based on the similarities in the lower dimensional space.

Sketched assay name. Default is 'sketch'.

Dimensional reduction name to use for label transfer.

An integer vector indicating which dimensions to use for label transfer.

A list of character strings indicating the metadata columns containing labels to transfer. Default is NULL. Similar to refdata in `MapQuery`

Number of neighbors to use for label transfer. Default is 50.

Dimensional reduction model to use for label transfer. Default is NULL.

An object storing the neighbors found during the sketching process. Default is NULL.

Whether to recompute the neighbors for label transfer. Default is FALSE.

Whether to recompute the weights for label transfer. Default is FALSE.

Print progress and diagnostic messages

A Seurat object with transferred labels stored in the metadata. If a UMAP model is provided, the full data are also projected onto the UMAP space, with the results stored in a new reduction, full.`reduction.model`

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/sketching.R
```

Example 2 (unknown):
```unknown
TransferSketchLabels.Rd
```

Example 3 (unknown):
```unknown
TransferSketchLabels(
  object,
  sketched.assay = "sketch",
  reduction,
  dims,
  refdata = NULL,
  k = 50,
  reduction.model = NULL,
  neighbors = NULL,
  recompute.neighbors = FALSE,
  recompute.weights = FALSE,
  verbose = TRUE
)
```

Example 4 (r):
```r
TransferSketchLabels(
  object,
  sketched.assay = "sketch",
  reduction,
  dims,
  refdata = NULL,
  k = 50,
  reduction.model = NULL,
  neighbors = NULL,
  recompute.neighbors = FALSE,
  recompute.weights = FALSE,
  verbose = TRUE
)
```

Example 5 (r):
```r
TransferSketchLabels(
  object,
  sketched.assay = "sketch",
  reduction,
  dims,
  refdata = NULL,
  k = 50,
  reduction.model = NULL,
  neighbors = NULL,
  recompute.neighbors = FALSE,
  recompute.weights = FALSE,
  verbose = TRUE
)
```

---

## Hashtag oligo heatmap — HTOHeatmap • Seurat

**URL:** http://127.0.0.1:9173/seurat/reference/htoheatmap/index.html

**Contents:**
- Hashtag oligo heatmap
- Arguments
- Value
- See also
- Examples
- Contents

Draws a heatmap of hashtag oligo signals across singlets/doublets/negative cells. Allows for the visualization of HTO demultiplexing results.

Seurat object. Assumes that the hash tag oligo (HTO) data has been added and normalized, and demultiplexing has been run with HTODemux().

The naming for metadata column with classification result from HTODemux().

The slot for metadata column specifying a cell as singlet/doublet/negative.

Number of cells to plot. Default is to choose 5000 cells by random subsampling, to avoid having to draw exceptionally large heatmaps.

Namings for the singlets. Default is to use the same names as HTOs.

If true, plot with geom_raster, else use geom_tile. geom_raster may look blurry on some viewing applications such as Preview due to how the raster is interpolated. Set this to FALSE if you are encountering that issue (note that plots may take longer to produce/render).

Returns a ggplot2 plot object.

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/visualization.R
```

Example 2 (unknown):
```unknown
HTOHeatmap.Rd
```

Example 3 (unknown):
```unknown
HTOHeatmap(
  object,
  assay = "HTO",
  classification = paste0(assay, "_classification"),
  global.classification = paste0(assay, "_classification.global"),
  ncells = 5000,
  singlet.names = NULL,
  raster = TRUE
)
```

Example 4 (r):
```r
HTOHeatmap(
  object,
  assay = "HTO",
  classification = paste0(assay, "_classification"),
  global.classification = paste0(assay, "_classification.global"),
  ncells = 5000,
  singlet.names = NULL,
  raster = TRUE
)
```

Example 5 (r):
```r
HTOHeatmap(
  object,
  assay = "HTO",
  classification = paste0(assay, "_classification"),
  global.classification = paste0(assay, "_classification.global"),
  ncells = 5000,
  singlet.names = NULL,
  raster = TRUE
)
```

Example 6 (unknown):
```unknown
if (FALSE) { # \dontrun{
object <- HTODemux(object)
HTOHeatmap(object)
} # }
```

Example 7 (r):
```r
if (FALSE) { # \dontrun{
object <- HTODemux(object)
HTOHeatmap(object)
} # }
```

Example 8 (r):
```r
if (FALSE) { # \dontrun{
object <- HTODemux(object)
HTOHeatmap(object)
} # }
```

---

## Plot clusters as a tree — PlotClusterTree • Seurat

**URL:** http://127.0.0.1:9173/seurat/reference/plotclustertree/index.html

**Contents:**
- Plot clusters as a tree
- Arguments
- Value
- Examples
- Contents

Plots previously computed tree (from BuildClusterTree)

A character string specifying the direction of the tree (default is downwards) Possible options: "rightwards", "leftwards", "upwards", and "downwards".

Additional arguments to ape::plot.phylo

Plots dendogram (must be precomputed using BuildClusterTree), returns no value

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/visualization.R
```

Example 2 (unknown):
```unknown
PlotClusterTree.Rd
```

Example 3 (unknown):
```unknown
PlotClusterTree(object, direction = "downwards", ...)
```

Example 4 (r):
```r
PlotClusterTree(object, direction = "downwards", ...)
```

Example 5 (r):
```r
PlotClusterTree(object, direction = "downwards", ...)
```

Example 6 (unknown):
```unknown
ape::plot.phylo
```

Example 7 (unknown):
```unknown
if (FALSE) { # \dontrun{
if (requireNamespace("ape", quietly = TRUE)) {
  data("pbmc_small")
  pbmc_small <- BuildClusterTree(object = pbmc_small)
  PlotClusterTree(object = pbmc_small)
}
} # }
```

Example 8 (r):
```r
if (FALSE) { # \dontrun{
if (requireNamespace("ape", quietly = TRUE)) {
  data("pbmc_small")
  pbmc_small <- BuildClusterTree(object = pbmc_small)
  PlotClusterTree(object = pbmc_small)
}
} # }
```

Example 9 (r):
```r
if (FALSE) { # \dontrun{
if (requireNamespace("ape", quietly = TRUE)) {
  data("pbmc_small")
  pbmc_small <- BuildClusterTree(object = pbmc_small)
  PlotClusterTree(object = pbmc_small)
}
} # }
```

---

## Phylogenetic Analysis of Identity Classes — BuildClusterTree • Seurat

**URL:** http://127.0.0.1:9173/seurat/reference/buildclustertree/index.html

**Contents:**
- Phylogenetic Analysis of Identity Classes
- Arguments
- Value
- Details
- Examples
- Contents

Constructs a phylogenetic tree relating the 'aggregate' cell from each identity class. Tree is estimated based on a distance matrix constructed in either gene expression space or PCA space.

Assay to use for the analysis.

Genes to use for the analysis. Default is the set of variable genes (VariableFeatures(object = object))

If set, tree is calculated in dimension reduction space; overrides features

Name of dimension reduction to use. Only used if dims is not NULL.

If graph is passed, build tree based on graph connectivity between clusters; overrides dims and features

Re-order identity classes (factor ordering), according to position on the tree. This groups similar classes together which can be helpful, for example, when drawing violin plots.

Re-order identity classes according to position on the tree, assigning a numeric value ('1' is the leftmost node)

Show progress updates

A Seurat object where the cluster tree can be accessed with Tool

Note that the tree is calculated for an 'aggregate' cell, so gene expression or PC scores are summed across all cells in an identity class before the tree is constructed.

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
BuildClusterTree.Rd
```

Example 2 (unknown):
```unknown
BuildClusterTree(
  object,
  assay = NULL,
  features = NULL,
  dims = NULL,
  reduction = "pca",
  graph = NULL,
  slot = "data",
  reorder = FALSE,
  reorder.numeric = FALSE,
  verbose = TRUE
)
```

Example 3 (r):
```r
BuildClusterTree(
  object,
  assay = NULL,
  features = NULL,
  dims = NULL,
  reduction = "pca",
  graph = NULL,
  slot = "data",
  reorder = FALSE,
  reorder.numeric = FALSE,
  verbose = TRUE
)
```

Example 4 (r):
```r
BuildClusterTree(
  object,
  assay = NULL,
  features = NULL,
  dims = NULL,
  reduction = "pca",
  graph = NULL,
  slot = "data",
  reorder = FALSE,
  reorder.numeric = FALSE,
  verbose = TRUE
)
```

Example 5 (unknown):
```unknown
VariableFeatures(object = object)
```

Example 6 (unknown):
```unknown
if (FALSE) { # \dontrun{
if (requireNamespace("ape", quietly = TRUE)) {
  data("pbmc_small")
  pbmc_small
  pbmc_small <- BuildClusterTree(object = pbmc_small)
  Tool(object = pbmc_small, slot = 'BuildClusterTree')
}
} # }
```

Example 7 (r):
```r
if (FALSE) { # \dontrun{
if (requireNamespace("ape", quietly = TRUE)) {
  data("pbmc_small")
  pbmc_small
  pbmc_small <- BuildClusterTree(object = pbmc_small)
  Tool(object = pbmc_small, slot = 'BuildClusterTree')
}
} # }
```

Example 8 (r):
```r
if (FALSE) { # \dontrun{
if (requireNamespace("ape", quietly = TRUE)) {
  data("pbmc_small")
  pbmc_small
  pbmc_small <- BuildClusterTree(object = pbmc_small)
  Tool(object = pbmc_small, slot = 'BuildClusterTree')
}
} # }
```

---

## Scale and center the data. — ScaleData • Seurat

**URL:** http://127.0.0.1:9173/seurat/reference/scaledata/index.html

**Contents:**
- Scale and center the data.
- Arguments
- Details
- Contents

Scales and centers features in the dataset. If variables are provided in vars.to.regress, they are individually regressed against each feature, and the resulting residuals are then scaled and centered.

Arguments passed to other methods

Vector of features names to scale/center. Default is variable features.

Variables to regress out (previously latent.vars in RegressOut). For example, nUMI, or percent.mito.

Extra data to regress out, should be cells x latent data

Name of variable in object metadata or a vector or factor defining grouping of cells. See argument f in split for more details

Use a linear model or generalized linear model (poisson, negative binomial) for the regression. Options are 'linear' (default), 'poisson', and 'negbinom'

Regress on UMI count data. Default is FALSE for linear modeling, but automatically set to TRUE if model.use is 'negbinom' or 'poisson'

Whether to scale the data.

Whether to center the data.

Max value to return for scaled data. The default is 10. Setting this can help reduce the effects of features that are only expressed in a very small number of cells. If regressing out latent variables and using a non-linear model, the default is 50.

Default size for number of features to scale at in a single computation. Increasing block.size may speed up calculations but at an additional memory cost.

If object contains fewer than this number of cells, don't block for scaling calculations.

Displays a progress bar for scaling procedure

Name of Assay to scale

ScaleData now incorporates the functionality of the function formerly known as RegressOut (which regressed out given the effects of provided variables and then scaled the residuals). To make use of the regression functionality, simply pass the variables you want to remove to the vars.to.regress parameter.

Setting center to TRUE will center the expression for each feature by subtracting the average expression for that feature. Setting scale to TRUE will scale the expression level for each feature by dividing the centered feature expression levels by their standard deviations if center is TRUE and by their root mean square otherwise.

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/generics.R
```

Example 2 (unknown):
```unknown
R/preprocessing.R
```

Example 3 (unknown):
```unknown
ScaleData.Rd
```

Example 4 (python):
```python
ScaleData(object, ...)

# Default S3 method
ScaleData(
  object,
  features = NULL,
  vars.to.regress = NULL,
  latent.data = NULL,
  split.by = NULL,
  model.use = "linear",
  use.umi = FALSE,
  do.scale = TRUE,
  do.center = TRUE,
  scale.max = 10,
  block.size = 1000,
  min.cells.to.block = 3000,
  verbose = TRUE,
  ...
)

# S3 method for class 'IterableMatrix'
ScaleData(
  object,
  features = NULL,
  do.scale = TRUE,
  do.center = TRUE,
  scale.max = 10,
  ...
)

# S3 method for class 'Assay'
ScaleData(
  object,
  features = NULL,
  vars.to.regress = NULL,
  latent.data = NULL,
  split.by = NULL,
  model.use = "linear",
  use.umi = FALSE,
  do.scale = TRUE,
  do.center = TRUE,
  scale.max = 10,
  block.size = 1000,
  min.cells.to.block = 3000,
  verbose = TRUE,
  ...
)

# S3 method for class 'Seurat'
ScaleData(
  object,
  features = NULL,
  assay = NULL,
  vars.to.regress = NULL,
  split.by = NULL,
  model.use = "linear",
  use.umi = FALSE,
  do.scale = TRUE,
  do.center = TRUE,
  scale.max = 10,
  block.size = 1000,
  min.cells.to.block = 3000,
  verbose = TRUE,
  ...
)
```

Example 5 (r):
```r
ScaleData(object, ...)

# Default S3 method
ScaleData(
  object,
  features = NULL,
  vars.to.regress = NULL,
  latent.data = NULL,
  split.by = NULL,
  model.use = "linear",
  use.umi = FALSE,
  do.scale = TRUE,
  do.center = TRUE,
  scale.max = 10,
  block.size = 1000,
  min.cells.to.block = 3000,
  verbose = TRUE,
  ...
)

# S3 method for class 'IterableMatrix'
ScaleData(
  object,
  features = NULL,
  do.scale = TRUE,
  do.center = TRUE,
  scale.max = 10,
  ...
)

# S3 method for class 'Assay'
ScaleData(
  object,
  features = NULL,
  vars.to.regress = NULL,
  latent.data = NULL,
  split.by = NULL,
  model.use = "linear",
  use.umi = FALSE,
  do.scale = TRUE,
  do.center = TRUE,
  scale.max = 10,
  block.size = 1000,
  min.cells.to.block = 3000,
  verbose = TRUE,
  ...
)

# S3 method for class 'Seurat'
ScaleData(
  object,
  features = NULL,
  assay = NULL,
  vars.to.regress = NULL,
  split.by = NULL,
  model.use = "linear",
  use.umi = FALSE,
  do.scale = TRUE,
  do.center = TRUE,
  scale.max = 10,
  block.size = 1000,
  min.cells.to.block = 3000,
  verbose = TRUE,
  ...
)
```

Example 6 (r):
```r
ScaleData(object, ...)

# Default S3 method
ScaleData(
  object,
  features = NULL,
  vars.to.regress = NULL,
  latent.data = NULL,
  split.by = NULL,
  model.use = "linear",
  use.umi = FALSE,
  do.scale = TRUE,
  do.center = TRUE,
  scale.max = 10,
  block.size = 1000,
  min.cells.to.block = 3000,
  verbose = TRUE,
  ...
)

# S3 method for class 'IterableMatrix'
ScaleData(
  object,
  features = NULL,
  do.scale = TRUE,
  do.center = TRUE,
  scale.max = 10,
  ...
)

# S3 method for class 'Assay'
ScaleData(
  object,
  features = NULL,
  vars.to.regress = NULL,
  latent.data = NULL,
  split.by = NULL,
  model.use = "linear",
  use.umi = FALSE,
  do.scale = TRUE,
  do.center = TRUE,
  scale.max = 10,
  block.size = 1000,
  min.cells.to.block = 3000,
  verbose = TRUE,
  ...
)

# S3 method for class 'Seurat'
ScaleData(
  object,
  features = NULL,
  assay = NULL,
  vars.to.regress = NULL,
  split.by = NULL,
  model.use = "linear",
  use.umi = FALSE,
  do.scale = TRUE,
  do.center = TRUE,
  scale.max = 10,
  block.size = 1000,
  min.cells.to.block = 3000,
  verbose = TRUE,
  ...
)
```

---

## The Seurat Class — Seurat-class • Seurat

**URL:** http://127.0.0.1:9173/seurat/reference/seurat-class/index.html

**Contents:**
- The Seurat Class
- See also
- Contents

The Seurat object is a representation of single-cell expression data for R; for more details, please see the documentation in SeuratObject

SeuratObject::Seurat-class

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/reexports.R
```

Example 2 (unknown):
```unknown
Seurat-class.Rd
```

Example 3 (unknown):
```unknown
SeuratObject
```

Example 4 (unknown):
```unknown
SeuratObject::Seurat-class
```

---

## Load STARmap data — LoadSTARmap • Seurat

**URL:** http://127.0.0.1:9173/seurat/reference/loadstarmap/index.html

**Contents:**
- Load STARmap data
- Arguments
- Value
- See also
- Contents

location of data directory that contains the counts matrix, gene name, qhull, and centroid files.

name of file containing the counts matrix (csv)

name of file containing the gene names (csv)

name of file containing the hull coordinates (tsv)

name of file containing the centroid positions (tsv)

Name of assay to associate spatial data to

Name of "image" object storing spatial coordinates

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/preprocessing.R
```

Example 2 (unknown):
```unknown
LoadSTARmap.Rd
```

Example 3 (unknown):
```unknown
LoadSTARmap(
  data.dir,
  counts.file = "cell_barcode_count.csv",
  gene.file = "genes.csv",
  qhull.file = "qhulls.tsv",
  centroid.file = "centroids.tsv",
  assay = "Spatial",
  image = "image"
)
```

Example 4 (r):
```r
LoadSTARmap(
  data.dir,
  counts.file = "cell_barcode_count.csv",
  gene.file = "genes.csv",
  qhull.file = "qhulls.tsv",
  centroid.file = "centroids.tsv",
  assay = "Spatial",
  image = "image"
)
```

Example 5 (r):
```r
LoadSTARmap(
  data.dir,
  counts.file = "cell_barcode_count.csv",
  gene.file = "genes.csv",
  qhull.file = "qhulls.tsv",
  centroid.file = "centroids.tsv",
  assay = "Spatial",
  image = "image"
)
```

---

## Construct an assay for spatial niche analysis — BuildNicheAssay • Seurat

**URL:** http://127.0.0.1:9173/reference_buildnicheassay.html

**Contents:**
- Construct an assay for spatial niche analysis
- Arguments
- Value
- Contents

This function will construct a new assay where each feature is a cell label The values represents the sum of a particular cell label neighboring a given cell.

FOV object to gather cell positions from

Cell classifications to count in spatial neighborhood

Name for spatial neighborhoods assay

Name of output clusters

Number of neighbors to consider for each cell

Number of clusters to return based on the niche assay

Seurat object containing a new assay

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/utilities.R
```

Example 2 (unknown):
```unknown
BuildNicheAssay.Rd
```

Example 3 (unknown):
```unknown
BuildNicheAssay(
  object,
  fov,
  group.by,
  assay = "niche",
  cluster.name = "niches",
  neighbors.k = 20,
  niches.k = 4
)
```

Example 4 (r):
```r
BuildNicheAssay(
  object,
  fov,
  group.by,
  assay = "niche",
  cluster.name = "niches",
  neighbors.k = 20,
  niches.k = 4
)
```

Example 5 (r):
```r
BuildNicheAssay(
  object,
  fov,
  group.by,
  assay = "niche",
  cluster.name = "niches",
  neighbors.k = 20,
  niches.k = 4
)
```

---

## Integrate low dimensional embeddings — IntegrateEmbeddings • Seurat

**URL:** http://127.0.0.1:9173/seurat/reference/integrateembeddings/index.html

**Contents:**
- Integrate low dimensional embeddings
- Arguments
- Value
- Details
- Contents

Perform dataset integration using a pre-computed Anchorset of specified low dimensional representations.

Reserved for internal use

Name for new integrated dimensional reduction.

Name of reductions to be integrated. For a TransferAnchorSet, this should be the name of a reduction present in the anchorset object (for example, "pcaproject"). For an IntegrationAnchorSet, this should be a DimReduc object containing all cells present in the anchorset object.

Number of dimensions to return integrated values for

Number of neighbors to consider when weighting anchors

Dimension reduction to use when calculating anchor weights. This can be one of:

A string, specifying the name of a dimension reduction present in all objects to be integrated

A vector of strings, specifying the name of a dimension reduction to use for each object to be integrated

A vector of DimReduc objects, specifying the object to use for each object in the integration

NULL, in which case the full corrected space is used for computing anchor weights.

Controls the bandwidth of the Gaussian kernel for weighting

Specify the order of integration. Order of integration should be encoded in a matrix, where each row represents one of the pairwise integration steps. Negative numbers specify a dataset, positive numbers specify the integration results from a given row (the format of the merge matrix included in the hclust function output). For example: matrix(c(-2, 1, -3, -1), ncol = 2) gives:

Which would cause dataset 2 and 3 to be integrated first, then the resulting object integrated with dataset 1.

If NULL, the sample tree will be computed automatically.

Do not reorder objects based on size for each pairwise integration.

Print progress bars and output

Reference object used in anchorset construction

Query object used in anchorset construction

Name of the Assay to use from query

Can be used in conjunction with the store.weights parameter in TransferData to reuse a precomputed weights matrix.

When called on a TransferAnchorSet (from FindTransferAnchors), this will return the query object with the integrated embeddings stored in a new reduction. When called on an IntegrationAnchorSet (from IntegrateData), this will return a merged object with the integrated reduction stored.

The main steps of this procedure are identical to IntegrateData with one key distinction. When computing the weights matrix, the distance calculations are performed in the full space of integrated embeddings when integrating more than two datasets, as opposed to a reduced PCA space which is the default behavior in IntegrateData.

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/generics.R
```

Example 2 (unknown):
```unknown
R/integration.R
```

Example 3 (unknown):
```unknown
IntegrateEmbeddings.Rd
```

Example 4 (python):
```python
IntegrateEmbeddings(anchorset, ...)

# S3 method for class 'IntegrationAnchorSet'
IntegrateEmbeddings(
  anchorset,
  new.reduction.name = "integrated_dr",
  reductions = NULL,
  dims.to.integrate = NULL,
  k.weight = 100,
  weight.reduction = NULL,
  sd.weight = 1,
  sample.tree = NULL,
  preserve.order = FALSE,
  verbose = TRUE,
  ...
)

# S3 method for class 'TransferAnchorSet'
IntegrateEmbeddings(
  anchorset,
  reference,
  query,
  query.assay = NULL,
  new.reduction.name = "integrated_dr",
  reductions = "pcaproject",
  dims.to.integrate = NULL,
  k.weight = 100,
  weight.reduction = NULL,
  reuse.weights.matrix = TRUE,
  sd.weight = 1,
  preserve.order = FALSE,
  verbose = TRUE,
  ...
)
```

Example 5 (r):
```r
IntegrateEmbeddings(anchorset, ...)

# S3 method for class 'IntegrationAnchorSet'
IntegrateEmbeddings(
  anchorset,
  new.reduction.name = "integrated_dr",
  reductions = NULL,
  dims.to.integrate = NULL,
  k.weight = 100,
  weight.reduction = NULL,
  sd.weight = 1,
  sample.tree = NULL,
  preserve.order = FALSE,
  verbose = TRUE,
  ...
)

# S3 method for class 'TransferAnchorSet'
IntegrateEmbeddings(
  anchorset,
  reference,
  query,
  query.assay = NULL,
  new.reduction.name = "integrated_dr",
  reductions = "pcaproject",
  dims.to.integrate = NULL,
  k.weight = 100,
  weight.reduction = NULL,
  reuse.weights.matrix = TRUE,
  sd.weight = 1,
  preserve.order = FALSE,
  verbose = TRUE,
  ...
)
```

Example 6 (r):
```r
IntegrateEmbeddings(anchorset, ...)

# S3 method for class 'IntegrationAnchorSet'
IntegrateEmbeddings(
  anchorset,
  new.reduction.name = "integrated_dr",
  reductions = NULL,
  dims.to.integrate = NULL,
  k.weight = 100,
  weight.reduction = NULL,
  sd.weight = 1,
  sample.tree = NULL,
  preserve.order = FALSE,
  verbose = TRUE,
  ...
)

# S3 method for class 'TransferAnchorSet'
IntegrateEmbeddings(
  anchorset,
  reference,
  query,
  query.assay = NULL,
  new.reduction.name = "integrated_dr",
  reductions = "pcaproject",
  dims.to.integrate = NULL,
  k.weight = 100,
  weight.reduction = NULL,
  reuse.weights.matrix = TRUE,
  sd.weight = 1,
  preserve.order = FALSE,
  verbose = TRUE,
  ...
)
```

Example 7 (unknown):
```unknown
matrix(c(-2, 1, -3, -1), ncol = 2)
```

Example 8 (unknown):
```unknown
[,1]  [,2]
       [1,]   -2   -3
       [2,]    1   -1
```

Example 9 (unknown):
```unknown
[,1]  [,2]
       [1,]   -2   -3
       [2,]    1   -1
```

Example 10 (unknown):
```unknown
[,1]  [,2]
       [1,]   -2   -3
       [2,]    1   -1
```

Example 11 (unknown):
```unknown
IntegrateData
```

Example 12 (unknown):
```unknown
IntegrateData
```

---

## Plot the Barcode Distribution and Calculated Inflection Points — BarcodeInflectionsPlot • Seurat

**URL:** http://127.0.0.1:9173/reference_barcodeinflectionsplot.html

**Contents:**
- Plot the Barcode Distribution and Calculated Inflection Points
- Arguments
- Value
- Details
- See also
- Author
- Examples
- Contents

This function plots the calculated inflection points derived from the barcode-rank distribution.

Returns a `ggplot2` object showing the by-group inflection points and provided (or default) rank threshold values in grey.

See [CalculateBarcodeInflections()] to calculate inflection points and [SubsetByBarcodeInflections()] to subsequently subset the Seurat object.

CalculateBarcodeInflections SubsetByBarcodeInflections

Robert A. Amezquita, robert.amezquita@fredhutch.org

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/visualization.R
```

Example 2 (unknown):
```unknown
BarcodeInflectionsPlot.Rd
```

Example 3 (unknown):
```unknown
BarcodeInflectionsPlot(object)
```

Example 4 (r):
```r
BarcodeInflectionsPlot(object)
```

Example 5 (r):
```r
BarcodeInflectionsPlot(object)
```

Example 6 (unknown):
```unknown
CalculateBarcodeInflections
```

Example 7 (unknown):
```unknown
SubsetByBarcodeInflections
```

Example 8 (unknown):
```unknown
data("pbmc_small")
pbmc_small <- CalculateBarcodeInflections(pbmc_small, group.column = 'groups')
BarcodeInflectionsPlot(pbmc_small)
```

Example 9 (r):
```r
data("pbmc_small")
pbmc_small <- CalculateBarcodeInflections(pbmc_small, group.column = 'groups')
BarcodeInflectionsPlot(pbmc_small)
```

Example 10 (r):
```r
data("pbmc_small")
pbmc_small <- CalculateBarcodeInflections(pbmc_small, group.column = 'groups')
BarcodeInflectionsPlot(pbmc_small)
```

---

## Run Mixscape — RunMixscape • Seurat

**URL:** http://127.0.0.1:9173/seurat/reference/runmixscape/index.html

**Contents:**
- Run Mixscape
- Arguments
- Value
- Contents

Function to identify perturbed and non-perturbed gRNA expressing cells that accounts for multiple treatments/conditions/chemical perturbations.

An object of class Seurat.

Assay to use for mixscape classification.

Assay data slot to use.

metadata column with target gene labels.

Classification name of non-targeting gRNA cells.

Name of mixscape classification to be stored in metadata.

Required number of genes that are differentially expressed for method to separate perturbed and non-perturbed cells.

Minimum number of cells in target gene class. If fewer than this many cells are assigned to a target gene class during classification, all are assigned NP.

Assay to use when performing differential expression analysis. Usually RNA.

Limit testing to genes which show, on average, at least X-fold difference (log-scale) between the two groups of cells. Default is 0.25 Increasing logfc.threshold speeds up the function, but can miss weaker signals.

Number of normalmixEM iterations to run if convergence does not occur.

metadata column with experimental condition/cell type classification information. This is meant to be used to account for cases a perturbation is condition/cell type -specific.

When this is equal to TRUE, DE genes for each target gene class will be calculated for each gRNA separately and pooled into one DE list for calculating the perturbation score of every cell and their subsequent classification.

metadata column with gRNA ID labels.

specify type of CRISPR perturbation expected for labeling mixscape classifications. Default is KO.

Returns Seurat object with with the following information in the meta data and tools slots:

Classification result with cells being either classified as perturbed (KO, by default) or non-perturbed (NP) based on their target gene class.

Global classification result (perturbed, NP or NT)

Posterior probabilities used to determine if a cell is KO (default). Name of this item will change to match prtb.type parameter setting. (>0.5) or NP

Perturbation scores for every cell calculated in the first iteration of the function.

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/mixscape.R
```

Example 2 (unknown):
```unknown
RunMixscape.Rd
```

Example 3 (unknown):
```unknown
RunMixscape(
  object,
  assay = "PRTB",
  slot = "scale.data",
  labels = "gene",
  nt.class.name = "NT",
  new.class.name = "mixscape_class",
  min.de.genes = 5,
  min.cells = 5,
  de.assay = "RNA",
  logfc.threshold = 0.25,
  iter.num = 10,
  verbose = FALSE,
  split.by = NULL,
  fine.mode = FALSE,
  fine.mode.labels = "guide_ID",
  prtb.type = "KO"
)
```

Example 4 (r):
```r
RunMixscape(
  object,
  assay = "PRTB",
  slot = "scale.data",
  labels = "gene",
  nt.class.name = "NT",
  new.class.name = "mixscape_class",
  min.de.genes = 5,
  min.cells = 5,
  de.assay = "RNA",
  logfc.threshold = 0.25,
  iter.num = 10,
  verbose = FALSE,
  split.by = NULL,
  fine.mode = FALSE,
  fine.mode.labels = "guide_ID",
  prtb.type = "KO"
)
```

Example 5 (r):
```r
RunMixscape(
  object,
  assay = "PRTB",
  slot = "scale.data",
  labels = "gene",
  nt.class.name = "NT",
  new.class.name = "mixscape_class",
  min.de.genes = 5,
  min.cells = 5,
  de.assay = "RNA",
  logfc.threshold = 0.25,
  iter.num = 10,
  verbose = FALSE,
  split.by = NULL,
  fine.mode = FALSE,
  fine.mode.labels = "guide_ID",
  prtb.type = "KO"
)
```

---

## Cluster Determination — FindClusters • Seurat

**URL:** http://127.0.0.1:9173/reference_findclusters.html

**Contents:**
- Cluster Determination
- Arguments
- Value
- Details
- Contents

Identify clusters of cells by a shared nearest neighbor (SNN) modularity optimization based clustering algorithm. First calculate k-nearest neighbors and construct the SNN graph. Then optimize the modularity function to determine clusters. For a full description of the algorithms, see Waltman and van Eck (2013) The European Physical Journal B. Thanks to Nigel Delaney (evolvedmicrobe@github) for the rewrite of the Java modularity optimizer code in Rcpp!

Arguments passed to other methods

Modularity function (1 = standard; 2 = alternative).

Passed to the `initial_membership` parameter of `leidenbase::leiden_find_partition`.

Passed to the `node_sizes` parameter of `leidenbase::leiden_find_partition`.

Value of the resolution parameter, use a value above (below) 1.0 if you want to obtain a larger (smaller) number of communities.

Algorithm for modularity optimization (1 = original Louvain algorithm; 2 = Louvain algorithm with multilevel refinement; 3 = SLM algorithm; 4 = Leiden algorithm).

Number of random starts.

Maximal number of iterations per random start.

Seed of the random number generator.

Group singletons into nearest cluster. If FALSE, assign all singletons to a "singleton" group

Directory where intermediate files will be written. Specify the ABSOLUTE path.

Edge file to use as input for modularity optimizer jar.

Name of graph to use for the clustering algorithm

Name of output clusters

Returns a Seurat object where the idents have been updated with new cluster info; latest clustering results will be stored in object metadata under 'seurat_clusters'. Note that 'seurat_clusters' will be overwritten everytime FindClusters is run

To run Leiden algorithm, you must first install the leidenalg python package (e.g. via pip install leidenalg), see Traag et al (2018).

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/generics.R
```

Example 2 (unknown):
```unknown
R/clustering.R
```

Example 3 (unknown):
```unknown
FindClusters.Rd
```

Example 4 (python):
```python
FindClusters(object, ...)

# Default S3 method
FindClusters(
  object,
  modularity.fxn = 1,
  initial.membership = NULL,
  node.sizes = NULL,
  resolution = 0.8,
  method = deprecated(),
  algorithm = 1,
  n.start = 10,
  n.iter = 10,
  random.seed = 0,
  group.singletons = TRUE,
  temp.file.location = NULL,
  edge.file.name = NULL,
  verbose = TRUE,
  ...
)

# S3 method for class 'Seurat'
FindClusters(
  object,
  graph.name = NULL,
  cluster.name = NULL,
  modularity.fxn = 1,
  initial.membership = NULL,
  node.sizes = NULL,
  resolution = 0.8,
  method = NULL,
  algorithm = 1,
  n.start = 10,
  n.iter = 10,
  random.seed = 0,
  group.singletons = TRUE,
  temp.file.location = NULL,
  edge.file.name = NULL,
  verbose = TRUE,
  ...
)
```

Example 5 (r):
```r
FindClusters(object, ...)

# Default S3 method
FindClusters(
  object,
  modularity.fxn = 1,
  initial.membership = NULL,
  node.sizes = NULL,
  resolution = 0.8,
  method = deprecated(),
  algorithm = 1,
  n.start = 10,
  n.iter = 10,
  random.seed = 0,
  group.singletons = TRUE,
  temp.file.location = NULL,
  edge.file.name = NULL,
  verbose = TRUE,
  ...
)

# S3 method for class 'Seurat'
FindClusters(
  object,
  graph.name = NULL,
  cluster.name = NULL,
  modularity.fxn = 1,
  initial.membership = NULL,
  node.sizes = NULL,
  resolution = 0.8,
  method = NULL,
  algorithm = 1,
  n.start = 10,
  n.iter = 10,
  random.seed = 0,
  group.singletons = TRUE,
  temp.file.location = NULL,
  edge.file.name = NULL,
  verbose = TRUE,
  ...
)
```

Example 6 (r):
```r
FindClusters(object, ...)

# Default S3 method
FindClusters(
  object,
  modularity.fxn = 1,
  initial.membership = NULL,
  node.sizes = NULL,
  resolution = 0.8,
  method = deprecated(),
  algorithm = 1,
  n.start = 10,
  n.iter = 10,
  random.seed = 0,
  group.singletons = TRUE,
  temp.file.location = NULL,
  edge.file.name = NULL,
  verbose = TRUE,
  ...
)

# S3 method for class 'Seurat'
FindClusters(
  object,
  graph.name = NULL,
  cluster.name = NULL,
  modularity.fxn = 1,
  initial.membership = NULL,
  node.sizes = NULL,
  resolution = 0.8,
  method = NULL,
  algorithm = 1,
  n.start = 10,
  n.iter = 10,
  random.seed = 0,
  group.singletons = TRUE,
  temp.file.location = NULL,
  edge.file.name = NULL,
  verbose = TRUE,
  ...
)
```

---

## Calculate module scores for feature expression programs in single cells — AddModuleScore • Seurat

**URL:** http://127.0.0.1:9173/reference_addmodulescore.html

**Contents:**
- Calculate module scores for feature expression programs in single cells
- Arguments
- Value
- References
- Examples
- Contents

Calculate the average expression levels of each program (cluster) on single cell level, subtracted by the aggregated expression of control feature sets. All analyzed features are binned based on averaged expression, and the control features are randomly selected from each bin.

A list of vectors of features for expression programs; each entry should be a vector of feature names

List of features to check expression levels against, defaults to rownames(x = object)

Number of bins of aggregate expression levels for all analyzed features

Number of control features selected from the same bin per analyzed feature

Use feature clusters returned from DoKMeans

Name for the expression programs; will append a number to the end for each entry in features (eg. if features has three programs, the results will be stored as name1, name2, name3, respectively)

Set a random seed. If NULL, seed is not set.

Search for symbol synonyms for features in features that don't match features in object? Searches the HGNC's gene names database; see UpdateSymbolList for more details

Slot to calculate score values off of. Defaults to data slot (i.e log-normalized counts)

Extra parameters passed to UpdateSymbolList

Returns a Seurat object with module scores added to object meta data; each module is stored as name# for each module program present in features

Tirosh et al, Science (2016)

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/utilities.R
```

Example 2 (unknown):
```unknown
AddModuleScore.Rd
```

Example 3 (unknown):
```unknown
AddModuleScore(
  object,
  features,
  pool = NULL,
  nbin = 24,
  ctrl = 100,
  k = FALSE,
  assay = NULL,
  name = "Cluster",
  seed = 1,
  search = FALSE,
  slot = "data",
  ...
)
```

Example 4 (r):
```r
AddModuleScore(
  object,
  features,
  pool = NULL,
  nbin = 24,
  ctrl = 100,
  k = FALSE,
  assay = NULL,
  name = "Cluster",
  seed = 1,
  search = FALSE,
  slot = "data",
  ...
)
```

Example 5 (r):
```r
AddModuleScore(
  object,
  features,
  pool = NULL,
  nbin = 24,
  ctrl = 100,
  k = FALSE,
  assay = NULL,
  name = "Cluster",
  seed = 1,
  search = FALSE,
  slot = "data",
  ...
)
```

Example 6 (unknown):
```unknown
rownames(x = object)
```

Example 7 (unknown):
```unknown
UpdateSymbolList
```

Example 8 (unknown):
```unknown
UpdateSymbolList
```

Example 9 (unknown):
```unknown
if (FALSE) { # \dontrun{
data("pbmc_small")
cd_features <- list(c(
  'CD79B',
  'CD79A',
  'CD19',
  'CD180',
  'CD200',
  'CD3D',
  'CD2',
  'CD3E',
  'CD7',
  'CD8A',
  'CD14',
  'CD1C',
  'CD68',
  'CD9',
  'CD247'
))
pbmc_small <- AddModuleScore(
  object = pbmc_small,
  features = cd_features,
  ctrl = 5,
  name = 'CD_Features'
)
head(x = pbmc_small[])
} # }
```

Example 10 (r):
```r
if (FALSE) { # \dontrun{
data("pbmc_small")
cd_features <- list(c(
  'CD79B',
  'CD79A',
  'CD19',
  'CD180',
  'CD200',
  'CD3D',
  'CD2',
  'CD3E',
  'CD7',
  'CD8A',
  'CD14',
  'CD1C',
  'CD68',
  'CD9',
  'CD247'
))
pbmc_small <- AddModuleScore(
  object = pbmc_small,
  features = cd_features,
  ctrl = 5,
  name = 'CD_Features'
)
head(x = pbmc_small[])
} # }
```

Example 11 (r):
```r
if (FALSE) { # \dontrun{
data("pbmc_small")
cd_features <- list(c(
  'CD79B',
  'CD79A',
  'CD19',
  'CD180',
  'CD200',
  'CD3D',
  'CD2',
  'CD3E',
  'CD7',
  'CD8A',
  'CD14',
  'CD1C',
  'CD68',
  'CD9',
  'CD247'
))
pbmc_small <- AddModuleScore(
  object = pbmc_small,
  features = cd_features,
  ctrl = 5,
  name = 'CD_Features'
)
head(x = pbmc_small[])
} # }
```

---

## Read Data From Vitessce — ReadVitessce • Seurat

**URL:** http://127.0.0.1:9173/seurat/reference/readvitessce/index.html

**Contents:**
- Read Data From Vitessce
- Arguments
- Value
- Note
- Progress Updates with progressr
- Examples
- Contents

Read in data from Vitessce-formatted JSON files

Path or URL to a Vitessce-formatted JSON file with expression data; should end in “.genes.json” or “.clusters.json”; pass NULL to skip

Path or URL to a Vitessce-formatted JSON file with cell/spot spatial coordinates; should end in “.cells.json”; pass NULL to skip

Path or URL to a Vitessce-formatted JSON file with molecule spatial coordinates; should end in “.molecules.json”; pass NULL to skip

Type of cell/spot spatial coordinates to return, choose one or more from:

“segmentations” cell/spot segmentations

“centroids” cell/spot centroids

A character to filter molecules by, pass NA to skip molecule filtering

Path to a directory containing Vitessce cells and clusters JSONs

Name to store expression matrix as

ReadVitessce: A list with some combination of the following values:

“counts”: if counts is not NULL, an expression matrix with cells as columns and features as rows

“centroids”: if coords is not NULL and type is contains“centroids”, a data frame with cell centroids in three columns: “x”, “y”, and “cell”

“segmentations”: if coords is not NULL and type contains “centroids”, a data frame with cell segmentations in three columns: “x”, “y” and “cell”

“molecules”: if molecules is not NULL, a data frame with molecule spatial coordinates in three columns: “x”, “y”, and “gene”

LoadHuBMAPCODEX: A Seurat object

This function requires the jsonlite package to be installed

This function uses progressr to render status updates and progress bars. To enable progress updates, wrap the function call in with_progress or run handlers(global = TRUE) before running this function. For more details about progressr, please read vignette("progressr-intro")

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/preprocessing.R
```

Example 2 (unknown):
```unknown
R/convenience.R
```

Example 3 (unknown):
```unknown
ReadVitessce.Rd
```

Example 4 (unknown):
```unknown
ReadVitessce(
  counts = NULL,
  coords = NULL,
  molecules = NULL,
  type = c("segmentations", "centroids"),
  filter = NA_character_
)

LoadHuBMAPCODEX(data.dir, fov, assay = "CODEX")
```

Example 5 (r):
```r
ReadVitessce(
  counts = NULL,
  coords = NULL,
  molecules = NULL,
  type = c("segmentations", "centroids"),
  filter = NA_character_
)

LoadHuBMAPCODEX(data.dir, fov, assay = "CODEX")
```

Example 6 (r):
```r
ReadVitessce(
  counts = NULL,
  coords = NULL,
  molecules = NULL,
  type = c("segmentations", "centroids"),
  filter = NA_character_
)

LoadHuBMAPCODEX(data.dir, fov, assay = "CODEX")
```

Example 7 (unknown):
```unknown
.genes.json
```

Example 8 (unknown):
```unknown
.clusters.json
```

Example 9 (unknown):
```unknown
.cells.json
```

Example 10 (unknown):
```unknown
.molecules.json
```

Example 11 (unknown):
```unknown
ReadVitessce
```

Example 12 (unknown):
```unknown
segmentations
```

Example 13 (unknown):
```unknown
LoadHuBMAPCODEX
```

Example 14 (unknown):
```unknown
with_progress
```

Example 15 (unknown):
```unknown
handlers(global = TRUE)
```

Example 16 (unknown):
```unknown
vignette("progressr-intro")
```

Example 17 (unknown):
```unknown
if (FALSE) { # \dontrun{
coords <- ReadVitessce(
  counts =
     "https://s3.amazonaws.com/vitessce-data/0.0.31/master_release/wang/wang.genes.json",
  coords =
     "https://s3.amazonaws.com/vitessce-data/0.0.31/master_release/wang/wang.cells.json",
  molecules =
     "https://s3.amazonaws.com/vitessce-data/0.0.31/master_release/wang/wang.molecules.json"
)
names(coords)
coords$counts[1:10, 1:10]
head(coords$centroids)
head(coords$segmentations)
head(coords$molecules)
} # }
```

Example 18 (r):
```r
if (FALSE) { # \dontrun{
coords <- ReadVitessce(
  counts =
     "https://s3.amazonaws.com/vitessce-data/0.0.31/master_release/wang/wang.genes.json",
  coords =
     "https://s3.amazonaws.com/vitessce-data/0.0.31/master_release/wang/wang.cells.json",
  molecules =
     "https://s3.amazonaws.com/vitessce-data/0.0.31/master_release/wang/wang.molecules.json"
)
names(coords)
coords$counts[1:10, 1:10]
head(coords$centroids)
head(coords$segmentations)
head(coords$molecules)
} # }
```

Example 19 (r):
```r
if (FALSE) { # \dontrun{
coords <- ReadVitessce(
  counts =
     "https://s3.amazonaws.com/vitessce-data/0.0.31/master_release/wang/wang.genes.json",
  coords =
     "https://s3.amazonaws.com/vitessce-data/0.0.31/master_release/wang/wang.cells.json",
  molecules =
     "https://s3.amazonaws.com/vitessce-data/0.0.31/master_release/wang/wang.molecules.json"
)
names(coords)
coords$counts[1:10, 1:10]
head(coords$centroids)
head(coords$segmentations)
head(coords$molecules)
} # }
```

---

## Read 10X hdf5 file — Read10X_h5 • Seurat

**URL:** http://127.0.0.1:9173/seurat/reference/read10x_h5/index.html

**Contents:**
- Read 10X hdf5 file
- Arguments
- Value
- Contents

Read count matrix from 10X CellRanger hdf5 file. This can be used to read both scATAC-seq and scRNA-seq matrices.

Label row names with feature names rather than ID numbers.

Make feature names unique (default TRUE)

Returns a sparse matrix with rows and columns labeled. If multiple genomes are present, returns a list of sparse matrices (one per genome).

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/preprocessing.R
```

Example 2 (unknown):
```unknown
Read10X_h5.Rd
```

Example 3 (unknown):
```unknown
Read10X_h5(filename, use.names = TRUE, unique.features = TRUE)
```

Example 4 (r):
```r
Read10X_h5(filename, use.names = TRUE, unique.features = TRUE)
```

Example 5 (r):
```r
Read10X_h5(filename, use.names = TRUE, unique.features = TRUE)
```

---

## Read and Load Nanostring SMI data — ReadNanostring • Seurat

**URL:** http://127.0.0.1:9173/reference_readnanostring.html

**Contents:**
- Read and Load Nanostring SMI data
- Arguments
- Value
- Note
- Progress Updates with progressr
- Parallelization with future
- Contents

Read and Load Nanostring SMI data

Path to folder containing Nanostring SMI outputs

Path to Nanostring cell x gene matrix CSV

Contains metadata including cell center, area, and stain intensities

Path to molecules file

Path to segmentations CSV

Type of cell spatial coordinate matrices to read; choose one or more of:

“centroids”: cell centroids in pixel coordinate space

“segmentations”: cell segmentations in pixel coordinate space

Type of molecule spatial coordinate matrices to read; choose one or more of:

“pixels”: molecule coordinates in pixel space

Type of available metadata to read; choose zero or more of:

“Area”: number of pixels in cell segmentation

“Mean.MembraneStain”: mean membrane stain intensity

“Mean.DAPI”: mean DAPI stain intensity

“Mean.G”: mean green channel stain intensity

“Mean.Y”: mean yellow channel stain intensity

“Mean.R”: mean red channel stain intensity

“Max.MembraneStain”: max membrane stain intensity

“Max.DAPI”: max DAPI stain intensity

“Max.G”: max green channel stain intensity

“Max.Y”: max yellow stain intensity

“Max.R”: max red stain intensity

Filter molecules that match provided string

Filter genes from cell x gene matrix that match provided string

Only load in select FOVs. Nanostring SMI data contains 30 total FOVs.

If the counts matrix should be built from molecule coordinates for a specific segmentation; One of:

“Nuclear”: nuclear segmentations

“Cytoplasm”: cell cytoplasm segmentations

“Membrane”: cell membrane segmentations

If TRUE, only load molecules within a cell

Name to store expression matrix as

ReadNanostring: A list with some combination of the following values:

“matrix”: a sparse matrix with expression data; cells are columns and features are rows

“centroids”: a data frame with cell centroid coordinates in three columns: “x”, “y”, and “cell”

“pixels”: a data frame with molecule pixel coordinates in three columns: “x”, “y”, and “gene”

LoadNanostring: A Seurat object

This function requires the data.table package to be installed

This function uses progressr to render status updates and progress bars. To enable progress updates, wrap the function call in with_progress or run handlers(global = TRUE) before running this function. For more details about progressr, please read vignette("progressr-intro")

This function uses future to enable parallelization. Parallelization strategies can be set using plan. Common plans include “sequential” for non-parallelized processing or “multisession” for parallel evaluation using multiple R sessions; for other plans, see the “Implemented evaluation strategies” section of ?future::plan. For a more thorough introduction to future, see vignette("future-1-overview")

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/preprocessing.R
```

Example 2 (unknown):
```unknown
R/convenience.R
```

Example 3 (unknown):
```unknown
ReadNanostring.Rd
```

Example 4 (python):
```python
ReadNanostring(
  data.dir,
  mtx.file = NULL,
  metadata.file = NULL,
  molecules.file = NULL,
  segmentations.file = NULL,
  type = "centroids",
  mol.type = "pixels",
  metadata = NULL,
  mols.filter = NA_character_,
  genes.filter = NA_character_,
  fov.filter = NULL,
  subset.counts.matrix = NULL,
  cell.mols.only = TRUE
)

LoadNanostring(data.dir, fov, assay = "Nanostring")
```

Example 5 (r):
```r
ReadNanostring(
  data.dir,
  mtx.file = NULL,
  metadata.file = NULL,
  molecules.file = NULL,
  segmentations.file = NULL,
  type = "centroids",
  mol.type = "pixels",
  metadata = NULL,
  mols.filter = NA_character_,
  genes.filter = NA_character_,
  fov.filter = NULL,
  subset.counts.matrix = NULL,
  cell.mols.only = TRUE
)

LoadNanostring(data.dir, fov, assay = "Nanostring")
```

Example 6 (r):
```r
ReadNanostring(
  data.dir,
  mtx.file = NULL,
  metadata.file = NULL,
  molecules.file = NULL,
  segmentations.file = NULL,
  type = "centroids",
  mol.type = "pixels",
  metadata = NULL,
  mols.filter = NA_character_,
  genes.filter = NA_character_,
  fov.filter = NULL,
  subset.counts.matrix = NULL,
  cell.mols.only = TRUE
)

LoadNanostring(data.dir, fov, assay = "Nanostring")
```

Example 7 (unknown):
```unknown
ReadNanostring
```

Example 8 (unknown):
```unknown
LoadNanostring
```

Example 9 (unknown):
```unknown
with_progress
```

Example 10 (unknown):
```unknown
handlers(global = TRUE)
```

Example 11 (unknown):
```unknown
vignette("progressr-intro")
```

Example 12 (unknown):
```unknown
multisession
```

Example 13 (unknown):
```unknown
?future::plan
```

Example 14 (unknown):
```unknown
vignette("future-1-overview")
```

---

## Cell-cell scatter plot — CellScatter • Seurat

**URL:** http://127.0.0.1:9173/reference_cellscatter.html

**Contents:**
- Cell-cell scatter plot
- Arguments
- Value
- Examples
- Contents

Creates a plot of scatter plot of features across two single cells. Pearson correlation between the two cells is displayed above the plot.

Features to plot (default, all features)

Features to highlight

Colors to use for identity class plotting.

Size of the points on the plot

Smooth the graph (similar to smoothScatter)

Convert points to raster format, default is NULL which will automatically use raster if the number of points plotted is greater than 100,000

Pixel resolution for rasterized plots, passed to geom_scattermore(). Default is c(512, 512).

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/visualization.R
```

Example 2 (unknown):
```unknown
CellScatter.Rd
```

Example 3 (unknown):
```unknown
CellScatter(
  object,
  cell1,
  cell2,
  features = NULL,
  highlight = NULL,
  cols = NULL,
  pt.size = 1,
  smooth = FALSE,
  raster = NULL,
  raster.dpi = c(512, 512)
)
```

Example 4 (r):
```r
CellScatter(
  object,
  cell1,
  cell2,
  features = NULL,
  highlight = NULL,
  cols = NULL,
  pt.size = 1,
  smooth = FALSE,
  raster = NULL,
  raster.dpi = c(512, 512)
)
```

Example 5 (r):
```r
CellScatter(
  object,
  cell1,
  cell2,
  features = NULL,
  highlight = NULL,
  cols = NULL,
  pt.size = 1,
  smooth = FALSE,
  raster = NULL,
  raster.dpi = c(512, 512)
)
```

Example 6 (unknown):
```unknown
data("pbmc_small")
CellScatter(object = pbmc_small, cell1 = 'ATAGGAGAAACAGA', cell2 = 'CATCAGGATGCACA')
```

Example 7 (r):
```r
data("pbmc_small")
CellScatter(object = pbmc_small, cell1 = 'ATAGGAGAAACAGA', cell2 = 'CATCAGGATGCACA')
```

Example 8 (r):
```r
data("pbmc_small")
CellScatter(object = pbmc_small, cell1 = 'ATAGGAGAAACAGA', cell2 = 'CATCAGGATGCACA')
```

---

## The IntegrationData Class — IntegrationData-class • Seurat

**URL:** http://127.0.0.1:9173/reference_integrationdata-class.html

**Contents:**
- The IntegrationData Class
- Slots
- Contents

The IntegrationData object is an intermediate storage container used internally throughout the integration procedure to hold bits of data that are useful downstream.

List of neighborhood information for cells (outputs of RANN::nn2)

The offsets used to enable cell look up in downstream functions

Number of cells in each object in the object.list

Sample tree used for ordering multi-dataset integration

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/objects.R
```

Example 2 (unknown):
```unknown
IntegrationData-class.Rd
```

Example 3 (unknown):
```unknown
integration.matrix
```

Example 4 (unknown):
```unknown
objects.ncell
```

Example 5 (unknown):
```unknown
sample.tree
```

---

## Load Slide-seq spatial data — ReadSlideSeq • Seurat

**URL:** http://127.0.0.1:9173/seurat/reference/readslideseq/index.html

**Contents:**
- Load Slide-seq spatial data
- Arguments
- Value
- See also
- Contents

Load Slide-seq spatial data

Path to csv file containing bead coordinate positions

Name of assay to associate image to

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/preprocessing.R
```

Example 2 (unknown):
```unknown
ReadSlideSeq.Rd
```

Example 3 (unknown):
```unknown
ReadSlideSeq(coord.file, assay = "Spatial")
```

Example 4 (r):
```r
ReadSlideSeq(coord.file, assay = "Spatial")
```

Example 5 (r):
```r
ReadSlideSeq(coord.file, assay = "Spatial")
```

---

## Get Cell Names — Cells.SCTModel • Seurat

**URL:** http://127.0.0.1:9173/reference_cells.html

**Contents:**
- Get Cell Names
- Arguments
- See also
- Contents

Arguments passed to other methods

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/objects.R
```

Example 2 (python):
```python
# S3 method for class 'SCTModel'
Cells(x, ...)

# S3 method for class 'SlideSeq'
Cells(x, ...)

# S3 method for class 'STARmap'
Cells(x, ...)

# S3 method for class 'VisiumV1'
Cells(x, ...)
```

Example 3 (r):
```r
# S3 method for class 'SCTModel'
Cells(x, ...)

# S3 method for class 'SlideSeq'
Cells(x, ...)

# S3 method for class 'STARmap'
Cells(x, ...)

# S3 method for class 'VisiumV1'
Cells(x, ...)
```

Example 4 (r):
```r
# S3 method for class 'SCTModel'
Cells(x, ...)

# S3 method for class 'SlideSeq'
Cells(x, ...)

# S3 method for class 'STARmap'
Cells(x, ...)

# S3 method for class 'VisiumV1'
Cells(x, ...)
```

Example 5 (unknown):
```unknown
SeuratObject::Cells
```

---

## Map query cells to a reference — MapQuery • Seurat

**URL:** http://127.0.0.1:9173/reference_mapquery.html

**Contents:**
- Map query cells to a reference
- Arguments
- Value
- Contents

This is a convenience wrapper function around the following three functions that are often run together when mapping query data to a reference: TransferData, IntegrateEmbeddings, ProjectUMAP. Note that by default, the weight.reduction parameter for all functions will be set to the dimension reduction method used in the FindTransferAnchors function call used to construct the anchor object, and the dims parameter will be the same dimensions used to find anchors.

Query object used in anchorset construction

Reference object used in anchorset construction

Data to transfer. This can be specified in one of two ways:

The reference data itself as either a vector where the names correspond to the reference cells, or a matrix, where the column names correspond to the reference cells.

The name of the metadata field or assay from the reference object provided. This requires the reference parameter to be specified. If pulling assay data in this manner, it will pull the data from the data slot. To transfer data from other slots, please pull the data explicitly with GetAssayData and provide that matrix here.

Name for new integrated dimensional reduction.

Name of reduction to use from the reference for neighbor finding

Dimensions (columns) to use from reference

Dimensions (columns) to use from query

Determine if the weight and anchor matrices are stored.

DimReduc object that contains the umap model

A named list of additional arguments to TransferData

A named list of additional arguments to IntegrateEmbeddings

A named list of additional arguments to ProjectUMAP

Print progress bars and output

Returns a modified query Seurat object containing:#'

New Assays corresponding to the features transferred and/or their corresponding prediction scores from TransferData

An integrated reduction from IntegrateEmbeddings

A projected UMAP reduction of the query cells projected into the reference UMAP using ProjectUMAP

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/integration.R
```

Example 2 (unknown):
```unknown
MapQuery.Rd
```

Example 3 (unknown):
```unknown
TransferData
```

Example 4 (unknown):
```unknown
IntegrateEmbeddings
```

Example 5 (unknown):
```unknown
ProjectUMAP
```

Example 6 (unknown):
```unknown
weight.reduction
```

Example 7 (unknown):
```unknown
FindTransferAnchors
```

Example 8 (unknown):
```unknown
MapQuery(
  anchorset,
  query,
  reference,
  refdata = NULL,
  new.reduction.name = NULL,
  reference.reduction = NULL,
  reference.dims = NULL,
  query.dims = NULL,
  store.weights = FALSE,
  reduction.model = NULL,
  transferdata.args = list(),
  integrateembeddings.args = list(),
  projectumap.args = list(),
  verbose = TRUE
)
```

Example 9 (r):
```r
MapQuery(
  anchorset,
  query,
  reference,
  refdata = NULL,
  new.reduction.name = NULL,
  reference.reduction = NULL,
  reference.dims = NULL,
  query.dims = NULL,
  store.weights = FALSE,
  reduction.model = NULL,
  transferdata.args = list(),
  integrateembeddings.args = list(),
  projectumap.args = list(),
  verbose = TRUE
)
```

Example 10 (r):
```r
MapQuery(
  anchorset,
  query,
  reference,
  refdata = NULL,
  new.reduction.name = NULL,
  reference.reduction = NULL,
  reference.dims = NULL,
  query.dims = NULL,
  store.weights = FALSE,
  reduction.model = NULL,
  transferdata.args = list(),
  integrateembeddings.args = list(),
  projectumap.args = list(),
  verbose = TRUE
)
```

Example 11 (unknown):
```unknown
GetAssayData
```

Example 12 (unknown):
```unknown
TransferData
```

Example 13 (unknown):
```unknown
IntegrateEmbeddings
```

Example 14 (unknown):
```unknown
ProjectUMAP
```

Example 15 (unknown):
```unknown
TransferData
```

Example 16 (unknown):
```unknown
IntegrateEmbeddings
```

Example 17 (unknown):
```unknown
ProjectUMAP
```

---

## Visualize features spatially and interactively — ISpatialFeaturePlot • Seurat

**URL:** http://127.0.0.1:9173/seurat/reference/ispatialfeatureplot/index.html

**Contents:**
- Visualize features spatially and interactively
- Arguments
- Value
- Contents

Visualize features spatially and interactively

Name of the image to use in the plot

Choose the scale factor ("lowres"/"hires") to apply in order to matchthe plot with the specified `image` - defaults to "lowres"

If plotting a feature, which data slot to pull from (counts, data, or scale.data)

Controls opacity of spots. Provide as a vector specifying the min and max for SpatialFeaturePlot. For SpatialDimPlot, provide a single alpha value for each plot.

Returns final plot as a ggplot object

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/visualization.R
```

Example 2 (unknown):
```unknown
ISpatialFeaturePlot.Rd
```

Example 3 (unknown):
```unknown
ISpatialFeaturePlot(
  object,
  feature,
  image = NULL,
  image.scale = "lowres",
  slot = "data",
  alpha = c(0.1, 1)
)
```

Example 4 (r):
```r
ISpatialFeaturePlot(
  object,
  feature,
  image = NULL,
  image.scale = "lowres",
  slot = "data",
  alpha = c(0.1, 1)
)
```

Example 5 (r):
```r
ISpatialFeaturePlot(
  object,
  feature,
  image = NULL,
  image.scale = "lowres",
  slot = "data",
  alpha = c(0.1, 1)
)
```

---

## Read output from Parse Biosciences — ReadParseBio • Seurat

**URL:** http://127.0.0.1:9173/reference_readparsebio.html

**Contents:**
- Read output from Parse Biosciences
- Arguments
- Contents

Read output from Parse Biosciences

Directory containing the data files

Extra parameters passed to ReadMtx

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/convenience.R
```

Example 2 (unknown):
```unknown
ReadParseBio.Rd
```

Example 3 (unknown):
```unknown
ReadParseBio(data.dir, ...)
```

Example 4 (r):
```r
ReadParseBio(data.dir, ...)
```

Example 5 (r):
```r
ReadParseBio(data.dir, ...)
```

---

## Normalize Data — NormalizeData • Seurat

**URL:** http://127.0.0.1:9173/reference_normalizedata.html

**Contents:**
- Normalize Data
- Arguments
- Value
- Examples
- Contents

Normalize the count data present in a given assay.

Arguments passed to other methods

Method for normalization.

“LogNormalize”: Feature counts for each cell are divided by the total counts for that cell and multiplied by the scale.factor. This is then natural-log transformed using log1p

“CLR”: Applies a centered log ratio transformation

“RC”: Relative counts. Feature counts for each cell are divided by the total counts for that cell and multiplied by the scale.factor. No log-transformation is applied. For counts per million (CPM) set scale.factor = 1e6

Sets the scale factor for cell-level normalization

If performing CLR normalization, normalize across features (1) or cells (2)

How many cells should be run in each chunk, will try to split evenly across threads

display progress bar for normalization procedure

Returns object after normalization

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/generics.R
```

Example 2 (unknown):
```unknown
R/preprocessing.R
```

Example 3 (unknown):
```unknown
NormalizeData.Rd
```

Example 4 (python):
```python
NormalizeData(object, ...)

# S3 method for class 'V3Matrix'
NormalizeData(
  object,
  normalization.method = "LogNormalize",
  scale.factor = 10000,
  margin = 1,
  block.size = NULL,
  verbose = TRUE,
  ...
)

# S3 method for class 'Assay'
NormalizeData(
  object,
  normalization.method = "LogNormalize",
  scale.factor = 10000,
  margin = 1,
  verbose = TRUE,
  ...
)

# S3 method for class 'Seurat'
NormalizeData(
  object,
  assay = NULL,
  normalization.method = "LogNormalize",
  scale.factor = 10000,
  margin = 1,
  verbose = TRUE,
  ...
)
```

Example 5 (r):
```r
NormalizeData(object, ...)

# S3 method for class 'V3Matrix'
NormalizeData(
  object,
  normalization.method = "LogNormalize",
  scale.factor = 10000,
  margin = 1,
  block.size = NULL,
  verbose = TRUE,
  ...
)

# S3 method for class 'Assay'
NormalizeData(
  object,
  normalization.method = "LogNormalize",
  scale.factor = 10000,
  margin = 1,
  verbose = TRUE,
  ...
)

# S3 method for class 'Seurat'
NormalizeData(
  object,
  assay = NULL,
  normalization.method = "LogNormalize",
  scale.factor = 10000,
  margin = 1,
  verbose = TRUE,
  ...
)
```

Example 6 (r):
```r
NormalizeData(object, ...)

# S3 method for class 'V3Matrix'
NormalizeData(
  object,
  normalization.method = "LogNormalize",
  scale.factor = 10000,
  margin = 1,
  block.size = NULL,
  verbose = TRUE,
  ...
)

# S3 method for class 'Assay'
NormalizeData(
  object,
  normalization.method = "LogNormalize",
  scale.factor = 10000,
  margin = 1,
  verbose = TRUE,
  ...
)

# S3 method for class 'Seurat'
NormalizeData(
  object,
  assay = NULL,
  normalization.method = "LogNormalize",
  scale.factor = 10000,
  margin = 1,
  verbose = TRUE,
  ...
)
```

Example 7 (unknown):
```unknown
LogNormalize
```

Example 8 (unknown):
```unknown
scale.factor
```

Example 9 (unknown):
```unknown
scale.factor
```

Example 10 (unknown):
```unknown
scale.factor = 1e6
```

Example 11 (unknown):
```unknown
if (FALSE) { # \dontrun{
data("pbmc_small")
pbmc_small
pmbc_small <- NormalizeData(object = pbmc_small)
} # }
```

Example 12 (r):
```r
if (FALSE) { # \dontrun{
data("pbmc_small")
pbmc_small
pmbc_small <- NormalizeData(object = pbmc_small)
} # }
```

Example 13 (r):
```r
if (FALSE) { # \dontrun{
data("pbmc_small")
pbmc_small
pmbc_small <- NormalizeData(object = pbmc_small)
} # }
```

---

## Cell-cell scatter plot — CellScatter • Seurat

**URL:** http://127.0.0.1:9173/seurat/reference/cellscatter/index.html

**Contents:**
- Cell-cell scatter plot
- Arguments
- Value
- Examples
- Contents

Creates a plot of scatter plot of features across two single cells. Pearson correlation between the two cells is displayed above the plot.

Features to plot (default, all features)

Features to highlight

Colors to use for identity class plotting.

Size of the points on the plot

Smooth the graph (similar to smoothScatter)

Convert points to raster format, default is NULL which will automatically use raster if the number of points plotted is greater than 100,000

Pixel resolution for rasterized plots, passed to geom_scattermore(). Default is c(512, 512).

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/visualization.R
```

Example 2 (unknown):
```unknown
CellScatter.Rd
```

Example 3 (unknown):
```unknown
CellScatter(
  object,
  cell1,
  cell2,
  features = NULL,
  highlight = NULL,
  cols = NULL,
  pt.size = 1,
  smooth = FALSE,
  raster = NULL,
  raster.dpi = c(512, 512)
)
```

Example 4 (r):
```r
CellScatter(
  object,
  cell1,
  cell2,
  features = NULL,
  highlight = NULL,
  cols = NULL,
  pt.size = 1,
  smooth = FALSE,
  raster = NULL,
  raster.dpi = c(512, 512)
)
```

Example 5 (r):
```r
CellScatter(
  object,
  cell1,
  cell2,
  features = NULL,
  highlight = NULL,
  cols = NULL,
  pt.size = 1,
  smooth = FALSE,
  raster = NULL,
  raster.dpi = c(512, 512)
)
```

Example 6 (unknown):
```unknown
data("pbmc_small")
CellScatter(object = pbmc_small, cell1 = 'ATAGGAGAAACAGA', cell2 = 'CATCAGGATGCACA')
```

Example 7 (r):
```r
data("pbmc_small")
CellScatter(object = pbmc_small, cell1 = 'ATAGGAGAAACAGA', cell2 = 'CATCAGGATGCACA')
```

Example 8 (r):
```r
data("pbmc_small")
CellScatter(object = pbmc_small, cell1 = 'ATAGGAGAAACAGA', cell2 = 'CATCAGGATGCACA')
```

---

## Objects exported from other packages — components • Seurat

**URL:** http://127.0.0.1:9173/reference_reexports.html

**Contents:**
- Objects exported from other packages
- Contents

These objects are imported from other packages. Follow the links below to see their documentation.

AddMetaData, as.Graph, as.Neighbor, as.Seurat, as.sparse, Assays, Cells, CellsByIdentities, Command, CreateAssayObject, CreateDimReducObject, CreateSeuratObject, DefaultAssay, DefaultAssay<-, Distances, Embeddings, FetchData, GetAssayData, GetImage, GetTissueCoordinates, HVFInfo, Idents, Idents<-, Images, Index, Index<-, Indices, IsGlobal, JS, JS<-, Key, Key<-, Loadings, Loadings<-, LogSeuratCommand, Misc, Misc<-, Neighbors, Project, Project<-, Radius, Reductions, RenameCells, RenameIdents, ReorderIdent, RowMergeSparseMatrices, SetAssayData, SetIdent, SpatiallyVariableFeatures, StashIdent, Stdev, SVFInfo, Tool, Tool<-, UpdateSeuratObject, VariableFeatures, VariableFeatures<-, WhichCells

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/reexports.R
```

Example 2 (unknown):
```unknown
reexports.Rd
```

Example 3 (unknown):
```unknown
AddMetaData
```

Example 4 (unknown):
```unknown
as.Neighbor
```

Example 5 (unknown):
```unknown
CellsByIdentities
```

Example 6 (unknown):
```unknown
CreateAssayObject
```

Example 7 (unknown):
```unknown
CreateDimReducObject
```

Example 8 (unknown):
```unknown
CreateSeuratObject
```

Example 9 (unknown):
```unknown
DefaultAssay
```

Example 10 (unknown):
```unknown
DefaultAssay<-
```

Example 11 (unknown):
```unknown
GetAssayData
```

Example 12 (unknown):
```unknown
GetTissueCoordinates
```

Example 13 (unknown):
```unknown
LogSeuratCommand
```

Example 14 (unknown):
```unknown
RenameCells
```

Example 15 (unknown):
```unknown
RenameIdents
```

Example 16 (unknown):
```unknown
ReorderIdent
```

Example 17 (unknown):
```unknown
RowMergeSparseMatrices
```

Example 18 (unknown):
```unknown
SetAssayData
```

Example 19 (unknown):
```unknown
SpatiallyVariableFeatures
```

Example 20 (unknown):
```unknown
UpdateSeuratObject
```

Example 21 (unknown):
```unknown
VariableFeatures
```

Example 22 (unknown):
```unknown
VariableFeatures<-
```

Example 23 (unknown):
```unknown
components(object, ...)

x %||% y

x %iff% y
```

Example 24 (r):
```r
components(object, ...)

x %||% y

x %iff% y
```

Example 25 (r):
```r
components(object, ...)

x %||% y

x %iff% y
```

---

## Apply a ceiling and floor to all values in a matrix — MinMax • Seurat

**URL:** http://127.0.0.1:9173/reference_minmax.html

**Contents:**
- Apply a ceiling and floor to all values in a matrix
- Arguments
- Value
- Examples
- Contents

Apply a ceiling and floor to all values in a matrix

all values below this min value will be replaced with min

all values above this max value will be replaced with max

Returns matrix after performing these floor and ceil operations

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/utilities.R
```

Example 2 (unknown):
```unknown
MinMax(data, min, max)
```

Example 3 (r):
```r
MinMax(data, min, max)
```

Example 4 (r):
```r
MinMax(data, min, max)
```

Example 5 (unknown):
```unknown
mat <- matrix(data = rbinom(n = 25, size = 20, prob = 0.2 ), nrow = 5)
mat
#>      [,1] [,2] [,3] [,4] [,5]
#> [1,]    3    6    3    4    5
#> [2,]    4    5    6    5    4
#> [3,]    4    5    5    1    6
#> [4,]    4    2    5    4    4
#> [5,]    2    5    4    5    3
MinMax(data = mat, min = 4, max = 5)
#>      [,1] [,2] [,3] [,4] [,5]
#> [1,]    4    5    4    4    5
#> [2,]    4    5    5    5    4
#> [3,]    4    5    5    4    5
#> [4,]    4    4    5    4    4
#> [5,]    4    5    4    5    4
```

Example 6 (r):
```r
mat <- matrix(data = rbinom(n = 25, size = 20, prob = 0.2 ), nrow = 5)
mat
#>      [,1] [,2] [,3] [,4] [,5]
#> [1,]    3    6    3    4    5
#> [2,]    4    5    6    5    4
#> [3,]    4    5    5    1    6
#> [4,]    4    2    5    4    4
#> [5,]    2    5    4    5    3
MinMax(data = mat, min = 4, max = 5)
#>      [,1] [,2] [,3] [,4] [,5]
#> [1,]    4    5    4    4    5
#> [2,]    4    5    5    5    4
#> [3,]    4    5    5    4    5
#> [4,]    4    4    5    4    4
#> [5,]    4    5    4    5    4
```

Example 7 (r):
```r
mat <- matrix(data = rbinom(n = 25, size = 20, prob = 0.2 ), nrow = 5)
mat
#>      [,1] [,2] [,3] [,4] [,5]
#> [1,]    3    6    3    4    5
#> [2,]    4    5    6    5    4
#> [3,]    4    5    5    1    6
#> [4,]    4    2    5    4    4
#> [5,]    2    5    4    5    3
MinMax(data = mat, min = 4, max = 5)
#>      [,1] [,2] [,3] [,4] [,5]
#> [1,]    4    5    4    4    5
#> [2,]    4    5    5    5    4
#> [3,]    4    5    5    4    5
#> [4,]    4    4    5    4    4
#> [5,]    4    5    4    5    4
```

---

## Match the case of character vectors — CaseMatch • Seurat

**URL:** http://127.0.0.1:9173/reference_casematch.html

**Contents:**
- Match the case of character vectors
- Arguments
- Value
- Examples
- Contents

Match the case of character vectors

A vector of search terms

A vector of characters whose case should be matched

Values from search present in match with the case of match

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/utilities.R
```

Example 2 (unknown):
```unknown
CaseMatch.Rd
```

Example 3 (unknown):
```unknown
CaseMatch(search, match)
```

Example 4 (r):
```r
CaseMatch(search, match)
```

Example 5 (r):
```r
CaseMatch(search, match)
```

Example 6 (unknown):
```unknown
data("pbmc_small")
cd_genes <- c('Cd79b', 'Cd19', 'Cd200')
CaseMatch(search = cd_genes, match = rownames(x = pbmc_small))
#>   Cd79b    Cd19   Cd200 
#> "CD79B"  "CD19" "CD200"
```

Example 7 (r):
```r
data("pbmc_small")
cd_genes <- c('Cd79b', 'Cd19', 'Cd200')
CaseMatch(search = cd_genes, match = rownames(x = pbmc_small))
#>   Cd79b    Cd19   Cd200 
#> "CD79B"  "CD19" "CD200"
```

Example 8 (r):
```r
data("pbmc_small")
cd_genes <- c('Cd79b', 'Cd19', 'Cd200')
CaseMatch(search = cd_genes, match = rownames(x = pbmc_small))
#>   Cd79b    Cd19   Cd200 
#> "CD79B"  "CD19" "CD200"
```

---

## Project query data to reference dimensional reduction — ProjectDimReduc • Seurat

**URL:** http://127.0.0.1:9173/reference_projectdimreduc.html

**Contents:**
- Project query data to reference dimensional reduction
- Arguments
- Value
- Contents

Project query data to reference dimensional reduction

Projection mode name for projection

pcaproject: PCA projection

lsiproject: LSI projection

Name of dimensional reduction in the reference object

Determine if query and reference objects are combined

Assay used for query object

Assay used for reference object

Features used for projection

Determine if scale expression matrix in the pcaproject mode

dimensional reduction name, reference.reduction is used by default

dimensional reduction key, the key in reference.reduction is used by default

Print progress and message

Returns a query-only or query-reference combined seurat object

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/integration.R
```

Example 2 (unknown):
```unknown
ProjectDimReduc.Rd
```

Example 3 (unknown):
```unknown
ProjectDimReduc(
  query,
  reference,
  mode = c("pcaproject", "lsiproject"),
  reference.reduction,
  combine = FALSE,
  query.assay = NULL,
  reference.assay = NULL,
  features = NULL,
  do.scale = TRUE,
  reduction.name = NULL,
  reduction.key = NULL,
  verbose = TRUE
)
```

Example 4 (r):
```r
ProjectDimReduc(
  query,
  reference,
  mode = c("pcaproject", "lsiproject"),
  reference.reduction,
  combine = FALSE,
  query.assay = NULL,
  reference.assay = NULL,
  features = NULL,
  do.scale = TRUE,
  reduction.name = NULL,
  reduction.key = NULL,
  verbose = TRUE
)
```

Example 5 (r):
```r
ProjectDimReduc(
  query,
  reference,
  mode = c("pcaproject", "lsiproject"),
  reference.reduction,
  combine = FALSE,
  query.assay = NULL,
  reference.assay = NULL,
  features = NULL,
  do.scale = TRUE,
  reduction.name = NULL,
  reduction.key = NULL,
  verbose = TRUE
)
```

---

## Fold Change — FoldChange • Seurat

**URL:** http://127.0.0.1:9173/reference_foldchange.html

**Contents:**
- Fold Change
- Arguments
- Value
- Details
- See also
- Examples
- Contents

Calculate log fold change and percentage of cells expressing each feature for different identity classes.

Arguments passed to other methods

Vector of cell names belonging to group 1

Vector of cell names belonging to group 2

Function to use for fold change or average difference calculation

Name of the fold change, average difference, or custom function column in the output data.frame

Features to calculate fold change for. If NULL, use all features

Slot to pull data from

Pseudocount to add to averaged expression values when calculating logFC.

The base with respect to which logarithms are computed.

Normalization method for mean function selection when slot is “data”

Identity class to calculate fold change for; pass an object of class phylo or 'clustertree' to calculate fold change for a node in a cluster tree; passing 'clustertree' requires BuildClusterTree to have been run

A second identity class for comparison; if NULL, use all other cells for comparison; if an object of class phylo or 'clustertree' is passed to ident.1, must pass a node to calculate fold change for

Regroup cells into a different identity class prior to calculating fold change (see example in FindMarkers)

Subset a particular identity class prior to regrouping. Only relevant if group.by is set (see example in FindMarkers)

Assay to use in fold change calculation

Reduction to use - will calculate average difference on cell embeddings

If the slot is scale.data or a reduction is specified, average difference is returned instead of log fold change and the column is named "avg_diff". Otherwise, log2 fold change is returned with column named "avg_log2_FC".

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/generics.R
```

Example 2 (unknown):
```unknown
R/differential_expression.R
```

Example 3 (unknown):
```unknown
FoldChange.Rd
```

Example 4 (python):
```python
FoldChange(object, ...)

# Default S3 method
FoldChange(object, cells.1, cells.2, mean.fxn, fc.name, features = NULL, ...)

# S3 method for class 'Assay'
FoldChange(
  object,
  cells.1,
  cells.2,
  features = NULL,
  slot = "data",
  pseudocount.use = 1,
  fc.name = NULL,
  mean.fxn = NULL,
  base = 2,
  norm.method = NULL,
  ...
)

# S3 method for class 'SCTAssay'
FoldChange(
  object,
  cells.1,
  cells.2,
  features = NULL,
  slot = "data",
  pseudocount.use = 1,
  fc.name = NULL,
  mean.fxn = NULL,
  base = 2,
  ...
)

# S3 method for class 'DimReduc'
FoldChange(
  object,
  cells.1,
  cells.2,
  features = NULL,
  slot = NULL,
  pseudocount.use = 1,
  fc.name = NULL,
  mean.fxn = NULL,
  ...
)

# S3 method for class 'Seurat'
FoldChange(
  object,
  ident.1 = NULL,
  ident.2 = NULL,
  group.by = NULL,
  subset.ident = NULL,
  assay = NULL,
  slot = "data",
  reduction = NULL,
  features = NULL,
  pseudocount.use = 1,
  mean.fxn = NULL,
  base = 2,
  fc.name = NULL,
  ...
)
```

Example 5 (r):
```r
FoldChange(object, ...)

# Default S3 method
FoldChange(object, cells.1, cells.2, mean.fxn, fc.name, features = NULL, ...)

# S3 method for class 'Assay'
FoldChange(
  object,
  cells.1,
  cells.2,
  features = NULL,
  slot = "data",
  pseudocount.use = 1,
  fc.name = NULL,
  mean.fxn = NULL,
  base = 2,
  norm.method = NULL,
  ...
)

# S3 method for class 'SCTAssay'
FoldChange(
  object,
  cells.1,
  cells.2,
  features = NULL,
  slot = "data",
  pseudocount.use = 1,
  fc.name = NULL,
  mean.fxn = NULL,
  base = 2,
  ...
)

# S3 method for class 'DimReduc'
FoldChange(
  object,
  cells.1,
  cells.2,
  features = NULL,
  slot = NULL,
  pseudocount.use = 1,
  fc.name = NULL,
  mean.fxn = NULL,
  ...
)

# S3 method for class 'Seurat'
FoldChange(
  object,
  ident.1 = NULL,
  ident.2 = NULL,
  group.by = NULL,
  subset.ident = NULL,
  assay = NULL,
  slot = "data",
  reduction = NULL,
  features = NULL,
  pseudocount.use = 1,
  mean.fxn = NULL,
  base = 2,
  fc.name = NULL,
  ...
)
```

Example 6 (r):
```r
FoldChange(object, ...)

# Default S3 method
FoldChange(object, cells.1, cells.2, mean.fxn, fc.name, features = NULL, ...)

# S3 method for class 'Assay'
FoldChange(
  object,
  cells.1,
  cells.2,
  features = NULL,
  slot = "data",
  pseudocount.use = 1,
  fc.name = NULL,
  mean.fxn = NULL,
  base = 2,
  norm.method = NULL,
  ...
)

# S3 method for class 'SCTAssay'
FoldChange(
  object,
  cells.1,
  cells.2,
  features = NULL,
  slot = "data",
  pseudocount.use = 1,
  fc.name = NULL,
  mean.fxn = NULL,
  base = 2,
  ...
)

# S3 method for class 'DimReduc'
FoldChange(
  object,
  cells.1,
  cells.2,
  features = NULL,
  slot = NULL,
  pseudocount.use = 1,
  fc.name = NULL,
  mean.fxn = NULL,
  ...
)

# S3 method for class 'Seurat'
FoldChange(
  object,
  ident.1 = NULL,
  ident.2 = NULL,
  group.by = NULL,
  subset.ident = NULL,
  assay = NULL,
  slot = "data",
  reduction = NULL,
  features = NULL,
  pseudocount.use = 1,
  mean.fxn = NULL,
  base = 2,
  fc.name = NULL,
  ...
)
```

Example 7 (unknown):
```unknown
BuildClusterTree
```

Example 8 (unknown):
```unknown
FindMarkers
```

Example 9 (unknown):
```unknown
FindMarkers
```

Example 10 (unknown):
```unknown
FindMarkers
```

Example 11 (unknown):
```unknown
if (FALSE) { # \dontrun{
data("pbmc_small")
FoldChange(pbmc_small, ident.1 = 1)
} # }
```

Example 12 (r):
```r
if (FALSE) { # \dontrun{
data("pbmc_small")
FoldChange(pbmc_small, ident.1 = 1)
} # }
```

Example 13 (r):
```r
if (FALSE) { # \dontrun{
data("pbmc_small")
FoldChange(pbmc_small, ident.1 = 1)
} # }
```

---

## Regroup idents based on meta.data info — RegroupIdents • Seurat

**URL:** http://127.0.0.1:9173/reference_regroupidents.html

**Contents:**
- Regroup idents based on meta.data info
- Arguments
- Value
- Examples
- Contents

For cells in each ident, set a new identity based on the most common value of a specified metadata column.

Name of metadata column

A Seurat object with the active idents regrouped

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/utilities.R
```

Example 2 (unknown):
```unknown
RegroupIdents.Rd
```

Example 3 (python):
```python
RegroupIdents(object, metadata)
```

Example 4 (r):
```r
RegroupIdents(object, metadata)
```

Example 5 (r):
```r
RegroupIdents(object, metadata)
```

Example 6 (python):
```python
data("pbmc_small")
pbmc_small <- RegroupIdents(pbmc_small, metadata = "groups")
```

Example 7 (r):
```r
data("pbmc_small")
pbmc_small <- RegroupIdents(pbmc_small, metadata = "groups")
```

Example 8 (r):
```r
data("pbmc_small")
pbmc_small <- RegroupIdents(pbmc_small, metadata = "groups")
```

---

## Single cell violin plot — VlnPlot • Seurat

**URL:** http://127.0.0.1:9173/reference_vlnplot.html

**Contents:**
- Single cell violin plot
- Arguments
- Value
- See also
- Examples
- Contents

Draws a violin plot of single cell data (gene expression, metrics, PC scores, etc.)

Features to plot (gene expression, metrics, PC scores, anything that can be retreived by FetchData)

Colors to use for plotting

Point size for points

Alpha value for points

Which classes to include in the plot (default is all)

Sort identity classes (on the x-axis) by the average expression of the attribute being potted, can also pass 'increasing' or 'decreasing' to change sort direction

Name of assay to use, defaults to the active assay

Group (color) cells in different ways (for example, orig.ident)

A factor in object metadata to split the plot by, pass 'ident' to split by cell identity

Adjust parameter for geom_violin

Set all the y-axis limits to the same values

plot the feature axis on log scale

Number of columns if multiple plots are displayed

Slot to pull expression data from (e.g. "counts" or "data")

Layer to pull expression data from (e.g. "counts" or "data")

plot each group of the split violin plots by multiple or single violin shapes.

Horizontally stack plots for each feature

Combine plots into a single patchworked ggplot object. If FALSE, return a list of ggplot

Color violins/ridges based on either 'feature' or 'ident'

flip plot orientation (identities on x-axis)

determine if adding a small noise for plotting

Convert points to raster format. Requires 'ggrastr' to be installed.

A patchworked ggplot object if combine = TRUE; otherwise, a list of ggplot objects

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/visualization.R
```

Example 2 (unknown):
```unknown
VlnPlot(
  object,
  features,
  cols = NULL,
  pt.size = NULL,
  alpha = 1,
  idents = NULL,
  sort = FALSE,
  assay = NULL,
  group.by = NULL,
  split.by = NULL,
  adjust = 1,
  y.max = NULL,
  same.y.lims = FALSE,
  log = FALSE,
  ncol = NULL,
  slot = deprecated(),
  layer = NULL,
  split.plot = FALSE,
  stack = FALSE,
  combine = TRUE,
  fill.by = "feature",
  flip = FALSE,
  add.noise = TRUE,
  raster = NULL
)
```

Example 3 (r):
```r
VlnPlot(
  object,
  features,
  cols = NULL,
  pt.size = NULL,
  alpha = 1,
  idents = NULL,
  sort = FALSE,
  assay = NULL,
  group.by = NULL,
  split.by = NULL,
  adjust = 1,
  y.max = NULL,
  same.y.lims = FALSE,
  log = FALSE,
  ncol = NULL,
  slot = deprecated(),
  layer = NULL,
  split.plot = FALSE,
  stack = FALSE,
  combine = TRUE,
  fill.by = "feature",
  flip = FALSE,
  add.noise = TRUE,
  raster = NULL
)
```

Example 4 (r):
```r
VlnPlot(
  object,
  features,
  cols = NULL,
  pt.size = NULL,
  alpha = 1,
  idents = NULL,
  sort = FALSE,
  assay = NULL,
  group.by = NULL,
  split.by = NULL,
  adjust = 1,
  y.max = NULL,
  same.y.lims = FALSE,
  log = FALSE,
  ncol = NULL,
  slot = deprecated(),
  layer = NULL,
  split.plot = FALSE,
  stack = FALSE,
  combine = TRUE,
  fill.by = "feature",
  flip = FALSE,
  add.noise = TRUE,
  raster = NULL
)
```

Example 5 (unknown):
```unknown
patchworked
```

Example 6 (unknown):
```unknown
patchworked
```

Example 7 (unknown):
```unknown
combine = TRUE
```

Example 8 (unknown):
```unknown
data("pbmc_small")
VlnPlot(object = pbmc_small, features = 'PC_1')

VlnPlot(object = pbmc_small, features = 'LYZ', split.by = 'groups')
#> The default behaviour of split.by has changed.
#> Separate violin plots are now plotted side-by-side.
#> To restore the old behaviour of a single split violin,
#> set split.plot = TRUE.
#>       
#> This message will be shown once per session.
```

Example 9 (r):
```r
data("pbmc_small")
VlnPlot(object = pbmc_small, features = 'PC_1')

VlnPlot(object = pbmc_small, features = 'LYZ', split.by = 'groups')
#> The default behaviour of split.by has changed.
#> Separate violin plots are now plotted side-by-side.
#> To restore the old behaviour of a single split violin,
#> set split.plot = TRUE.
#>       
#> This message will be shown once per session.
```

Example 10 (r):
```r
data("pbmc_small")
VlnPlot(object = pbmc_small, features = 'PC_1')

VlnPlot(object = pbmc_small, features = 'LYZ', split.by = 'groups')
#> The default behaviour of split.by has changed.
#> Separate violin plots are now plotted side-by-side.
#> To restore the old behaviour of a single split violin,
#> set split.plot = TRUE.
#>       
#> This message will be shown once per session.
```

---

## The Assay Class — Assay-class • Seurat

**URL:** http://127.0.0.1:9173/reference_assay-class.html

**Contents:**
- The Assay Class
- See also
- Contents

The Assay object is the basic unit of Seurat; for more details, please see the documentation in SeuratObject

SeuratObject::Assay-class

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/reexports.R
```

Example 2 (unknown):
```unknown
Assay-class.Rd
```

Example 3 (unknown):
```unknown
SeuratObject
```

Example 4 (unknown):
```unknown
SeuratObject::Assay-class
```

---

## Polygon FeaturePlot — PolyFeaturePlot • Seurat

**URL:** http://127.0.0.1:9173/seurat/reference/polyfeatureplot/index.html

**Contents:**
- Polygon FeaturePlot
- Arguments
- Value
- Contents

Plot cells as polygons, rather than single points. Color cells by any value accessible by FetchData.

Vector of features to plot. Features can come from:

An Assay feature (e.g. a gene name - "MS4A1")

A column name from meta.data (e.g. mitochondrial percentage - "percent.mito")

A column name from a DimReduc object corresponding to the cell embedding values (e.g. the PC 1 scores - "PC_1")

Vector of cells to plot (default is all cells)

Name of the polygon dataframe in the misc slot

Number of columns to split the plot into

Vector of minimum and maximum cutoff values for each feature, may specify quantile in the form of 'q##' where '##' is the quantile (eg, 'q1', 'q10')

Flip x and y coordinates

Returns a ggplot object

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/visualization.R
```

Example 2 (unknown):
```unknown
PolyFeaturePlot.Rd
```

Example 3 (unknown):
```unknown
PolyFeaturePlot(
  object,
  features,
  cells = NULL,
  poly.data = "spatial",
  ncol = ceiling(x = length(x = features)/2),
  min.cutoff = 0,
  max.cutoff = NA,
  common.scale = TRUE,
  flip.coords = FALSE
)
```

Example 4 (r):
```r
PolyFeaturePlot(
  object,
  features,
  cells = NULL,
  poly.data = "spatial",
  ncol = ceiling(x = length(x = features)/2),
  min.cutoff = 0,
  max.cutoff = NA,
  common.scale = TRUE,
  flip.coords = FALSE
)
```

Example 5 (r):
```r
PolyFeaturePlot(
  object,
  features,
  cells = NULL,
  poly.data = "spatial",
  ncol = ceiling(x = length(x = features)/2),
  min.cutoff = 0,
  max.cutoff = NA,
  common.scale = TRUE,
  flip.coords = FALSE
)
```

---

## Boxplot of correlation of a variable (e.g. number of UMIs) with expression data — GroupCorrelationPlot • Seurat

**URL:** http://127.0.0.1:9173/reference_groupcorrelationplot.html

**Contents:**
- Boxplot of correlation of a variable (e.g. number of UMIs) with expression data
- Arguments
- Value
- Contents

Boxplot of correlation of a variable (e.g. number of UMIs) with expression data

Assay where the feature grouping info and correlations are stored

Name of the column in meta.features where the feature grouping info is stored

Name of the column in meta.features where correlation info is stored

Returns a ggplot boxplot of correlations split by group

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/visualization.R
```

Example 2 (unknown):
```unknown
GroupCorrelationPlot.Rd
```

Example 3 (unknown):
```unknown
GroupCorrelationPlot(
  object,
  assay = NULL,
  feature.group = "feature.grp",
  cor = "nCount_RNA_cor"
)
```

Example 4 (r):
```r
GroupCorrelationPlot(
  object,
  assay = NULL,
  feature.group = "feature.grp",
  cor = "nCount_RNA_cor"
)
```

Example 5 (r):
```r
GroupCorrelationPlot(
  object,
  assay = NULL,
  feature.group = "feature.grp",
  cor = "nCount_RNA_cor"
)
```

---

## Compute Moran's I value. — RunMoransI • Seurat

**URL:** http://127.0.0.1:9173/reference_runmoransi.html

**Contents:**
- Compute Moran's I value.
- Arguments
- Contents

Wraps the functionality of the Moran.I function from the ape package. Weights are computed as 1/distance.

Display messages/progress

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/preprocessing.R
```

Example 2 (unknown):
```unknown
RunMoransI.Rd
```

Example 3 (unknown):
```unknown
RunMoransI(data, pos, verbose = TRUE)
```

Example 4 (r):
```r
RunMoransI(data, pos, verbose = TRUE)
```

Example 5 (r):
```r
RunMoransI(data, pos, verbose = TRUE)
```

---

## Highlight Neighbors in DimPlot — NNPlot • Seurat

**URL:** http://127.0.0.1:9173/seurat/reference/nnplot/index.html

**Contents:**
- Highlight Neighbors in DimPlot
- Arguments
- Value
- Contents

It will color the query cells and the neighbors of the query cells in the DimPlot

Which dimensionality reduction to use. If not specified, first searches for umap, then tsne, then pca

the neighbor index of all cells

cells used to find their neighbors

Dimensions to plot, must be a two-length numeric vector specifying x- and y-dimensions

Whether to label the clusters

Size of highlighted cells; will repeat to the length groups in cells.highlight. If sizes.highlight = TRUE size of all points will be this value.

Adjust point size for plotting

A vector of colors to highlight the cells as; will repeat to the length groups in cells.highlight

Color value for NA points when using custom scale

Specify the order of plotting for the idents. This can be useful for crowded plots if points of interest are being buried. Provide either a full list of valid idents or a subset to be plotted last (on top)

Show all cells or only query and neighbor cells

Extra parameters passed to DimPlot

A patchworked ggplot object if combine = TRUE; otherwise, a list of ggplot objects

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/visualization.R
```

Example 2 (unknown):
```unknown
NNPlot(
  object,
  reduction,
  nn.idx,
  query.cells,
  dims = 1:2,
  label = FALSE,
  label.size = 4,
  repel = FALSE,
  sizes.highlight = 2,
  pt.size = 1,
  cols.highlight = c("#377eb8", "#e41a1c"),
  na.value = "#bdbdbd",
  order = c("self", "neighbors", "other"),
  show.all.cells = TRUE,
  ...
)
```

Example 3 (r):
```r
NNPlot(
  object,
  reduction,
  nn.idx,
  query.cells,
  dims = 1:2,
  label = FALSE,
  label.size = 4,
  repel = FALSE,
  sizes.highlight = 2,
  pt.size = 1,
  cols.highlight = c("#377eb8", "#e41a1c"),
  na.value = "#bdbdbd",
  order = c("self", "neighbors", "other"),
  show.all.cells = TRUE,
  ...
)
```

Example 4 (r):
```r
NNPlot(
  object,
  reduction,
  nn.idx,
  query.cells,
  dims = 1:2,
  label = FALSE,
  label.size = 4,
  repel = FALSE,
  sizes.highlight = 2,
  pt.size = 1,
  cols.highlight = c("#377eb8", "#e41a1c"),
  na.value = "#bdbdbd",
  order = c("self", "neighbors", "other"),
  show.all.cells = TRUE,
  ...
)
```

Example 5 (unknown):
```unknown
sizes.highlight = TRUE
```

Example 6 (unknown):
```unknown
patchworked
```

Example 7 (unknown):
```unknown
combine = TRUE
```

---

## Run Supervised Principal Component Analysis — RunSPCA • Seurat

**URL:** http://127.0.0.1:9173/reference_runspca.html

**Contents:**
- Run Supervised Principal Component Analysis
- Arguments
- Value
- References
- Contents

Run a supervised PCA (SPCA) dimensionality reduction supervised by a cell-cell kernel. SPCA is used to capture a linear transformation which maximizes its dependency to the given cell-cell kernel. We use SNN graph as the kernel to supervise the linear matrix factorization.

Arguments passed to other methods and IRLBA

Name of Assay SPCA is being run on

Total Number of SPCs to compute and store (50 by default)

dimensional reduction key, specifies the string before the number for the dimension names. SPC by default

Graph used supervised by SPCA

Print the top genes associated with high/low loadings for the SPCs

Set a random seed. By default, sets the seed to 42. Setting NULL will not set a seed.

Features to compute SPCA on. If features=NULL, SPCA will be run using the variable features for the Assay.

dimensional reduction name, spca by default

Returns Seurat object with the SPCA calculation stored in the reductions slot

Barshan E, Ghodsi A, Azimifar Z, Jahromi MZ. Supervised principal component analysis: Visualization, classification and regression on subspaces and submanifolds. Pattern Recognition. 2011 Jul 1;44(7):1357-71. doi:10.1016/j.patcog.2010.12.015;

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/generics.R
```

Example 2 (unknown):
```unknown
R/dimensional_reduction.R
```

Example 3 (python):
```python
RunSPCA(object, ...)

# Default S3 method
RunSPCA(
  object,
  assay = NULL,
  npcs = 50,
  reduction.key = "SPC_",
  graph = NULL,
  verbose = FALSE,
  seed.use = 42,
  ...
)

# S3 method for class 'Assay'
RunSPCA(
  object,
  assay = NULL,
  features = NULL,
  npcs = 50,
  reduction.key = "SPC_",
  graph = NULL,
  verbose = TRUE,
  seed.use = 42,
  ...
)

# S3 method for class 'Assay5'
RunSPCA(
  object,
  assay = NULL,
  features = NULL,
  npcs = 50,
  reduction.key = "SPC_",
  graph = NULL,
  verbose = TRUE,
  seed.use = 42,
  layer = "scale.data",
  ...
)

# S3 method for class 'Seurat'
RunSPCA(
  object,
  assay = NULL,
  features = NULL,
  npcs = 50,
  reduction.name = "spca",
  reduction.key = "SPC_",
  graph = NULL,
  verbose = TRUE,
  seed.use = 42,
  ...
)
```

Example 4 (r):
```r
RunSPCA(object, ...)

# Default S3 method
RunSPCA(
  object,
  assay = NULL,
  npcs = 50,
  reduction.key = "SPC_",
  graph = NULL,
  verbose = FALSE,
  seed.use = 42,
  ...
)

# S3 method for class 'Assay'
RunSPCA(
  object,
  assay = NULL,
  features = NULL,
  npcs = 50,
  reduction.key = "SPC_",
  graph = NULL,
  verbose = TRUE,
  seed.use = 42,
  ...
)

# S3 method for class 'Assay5'
RunSPCA(
  object,
  assay = NULL,
  features = NULL,
  npcs = 50,
  reduction.key = "SPC_",
  graph = NULL,
  verbose = TRUE,
  seed.use = 42,
  layer = "scale.data",
  ...
)

# S3 method for class 'Seurat'
RunSPCA(
  object,
  assay = NULL,
  features = NULL,
  npcs = 50,
  reduction.name = "spca",
  reduction.key = "SPC_",
  graph = NULL,
  verbose = TRUE,
  seed.use = 42,
  ...
)
```

Example 5 (r):
```r
RunSPCA(object, ...)

# Default S3 method
RunSPCA(
  object,
  assay = NULL,
  npcs = 50,
  reduction.key = "SPC_",
  graph = NULL,
  verbose = FALSE,
  seed.use = 42,
  ...
)

# S3 method for class 'Assay'
RunSPCA(
  object,
  assay = NULL,
  features = NULL,
  npcs = 50,
  reduction.key = "SPC_",
  graph = NULL,
  verbose = TRUE,
  seed.use = 42,
  ...
)

# S3 method for class 'Assay5'
RunSPCA(
  object,
  assay = NULL,
  features = NULL,
  npcs = 50,
  reduction.key = "SPC_",
  graph = NULL,
  verbose = TRUE,
  seed.use = 42,
  layer = "scale.data",
  ...
)

# S3 method for class 'Seurat'
RunSPCA(
  object,
  assay = NULL,
  features = NULL,
  npcs = 50,
  reduction.name = "spca",
  reduction.key = "SPC_",
  graph = NULL,
  verbose = TRUE,
  seed.use = 42,
  ...
)
```

---

## Run Mixscape — RunMixscape • Seurat

**URL:** http://127.0.0.1:9173/reference_runmixscape.html

**Contents:**
- Run Mixscape
- Arguments
- Value
- Contents

Function to identify perturbed and non-perturbed gRNA expressing cells that accounts for multiple treatments/conditions/chemical perturbations.

An object of class Seurat.

Assay to use for mixscape classification.

Assay data slot to use.

metadata column with target gene labels.

Classification name of non-targeting gRNA cells.

Name of mixscape classification to be stored in metadata.

Required number of genes that are differentially expressed for method to separate perturbed and non-perturbed cells.

Minimum number of cells in target gene class. If fewer than this many cells are assigned to a target gene class during classification, all are assigned NP.

Assay to use when performing differential expression analysis. Usually RNA.

Limit testing to genes which show, on average, at least X-fold difference (log-scale) between the two groups of cells. Default is 0.25 Increasing logfc.threshold speeds up the function, but can miss weaker signals.

Number of normalmixEM iterations to run if convergence does not occur.

metadata column with experimental condition/cell type classification information. This is meant to be used to account for cases a perturbation is condition/cell type -specific.

When this is equal to TRUE, DE genes for each target gene class will be calculated for each gRNA separately and pooled into one DE list for calculating the perturbation score of every cell and their subsequent classification.

metadata column with gRNA ID labels.

specify type of CRISPR perturbation expected for labeling mixscape classifications. Default is KO.

Returns Seurat object with with the following information in the meta data and tools slots:

Classification result with cells being either classified as perturbed (KO, by default) or non-perturbed (NP) based on their target gene class.

Global classification result (perturbed, NP or NT)

Posterior probabilities used to determine if a cell is KO (default). Name of this item will change to match prtb.type parameter setting. (>0.5) or NP

Perturbation scores for every cell calculated in the first iteration of the function.

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/mixscape.R
```

Example 2 (unknown):
```unknown
RunMixscape.Rd
```

Example 3 (unknown):
```unknown
RunMixscape(
  object,
  assay = "PRTB",
  slot = "scale.data",
  labels = "gene",
  nt.class.name = "NT",
  new.class.name = "mixscape_class",
  min.de.genes = 5,
  min.cells = 5,
  de.assay = "RNA",
  logfc.threshold = 0.25,
  iter.num = 10,
  verbose = FALSE,
  split.by = NULL,
  fine.mode = FALSE,
  fine.mode.labels = "guide_ID",
  prtb.type = "KO"
)
```

Example 4 (r):
```r
RunMixscape(
  object,
  assay = "PRTB",
  slot = "scale.data",
  labels = "gene",
  nt.class.name = "NT",
  new.class.name = "mixscape_class",
  min.de.genes = 5,
  min.cells = 5,
  de.assay = "RNA",
  logfc.threshold = 0.25,
  iter.num = 10,
  verbose = FALSE,
  split.by = NULL,
  fine.mode = FALSE,
  fine.mode.labels = "guide_ID",
  prtb.type = "KO"
)
```

Example 5 (r):
```r
RunMixscape(
  object,
  assay = "PRTB",
  slot = "scale.data",
  labels = "gene",
  nt.class.name = "NT",
  new.class.name = "mixscape_class",
  min.de.genes = 5,
  min.cells = 5,
  de.assay = "RNA",
  logfc.threshold = 0.25,
  iter.num = 10,
  verbose = FALSE,
  split.by = NULL,
  fine.mode = FALSE,
  fine.mode.labels = "guide_ID",
  prtb.type = "KO"
)
```

---

## Integrate Layers — IntegrateLayers • Seurat

**URL:** http://127.0.0.1:9173/reference_integratelayers.html

**Contents:**
- Integrate Layers
- Arguments
- Value
- Integration Method Functions
- See also
- Contents

Integration method function

Name of dimensional reduction for correction

Name of assay for integration

A vector of features to use for integration

Names of normalized layers in assay

Name(s) of scaled layer(s) in assay

Arguments passed on to method

object with integration data added to it

The following integration method functions are available:

Writing integration method functions

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/integration5.R
```

Example 2 (unknown):
```unknown
IntegrateLayers.Rd
```

Example 3 (unknown):
```unknown
IntegrateLayers(
  object,
  method,
  orig.reduction = "pca",
  assay = NULL,
  features = NULL,
  layers = NULL,
  scale.layer = "scale.data",
  ...
)
```

Example 4 (r):
```r
IntegrateLayers(
  object,
  method,
  orig.reduction = "pca",
  assay = NULL,
  features = NULL,
  layers = NULL,
  scale.layer = "scale.data",
  ...
)
```

Example 5 (r):
```r
IntegrateLayers(
  object,
  method,
  orig.reduction = "pca",
  assay = NULL,
  features = NULL,
  layers = NULL,
  scale.layer = "scale.data",
  ...
)
```

Example 6 (unknown):
```unknown
CCAIntegration
```

Example 7 (unknown):
```unknown
HarmonyIntegration
```

Example 8 (unknown):
```unknown
JointPCAIntegration
```

Example 9 (unknown):
```unknown
RPCAIntegration
```

---

## Package index • Seurat

**URL:** http://127.0.0.1:9173/seurat/reference/index.html

**Contents:**
- Reference
- Object interaction
- Preprocessing
- Differential expression
- Dimensional Reduction
- Clustering
- Integration
- Spatial
- Sketching
- Mixscape
- Visualization
- Tree-related functions
- Utility functions
- Data
- Convenience functions
- Sketching
- Re-exports
- Contents

Functions for interacting with a Seurat object

AnchorSet-class AnchorSet

BridgeReferenceSet-class BridgeReferenceSet

The BridgeReferenceSet Class The BridgeReferenceSet is an output from PrepareBridgeReference

Cells(<SCTModel>) Cells(<SlideSeq>) Cells(<STARmap>) Cells(<VisiumV1>)

CreateSCTAssayObject()

Create a SCT Assay object

Slim down a Seurat object

Filter stray beads from Slide-seq puck

Get an Assay object from a given Seurat object.

GetImage(<SlideSeq>) GetImage(<STARmap>) GetImage(<VisiumV1>) GetImage(<VisiumV2>)

GetTissueCoordinates(<SlideSeq>) GetTissueCoordinates(<STARmap>) GetTissueCoordinates(<VisiumV1>) GetTissueCoordinates(<VisiumV2>)

Get Tissue Coordinates

Get Variable Feature Information

IntegrationAnchorSet-class IntegrationAnchorSet

The IntegrationAnchorSet Class

IntegrationData-class IntegrationData

The IntegrationData Class

ModalityWeights-class ModalityWeights

The ModalityWeights Class

Radius(<SlideSeq>) Radius(<STARmap>) Radius(<VisiumV1>)

RenameCells(<SCTAssay>) RenameCells(<SlideSeq>) RenameCells(<STARmap>) RenameCells(<VisiumV1>)

Rename Cells in an Object

levels(<SCTAssay>) `levels<-`(<SCTAssay>)

SCTResults() `SCTResults<-`()

Get SCT results from an Assay

STARmap-class STARmap

ScaleFactors() scalefactors()

Get image scale factors

Splits object into a list of subsetted objects.

Find cells with highest scores for a given dimensional reduction technique

Find features with highest scores for a given dimensional reduction technique

Get nearest neighbors for given cell

TransferAnchorSet-class TransferAnchorSet

The TransferAnchorSet Class

Update pre-V4 Assays generated with SCTransform in the Seurat to the new SCTAssay class

VisiumV1-class VisiumV1

VisiumV2-class VisiumV2

Convert objects to CellDataSet objects

as.Seurat(<CellDataSet>) as.Seurat(<SingleCellExperiment>)

Convert objects to Seurat objects

as.SingleCellExperiment()

Convert objects to SingleCellExperiment objects

as.sparse(<H5Group>) as.data.frame(<Matrix>)

Merge SCTAssay objects

Subset an AnchorSet object

Functions for preprocessing single-cell data

CalculateBarcodeInflections()

Calculate the Barcode Distribution Inflection

Calculate pearson residuals of features not in the scale.data

FindSpatiallyVariableFeatures()

Find spatially variable features

FindVariableFeatures()

Find variable features

Calculate pearson residuals of features not in the scale.data

Demultiplex samples based on data from cell 'hashing'

Load a 10x Genomics Visium Spatial Experiment into a Seurat object

Load Curio Seeker data

Demultiplex samples based on classification method from MULTI-seq (McGinnis et al., bioRxiv 2018)

Load in data from 10X

Read10X_Coordinates()

Load 10X Genomics Visium Tissue Positions

Load a 10X Genomics Visium Image

Read10X_ScaleFactors()

Load 10X Genomics Visium Scale Factors

Read10X_probe_metadata()

Read10x Probe Metadata

ReadAkoya() LoadAkoya()

Read and Load Akoya CODEX data

Load in data from remote or local mtx files

ReadNanostring() LoadNanostring()

Read and Load Nanostring SMI data

Load Slide-seq spatial data

ReadVitessce() LoadHuBMAPCODEX()

Read Data From Vitessce

ReadVizgen() LoadVizgen()

Read and Load MERFISH Input from Vizgen

LoadXenium() ReadXenium()

Read and Load 10x Genomics Xenium in-situ data

Normalize raw data to fractions

Run the mark variogram computation on a given position matrix and expression matrix.

Compute Moran's I value.

Perform sctransform-based normalization

Scale and center the data.

SubsetByBarcodeInflections()

Subset a Seurat Object based on the Barcode Distribution Inflection Points

Functions for testing differential gene (feature) expression

Gene expression markers for all identity classes

FindConservedMarkers()

Finds markers that are conserved between the groups

Gene expression markers of identity classes

Prepare object to run differential expression on SCT assay with multiple models

Functions to reduce the dimensionality of datasets

Determine statistical significance of PCA scores.

Significant genes from a PCA

Project Dimensional reduction onto full dataset

Project query into UMAP coordinates of a reference

Perform Canonical Correlation Analysis

Run Graph Laplacian Eigendecomposition

Run Independent Component Analysis on gene expression

Run Principal Component Analysis

Run Supervised Latent Semantic Indexing

Run Supervised Principal Component Analysis

Run t-distributed Stochastic Neighbor Embedding

Compute Jackstraw scores significance.

Functions to cluster single-cell data

Construct an assay for spatial niche analysis

Cluster Determination

FindMultiModalNeighbors()

Construct weighted nearest neighbor graph

(Shared) Nearest-neighbor graph construction

Find subclusters under one cluster

Run Leiden clustering algorithm

Functions related to the Seurat v3 integration and label transfer algorithms

Add info to anchor matrix

BridgeCellsRepresentation()

Construct a dictionary representation for each unimodal dataset

Seurat-CCA Integration

FastRPCAIntegration()

Perform integration on the joint PCA cell embeddings.

FindBridgeIntegrationAnchors()

Find integration bridge anchors between query and extended bridge-reference

FindBridgeTransferAnchors()

Find bridge anchors between query and extended bridge-reference

FindIntegrationAnchors()

Find integration anchors

FindTransferAnchors()

Find transfer anchors

GetTransferPredictions()

Get the predicted identity

IntegrateEmbeddings()

Integrate low dimensional embeddings

JointPCAIntegration()

Seurat-Joint PCA Integration

Calculate the local structure preservation metric

Map query cells to a reference

Metric for evaluating mapping success

Calculates a mixing metric

Convert Neighbor class to an asymmetrical Graph class

Predict value from nearest neighbors

Prepare an object list normalized with sctransform for integration.

PrepareBridgeReference()

Prepare the bridge and reference datasets

Project query data to reference dimensional reduction

Integrate embeddings from the integrated sketched.assay

SelectIntegrationFeatures()

Select integration features

SelectIntegrationFeatures5()

Select integration features

SelectSCTIntegrationFeatures()

Select SCT integration features

Transfer embeddings from sketched cells to the full data

Functions related to the analysis of spatially-resolved single-cell data

Cells(<SCTModel>) Cells(<SlideSeq>) Cells(<STARmap>) Cells(<VisiumV1>)

Filter stray beads from Slide-seq puck

FindSpatiallyVariableFeatures()

Find spatially variable features

GetImage(<SlideSeq>) GetImage(<STARmap>) GetImage(<VisiumV1>) GetImage(<VisiumV2>)

GetTissueCoordinates(<SlideSeq>) GetTissueCoordinates(<STARmap>) GetTissueCoordinates(<VisiumV1>) GetTissueCoordinates(<VisiumV2>)

Get Tissue Coordinates

Visualize clusters spatially and interactively

ISpatialFeaturePlot()

Visualize features spatially and interactively

Spatial Cluster Plots

Spatial Feature Plots

LinkedDimPlot() LinkedFeaturePlot()

Visualize spatial and clustering (dimensional reduction) data in a linked, interactive framework

Radius(<SlideSeq>) Radius(<STARmap>) Radius(<VisiumV1>)

STARmap-class STARmap

ScaleFactors() scalefactors()

Get image scale factors

SlideSeq-class SlideSeq

SpatialPlot() SpatialDimPlot() SpatialFeaturePlot()

Visualize spatial clustering and expression data.

VisiumV1-class VisiumV1

VisiumV2-class VisiumV2

Functions for flexible analysis of massively scalable datasets

Leverage Score Calculation

Project full data to the sketch assay

TransferSketchLabels()

Transfer data from sketch data to full data

Functions related to the mixscape algorithm

Calculate a perturbation Signature

DE and EnrichR pathway visualization barplot

Differential expression heatmap for mixscape

Linear discriminant analysis on pooled CRISPR screen data.

Function to plot perturbation score distributions.

Function to prepare data for Linear Discriminant Analysis.

Run Linear Discriminant Analysis

Functions for plotting data and adjusting

Augments ggplot2-based plot with a PNG image.

Automagically calculate a point size for ggplot2-based scatter plots

Determine text color based on background color

BarcodeInflectionsPlot()

Plot the Barcode Distribution and Calculated Inflection Points

Cell-cell scatter plot

CellSelector() FeatureLocator()

CollapseEmbeddingOutliers()

Move outliers towards center on dimension reduction plot

Color dimensional reduction plot by tree split

Combine ggplot2-based plots into a single plot

BlackAndWhite() BlueAndRed() CustomPalette() PurpleAndYellow()

Create a custom color palette

DimHeatmap() PCHeatmap()

Dimensional reduction heatmap

DimPlot() PCAPlot() TSNEPlot() UMAPPlot()

Dimensional reduction plot

Discrete colour palettes from pals

Feature expression heatmap

Dot plot visualization

Quickly Pick Relevant Dimensions

Visualize 'features' on a dimensional reduction plot

Scatter plot of single cell data

GroupCorrelationPlot()

Boxplot of correlation of a variable (e.g. number of UMIs) with expression data

Hashtag oligo heatmap

Visualize features in dimensional reduction space interactively

Visualize clusters spatially and interactively

ISpatialFeaturePlot()

Visualize features spatially and interactively

Spatial Cluster Plots

Spatial Feature Plots

Label clusters on a ggplot2-based scatter plot

Add text labels to a ggplot2 plot

LinkedDimPlot() LinkedFeaturePlot()

Visualize spatial and clustering (dimensional reduction) data in a linked, interactive framework

Highlight Neighbors in DimPlot

Plot clusters as a tree

Single cell ridge plot

SeuratTheme() CenterTitle() DarkTheme() FontSize() NoAxes() NoLegend() NoGrid() SeuratAxes() SpatialTheme() RestoreLegend() RotatedAxis() BoldTitle() WhiteBackground()

SpatialPlot() SpatialDimPlot() SpatialFeaturePlot()

Visualize spatial clustering and expression data.

VariableFeaturePlot()

View variable features

Visualize Dimensional Reduction genes

Single cell violin plot

Intensity() Luminance()

Get the intensity and/or luminance of a color

Function related to tree-based analysis of identity classes

Phylogenetic Analysis of Identity Classes

Useful functions to help with a variety of tasks

Calculate module scores for feature expression programs in single cells

AggregateExpression()

Aggregated feature expression by identity class

Averaged feature expression by identity class

Match the case of character vectors

Score cell cycle phases

CollapseSpeciesExpressionMatrix()

Slim down a multi-species expression matrix, when only one species is primarily of interenst.

CreateCategoryMatrix()

Create one hot matrix for a given label

Run a custom distance function on an input data matrix

Calculate the mean of logged values

Calculate the standard deviation of logged values

Calculate the variance of logged values

Scale and/or center matrix rowwise

Compute the correlation of features broken down by groups with another covariate

Load the Annoy index file

Calculate the variance to mean ratio of logged values

Aggregate expression of multiple features into a single feature

Apply a ceiling and floor to all values in a matrix

Calculate the percentage of a vector above some threshold

PercentageFeatureSet()

Calculate the percentage of all counts that belong to a given set of features

PseudobulkExpression()

Pseudobulk Expression

Seurat-RPCA Integration

Regroup idents based on meta.data info

Find the Quantile of Data

GeneSymbolThesarus() UpdateSymbolList()

Get updated synonyms for gene symbols

as.sparse(<H5Group>) as.data.frame(<Matrix>)

Descriptions of data included with Seurat

cc.genes.updated.2019

Cell cycle genes: 2019 update

Functions included for user convenience and to keep maintain backwards compatability

DimHeatmap() PCHeatmap()

Dimensional reduction heatmap

DimPlot() PCAPlot() TSNEPlot() UMAPPlot()

Dimensional reduction plot

Read output from Parse Biosciences

Read output from STARsolo

SpatialPlot() SpatialDimPlot() SpatialFeaturePlot()

Visualize spatial clustering and expression data.

Functions for flexible analysis of massively scalable datasets

Leverage Score Calculation

Project full data to the sketch assay

TransferSketchLabels()

Transfer data from sketch data to full data

Functions re-exported from other packages

components() `%||%` `%iff%`

Objects exported from other packages

The SpatialImage Class

The JackStrawData Class

The SeuratCommand Class

Seurat Seurat-package

Seurat: Tools for Single Cell Genomics

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
AnchorSet-class
```

Example 2 (unknown):
```unknown
BridgeReferenceSet-class
```

Example 3 (unknown):
```unknown
BridgeReferenceSet
```

Example 4 (unknown):
```unknown
Cells(<SCTModel>)
```

Example 5 (unknown):
```unknown
Cells(<SlideSeq>)
```

Example 6 (unknown):
```unknown
Cells(<STARmap>)
```

Example 7 (unknown):
```unknown
Cells(<VisiumV1>)
```

Example 8 (unknown):
```unknown
CreateSCTAssayObject()
```

Example 9 (unknown):
```unknown
DietSeurat()
```

Example 10 (unknown):
```unknown
FilterSlideSeq()
```

Example 11 (unknown):
```unknown
GetImage(<SlideSeq>)
```

Example 12 (unknown):
```unknown
GetImage(<STARmap>)
```

Example 13 (unknown):
```unknown
GetImage(<VisiumV1>)
```

Example 14 (unknown):
```unknown
GetImage(<VisiumV2>)
```

Example 15 (unknown):
```unknown
GetIntegrationData()
```

Example 16 (unknown):
```unknown
GetTissueCoordinates(<SlideSeq>)
```

Example 17 (unknown):
```unknown
GetTissueCoordinates(<STARmap>)
```

Example 18 (unknown):
```unknown
GetTissueCoordinates(<VisiumV1>)
```

Example 19 (unknown):
```unknown
GetTissueCoordinates(<VisiumV2>)
```

Example 20 (unknown):
```unknown
HVFInfo(<SCTAssay>)
```

Example 21 (unknown):
```unknown
IntegrationAnchorSet-class
```

Example 22 (unknown):
```unknown
IntegrationAnchorSet
```

Example 23 (unknown):
```unknown
IntegrationData-class
```

Example 24 (unknown):
```unknown
IntegrationData
```

Example 25 (unknown):
```unknown
ModalityWeights-class
```

Example 26 (unknown):
```unknown
ModalityWeights
```

Example 27 (unknown):
```unknown
Radius(<SlideSeq>)
```

Example 28 (unknown):
```unknown
Radius(<STARmap>)
```

Example 29 (unknown):
```unknown
Radius(<VisiumV1>)
```

Example 30 (unknown):
```unknown
RenameCells(<SCTAssay>)
```

Example 31 (unknown):
```unknown
RenameCells(<SlideSeq>)
```

Example 32 (unknown):
```unknown
RenameCells(<STARmap>)
```

Example 33 (unknown):
```unknown
RenameCells(<VisiumV1>)
```

Example 34 (unknown):
```unknown
levels(<SCTAssay>)
```

Example 35 (unknown):
```unknown
`levels<-`(<SCTAssay>)
```

Example 36 (unknown):
```unknown
SCTResults()
```

Example 37 (unknown):
```unknown
`SCTResults<-`()
```

Example 38 (unknown):
```unknown
STARmap-class
```

Example 39 (unknown):
```unknown
ScaleFactors()
```

Example 40 (unknown):
```unknown
scalefactors()
```

Example 41 (unknown):
```unknown
SetIntegrationData()
```

Example 42 (unknown):
```unknown
SplitObject()
```

Example 43 (unknown):
```unknown
TopFeatures()
```

Example 44 (unknown):
```unknown
TopNeighbors()
```

Example 45 (unknown):
```unknown
TransferAnchorSet-class
```

Example 46 (unknown):
```unknown
TransferAnchorSet
```

Example 47 (unknown):
```unknown
UpdateSCTAssays()
```

Example 48 (unknown):
```unknown
VisiumV1-class
```

Example 49 (unknown):
```unknown
VisiumV2-class
```

Example 50 (unknown):
```unknown
as.CellDataSet()
```

Example 51 (unknown):
```unknown
as.Seurat(<CellDataSet>)
```

Example 52 (unknown):
```unknown
as.Seurat(<SingleCellExperiment>)
```

Example 53 (unknown):
```unknown
as.SingleCellExperiment()
```

Example 54 (unknown):
```unknown
as.sparse(<H5Group>)
```

Example 55 (unknown):
```unknown
as.data.frame(<Matrix>)
```

Example 56 (unknown):
```unknown
merge(<SCTAssay>)
```

Example 57 (unknown):
```unknown
subset(<AnchorSet>)
```

Example 58 (unknown):
```unknown
CalculateBarcodeInflections()
```

Example 59 (unknown):
```unknown
FetchResiduals()
```

Example 60 (unknown):
```unknown
FindSpatiallyVariableFeatures()
```

Example 61 (unknown):
```unknown
FindVariableFeatures()
```

Example 62 (unknown):
```unknown
GetResidual()
```

Example 63 (unknown):
```unknown
Load10X_Spatial()
```

Example 64 (unknown):
```unknown
LoadCurioSeeker()
```

Example 65 (unknown):
```unknown
LoadSTARmap()
```

Example 66 (unknown):
```unknown
LogNormalize()
```

Example 67 (unknown):
```unknown
MULTIseqDemux()
```

Example 68 (unknown):
```unknown
NormalizeData()
```

Example 69 (unknown):
```unknown
Read10X_Coordinates()
```

Example 70 (unknown):
```unknown
Read10X_Image()
```

Example 71 (unknown):
```unknown
Read10X_ScaleFactors()
```

Example 72 (unknown):
```unknown
Read10X_h5()
```

Example 73 (python):
```python
Read10X_probe_metadata()
```

Example 74 (unknown):
```unknown
ReadAkoya()
```

Example 75 (unknown):
```unknown
LoadAkoya()
```

Example 76 (unknown):
```unknown
ReadNanostring()
```

Example 77 (unknown):
```unknown
LoadNanostring()
```

Example 78 (unknown):
```unknown
ReadSlideSeq()
```

Example 79 (unknown):
```unknown
ReadVitessce()
```

Example 80 (unknown):
```unknown
LoadHuBMAPCODEX()
```

Example 81 (unknown):
```unknown
ReadVizgen()
```

Example 82 (unknown):
```unknown
LoadVizgen()
```

Example 83 (unknown):
```unknown
LoadXenium()
```

Example 84 (unknown):
```unknown
ReadXenium()
```

Example 85 (unknown):
```unknown
RelativeCounts()
```

Example 86 (unknown):
```unknown
RunMarkVario()
```

Example 87 (unknown):
```unknown
RunMoransI()
```

Example 88 (unknown):
```unknown
SCTransform()
```

Example 89 (unknown):
```unknown
SampleUMI()
```

Example 90 (unknown):
```unknown
ScaleData()
```

Example 91 (unknown):
```unknown
SubsetByBarcodeInflections()
```

Example 92 (unknown):
```unknown
FindAllMarkers()
```

Example 93 (unknown):
```unknown
FindConservedMarkers()
```

Example 94 (unknown):
```unknown
FindMarkers()
```

Example 95 (unknown):
```unknown
FoldChange()
```

Example 96 (unknown):
```unknown
PrepSCTFindMarkers()
```

Example 97 (unknown):
```unknown
JackStraw()
```

Example 98 (unknown):
```unknown
PCASigGenes()
```

Example 99 (unknown):
```unknown
ProjectDim()
```

Example 100 (unknown):
```unknown
ProjectUMAP()
```

Example 101 (unknown):
```unknown
RunGraphLaplacian()
```

Example 102 (unknown):
```unknown
ScoreJackStraw()
```

Example 103 (unknown):
```unknown
BuildNicheAssay()
```

Example 104 (unknown):
```unknown
FindClusters()
```

Example 105 (unknown):
```unknown
FindMultiModalNeighbors()
```

Example 106 (unknown):
```unknown
FindNeighbors()
```

Example 107 (unknown):
```unknown
FindSubCluster()
```

Example 108 (unknown):
```unknown
RunLeiden()
```

Example 109 (unknown):
```unknown
AnnotateAnchors()
```

Example 110 (unknown):
```unknown
BridgeCellsRepresentation()
```

Example 111 (unknown):
```unknown
CCAIntegration()
```

Example 112 (unknown):
```unknown
FastRPCAIntegration()
```

Example 113 (unknown):
```unknown
FindBridgeIntegrationAnchors()
```

Example 114 (unknown):
```unknown
FindBridgeTransferAnchors()
```

Example 115 (unknown):
```unknown
FindIntegrationAnchors()
```

Example 116 (unknown):
```unknown
FindTransferAnchors()
```

Example 117 (unknown):
```unknown
GetTransferPredictions()
```

Example 118 (unknown):
```unknown
HarmonyIntegration()
```

Example 119 (unknown):
```unknown
IntegrateData()
```

Example 120 (unknown):
```unknown
IntegrateEmbeddings()
```

Example 121 (unknown):
```unknown
IntegrateLayers()
```

Example 122 (unknown):
```unknown
JointPCAIntegration()
```

Example 123 (unknown):
```unknown
LocalStruct()
```

Example 124 (unknown):
```unknown
MappingScore()
```

Example 125 (unknown):
```unknown
MixingMetric()
```

Example 126 (unknown):
```unknown
NNtoGraph()
```

Example 127 (unknown):
```unknown
PredictAssay()
```

Example 128 (unknown):
```unknown
PrepSCTIntegration()
```

Example 129 (unknown):
```unknown
PrepareBridgeReference()
```

Example 130 (unknown):
```unknown
ProjectDimReduc()
```

Example 131 (unknown):
```unknown
ProjectIntegration()
```

Example 132 (unknown):
```unknown
SelectIntegrationFeatures()
```

Example 133 (unknown):
```unknown
SelectIntegrationFeatures5()
```

Example 134 (unknown):
```unknown
SelectSCTIntegrationFeatures()
```

Example 135 (unknown):
```unknown
TransferData()
```

Example 136 (unknown):
```unknown
UnSketchEmbeddings()
```

Example 137 (unknown):
```unknown
Cells(<SCTModel>)
```

Example 138 (unknown):
```unknown
Cells(<SlideSeq>)
```

Example 139 (unknown):
```unknown
Cells(<STARmap>)
```

Example 140 (unknown):
```unknown
Cells(<VisiumV1>)
```

Example 141 (unknown):
```unknown
FilterSlideSeq()
```

Example 142 (unknown):
```unknown
FindSpatiallyVariableFeatures()
```

Example 143 (unknown):
```unknown
GetImage(<SlideSeq>)
```

Example 144 (unknown):
```unknown
GetImage(<STARmap>)
```

Example 145 (unknown):
```unknown
GetImage(<VisiumV1>)
```

Example 146 (unknown):
```unknown
GetImage(<VisiumV2>)
```

Example 147 (unknown):
```unknown
GetTissueCoordinates(<SlideSeq>)
```

Example 148 (unknown):
```unknown
GetTissueCoordinates(<STARmap>)
```

Example 149 (unknown):
```unknown
GetTissueCoordinates(<VisiumV1>)
```

Example 150 (unknown):
```unknown
GetTissueCoordinates(<VisiumV2>)
```

Example 151 (unknown):
```unknown
ISpatialDimPlot()
```

Example 152 (unknown):
```unknown
ISpatialFeaturePlot()
```

Example 153 (unknown):
```unknown
ImageDimPlot()
```

Example 154 (unknown):
```unknown
ImageFeaturePlot()
```

Example 155 (unknown):
```unknown
LinkedDimPlot()
```

Example 156 (unknown):
```unknown
LinkedFeaturePlot()
```

Example 157 (unknown):
```unknown
PolyFeaturePlot()
```

Example 158 (unknown):
```unknown
Radius(<SlideSeq>)
```

Example 159 (unknown):
```unknown
Radius(<STARmap>)
```

Example 160 (unknown):
```unknown
Radius(<VisiumV1>)
```

Example 161 (unknown):
```unknown
STARmap-class
```

Example 162 (unknown):
```unknown
ScaleFactors()
```

Example 163 (unknown):
```unknown
scalefactors()
```

Example 164 (unknown):
```unknown
SlideSeq-class
```

Example 165 (unknown):
```unknown
SpatialPlot()
```

Example 166 (unknown):
```unknown
SpatialDimPlot()
```

Example 167 (unknown):
```unknown
SpatialFeaturePlot()
```

Example 168 (unknown):
```unknown
VisiumV1-class
```

Example 169 (unknown):
```unknown
VisiumV2-class
```

Example 170 (unknown):
```unknown
LeverageScore()
```

Example 171 (unknown):
```unknown
ProjectData()
```

Example 172 (unknown):
```unknown
SketchData()
```

Example 173 (unknown):
```unknown
TransferSketchLabels()
```

Example 174 (unknown):
```unknown
CalcPerturbSig()
```

Example 175 (unknown):
```unknown
DEenrichRPlot()
```

Example 176 (unknown):
```unknown
MixscapeHeatmap()
```

Example 177 (unknown):
```unknown
MixscapeLDA()
```

Example 178 (unknown):
```unknown
PlotPerturbScore()
```

Example 179 (unknown):
```unknown
RunMixscape()
```

Example 180 (unknown):
```unknown
AugmentPlot()
```

Example 181 (unknown):
```unknown
AutoPointSize()
```

Example 182 (unknown):
```unknown
BGTextColor()
```

Example 183 (unknown):
```unknown
BarcodeInflectionsPlot()
```

Example 184 (unknown):
```unknown
CellScatter()
```

Example 185 (unknown):
```unknown
CellSelector()
```

Example 186 (unknown):
```unknown
FeatureLocator()
```

Example 187 (unknown):
```unknown
CollapseEmbeddingOutliers()
```

Example 188 (unknown):
```unknown
ColorDimSplit()
```

Example 189 (unknown):
```unknown
CombinePlots()
```

Example 190 (unknown):
```unknown
BlackAndWhite()
```

Example 191 (unknown):
```unknown
BlueAndRed()
```

Example 192 (unknown):
```unknown
CustomPalette()
```

Example 193 (unknown):
```unknown
PurpleAndYellow()
```

Example 194 (unknown):
```unknown
DimHeatmap()
```

Example 195 (unknown):
```unknown
PCHeatmap()
```

Example 196 (unknown):
```unknown
DiscretePalette()
```

Example 197 (unknown):
```unknown
DoHeatmap()
```

Example 198 (unknown):
```unknown
ElbowPlot()
```

Example 199 (unknown):
```unknown
FeaturePlot()
```

Example 200 (unknown):
```unknown
FeatureScatter()
```

Example 201 (unknown):
```unknown
GroupCorrelationPlot()
```

Example 202 (unknown):
```unknown
HTOHeatmap()
```

Example 203 (unknown):
```unknown
HoverLocator()
```

Example 204 (unknown):
```unknown
IFeaturePlot()
```

Example 205 (unknown):
```unknown
ISpatialDimPlot()
```

Example 206 (unknown):
```unknown
ISpatialFeaturePlot()
```

Example 207 (unknown):
```unknown
ImageDimPlot()
```

Example 208 (unknown):
```unknown
ImageFeaturePlot()
```

Example 209 (unknown):
```unknown
JackStrawPlot()
```

Example 210 (unknown):
```unknown
LabelClusters()
```

Example 211 (unknown):
```unknown
LabelPoints()
```

Example 212 (unknown):
```unknown
LinkedDimPlot()
```

Example 213 (unknown):
```unknown
LinkedFeaturePlot()
```

Example 214 (unknown):
```unknown
PlotClusterTree()
```

Example 215 (unknown):
```unknown
PolyDimPlot()
```

Example 216 (unknown):
```unknown
PolyFeaturePlot()
```

Example 217 (unknown):
```unknown
RidgePlot()
```

Example 218 (unknown):
```unknown
SeuratTheme()
```

Example 219 (unknown):
```unknown
CenterTitle()
```

Example 220 (unknown):
```unknown
DarkTheme()
```

Example 221 (unknown):
```unknown
SeuratAxes()
```

Example 222 (unknown):
```unknown
SpatialTheme()
```

Example 223 (unknown):
```unknown
RestoreLegend()
```

Example 224 (unknown):
```unknown
RotatedAxis()
```

Example 225 (unknown):
```unknown
BoldTitle()
```

Example 226 (unknown):
```unknown
WhiteBackground()
```

Example 227 (unknown):
```unknown
SpatialPlot()
```

Example 228 (unknown):
```unknown
SpatialDimPlot()
```

Example 229 (unknown):
```unknown
SpatialFeaturePlot()
```

Example 230 (unknown):
```unknown
VariableFeaturePlot()
```

Example 231 (unknown):
```unknown
VizDimLoadings()
```

Example 232 (unknown):
```unknown
Intensity()
```

Example 233 (unknown):
```unknown
Luminance()
```

Example 234 (unknown):
```unknown
BuildClusterTree()
```

Example 235 (unknown):
```unknown
AddAzimuthResults()
```

Example 236 (unknown):
```unknown
AddModuleScore()
```

Example 237 (unknown):
```unknown
AggregateExpression()
```

Example 238 (unknown):
```unknown
AverageExpression()
```

Example 239 (unknown):
```unknown
CaseMatch()
```

Example 240 (unknown):
```unknown
CellCycleScoring()
```

Example 241 (unknown):
```unknown
CollapseSpeciesExpressionMatrix()
```

Example 242 (unknown):
```unknown
CreateCategoryMatrix()
```

Example 243 (unknown):
```unknown
CustomDistance()
```

Example 244 (unknown):
```unknown
FastRowScale()
```

Example 245 (unknown):
```unknown
GroupCorrelation()
```

Example 246 (unknown):
```unknown
LoadAnnoyIndex()
```

Example 247 (unknown):
```unknown
MetaFeature()
```

Example 248 (unknown):
```unknown
PercentAbove()
```

Example 249 (unknown):
```unknown
PercentageFeatureSet()
```

Example 250 (unknown):
```unknown
PseudobulkExpression()
```

Example 251 (unknown):
```unknown
RPCAIntegration()
```

Example 252 (unknown):
```unknown
RegroupIdents()
```

Example 253 (unknown):
```unknown
SaveAnnoyIndex()
```

Example 254 (unknown):
```unknown
SetQuantile()
```

Example 255 (unknown):
```unknown
GeneSymbolThesarus()
```

Example 256 (unknown):
```unknown
UpdateSymbolList()
```

Example 257 (unknown):
```unknown
as.sparse(<H5Group>)
```

Example 258 (unknown):
```unknown
as.data.frame(<Matrix>)
```

Example 259 (unknown):
```unknown
cc.genes.updated.2019
```

Example 260 (unknown):
```unknown
DimHeatmap()
```

Example 261 (unknown):
```unknown
PCHeatmap()
```

Example 262 (unknown):
```unknown
ReadParseBio()
```

Example 263 (unknown):
```unknown
ReadSTARsolo()
```

Example 264 (unknown):
```unknown
SpatialPlot()
```

Example 265 (unknown):
```unknown
SpatialDimPlot()
```

Example 266 (unknown):
```unknown
SpatialFeaturePlot()
```

Example 267 (unknown):
```unknown
LeverageScore()
```

Example 268 (unknown):
```unknown
ProjectData()
```

Example 269 (unknown):
```unknown
SketchData()
```

Example 270 (unknown):
```unknown
TransferSketchLabels()
```

Example 271 (unknown):
```unknown
components()
```

Example 272 (unknown):
```unknown
Seurat-class
```

Example 273 (unknown):
```unknown
Assay-class
```

Example 274 (unknown):
```unknown
DimReduc-class
```

Example 275 (unknown):
```unknown
Neighbor-class
```

Example 276 (unknown):
```unknown
Graph-class
```

Example 277 (unknown):
```unknown
SpatialImage-class
```

Example 278 (unknown):
```unknown
JackStrawData-class
```

Example 279 (unknown):
```unknown
SeuratCommand-class
```

Example 280 (unknown):
```unknown
Seurat-package
```

---

## Determine statistical significance of PCA scores. — JackStraw • Seurat

**URL:** http://127.0.0.1:9173/reference_jackstraw.html

**Contents:**
- Determine statistical significance of PCA scores.
- Arguments
- Value
- References
- Examples
- Contents

Randomly permutes a subset of data, and calculates projected PCA scores for these 'random' genes. Then compares the PCA scores for the 'random' genes with the observed PCA scores to determine statistical significance. End result is a p-value for each gene's association with each principal component.

DimReduc to use. ONLY PCA CURRENTLY SUPPORTED.

Assay used to calculate reduction.

Number of PCs to compute significance for

Number of replicate samplings to perform

Proportion of the data to randomly permute for each replicate

Print progress bar showing the number of replicates that have been processed.

maximum number of iterations to be performed by the irlba function of RunPCA

Returns a Seurat object where JS(object = object[['pca']], slot = 'empirical') represents p-values for each gene in the PCA analysis. If ProjectPCA is subsequently run, JS(object = object[['pca']], slot = 'full') then represents p-values for all genes.

Inspired by Chung et al, Bioinformatics (2014)

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/dimensional_reduction.R
```

Example 2 (unknown):
```unknown
JackStraw.Rd
```

Example 3 (unknown):
```unknown
JackStraw(
  object,
  reduction = "pca",
  assay = NULL,
  dims = 20,
  num.replicate = 100,
  prop.freq = 0.01,
  verbose = TRUE,
  maxit = 1000
)
```

Example 4 (r):
```r
JackStraw(
  object,
  reduction = "pca",
  assay = NULL,
  dims = 20,
  num.replicate = 100,
  prop.freq = 0.01,
  verbose = TRUE,
  maxit = 1000
)
```

Example 5 (r):
```r
JackStraw(
  object,
  reduction = "pca",
  assay = NULL,
  dims = 20,
  num.replicate = 100,
  prop.freq = 0.01,
  verbose = TRUE,
  maxit = 1000
)
```

Example 6 (unknown):
```unknown
if (FALSE) { # \dontrun{
data("pbmc_small")
pbmc_small = suppressWarnings(JackStraw(pbmc_small))
head(JS(object = pbmc_small[['pca']], slot = 'empirical'))
} # }
```

Example 7 (r):
```r
if (FALSE) { # \dontrun{
data("pbmc_small")
pbmc_small = suppressWarnings(JackStraw(pbmc_small))
head(JS(object = pbmc_small[['pca']], slot = 'empirical'))
} # }
```

Example 8 (r):
```r
if (FALSE) { # \dontrun{
data("pbmc_small")
pbmc_small = suppressWarnings(JackStraw(pbmc_small))
head(JS(object = pbmc_small[['pca']], slot = 'empirical'))
} # }
```

---

## Read and Load 10x Genomics Xenium in-situ data — LoadXenium • Seurat

**URL:** http://127.0.0.1:9173/reference_readxenium.html

**Contents:**
- Read and Load 10x Genomics Xenium in-situ data
- Arguments
- Value
- Contents

Read and Load 10x Genomics Xenium in-situ data

Directory containing all Xenium output files with default filenames

Remove transcript molecules with a QV less than this threshold. QV >= 20 is the standard threshold used to construct the cell x gene count matrix.

Whether or not to load cell centroids

Whether or not to load molecule pixel coordinates

One of "cell", "nucleus" or NULL (to load either cell segmentations, nucleus segmentations or neither)

Whether or not to flip the x/y coordinates of the Xenium outputs to match what is displayed in Xenium Explorer, or fit on your screen better.

Types of molecular outputs to read; choose one or more of:

“matrix”: the counts matrix

“microns”: molecule coordinates

“segmentation_method”: cell segmentation method (for runs which use multi-modal segmentation)

Type of cell spatial coordinate matrices to read; choose one or more of:

“centroids”: cell centroids in pixel coordinate space

“segmentations”: cell segmentations in pixel coordinate space

“nucleus_segmentations”: nucleus segmentations in pixel coordinate space

LoadXenium: A Seurat object

ReadXenium: A list with some combination of the following values:

“matrix”: a sparse matrix with expression data; cells are columns and features are rows

“centroids”: a data frame with cell centroid coordinates in three columns: “x”, “y”, and “cell”

“pixels”: a data frame with molecule pixel coordinates in three columns: “x”, “y”, and “gene”

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/convenience.R
```

Example 2 (unknown):
```unknown
R/preprocessing.R
```

Example 3 (unknown):
```unknown
ReadXenium.Rd
```

Example 4 (unknown):
```unknown
LoadXenium(
  data.dir,
  fov = "fov",
  assay = "Xenium",
  mols.qv.threshold = 20,
  cell.centroids = TRUE,
  molecule.coordinates = TRUE,
  segmentations = NULL,
  flip.xy = FALSE
)

ReadXenium(
  data.dir,
  outs = c("segmentation_method", "matrix", "microns"),
  type = "centroids",
  mols.qv.threshold = 20,
  flip.xy = F
)
```

Example 5 (r):
```r
LoadXenium(
  data.dir,
  fov = "fov",
  assay = "Xenium",
  mols.qv.threshold = 20,
  cell.centroids = TRUE,
  molecule.coordinates = TRUE,
  segmentations = NULL,
  flip.xy = FALSE
)

ReadXenium(
  data.dir,
  outs = c("segmentation_method", "matrix", "microns"),
  type = "centroids",
  mols.qv.threshold = 20,
  flip.xy = F
)
```

Example 6 (r):
```r
LoadXenium(
  data.dir,
  fov = "fov",
  assay = "Xenium",
  mols.qv.threshold = 20,
  cell.centroids = TRUE,
  molecule.coordinates = TRUE,
  segmentations = NULL,
  flip.xy = FALSE
)

ReadXenium(
  data.dir,
  outs = c("segmentation_method", "matrix", "microns"),
  type = "centroids",
  mols.qv.threshold = 20,
  flip.xy = F
)
```

---

## Linear discriminant analysis on pooled CRISPR screen data. — MixscapeLDA • Seurat

**URL:** http://127.0.0.1:9173/reference_mixscapelda.html

**Contents:**
- Linear discriminant analysis on pooled CRISPR screen data.
- Arguments
- Value
- Contents

This function performs unsupervised PCA on each mixscape class separately and projects each subspace onto all cells in the data. Finally, it uses the first 10 principle components from each projection as input to lda in MASS package together with mixscape class labels.

An object of class Seurat.

Assay to use for performing Linear Discriminant Analysis (LDA).

Number of LDA dimensions to print.

Number of features to print for each LDA component.

Value for random seed

Assay to use for running Principle components analysis.

Meta data column with target gene class labels.

Name of non-targeting cell class.

Number of principle components to use.

Limit testing to genes which show, on average, at least X-fold difference (log-scale) between the two groups of cells. Default is 0.25. Increasing logfc.threshold speeds up the function, but can miss weaker signals.

Returns a Seurat object with LDA added in the reduction slot.

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/mixscape.R
```

Example 2 (unknown):
```unknown
MixscapeLDA.Rd
```

Example 3 (unknown):
```unknown
MixscapeLDA(
  object,
  assay = NULL,
  ndims.print = 1:5,
  nfeatures.print = 30,
  reduction.key = "LDA_",
  seed = 42,
  pc.assay = "PRTB",
  labels = "gene",
  nt.label = "NT",
  npcs = 10,
  verbose = TRUE,
  logfc.threshold = 0.25
)
```

Example 4 (r):
```r
MixscapeLDA(
  object,
  assay = NULL,
  ndims.print = 1:5,
  nfeatures.print = 30,
  reduction.key = "LDA_",
  seed = 42,
  pc.assay = "PRTB",
  labels = "gene",
  nt.label = "NT",
  npcs = 10,
  verbose = TRUE,
  logfc.threshold = 0.25
)
```

Example 5 (r):
```r
MixscapeLDA(
  object,
  assay = NULL,
  ndims.print = 1:5,
  nfeatures.print = 30,
  reduction.key = "LDA_",
  seed = 42,
  pc.assay = "PRTB",
  labels = "gene",
  nt.label = "NT",
  npcs = 10,
  verbose = TRUE,
  logfc.threshold = 0.25
)
```

---

## Load 10X Genomics Visium Tissue Positions — Read10X_Coordinates • Seurat

**URL:** http://127.0.0.1:9173/reference_read10x_coordinates.html

**Contents:**
- Load 10X Genomics Visium Tissue Positions
- Arguments
- Value
- Contents

Load 10X Genomics Visium Tissue Positions

Path to a tissue_positions_list.csv file

Filter spot/feature matrix to only include spots that have been determined to be over tissue

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/preprocessing.R
```

Example 2 (unknown):
```unknown
Read10X_Coordinates.Rd
```

Example 3 (unknown):
```unknown
Read10X_Coordinates(filename, filter.matrix)
```

Example 4 (r):
```r
Read10X_Coordinates(filename, filter.matrix)
```

Example 5 (r):
```r
Read10X_Coordinates(filename, filter.matrix)
```

Example 6 (unknown):
```unknown
tissue_positions_list.csv
```

---

## Splits object into a list of subsetted objects. — SplitObject • Seurat

**URL:** http://127.0.0.1:9173/seurat/reference/splitobject/index.html

**Contents:**
- Splits object into a list of subsetted objects.
- Arguments
- Value
- Examples
- Contents

Splits object based on a single attribute into a list of subsetted objects, one for each level of the attribute. For example, useful for taking an object that contains cells from many patients, and subdividing it into patient-specific objects.

Attribute for splitting. Default is "ident". Currently only supported for class-level (i.e. non-quantitative) attributes.

A named list of Seurat objects, each containing a subset of cells from the original object.

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/objects.R
```

Example 2 (unknown):
```unknown
SplitObject.Rd
```

Example 3 (unknown):
```unknown
SplitObject(object, split.by = "ident")
```

Example 4 (r):
```r
SplitObject(object, split.by = "ident")
```

Example 5 (r):
```r
SplitObject(object, split.by = "ident")
```

Example 6 (python):
```python
data("pbmc_small")
# Assign the test object a three level attribute
groups <- sample(c("group1", "group2", "group3"), size = 80, replace = TRUE)
names(groups) <- colnames(pbmc_small)
pbmc_small <- AddMetaData(object = pbmc_small, metadata = groups, col.name = "group")
obj.list <- SplitObject(pbmc_small, split.by = "group")
```

Example 7 (r):
```r
data("pbmc_small")
# Assign the test object a three level attribute
groups <- sample(c("group1", "group2", "group3"), size = 80, replace = TRUE)
names(groups) <- colnames(pbmc_small)
pbmc_small <- AddMetaData(object = pbmc_small, metadata = groups, col.name = "group")
obj.list <- SplitObject(pbmc_small, split.by = "group")
```

Example 8 (r):
```r
data("pbmc_small")
# Assign the test object a three level attribute
groups <- sample(c("group1", "group2", "group3"), size = 80, replace = TRUE)
names(groups) <- colnames(pbmc_small)
pbmc_small <- AddMetaData(object = pbmc_small, metadata = groups, col.name = "group")
obj.list <- SplitObject(pbmc_small, split.by = "group")
```

---

## Run Independent Component Analysis on gene expression — RunICA • Seurat

**URL:** http://127.0.0.1:9173/reference_runica.html

**Contents:**
- Run Independent Component Analysis on gene expression
- Arguments
- Contents

Run fastica algorithm from the ica package for ICA dimensionality reduction. For details about stored ICA calculation parameters, see PrintICAParams.

Additional arguments to be passed to fastica

Name of Assay ICA is being run on

Number of ICs to compute

By default, computes the dimensional reduction on the cell x feature matrix. Setting to true will compute it on the transpose (feature x cell matrix).

ICA function from ica package to run (options: icafast, icaimax, icajade)

Print the top genes associated with high/low loadings for the ICs

ICs to print genes for

Number of genes to print for each IC

dimensional reduction name

dimensional reduction key, specifies the string before the number for the dimension names.

Set a random seed. Setting NULL will not set a seed.

Features to compute ICA on

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/generics.R
```

Example 2 (unknown):
```unknown
R/dimensional_reduction.R
```

Example 3 (unknown):
```unknown
PrintICAParams
```

Example 4 (python):
```python
RunICA(object, ...)

# Default S3 method
RunICA(
  object,
  assay = NULL,
  nics = 50,
  rev.ica = FALSE,
  ica.function = "icafast",
  verbose = TRUE,
  ndims.print = 1:5,
  nfeatures.print = 30,
  reduction.name = "ica",
  reduction.key = "ica_",
  seed.use = 42,
  ...
)

# S3 method for class 'Assay'
RunICA(
  object,
  assay = NULL,
  features = NULL,
  nics = 50,
  rev.ica = FALSE,
  ica.function = "icafast",
  verbose = TRUE,
  ndims.print = 1:5,
  nfeatures.print = 30,
  reduction.name = "ica",
  reduction.key = "ica_",
  seed.use = 42,
  ...
)

# S3 method for class 'Seurat'
RunICA(
  object,
  assay = NULL,
  features = NULL,
  nics = 50,
  rev.ica = FALSE,
  ica.function = "icafast",
  verbose = TRUE,
  ndims.print = 1:5,
  nfeatures.print = 30,
  reduction.name = "ica",
  reduction.key = "IC_",
  seed.use = 42,
  ...
)
```

Example 5 (r):
```r
RunICA(object, ...)

# Default S3 method
RunICA(
  object,
  assay = NULL,
  nics = 50,
  rev.ica = FALSE,
  ica.function = "icafast",
  verbose = TRUE,
  ndims.print = 1:5,
  nfeatures.print = 30,
  reduction.name = "ica",
  reduction.key = "ica_",
  seed.use = 42,
  ...
)

# S3 method for class 'Assay'
RunICA(
  object,
  assay = NULL,
  features = NULL,
  nics = 50,
  rev.ica = FALSE,
  ica.function = "icafast",
  verbose = TRUE,
  ndims.print = 1:5,
  nfeatures.print = 30,
  reduction.name = "ica",
  reduction.key = "ica_",
  seed.use = 42,
  ...
)

# S3 method for class 'Seurat'
RunICA(
  object,
  assay = NULL,
  features = NULL,
  nics = 50,
  rev.ica = FALSE,
  ica.function = "icafast",
  verbose = TRUE,
  ndims.print = 1:5,
  nfeatures.print = 30,
  reduction.name = "ica",
  reduction.key = "IC_",
  seed.use = 42,
  ...
)
```

Example 6 (r):
```r
RunICA(object, ...)

# Default S3 method
RunICA(
  object,
  assay = NULL,
  nics = 50,
  rev.ica = FALSE,
  ica.function = "icafast",
  verbose = TRUE,
  ndims.print = 1:5,
  nfeatures.print = 30,
  reduction.name = "ica",
  reduction.key = "ica_",
  seed.use = 42,
  ...
)

# S3 method for class 'Assay'
RunICA(
  object,
  assay = NULL,
  features = NULL,
  nics = 50,
  rev.ica = FALSE,
  ica.function = "icafast",
  verbose = TRUE,
  ndims.print = 1:5,
  nfeatures.print = 30,
  reduction.name = "ica",
  reduction.key = "ica_",
  seed.use = 42,
  ...
)

# S3 method for class 'Seurat'
RunICA(
  object,
  assay = NULL,
  features = NULL,
  nics = 50,
  rev.ica = FALSE,
  ica.function = "icafast",
  verbose = TRUE,
  ndims.print = 1:5,
  nfeatures.print = 30,
  reduction.name = "ica",
  reduction.key = "IC_",
  seed.use = 42,
  ...
)
```

---

## Read output from STARsolo — ReadSTARsolo • Seurat

**URL:** http://127.0.0.1:9173/reference_readstarsolo.html

**Contents:**
- Read output from STARsolo
- Arguments
- Contents

Read output from STARsolo

Directory containing the data files

Extra parameters passed to ReadMtx

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/convenience.R
```

Example 2 (unknown):
```unknown
ReadSTARsolo.Rd
```

Example 3 (unknown):
```unknown
ReadSTARsolo(data.dir, ...)
```

Example 4 (r):
```r
ReadSTARsolo(data.dir, ...)
```

Example 5 (r):
```r
ReadSTARsolo(data.dir, ...)
```

---

## Cell cycle genes — cc.genes • Seurat

**URL:** http://127.0.0.1:9173/reference_cc.genes.html

**Contents:**
- Cell cycle genes
- Format
- Source
- Contents

A list of genes used in cell-cycle regression

A list of two vectors

Genes associated with S-phase

Genes associated with G2M-phase

https://www.science.org/doi/abs/10.1126/science.aad0501

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
cc.genes.Rd
```

---

## Select integration features — SelectIntegrationFeatures5 • Seurat

**URL:** http://127.0.0.1:9173/reference_selectintegrationfeatures5.html

**Contents:**
- Select integration features
- Arguments
- Contents

Select integration features

Number of features to return for integration

Name of assay to use for integration feature selection

Which method to pull. For HVFInfo and VariableFeatures, choose one from one of the following:

“sctransform” or “sct”

“mean.var.plot”, “dispersion”, “mvp”, or “disp”

Name of layers to use for integration feature selection

Arguments passed on to method

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/integration.R
```

Example 2 (unknown):
```unknown
SelectIntegrationFeatures5.Rd
```

Example 3 (unknown):
```unknown
SelectIntegrationFeatures5(
  object,
  nfeatures = 2000,
  assay = NULL,
  method = NULL,
  layers = NULL,
  verbose = TRUE,
  ...
)
```

Example 4 (r):
```r
SelectIntegrationFeatures5(
  object,
  nfeatures = 2000,
  assay = NULL,
  method = NULL,
  layers = NULL,
  verbose = TRUE,
  ...
)
```

Example 5 (r):
```r
SelectIntegrationFeatures5(
  object,
  nfeatures = 2000,
  assay = NULL,
  method = NULL,
  layers = NULL,
  verbose = TRUE,
  ...
)
```

Example 6 (unknown):
```unknown
VariableFeatures
```

---

## Compute the correlation of features broken down by groups with another covariate — GroupCorrelation • Seurat

**URL:** http://127.0.0.1:9173/seurat/reference/groupcorrelation/index.html

**Contents:**
- Compute the correlation of features broken down by groups with another covariate
- Arguments
- Value
- Contents

Compute the correlation of features broken down by groups with another covariate

Assay to pull the data from

Slot in the assay to pull feature expression data from (counts, data, or scale.data)

Variable with which to correlate the features

Compute the gene groups based off the data in this assay.

Only compute for genes in at least this many cells

Number of groups to split into

Display the group correlation boxplot (via GroupCorrelationPlot)

A Seurat object with the correlation stored in metafeatures

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/utilities.R
```

Example 2 (unknown):
```unknown
GroupCorrelation.Rd
```

Example 3 (unknown):
```unknown
GroupCorrelation(
  object,
  assay = NULL,
  slot = "scale.data",
  var = NULL,
  group.assay = NULL,
  min.cells = 5,
  ngroups = 6,
  do.plot = TRUE
)
```

Example 4 (r):
```r
GroupCorrelation(
  object,
  assay = NULL,
  slot = "scale.data",
  var = NULL,
  group.assay = NULL,
  min.cells = 5,
  ngroups = 6,
  do.plot = TRUE
)
```

Example 5 (r):
```r
GroupCorrelation(
  object,
  assay = NULL,
  slot = "scale.data",
  var = NULL,
  group.assay = NULL,
  min.cells = 5,
  ngroups = 6,
  do.plot = TRUE
)
```

Example 6 (unknown):
```unknown
GroupCorrelationPlot
```

---

## Create one hot matrix for a given label — CreateCategoryMatrix • Seurat

**URL:** http://127.0.0.1:9173/seurat/reference/createcategorymatrix/index.html

**Contents:**
- Create one hot matrix for a given label
- Arguments
- Contents

Create one hot matrix for a given label

Method to aggregate cells with the same label. Either 'aggregate' or 'average'

A vector of cell names

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/utilities.R
```

Example 2 (unknown):
```unknown
CreateCategoryMatrix.Rd
```

Example 3 (unknown):
```unknown
CreateCategoryMatrix(
  labels,
  method = c("aggregate", "average"),
  cells.name = NULL
)
```

Example 4 (r):
```r
CreateCategoryMatrix(
  labels,
  method = c("aggregate", "average"),
  cells.name = NULL
)
```

Example 5 (r):
```r
CreateCategoryMatrix(
  labels,
  method = c("aggregate", "average"),
  cells.name = NULL
)
```

---

## Get the predicted identity — GetTransferPredictions • Seurat

**URL:** http://127.0.0.1:9173/reference_gettransferpredictions.html

**Contents:**
- Get the predicted identity
- Arguments
- Value
- Examples
- Contents

Utility function to easily pull out the name of the class with the maximum prediction. This is useful if you've set prediction.assay = TRUE in TransferData and want to have a vector with the predicted class.

Name of the assay holding the predictions

Slot of the assay in which the prediction scores are stored

Return "Unassigned" for any cell with a score less than this value

Returns a vector of predicted class names

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/integration.R
```

Example 2 (unknown):
```unknown
GetTransferPredictions.Rd
```

Example 3 (unknown):
```unknown
prediction.assay = TRUE
```

Example 4 (unknown):
```unknown
TransferData
```

Example 5 (unknown):
```unknown
GetTransferPredictions(
  object,
  assay = "predictions",
  slot = "data",
  score.filter = 0.75
)
```

Example 6 (r):
```r
GetTransferPredictions(
  object,
  assay = "predictions",
  slot = "data",
  score.filter = 0.75
)
```

Example 7 (r):
```r
GetTransferPredictions(
  object,
  assay = "predictions",
  slot = "data",
  score.filter = 0.75
)
```

Example 8 (unknown):
```unknown
if (FALSE) { # \dontrun{
  prediction.assay <- TransferData(anchorset = anchors, refdata = reference$class)
  query[["predictions"]] <- prediction.assay
  query$predicted.id <- GetTransferPredictions(query)
} # }
```

Example 9 (r):
```r
if (FALSE) { # \dontrun{
  prediction.assay <- TransferData(anchorset = anchors, refdata = reference$class)
  query[["predictions"]] <- prediction.assay
  query$predicted.id <- GetTransferPredictions(query)
} # }
```

Example 10 (r):
```r
if (FALSE) { # \dontrun{
  prediction.assay <- TransferData(anchorset = anchors, refdata = reference$class)
  query[["predictions"]] <- prediction.assay
  query$predicted.id <- GetTransferPredictions(query)
} # }
```

---

## Plot clusters as a tree — PlotClusterTree • Seurat

**URL:** http://127.0.0.1:9173/reference_plotclustertree.html

**Contents:**
- Plot clusters as a tree
- Arguments
- Value
- Examples
- Contents

Plots previously computed tree (from BuildClusterTree)

A character string specifying the direction of the tree (default is downwards) Possible options: "rightwards", "leftwards", "upwards", and "downwards".

Additional arguments to ape::plot.phylo

Plots dendogram (must be precomputed using BuildClusterTree), returns no value

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/visualization.R
```

Example 2 (unknown):
```unknown
PlotClusterTree.Rd
```

Example 3 (unknown):
```unknown
PlotClusterTree(object, direction = "downwards", ...)
```

Example 4 (r):
```r
PlotClusterTree(object, direction = "downwards", ...)
```

Example 5 (r):
```r
PlotClusterTree(object, direction = "downwards", ...)
```

Example 6 (unknown):
```unknown
ape::plot.phylo
```

Example 7 (unknown):
```unknown
if (FALSE) { # \dontrun{
if (requireNamespace("ape", quietly = TRUE)) {
  data("pbmc_small")
  pbmc_small <- BuildClusterTree(object = pbmc_small)
  PlotClusterTree(object = pbmc_small)
}
} # }
```

Example 8 (r):
```r
if (FALSE) { # \dontrun{
if (requireNamespace("ape", quietly = TRUE)) {
  data("pbmc_small")
  pbmc_small <- BuildClusterTree(object = pbmc_small)
  PlotClusterTree(object = pbmc_small)
}
} # }
```

Example 9 (r):
```r
if (FALSE) { # \dontrun{
if (requireNamespace("ape", quietly = TRUE)) {
  data("pbmc_small")
  pbmc_small <- BuildClusterTree(object = pbmc_small)
  PlotClusterTree(object = pbmc_small)
}
} # }
```

---

## Visualize 'features' on a dimensional reduction plot — FeaturePlot • Seurat

**URL:** http://127.0.0.1:9173/reference_featureplot.html

**Contents:**
- Visualize 'features' on a dimensional reduction plot
- Arguments
- Value
- Note
- See also
- Examples
- Contents

Colors single cells on a dimensional reduction plot according to a 'feature' (i.e. gene expression, PC scores, number of genes detected, etc.)

Vector of features to plot. Features can come from:

An Assay feature (e.g. a gene name - "MS4A1")

A column name from meta.data (e.g. mitochondrial percentage - "percent.mito")

A column name from a DimReduc object corresponding to the cell embedding values (e.g. the PC 1 scores - "PC_1")

Dimensions to plot, must be a two-length numeric vector specifying x- and y-dimensions

Vector of cells to plot (default is all cells)

The two colors to form the gradient over. Provide as string vector with the first color corresponding to low values, the second to high. Also accepts a Brewer color scale or vector of colors. Note: this will bin the data into number of colors provided. When blend is TRUE, takes anywhere from 1-3 colors:

Treated as color for double-negatives, will use default colors 2 and 3 for per-feature expression

Treated as colors for per-feature expression, will use default color 1 for double-negatives

First color used for double-negatives, colors 2 and 3 used for per-feature expression, all others ignored

Adjust point size for plotting

Alpha value for plotting (default is 1)

Boolean determining whether to plot cells in order of expression. Can be useful if cells expressing given feature are getting buried.

Vector of minimum and maximum cutoff values for each feature, may specify quantile in the form of 'q##' where '##' is the quantile (eg, 'q1', 'q10')

Which dimensionality reduction to use. If not specified, first searches for umap, then tsne, then pca

A factor in object metadata to split the plot by, pass 'ident' to split by cell identity

How to handle the color scale across multiple plots. Options are:

“feature” (default; by row/feature scaling): The plots for each individual feature are scaled to the maximum expression of the feature across the conditions provided to split.by

“all” (universal scaling): The plots for all features and conditions are scaled to the maximum expression value for the feature with the highest overall expression

NULL (no scaling): Each individual plot is scaled to the maximum expression value of the feature in the condition provided to split.by. Be aware setting NULL will result in color scales that are not comparable between plots

If NULL, all points are circles (default). You can specify any cell attribute (that can be pulled with FetchData) allowing for both different colors and different shapes on cells. Only applicable if raster = FALSE.

Which slot to pull expression data from?

Scale and blend expression values to visualize coexpression of two features

The color cutoff from weak signal to strong signal; ranges from 0 to 1.

Whether to label the clusters

Sets the color of the label text

Number of columns to combine multiple feature plots to, ignored if split.by is not NULL

Plot cartesian coordinates with fixed aspect ratio

If splitting by a factor, plot the splits per column with the features as rows; ignored if blend = TRUE

Redundant with order. This argument is being deprecated. Please use order instead.

Launch an interactive FeaturePlot

Combine plots into a single patchworked ggplot object. If FALSE, return a list of ggplot objects

Convert points to raster format, default is NULL which automatically rasterizes if plotting more than 100,000 cells

Pixel resolution for rasterized plots, passed to geom_scattermore(). Default is c(512, 512).

A patchworked ggplot object if combine = TRUE; otherwise, a list of ggplot objects

For the old do.hover and do.identify functionality, please see HoverLocator and CellSelector, respectively.

DimPlot HoverLocator CellSelector

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/visualization.R
```

Example 2 (unknown):
```unknown
FeaturePlot.Rd
```

Example 3 (unknown):
```unknown
FeaturePlot(
  object,
  features,
  dims = c(1, 2),
  cells = NULL,
  cols = if (blend) {
     c("lightgrey", "#ff0000", "#00ff00")
 } else {
    
    c("lightgrey", "blue")
 },
  pt.size = NULL,
  alpha = 1,
  order = FALSE,
  min.cutoff = NA,
  max.cutoff = NA,
  reduction = NULL,
  split.by = NULL,
  keep.scale = "feature",
  shape.by = NULL,
  slot = "data",
  blend = FALSE,
  blend.threshold = 0.5,
  label = FALSE,
  label.size = 4,
  label.color = "black",
  repel = FALSE,
  ncol = NULL,
  coord.fixed = FALSE,
  by.col = TRUE,
  sort.cell = deprecated(),
  interactive = FALSE,
  combine = TRUE,
  raster = NULL,
  raster.dpi = c(512, 512)
)
```

Example 4 (r):
```r
FeaturePlot(
  object,
  features,
  dims = c(1, 2),
  cells = NULL,
  cols = if (blend) {
     c("lightgrey", "#ff0000", "#00ff00")
 } else {
    
    c("lightgrey", "blue")
 },
  pt.size = NULL,
  alpha = 1,
  order = FALSE,
  min.cutoff = NA,
  max.cutoff = NA,
  reduction = NULL,
  split.by = NULL,
  keep.scale = "feature",
  shape.by = NULL,
  slot = "data",
  blend = FALSE,
  blend.threshold = 0.5,
  label = FALSE,
  label.size = 4,
  label.color = "black",
  repel = FALSE,
  ncol = NULL,
  coord.fixed = FALSE,
  by.col = TRUE,
  sort.cell = deprecated(),
  interactive = FALSE,
  combine = TRUE,
  raster = NULL,
  raster.dpi = c(512, 512)
)
```

Example 5 (r):
```r
FeaturePlot(
  object,
  features,
  dims = c(1, 2),
  cells = NULL,
  cols = if (blend) {
     c("lightgrey", "#ff0000", "#00ff00")
 } else {
    
    c("lightgrey", "blue")
 },
  pt.size = NULL,
  alpha = 1,
  order = FALSE,
  min.cutoff = NA,
  max.cutoff = NA,
  reduction = NULL,
  split.by = NULL,
  keep.scale = "feature",
  shape.by = NULL,
  slot = "data",
  blend = FALSE,
  blend.threshold = 0.5,
  label = FALSE,
  label.size = 4,
  label.color = "black",
  repel = FALSE,
  ncol = NULL,
  coord.fixed = FALSE,
  by.col = TRUE,
  sort.cell = deprecated(),
  interactive = FALSE,
  combine = TRUE,
  raster = NULL,
  raster.dpi = c(512, 512)
)
```

Example 6 (unknown):
```unknown
raster = FALSE
```

Example 7 (unknown):
```unknown
blend = TRUE
```

Example 8 (unknown):
```unknown
FeaturePlot
```

Example 9 (unknown):
```unknown
patchworked
```

Example 10 (unknown):
```unknown
patchworked
```

Example 11 (unknown):
```unknown
combine = TRUE
```

Example 12 (unknown):
```unknown
do.identify
```

Example 13 (unknown):
```unknown
HoverLocator
```

Example 14 (unknown):
```unknown
CellSelector
```

Example 15 (unknown):
```unknown
HoverLocator
```

Example 16 (unknown):
```unknown
CellSelector
```

Example 17 (unknown):
```unknown
data("pbmc_small")
FeaturePlot(object = pbmc_small, features = 'PC_1')
```

Example 18 (r):
```r
data("pbmc_small")
FeaturePlot(object = pbmc_small, features = 'PC_1')
```

Example 19 (r):
```r
data("pbmc_small")
FeaturePlot(object = pbmc_small, features = 'PC_1')
```

---

## Visualize clusters spatially and interactively — ISpatialDimPlot • Seurat

**URL:** http://127.0.0.1:9173/reference_ispatialdimplot.html

**Contents:**
- Visualize clusters spatially and interactively
- Arguments
- Value
- Contents

Visualize clusters spatially and interactively

Name of the image to use in the plot

Choose the scale factor ("lowres"/"hires") to apply in order to matchthe plot with the specified `image` - defaults to "lowres"

Name of meta.data column to group the data by

Controls opacity of spots. Provide as a vector specifying the min and max for SpatialFeaturePlot. For SpatialDimPlot, provide a single alpha value for each plot.

Returns final plot as a ggplot object

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/visualization.R
```

Example 2 (unknown):
```unknown
ISpatialDimPlot.Rd
```

Example 3 (unknown):
```unknown
ISpatialDimPlot(
  object,
  image = NULL,
  image.scale = "lowres",
  group.by = NULL,
  alpha = c(0.3, 1)
)
```

Example 4 (r):
```r
ISpatialDimPlot(
  object,
  image = NULL,
  image.scale = "lowres",
  group.by = NULL,
  alpha = c(0.3, 1)
)
```

Example 5 (r):
```r
ISpatialDimPlot(
  object,
  image = NULL,
  image.scale = "lowres",
  group.by = NULL,
  alpha = c(0.3, 1)
)
```

---

## Run Linear Discriminant Analysis — RunLDA • Seurat

**URL:** http://127.0.0.1:9173/seurat/reference/runlda/index.html

**Contents:**
- Run Linear Discriminant Analysis
- Arguments
- Contents

Run Linear Discriminant Analysis

Function to perform Linear Discriminant Analysis.

An object of class Seurat.

Arguments passed to other methods

Meta data column with target gene class labels.

Assay to use for performing Linear Discriminant Analysis (LDA).

Print the top genes associated with high/low loadings for the PCs

Number of LDA dimensions to print.

Number of features to print for each LDA component.

Value for random seed

Features to compute LDA on

dimensional reduction name, lda by default

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/generics.R
```

Example 2 (unknown):
```unknown
R/mixscape.R
```

Example 3 (python):
```python
RunLDA(object, ...)

# Default S3 method
RunLDA(
  object,
  labels,
  assay = NULL,
  verbose = TRUE,
  ndims.print = 1:5,
  nfeatures.print = 30,
  reduction.key = "LDA_",
  seed = 42,
  ...
)

# S3 method for class 'Assay'
RunLDA(
  object,
  assay = NULL,
  labels,
  features = NULL,
  verbose = TRUE,
  ndims.print = 1:5,
  nfeatures.print = 30,
  reduction.key = "LDA_",
  seed = 42,
  ...
)

# S3 method for class 'Seurat'
RunLDA(
  object,
  assay = NULL,
  labels,
  features = NULL,
  reduction.name = "lda",
  reduction.key = "LDA_",
  seed = 42,
  verbose = TRUE,
  ndims.print = 1:5,
  nfeatures.print = 30,
  ...
)
```

Example 4 (r):
```r
RunLDA(object, ...)

# Default S3 method
RunLDA(
  object,
  labels,
  assay = NULL,
  verbose = TRUE,
  ndims.print = 1:5,
  nfeatures.print = 30,
  reduction.key = "LDA_",
  seed = 42,
  ...
)

# S3 method for class 'Assay'
RunLDA(
  object,
  assay = NULL,
  labels,
  features = NULL,
  verbose = TRUE,
  ndims.print = 1:5,
  nfeatures.print = 30,
  reduction.key = "LDA_",
  seed = 42,
  ...
)

# S3 method for class 'Seurat'
RunLDA(
  object,
  assay = NULL,
  labels,
  features = NULL,
  reduction.name = "lda",
  reduction.key = "LDA_",
  seed = 42,
  verbose = TRUE,
  ndims.print = 1:5,
  nfeatures.print = 30,
  ...
)
```

Example 5 (r):
```r
RunLDA(object, ...)

# Default S3 method
RunLDA(
  object,
  labels,
  assay = NULL,
  verbose = TRUE,
  ndims.print = 1:5,
  nfeatures.print = 30,
  reduction.key = "LDA_",
  seed = 42,
  ...
)

# S3 method for class 'Assay'
RunLDA(
  object,
  assay = NULL,
  labels,
  features = NULL,
  verbose = TRUE,
  ndims.print = 1:5,
  nfeatures.print = 30,
  reduction.key = "LDA_",
  seed = 42,
  ...
)

# S3 method for class 'Seurat'
RunLDA(
  object,
  assay = NULL,
  labels,
  features = NULL,
  reduction.name = "lda",
  reduction.key = "LDA_",
  seed = 42,
  verbose = TRUE,
  ndims.print = 1:5,
  nfeatures.print = 30,
  ...
)
```

---

## Sample UMI — SampleUMI • Seurat

**URL:** http://127.0.0.1:9173/seurat/reference/sampleumi/index.html

**Contents:**
- Sample UMI
- Arguments
- Value
- Examples
- Contents

Downsample each cell to a specified number of UMIs. Includes an option to upsample cells below specified UMI as well.

Matrix with the raw count data

Number of UMIs to sample to

Upsamples all cells with fewer than max.umi

Display the progress bar

Matrix with downsampled data

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/preprocessing.R
```

Example 2 (unknown):
```unknown
SampleUMI.Rd
```

Example 3 (unknown):
```unknown
SampleUMI(data, max.umi = 1000, upsample = FALSE, verbose = FALSE)
```

Example 4 (r):
```r
SampleUMI(data, max.umi = 1000, upsample = FALSE, verbose = FALSE)
```

Example 5 (r):
```r
SampleUMI(data, max.umi = 1000, upsample = FALSE, verbose = FALSE)
```

Example 6 (python):
```python
data("pbmc_small")
counts = as.matrix(x = GetAssayData(object = pbmc_small, assay = "RNA", slot = "counts"))
downsampled = SampleUMI(data = counts)
head(x = downsampled)
#> 6 x 80 sparse Matrix of class "dgCMatrix"
#>   [[ suppressing 80 column names ‘ATGCCAGAACGACT’, ‘CATGGCCTGTGCAT’, ‘GAACCTGATGAACC’ ... ]]
#>                                                                                
#> MS4A1    . . . . . . . . . .  2  2  4 4  2  3 3  4  2  3 .  . .  . 1 . . . .  .
#> CD79B    1 . . . . . . . . 1  2  4  3 3  2  3 1  2  2  5 .  . .  . . . . . .  1
#> CD79A    . . . . . . . . . .  .  5  2 2  5  8 1  5  5 12 .  . 1  . . . . 1 .  .
#> HLA-DRA  . 1 . . 1 1 . 1 . . 14 28 18 7 15 28 7 26 10 16 7 22 . 10 6 . 4 3 7 13
#> TCL1A    . . . . . . . . . .  3  .  2 4  .  . 3  3  3  2 .  . .  . . . . . .  .
#> HLA-DQB1 1 . . . . . . . . .  1  6  2 2  2  8 2  2  1  2 .  3 .  . . . 1 . 1  .
#>                                                                              
#> MS4A1    . . . . . . . . . . . . . . . . . . . .  .  . . . .  .  .  . . .   .
#> CD79B    1 . 2 . . . . . . . . . . . . . . . . .  1  . 1 1 2  2  .  . 3 .   .
#> CD79A    . . . . . . . . . . . . . . . . . . . .  .  . . . .  .  .  . . .   .
#> HLA-DRA  . 1 . . 1 . 1 1 . . . . . . . 1 1 1 . . 10 10 4 1 6 28 10 13 5 8 108
#> TCL1A    . . . . . . . . . . . . . . . . . . . .  .  . . . .  .  .  . . .   .
#> HLA-DQB1 . . . . . . . . . . . . . . . . . . . .  .  1 1 . 2  .  .  1 1 .  21
#>                                                          
#> MS4A1     .  .  .   .  .  .  1  .   . . . . . . . . . . .
#> CD79B     .  .  4   1  .  .  .  .   . . . . . . . . . . .
#> CD79A     .  .  8   .  .  .  .  1   . . . . . . . . . . .
#> HLA-DRA  93 41 42 138 77 76 15 19 104 1 . . . 2 1 1 . 2 7
#> TCL1A     .  .  4   .  .  .  .  .   . . . . . . . . . . .
#> HLA-DQB1 21  3  5  11 11 10  1  2  11 . . . . . . . . . 1
```

Example 7 (r):
```r
data("pbmc_small")
counts = as.matrix(x = GetAssayData(object = pbmc_small, assay = "RNA", slot = "counts"))
downsampled = SampleUMI(data = counts)
head(x = downsampled)
#> 6 x 80 sparse Matrix of class "dgCMatrix"
#>   [[ suppressing 80 column names ‘ATGCCAGAACGACT’, ‘CATGGCCTGTGCAT’, ‘GAACCTGATGAACC’ ... ]]
#>                                                                                
#> MS4A1    . . . . . . . . . .  2  2  4 4  2  3 3  4  2  3 .  . .  . 1 . . . .  .
#> CD79B    1 . . . . . . . . 1  2  4  3 3  2  3 1  2  2  5 .  . .  . . . . . .  1
#> CD79A    . . . . . . . . . .  .  5  2 2  5  8 1  5  5 12 .  . 1  . . . . 1 .  .
#> HLA-DRA  . 1 . . 1 1 . 1 . . 14 28 18 7 15 28 7 26 10 16 7 22 . 10 6 . 4 3 7 13
#> TCL1A    . . . . . . . . . .  3  .  2 4  .  . 3  3  3  2 .  . .  . . . . . .  .
#> HLA-DQB1 1 . . . . . . . . .  1  6  2 2  2  8 2  2  1  2 .  3 .  . . . 1 . 1  .
#>                                                                              
#> MS4A1    . . . . . . . . . . . . . . . . . . . .  .  . . . .  .  .  . . .   .
#> CD79B    1 . 2 . . . . . . . . . . . . . . . . .  1  . 1 1 2  2  .  . 3 .   .
#> CD79A    . . . . . . . . . . . . . . . . . . . .  .  . . . .  .  .  . . .   .
#> HLA-DRA  . 1 . . 1 . 1 1 . . . . . . . 1 1 1 . . 10 10 4 1 6 28 10 13 5 8 108
#> TCL1A    . . . . . . . . . . . . . . . . . . . .  .  . . . .  .  .  . . .   .
#> HLA-DQB1 . . . . . . . . . . . . . . . . . . . .  .  1 1 . 2  .  .  1 1 .  21
#>                                                          
#> MS4A1     .  .  .   .  .  .  1  .   . . . . . . . . . . .
#> CD79B     .  .  4   1  .  .  .  .   . . . . . . . . . . .
#> CD79A     .  .  8   .  .  .  .  1   . . . . . . . . . . .
#> HLA-DRA  93 41 42 138 77 76 15 19 104 1 . . . 2 1 1 . 2 7
#> TCL1A     .  .  4   .  .  .  .  .   . . . . . . . . . . .
#> HLA-DQB1 21  3  5  11 11 10  1  2  11 . . . . . . . . . 1
```

Example 8 (r):
```r
data("pbmc_small")
counts = as.matrix(x = GetAssayData(object = pbmc_small, assay = "RNA", slot = "counts"))
downsampled = SampleUMI(data = counts)
head(x = downsampled)
#> 6 x 80 sparse Matrix of class "dgCMatrix"
#>   [[ suppressing 80 column names ‘ATGCCAGAACGACT’, ‘CATGGCCTGTGCAT’, ‘GAACCTGATGAACC’ ... ]]
#>                                                                                
#> MS4A1    . . . . . . . . . .  2  2  4 4  2  3 3  4  2  3 .  . .  . 1 . . . .  .
#> CD79B    1 . . . . . . . . 1  2  4  3 3  2  3 1  2  2  5 .  . .  . . . . . .  1
#> CD79A    . . . . . . . . . .  .  5  2 2  5  8 1  5  5 12 .  . 1  . . . . 1 .  .
#> HLA-DRA  . 1 . . 1 1 . 1 . . 14 28 18 7 15 28 7 26 10 16 7 22 . 10 6 . 4 3 7 13
#> TCL1A    . . . . . . . . . .  3  .  2 4  .  . 3  3  3  2 .  . .  . . . . . .  .
#> HLA-DQB1 1 . . . . . . . . .  1  6  2 2  2  8 2  2  1  2 .  3 .  . . . 1 . 1  .
#>                                                                              
#> MS4A1    . . . . . . . . . . . . . . . . . . . .  .  . . . .  .  .  . . .   .
#> CD79B    1 . 2 . . . . . . . . . . . . . . . . .  1  . 1 1 2  2  .  . 3 .   .
#> CD79A    . . . . . . . . . . . . . . . . . . . .  .  . . . .  .  .  . . .   .
#> HLA-DRA  . 1 . . 1 . 1 1 . . . . . . . 1 1 1 . . 10 10 4 1 6 28 10 13 5 8 108
#> TCL1A    . . . . . . . . . . . . . . . . . . . .  .  . . . .  .  .  . . .   .
#> HLA-DQB1 . . . . . . . . . . . . . . . . . . . .  .  1 1 . 2  .  .  1 1 .  21
#>                                                          
#> MS4A1     .  .  .   .  .  .  1  .   . . . . . . . . . . .
#> CD79B     .  .  4   1  .  .  .  .   . . . . . . . . . . .
#> CD79A     .  .  8   .  .  .  .  1   . . . . . . . . . . .
#> HLA-DRA  93 41 42 138 77 76 15 19 104 1 . . . 2 1 1 . 2 7
#> TCL1A     .  .  4   .  .  .  .  .   . . . . . . . . . . .
#> HLA-DQB1 21  3  5  11 11 10  1  2  11 . . . . . . . . . 1
```

---

## Highlight Neighbors in DimPlot — NNPlot • Seurat

**URL:** http://127.0.0.1:9173/reference_nnplot.html

**Contents:**
- Highlight Neighbors in DimPlot
- Arguments
- Value
- Contents

It will color the query cells and the neighbors of the query cells in the DimPlot

Which dimensionality reduction to use. If not specified, first searches for umap, then tsne, then pca

the neighbor index of all cells

cells used to find their neighbors

Dimensions to plot, must be a two-length numeric vector specifying x- and y-dimensions

Whether to label the clusters

Size of highlighted cells; will repeat to the length groups in cells.highlight. If sizes.highlight = TRUE size of all points will be this value.

Adjust point size for plotting

A vector of colors to highlight the cells as; will repeat to the length groups in cells.highlight

Color value for NA points when using custom scale

Specify the order of plotting for the idents. This can be useful for crowded plots if points of interest are being buried. Provide either a full list of valid idents or a subset to be plotted last (on top)

Show all cells or only query and neighbor cells

Extra parameters passed to DimPlot

A patchworked ggplot object if combine = TRUE; otherwise, a list of ggplot objects

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/visualization.R
```

Example 2 (unknown):
```unknown
NNPlot(
  object,
  reduction,
  nn.idx,
  query.cells,
  dims = 1:2,
  label = FALSE,
  label.size = 4,
  repel = FALSE,
  sizes.highlight = 2,
  pt.size = 1,
  cols.highlight = c("#377eb8", "#e41a1c"),
  na.value = "#bdbdbd",
  order = c("self", "neighbors", "other"),
  show.all.cells = TRUE,
  ...
)
```

Example 3 (r):
```r
NNPlot(
  object,
  reduction,
  nn.idx,
  query.cells,
  dims = 1:2,
  label = FALSE,
  label.size = 4,
  repel = FALSE,
  sizes.highlight = 2,
  pt.size = 1,
  cols.highlight = c("#377eb8", "#e41a1c"),
  na.value = "#bdbdbd",
  order = c("self", "neighbors", "other"),
  show.all.cells = TRUE,
  ...
)
```

Example 4 (r):
```r
NNPlot(
  object,
  reduction,
  nn.idx,
  query.cells,
  dims = 1:2,
  label = FALSE,
  label.size = 4,
  repel = FALSE,
  sizes.highlight = 2,
  pt.size = 1,
  cols.highlight = c("#377eb8", "#e41a1c"),
  na.value = "#bdbdbd",
  order = c("self", "neighbors", "other"),
  show.all.cells = TRUE,
  ...
)
```

Example 5 (unknown):
```unknown
sizes.highlight = TRUE
```

Example 6 (unknown):
```unknown
patchworked
```

Example 7 (unknown):
```unknown
combine = TRUE
```

---

## Prepare the bridge and reference datasets — PrepareBridgeReference • Seurat

**URL:** http://127.0.0.1:9173/seurat/reference/preparebridgereference/index.html

**Contents:**
- Prepare the bridge and reference datasets
- Arguments
- Value
- Contents

Preprocess the multi-omic bridge and unimodal reference datasets into an extended reference. This function performs the following three steps: 1. Performs within-modality harmonization between bridge and reference 2. Performs dimensional reduction on the SNN graph of bridge datasets via Laplacian Eigendecomposition 3. Constructs a bridge dictionary representation for unimodal reference cells

A reference Seurat object

A multi-omic bridge Seurat object

Name of dimensional reduction of the reference object (default is 'pca')

Number of dimensions used for the reference.reduction (default is 50)

Name of normalization method used: LogNormalize or SCT

Assay name for reference (default is DefaultAssay)

Assay name for bridge used for reference mapping. RNA by default

Assay name for bridge used for query mapping. ATAC by default

Type of supervised dimensional reduction to be performed for integrating the bridge and query. Options are:

slsi: Perform supervised LSI as the dimensional reduction for the bridge-query integration

spca: Perform supervised PCA as the dimensional reduction for the bridge-query integration

NULL: no supervised dimensional reduction will be calculated. bridge.query.reduction is used for the bridge-query integration

Name of dimensions used for the bridge-query harmonization. 'bridge.query.reduction' and 'supervised.reduction' cannot be NULL together.

Features used for bridge query dimensional reduction (default is NULL which uses VariableFeatures from the bridge object)

Name of dimensional reduction name of graph laplacian eigenspace (default is 'lap')

Dimensional reduction key (default is 'lap_')

Number of dimensions used for graph laplacian eigenspace (default is 50)

Print progress and message (default is TRUE)

Returns a BridgeReferenceSet that can be used as input to FindBridgeTransferAnchors. The parameters used are stored in the BridgeReferenceSet as well

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/integration.R
```

Example 2 (unknown):
```unknown
PrepareBridgeReference.Rd
```

Example 3 (unknown):
```unknown
PrepareBridgeReference(
  reference,
  bridge,
  reference.reduction = "pca",
  reference.dims = 1:50,
  normalization.method = c("SCT", "LogNormalize"),
  reference.assay = NULL,
  bridge.ref.assay = "RNA",
  bridge.query.assay = "ATAC",
  supervised.reduction = c("slsi", "spca", NULL),
  bridge.query.reduction = NULL,
  bridge.query.features = NULL,
  laplacian.reduction.name = "lap",
  laplacian.reduction.key = "lap_",
  laplacian.reduction.dims = 1:50,
  verbose = TRUE
)
```

Example 4 (r):
```r
PrepareBridgeReference(
  reference,
  bridge,
  reference.reduction = "pca",
  reference.dims = 1:50,
  normalization.method = c("SCT", "LogNormalize"),
  reference.assay = NULL,
  bridge.ref.assay = "RNA",
  bridge.query.assay = "ATAC",
  supervised.reduction = c("slsi", "spca", NULL),
  bridge.query.reduction = NULL,
  bridge.query.features = NULL,
  laplacian.reduction.name = "lap",
  laplacian.reduction.key = "lap_",
  laplacian.reduction.dims = 1:50,
  verbose = TRUE
)
```

Example 5 (r):
```r
PrepareBridgeReference(
  reference,
  bridge,
  reference.reduction = "pca",
  reference.dims = 1:50,
  normalization.method = c("SCT", "LogNormalize"),
  reference.assay = NULL,
  bridge.ref.assay = "RNA",
  bridge.query.assay = "ATAC",
  supervised.reduction = c("slsi", "spca", NULL),
  bridge.query.reduction = NULL,
  bridge.query.features = NULL,
  laplacian.reduction.name = "lap",
  laplacian.reduction.key = "lap_",
  laplacian.reduction.dims = 1:50,
  verbose = TRUE
)
```

Example 6 (unknown):
```unknown
DefaultAssay
```

Example 7 (unknown):
```unknown
BridgeReferenceSet
```

Example 8 (unknown):
```unknown
FindBridgeTransferAnchors
```

Example 9 (unknown):
```unknown
BridgeReferenceSet
```

---

## Load in data from remote or local mtx files — ReadMtx • Seurat

**URL:** http://127.0.0.1:9173/reference_readmtx.html

**Contents:**
- Load in data from remote or local mtx files
- Arguments
- Value
- Examples
- Contents

Enables easy loading of sparse data matrices

Name or remote URL of the mtx file

Name or remote URL of the cells/barcodes file

Name or remote URL of the features/genes file

Specify which column of cells file to use for cell names; default is 1

Specify which column of features files to use for feature/gene names; default is 2

Specify the delimiter in the cell name file

Specify the delimiter in the feature name file

Number of lines to skip in the cells file before beginning to read cell names

Number of lines to skip in the features file before beginning to gene names

Transpose the matrix after reading in

Make feature names unique (default TRUE)

Remove trailing "-1" if present in all cell barcodes.

A sparse matrix containing the expression data.

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/preprocessing.R
```

Example 2 (unknown):
```unknown
ReadMtx(
  mtx,
  cells,
  features,
  cell.column = 1,
  feature.column = 2,
  cell.sep = "\t",
  feature.sep = "\t",
  skip.cell = 0,
  skip.feature = 0,
  mtx.transpose = FALSE,
  unique.features = TRUE,
  strip.suffix = FALSE
)
```

Example 3 (r):
```r
ReadMtx(
  mtx,
  cells,
  features,
  cell.column = 1,
  feature.column = 2,
  cell.sep = "\t",
  feature.sep = "\t",
  skip.cell = 0,
  skip.feature = 0,
  mtx.transpose = FALSE,
  unique.features = TRUE,
  strip.suffix = FALSE
)
```

Example 4 (r):
```r
ReadMtx(
  mtx,
  cells,
  features,
  cell.column = 1,
  feature.column = 2,
  cell.sep = "\t",
  feature.sep = "\t",
  skip.cell = 0,
  skip.feature = 0,
  mtx.transpose = FALSE,
  unique.features = TRUE,
  strip.suffix = FALSE
)
```

Example 5 (unknown):
```unknown
if (FALSE) { # \dontrun{
# For local files:

expression_matrix <- ReadMtx(
  mtx = "count_matrix.mtx.gz", features = "features.tsv.gz",
  cells = "barcodes.tsv.gz"
)
seurat_object <- CreateSeuratObject(counts = expression_matrix)

# For remote files:

expression_matrix <- ReadMtx(mtx = "http://localhost/matrix.mtx",
cells = "http://localhost/barcodes.tsv",
features = "http://localhost/genes.tsv")
seurat_object <- CreateSeuratObject(counts = data)
} # }
```

Example 6 (r):
```r
if (FALSE) { # \dontrun{
# For local files:

expression_matrix <- ReadMtx(
  mtx = "count_matrix.mtx.gz", features = "features.tsv.gz",
  cells = "barcodes.tsv.gz"
)
seurat_object <- CreateSeuratObject(counts = expression_matrix)

# For remote files:

expression_matrix <- ReadMtx(mtx = "http://localhost/matrix.mtx",
cells = "http://localhost/barcodes.tsv",
features = "http://localhost/genes.tsv")
seurat_object <- CreateSeuratObject(counts = data)
} # }
```

Example 7 (r):
```r
if (FALSE) { # \dontrun{
# For local files:

expression_matrix <- ReadMtx(
  mtx = "count_matrix.mtx.gz", features = "features.tsv.gz",
  cells = "barcodes.tsv.gz"
)
seurat_object <- CreateSeuratObject(counts = expression_matrix)

# For remote files:

expression_matrix <- ReadMtx(mtx = "http://localhost/matrix.mtx",
cells = "http://localhost/barcodes.tsv",
features = "http://localhost/genes.tsv")
seurat_object <- CreateSeuratObject(counts = data)
} # }
```

---

## Create a custom color palette — BlackAndWhite • Seurat

**URL:** http://127.0.0.1:9173/seurat/reference/custompalette/index.html

**Contents:**
- Create a custom color palette
- Arguments
- Value
- Examples
- Contents

Creates a custom color palette based on low, middle, and high color values

middle color. Optional.

number of steps (colors levels) to include between low and high values

A color palette for plotting

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/visualization.R
```

Example 2 (unknown):
```unknown
CustomPalette.Rd
```

Example 3 (unknown):
```unknown
BlackAndWhite(mid = NULL, k = 50)

BlueAndRed(k = 50)

CustomPalette(low = "white", high = "red", mid = NULL, k = 50)

PurpleAndYellow(k = 50)
```

Example 4 (r):
```r
BlackAndWhite(mid = NULL, k = 50)

BlueAndRed(k = 50)

CustomPalette(low = "white", high = "red", mid = NULL, k = 50)

PurpleAndYellow(k = 50)
```

Example 5 (r):
```r
BlackAndWhite(mid = NULL, k = 50)

BlueAndRed(k = 50)

CustomPalette(low = "white", high = "red", mid = NULL, k = 50)

PurpleAndYellow(k = 50)
```

Example 6 (unknown):
```unknown
df <- data.frame(x = rnorm(n = 100, mean = 20, sd = 2), y = rbinom(n = 100, size = 100, prob = 0.2))
plot(df, col = BlackAndWhite())


df <- data.frame(x = rnorm(n = 100, mean = 20, sd = 2), y = rbinom(n = 100, size = 100, prob = 0.2))
plot(df, col = BlueAndRed())


myPalette <- CustomPalette()
myPalette
#>  [1] "#FFFFFF" "#FFFAFA" "#FFF5F5" "#FFEFEF" "#FFEAEA" "#FFE5E5" "#FFE0E0"
#>  [8] "#FFDBDB" "#FFD5D5" "#FFD0D0" "#FFCBCB" "#FFC6C6" "#FFC1C1" "#FFBBBB"
#> [15] "#FFB6B6" "#FFB1B1" "#FFACAC" "#FFA7A7" "#FFA1A1" "#FF9C9C" "#FF9797"
#> [22] "#FF9292" "#FF8D8D" "#FF8787" "#FF8282" "#FF7D7D" "#FF7878" "#FF7272"
#> [29] "#FF6D6D" "#FF6868" "#FF6363" "#FF5E5E" "#FF5858" "#FF5353" "#FF4E4E"
#> [36] "#FF4949" "#FF4444" "#FF3E3E" "#FF3939" "#FF3434" "#FF2F2F" "#FF2A2A"
#> [43] "#FF2424" "#FF1F1F" "#FF1A1A" "#FF1515" "#FF1010" "#FF0A0A" "#FF0505"
#> [50] "#FF0000"

df <- data.frame(x = rnorm(n = 100, mean = 20, sd = 2), y = rbinom(n = 100, size = 100, prob = 0.2))
plot(df, col = PurpleAndYellow())
```

Example 7 (r):
```r
df <- data.frame(x = rnorm(n = 100, mean = 20, sd = 2), y = rbinom(n = 100, size = 100, prob = 0.2))
plot(df, col = BlackAndWhite())


df <- data.frame(x = rnorm(n = 100, mean = 20, sd = 2), y = rbinom(n = 100, size = 100, prob = 0.2))
plot(df, col = BlueAndRed())


myPalette <- CustomPalette()
myPalette
#>  [1] "#FFFFFF" "#FFFAFA" "#FFF5F5" "#FFEFEF" "#FFEAEA" "#FFE5E5" "#FFE0E0"
#>  [8] "#FFDBDB" "#FFD5D5" "#FFD0D0" "#FFCBCB" "#FFC6C6" "#FFC1C1" "#FFBBBB"
#> [15] "#FFB6B6" "#FFB1B1" "#FFACAC" "#FFA7A7" "#FFA1A1" "#FF9C9C" "#FF9797"
#> [22] "#FF9292" "#FF8D8D" "#FF8787" "#FF8282" "#FF7D7D" "#FF7878" "#FF7272"
#> [29] "#FF6D6D" "#FF6868" "#FF6363" "#FF5E5E" "#FF5858" "#FF5353" "#FF4E4E"
#> [36] "#FF4949" "#FF4444" "#FF3E3E" "#FF3939" "#FF3434" "#FF2F2F" "#FF2A2A"
#> [43] "#FF2424" "#FF1F1F" "#FF1A1A" "#FF1515" "#FF1010" "#FF0A0A" "#FF0505"
#> [50] "#FF0000"

df <- data.frame(x = rnorm(n = 100, mean = 20, sd = 2), y = rbinom(n = 100, size = 100, prob = 0.2))
plot(df, col = PurpleAndYellow())
```

Example 8 (r):
```r
df <- data.frame(x = rnorm(n = 100, mean = 20, sd = 2), y = rbinom(n = 100, size = 100, prob = 0.2))
plot(df, col = BlackAndWhite())


df <- data.frame(x = rnorm(n = 100, mean = 20, sd = 2), y = rbinom(n = 100, size = 100, prob = 0.2))
plot(df, col = BlueAndRed())


myPalette <- CustomPalette()
myPalette
#>  [1] "#FFFFFF" "#FFFAFA" "#FFF5F5" "#FFEFEF" "#FFEAEA" "#FFE5E5" "#FFE0E0"
#>  [8] "#FFDBDB" "#FFD5D5" "#FFD0D0" "#FFCBCB" "#FFC6C6" "#FFC1C1" "#FFBBBB"
#> [15] "#FFB6B6" "#FFB1B1" "#FFACAC" "#FFA7A7" "#FFA1A1" "#FF9C9C" "#FF9797"
#> [22] "#FF9292" "#FF8D8D" "#FF8787" "#FF8282" "#FF7D7D" "#FF7878" "#FF7272"
#> [29] "#FF6D6D" "#FF6868" "#FF6363" "#FF5E5E" "#FF5858" "#FF5353" "#FF4E4E"
#> [36] "#FF4949" "#FF4444" "#FF3E3E" "#FF3939" "#FF3434" "#FF2F2F" "#FF2A2A"
#> [43] "#FF2424" "#FF1F1F" "#FF1A1A" "#FF1515" "#FF1010" "#FF0A0A" "#FF0505"
#> [50] "#FF0000"

df <- data.frame(x = rnorm(n = 100, mean = 20, sd = 2), y = rbinom(n = 100, size = 100, prob = 0.2))
plot(df, col = PurpleAndYellow())
```

---

## The SpatialImage Class — SpatialImage-class • Seurat

**URL:** http://127.0.0.1:9173/seurat/reference/spatialimage-class/index.html

**Contents:**
- The SpatialImage Class
- See also
- Contents

For more details, please see the documentation in SeuratObject

SeuratObject::SpatialImage-class

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/reexports.R
```

Example 2 (unknown):
```unknown
SpatialImage-class.Rd
```

Example 3 (unknown):
```unknown
SeuratObject
```

Example 4 (unknown):
```unknown
SeuratObject::SpatialImage-class
```

---

## Calculate the Barcode Distribution Inflection — CalculateBarcodeInflections • Seurat

**URL:** http://127.0.0.1:9173/seurat/reference/calculatebarcodeinflections/index.html

**Contents:**
- Calculate the Barcode Distribution Inflection
- Arguments
- Value
- Details
- See also
- Author
- Examples
- Contents

This function calculates an adaptive inflection point ("knee") of the barcode distribution for each sample group. This is useful for determining a threshold for removing low-quality samples.

Column to use as proxy for barcodes ("nCount_RNA" by default)

Column to group by ("orig.ident" by default)

Ignore barcodes of rank below this threshold in inflection calculation

Ignore barcodes of rank above this threshold in inflection calculation

Returns Seurat object with a new list in the `tools` slot, `CalculateBarcodeInflections` with values:

* `barcode_distribution` - contains the full barcode distribution across the entire dataset * `inflection_points` - the calculated inflection points within the thresholds * `threshold_values` - the provided (or default) threshold values to search within for inflections * `cells_pass` - the cells that pass the inflection point calculation

The function operates by calculating the slope of the barcode number vs. rank distribution, and then finding the point at which the distribution changes most steeply (the "knee"). Of note, this calculation often must be restricted as to the range at which it performs, so `threshold` parameters are provided to restrict the range of the calculation based on the rank of the barcodes. [BarcodeInflectionsPlot()] is provided as a convenience function to visualize and test different thresholds and thus provide more sensical end results.

See [BarcodeInflectionsPlot()] to visualize the calculated inflection points and [SubsetByBarcodeInflections()] to subsequently subset the Seurat object.

BarcodeInflectionsPlot SubsetByBarcodeInflections

Robert A. Amezquita, robert.amezquita@fredhutch.org

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/preprocessing.R
```

Example 2 (unknown):
```unknown
CalculateBarcodeInflections.Rd
```

Example 3 (unknown):
```unknown
CalculateBarcodeInflections(
  object,
  barcode.column = "nCount_RNA",
  group.column = "orig.ident",
  threshold.low = NULL,
  threshold.high = NULL
)
```

Example 4 (r):
```r
CalculateBarcodeInflections(
  object,
  barcode.column = "nCount_RNA",
  group.column = "orig.ident",
  threshold.low = NULL,
  threshold.high = NULL
)
```

Example 5 (r):
```r
CalculateBarcodeInflections(
  object,
  barcode.column = "nCount_RNA",
  group.column = "orig.ident",
  threshold.low = NULL,
  threshold.high = NULL
)
```

Example 6 (unknown):
```unknown
BarcodeInflectionsPlot
```

Example 7 (unknown):
```unknown
SubsetByBarcodeInflections
```

Example 8 (python):
```python
data("pbmc_small")
CalculateBarcodeInflections(pbmc_small, group.column = 'groups')
#> An object of class Seurat 
#> 230 features across 80 samples within 1 assay 
#> Active assay: RNA (230 features, 20 variable features)
#>  3 layers present: counts, data, scale.data
#>  2 dimensional reductions calculated: pca, tsne
```

Example 9 (r):
```r
data("pbmc_small")
CalculateBarcodeInflections(pbmc_small, group.column = 'groups')
#> An object of class Seurat 
#> 230 features across 80 samples within 1 assay 
#> Active assay: RNA (230 features, 20 variable features)
#>  3 layers present: counts, data, scale.data
#>  2 dimensional reductions calculated: pca, tsne
```

Example 10 (r):
```r
data("pbmc_small")
CalculateBarcodeInflections(pbmc_small, group.column = 'groups')
#> An object of class Seurat 
#> 230 features across 80 samples within 1 assay 
#> Active assay: RNA (230 features, 20 variable features)
#>  3 layers present: counts, data, scale.data
#>  2 dimensional reductions calculated: pca, tsne
```

---

## Get the predicted identity — GetTransferPredictions • Seurat

**URL:** http://127.0.0.1:9173/seurat/reference/gettransferpredictions/index.html

**Contents:**
- Get the predicted identity
- Arguments
- Value
- Examples
- Contents

Utility function to easily pull out the name of the class with the maximum prediction. This is useful if you've set prediction.assay = TRUE in TransferData and want to have a vector with the predicted class.

Name of the assay holding the predictions

Slot of the assay in which the prediction scores are stored

Return "Unassigned" for any cell with a score less than this value

Returns a vector of predicted class names

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/integration.R
```

Example 2 (unknown):
```unknown
GetTransferPredictions.Rd
```

Example 3 (unknown):
```unknown
prediction.assay = TRUE
```

Example 4 (unknown):
```unknown
TransferData
```

Example 5 (unknown):
```unknown
GetTransferPredictions(
  object,
  assay = "predictions",
  slot = "data",
  score.filter = 0.75
)
```

Example 6 (r):
```r
GetTransferPredictions(
  object,
  assay = "predictions",
  slot = "data",
  score.filter = 0.75
)
```

Example 7 (r):
```r
GetTransferPredictions(
  object,
  assay = "predictions",
  slot = "data",
  score.filter = 0.75
)
```

Example 8 (unknown):
```unknown
if (FALSE) { # \dontrun{
  prediction.assay <- TransferData(anchorset = anchors, refdata = reference$class)
  query[["predictions"]] <- prediction.assay
  query$predicted.id <- GetTransferPredictions(query)
} # }
```

Example 9 (r):
```r
if (FALSE) { # \dontrun{
  prediction.assay <- TransferData(anchorset = anchors, refdata = reference$class)
  query[["predictions"]] <- prediction.assay
  query$predicted.id <- GetTransferPredictions(query)
} # }
```

Example 10 (r):
```r
if (FALSE) { # \dontrun{
  prediction.assay <- TransferData(anchorset = anchors, refdata = reference$class)
  query[["predictions"]] <- prediction.assay
  query$predicted.id <- GetTransferPredictions(query)
} # }
```

---

## Read10x Probe Metadata — Read10X_probe_metadata • Seurat

**URL:** http://127.0.0.1:9173/seurat/reference/read10x_probe_metadata/index.html

**Contents:**
- Read10x Probe Metadata
- Arguments
- Value
- Contents

This function reads the probe metadata from a 10x Genomics probe barcode matrix file in HDF5 format.

The directory where the file is located.

The name of the file containing the raw probe barcode matrix in HDF5 format. The default filename is 'raw_probe_bc_matrix.h5'.

Returns a data.frame containing the probe metadata.

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/preprocessing.R
```

Example 2 (python):
```python
Read10X_probe_metadata.Rd
```

Example 3 (python):
```python
Read10X_probe_metadata(data.dir, filename = "raw_probe_bc_matrix.h5")
```

Example 4 (r):
```r
Read10X_probe_metadata(data.dir, filename = "raw_probe_bc_matrix.h5")
```

Example 5 (r):
```r
Read10X_probe_metadata(data.dir, filename = "raw_probe_bc_matrix.h5")
```

---

## Calculate module scores for feature expression programs in single cells — AddModuleScore • Seurat

**URL:** http://127.0.0.1:9173/seurat/reference/addmodulescore/index.html

**Contents:**
- Calculate module scores for feature expression programs in single cells
- Arguments
- Value
- References
- Examples
- Contents

Calculate the average expression levels of each program (cluster) on single cell level, subtracted by the aggregated expression of control feature sets. All analyzed features are binned based on averaged expression, and the control features are randomly selected from each bin.

A list of vectors of features for expression programs; each entry should be a vector of feature names

List of features to check expression levels against, defaults to rownames(x = object)

Number of bins of aggregate expression levels for all analyzed features

Number of control features selected from the same bin per analyzed feature

Use feature clusters returned from DoKMeans

Name for the expression programs; will append a number to the end for each entry in features (eg. if features has three programs, the results will be stored as name1, name2, name3, respectively)

Set a random seed. If NULL, seed is not set.

Search for symbol synonyms for features in features that don't match features in object? Searches the HGNC's gene names database; see UpdateSymbolList for more details

Slot to calculate score values off of. Defaults to data slot (i.e log-normalized counts)

Extra parameters passed to UpdateSymbolList

Returns a Seurat object with module scores added to object meta data; each module is stored as name# for each module program present in features

Tirosh et al, Science (2016)

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/utilities.R
```

Example 2 (unknown):
```unknown
AddModuleScore.Rd
```

Example 3 (unknown):
```unknown
AddModuleScore(
  object,
  features,
  pool = NULL,
  nbin = 24,
  ctrl = 100,
  k = FALSE,
  assay = NULL,
  name = "Cluster",
  seed = 1,
  search = FALSE,
  slot = "data",
  ...
)
```

Example 4 (r):
```r
AddModuleScore(
  object,
  features,
  pool = NULL,
  nbin = 24,
  ctrl = 100,
  k = FALSE,
  assay = NULL,
  name = "Cluster",
  seed = 1,
  search = FALSE,
  slot = "data",
  ...
)
```

Example 5 (r):
```r
AddModuleScore(
  object,
  features,
  pool = NULL,
  nbin = 24,
  ctrl = 100,
  k = FALSE,
  assay = NULL,
  name = "Cluster",
  seed = 1,
  search = FALSE,
  slot = "data",
  ...
)
```

Example 6 (unknown):
```unknown
rownames(x = object)
```

Example 7 (unknown):
```unknown
UpdateSymbolList
```

Example 8 (unknown):
```unknown
UpdateSymbolList
```

Example 9 (unknown):
```unknown
if (FALSE) { # \dontrun{
data("pbmc_small")
cd_features <- list(c(
  'CD79B',
  'CD79A',
  'CD19',
  'CD180',
  'CD200',
  'CD3D',
  'CD2',
  'CD3E',
  'CD7',
  'CD8A',
  'CD14',
  'CD1C',
  'CD68',
  'CD9',
  'CD247'
))
pbmc_small <- AddModuleScore(
  object = pbmc_small,
  features = cd_features,
  ctrl = 5,
  name = 'CD_Features'
)
head(x = pbmc_small[])
} # }
```

Example 10 (r):
```r
if (FALSE) { # \dontrun{
data("pbmc_small")
cd_features <- list(c(
  'CD79B',
  'CD79A',
  'CD19',
  'CD180',
  'CD200',
  'CD3D',
  'CD2',
  'CD3E',
  'CD7',
  'CD8A',
  'CD14',
  'CD1C',
  'CD68',
  'CD9',
  'CD247'
))
pbmc_small <- AddModuleScore(
  object = pbmc_small,
  features = cd_features,
  ctrl = 5,
  name = 'CD_Features'
)
head(x = pbmc_small[])
} # }
```

Example 11 (r):
```r
if (FALSE) { # \dontrun{
data("pbmc_small")
cd_features <- list(c(
  'CD79B',
  'CD79A',
  'CD19',
  'CD180',
  'CD200',
  'CD3D',
  'CD2',
  'CD3E',
  'CD7',
  'CD8A',
  'CD14',
  'CD1C',
  'CD68',
  'CD9',
  'CD247'
))
pbmc_small <- AddModuleScore(
  object = pbmc_small,
  features = cd_features,
  ctrl = 5,
  name = 'CD_Features'
)
head(x = pbmc_small[])
} # }
```

---

## L2-Normalize CCA — L2CCA • Seurat

**URL:** http://127.0.0.1:9173/reference_l2cca.html

**Contents:**
- L2-Normalize CCA
- Arguments
- Contents

Perform l2 normalization on CCs

Additional parameters to L2Dim.

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/dimensional_reduction.R
```

Example 2 (unknown):
```unknown
L2CCA(object, ...)
```

Example 3 (r):
```r
L2CCA(object, ...)
```

Example 4 (r):
```r
L2CCA(object, ...)
```

---

## Slim down a multi-species expression matrix, when only one species is primarily of interenst. — CollapseSpeciesExpressionMatrix • Seurat

**URL:** http://127.0.0.1:9173/seurat/reference/collapsespeciesexpressionmatrix/index.html

**Contents:**
- Slim down a multi-species expression matrix, when only one species is primarily of interenst.
- Arguments
- Value
- Examples
- Contents

Valuable for CITE-seq analyses, where we typically spike in rare populations of 'negative control' cells from a different species.

A UMI count matrix. Should contain rownames that start with the ensuing arguments prefix.1 or prefix.2

The prefix denoting rownames for the species of interest. Default is "HUMAN_". These rownames will have this prefix removed in the returned matrix.

The prefix denoting rownames for the species of 'negative control' cells. Default is "MOUSE_".

How many of the most highly expressed (average) negative control features (by default, 100 mouse genes), should be kept? All other rownames starting with prefix.2 are discarded.

A UMI count matrix. Rownames that started with prefix have this prefix discarded. For rownames starting with controls, only the ncontrols most highly expressed features are kept, and the prefix is kept. All other rows are retained.

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/utilities.R
```

Example 2 (unknown):
```unknown
CollapseSpeciesExpressionMatrix.Rd
```

Example 3 (unknown):
```unknown
CollapseSpeciesExpressionMatrix(
  object,
  prefix = "HUMAN_",
  controls = "MOUSE_",
  ncontrols = 100
)
```

Example 4 (r):
```r
CollapseSpeciesExpressionMatrix(
  object,
  prefix = "HUMAN_",
  controls = "MOUSE_",
  ncontrols = 100
)
```

Example 5 (r):
```r
CollapseSpeciesExpressionMatrix(
  object,
  prefix = "HUMAN_",
  controls = "MOUSE_",
  ncontrols = 100
)
```

Example 6 (unknown):
```unknown
if (FALSE) { # \dontrun{
cbmc.rna.collapsed <- CollapseSpeciesExpressionMatrix(cbmc.rna)
} # }
```

Example 7 (r):
```r
if (FALSE) { # \dontrun{
cbmc.rna.collapsed <- CollapseSpeciesExpressionMatrix(cbmc.rna)
} # }
```

Example 8 (r):
```r
if (FALSE) { # \dontrun{
cbmc.rna.collapsed <- CollapseSpeciesExpressionMatrix(cbmc.rna)
} # }
```

---

## Add text labels to a ggplot2 plot — LabelPoints • Seurat

**URL:** http://127.0.0.1:9173/seurat/reference/labelpoints/index.html

**Contents:**
- Add text labels to a ggplot2 plot
- Arguments
- Value
- See also
- Examples
- Contents

Add text labels to a ggplot2 plot

A ggplot2 plot with a GeomPoint layer

A vector of points to label; if NULL, will use all points in the plot

A vector of labels for the points; if NULL, will use rownames of the data provided to the plot at the points selected

Use geom_text_repel to create a nicely-repelled labels; this is slow when a lot of points are being plotted. If using repel, set xnudge and ynudge to 0

Amount to nudge X and Y coordinates of labels by

Extra parameters passed to geom_text

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/visualization.R
```

Example 2 (unknown):
```unknown
LabelPoints.Rd
```

Example 3 (unknown):
```unknown
LabelPoints(
  plot,
  points,
  labels = NULL,
  repel = FALSE,
  xnudge = 0.3,
  ynudge = 0.05,
  ...
)
```

Example 4 (r):
```r
LabelPoints(
  plot,
  points,
  labels = NULL,
  repel = FALSE,
  xnudge = 0.3,
  ynudge = 0.05,
  ...
)
```

Example 5 (r):
```r
LabelPoints(
  plot,
  points,
  labels = NULL,
  repel = FALSE,
  xnudge = 0.3,
  ynudge = 0.05,
  ...
)
```

Example 6 (unknown):
```unknown
geom_text_repel
```

Example 7 (unknown):
```unknown
data("pbmc_small")
ff <- TopFeatures(object = pbmc_small[['pca']])
cc <- TopCells(object = pbmc_small[['pca']])
plot <- FeatureScatter(object = pbmc_small, feature1 = ff[1], feature2 = ff[2])
LabelPoints(plot = plot, points = cc)
```

Example 8 (r):
```r
data("pbmc_small")
ff <- TopFeatures(object = pbmc_small[['pca']])
cc <- TopCells(object = pbmc_small[['pca']])
plot <- FeatureScatter(object = pbmc_small, feature1 = ff[1], feature2 = ff[2])
LabelPoints(plot = plot, points = cc)
```

Example 9 (r):
```r
data("pbmc_small")
ff <- TopFeatures(object = pbmc_small[['pca']])
cc <- TopCells(object = pbmc_small[['pca']])
plot <- FeatureScatter(object = pbmc_small, feature1 = ff[1], feature2 = ff[2])
LabelPoints(plot = plot, points = cc)
```

---

## Determine text color based on background color — BGTextColor • Seurat

**URL:** http://127.0.0.1:9173/seurat/reference/bgtextcolor/index.html

**Contents:**
- Determine text color based on background color
- Source
- Arguments
- Value
- Examples
- Contents

Determine text color based on background color

https://stackoverflow.com/questions/3942878/how-to-decide-font-color-in-white-or-black-depending-on-background-color

A vector of background colors; supports R color names and hexadecimal codes

Intensity threshold for light/dark cutoff; intensities greater than theshold yield dark, others yield light

Use W3C formula for calculating background text color; ignores threshold

A named vector of either dark or light, depending on background; names of vector are background

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/visualization.R
```

Example 2 (unknown):
```unknown
BGTextColor.Rd
```

Example 3 (unknown):
```unknown
BGTextColor(
  background,
  threshold = 186,
  w3c = FALSE,
  dark = "black",
  light = "white"
)
```

Example 4 (r):
```r
BGTextColor(
  background,
  threshold = 186,
  w3c = FALSE,
  dark = "black",
  light = "white"
)
```

Example 5 (r):
```r
BGTextColor(
  background,
  threshold = 186,
  w3c = FALSE,
  dark = "black",
  light = "white"
)
```

Example 6 (unknown):
```unknown
BGTextColor(background = c('black', 'white', '#E76BF3'))
#>   black   white #E76BF3 
#> "white" "black" "white"
```

Example 7 (r):
```r
BGTextColor(background = c('black', 'white', '#E76BF3'))
#>   black   white #E76BF3 
#> "white" "black" "white"
```

Example 8 (r):
```r
BGTextColor(background = c('black', 'white', '#E76BF3'))
#>   black   white #E76BF3 
#> "white" "black" "white"
```

---

## Get updated synonyms for gene symbols — UpdateSymbolList • Seurat

**URL:** http://127.0.0.1:9173/seurat/reference/updatesymbollist/index.html

**Contents:**
- Get updated synonyms for gene symbols
- Source
- Arguments
- Value
- Details
- Note
- See also
- Examples
- Contents

Find current gene symbols based on old or alias symbols using the gene names database from the HUGO Gene Nomenclature Committee (HGNC)

https://www.genenames.org/ https://www.genenames.org/help/rest/

A vector of gene symbols

Time to wait before canceling query in seconds

Allow several current gene symbols for each provided symbol

Type of query to perform:

Find alternate symbols for the genes described by symbols

Find new new symbols for the genes described by symbols

This parameter accepts multiple options and short-hand options (eg. “prev” for “prev_symbol”)

Show a progress bar depicting search progress

Extra parameters passed to GET

GeneSymbolThesarus:, if several.ok, a named list where each entry is the current symbol found for each symbol provided and the names are the provided symbols. Otherwise, a named vector with the same information.

UpdateSymbolList: symbols with updated symbols from HGNC's gene names database

For each symbol passed, we query the HGNC gene names database for current symbols that have the provided symbol as either an alias (alias_symbol) or old (prev_symbol) symbol. All other queries are not supported.

This function requires internet access

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/utilities.R
```

Example 2 (unknown):
```unknown
UpdateSymbolList.Rd
```

Example 3 (unknown):
```unknown
GeneSymbolThesarus(
  symbols,
  timeout = 10,
  several.ok = FALSE,
  search.types = c("alias_symbol", "prev_symbol"),
  verbose = TRUE,
  ...
)

UpdateSymbolList(
  symbols,
  timeout = 10,
  several.ok = FALSE,
  verbose = TRUE,
  ...
)
```

Example 4 (r):
```r
GeneSymbolThesarus(
  symbols,
  timeout = 10,
  several.ok = FALSE,
  search.types = c("alias_symbol", "prev_symbol"),
  verbose = TRUE,
  ...
)

UpdateSymbolList(
  symbols,
  timeout = 10,
  several.ok = FALSE,
  verbose = TRUE,
  ...
)
```

Example 5 (r):
```r
GeneSymbolThesarus(
  symbols,
  timeout = 10,
  several.ok = FALSE,
  search.types = c("alias_symbol", "prev_symbol"),
  verbose = TRUE,
  ...
)

UpdateSymbolList(
  symbols,
  timeout = 10,
  several.ok = FALSE,
  verbose = TRUE,
  ...
)
```

Example 6 (unknown):
```unknown
alias_symbol
```

Example 7 (unknown):
```unknown
prev_symbol
```

Example 8 (unknown):
```unknown
prev_symbol
```

Example 9 (unknown):
```unknown
GeneSymbolThesarus
```

Example 10 (unknown):
```unknown
UpdateSymbolList
```

Example 11 (unknown):
```unknown
alias_symbol
```

Example 12 (unknown):
```unknown
prev_symbol
```

Example 13 (unknown):
```unknown
if (FALSE) { # \dontrun{
GeneSybmolThesarus(symbols = c("FAM64A"))
} # }

if (FALSE) { # \dontrun{
UpdateSymbolList(symbols = cc.genes$s.genes)
} # }
```

Example 14 (r):
```r
if (FALSE) { # \dontrun{
GeneSybmolThesarus(symbols = c("FAM64A"))
} # }

if (FALSE) { # \dontrun{
UpdateSymbolList(symbols = cc.genes$s.genes)
} # }
```

Example 15 (r):
```r
if (FALSE) { # \dontrun{
GeneSybmolThesarus(symbols = c("FAM64A"))
} # }

if (FALSE) { # \dontrun{
UpdateSymbolList(symbols = cc.genes$s.genes)
} # }
```

---

## Averaged feature expression by identity class — AverageExpression • Seurat

**URL:** http://127.0.0.1:9173/seurat/reference/averageexpression/index.html

**Contents:**
- Averaged feature expression by identity class
- Arguments
- Value
- Details
- Examples
- Contents

Returns averaged expression values for each identity class.

Which assays to use. Default is all assays

Features to analyze. Default is all features in the assay

Whether to return the data as a Seurat object. Default is FALSE

Category (or vector of categories) for grouping (e.g, ident, replicate, celltype); 'ident' by default To use multiple categories, specify a vector, such as c('ident', 'replicate', 'celltype')

(Deprecated). Place an additional label on each cell prior to pseudobulking

Layer(s) to use; if multiple layers are given, assumed to follow the order of 'assays' (if specified) or object's assays

(Deprecated). Slots(s) to use

Print messages and show progress bar

Arguments to be passed to methods such as CreateSeuratObject

Returns a matrix with genes as rows, identity classes as columns. If return.seurat is TRUE, returns an object of class Seurat.

If layer is set to 'data', this function assumes that the data has been log normalized and therefore feature values are exponentiated prior to averaging so that averaging is done in non-log space. Otherwise, if layer is set to either 'counts' or 'scale.data', no exponentiation is performed prior to averaging. If return.seurat = TRUE and layer is not 'scale.data', averaged values are placed in the 'counts' layer of the returned object and 'log1p' is run on the averaged counts and placed in the 'data' layer ScaleData is then run on the default assay before returning the object. If return.seurat = TRUE and layer is 'scale.data', the 'counts' layer contains average counts and 'scale.data' is set to the averaged values of 'scale.data'.

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/utilities.R
```

Example 2 (unknown):
```unknown
AverageExpression.Rd
```

Example 3 (unknown):
```unknown
AverageExpression(
  object,
  assays = NULL,
  features = NULL,
  return.seurat = FALSE,
  group.by = "ident",
  add.ident = NULL,
  layer = "data",
  slot = deprecated(),
  verbose = TRUE,
  ...
)
```

Example 4 (r):
```r
AverageExpression(
  object,
  assays = NULL,
  features = NULL,
  return.seurat = FALSE,
  group.by = "ident",
  add.ident = NULL,
  layer = "data",
  slot = deprecated(),
  verbose = TRUE,
  ...
)
```

Example 5 (r):
```r
AverageExpression(
  object,
  assays = NULL,
  features = NULL,
  return.seurat = FALSE,
  group.by = "ident",
  add.ident = NULL,
  layer = "data",
  slot = deprecated(),
  verbose = TRUE,
  ...
)
```

Example 6 (unknown):
```unknown
CreateSeuratObject
```

Example 7 (unknown):
```unknown
return.seurat = TRUE
```

Example 8 (unknown):
```unknown
return.seurat = TRUE
```

Example 9 (python):
```python
data("pbmc_small")
head(AverageExpression(object = pbmc_small)$RNA)
#> As of Seurat v5, we recommend using AggregateExpression to perform pseudo-bulk analysis.
#> This message is displayed once per session.
#> First group.by variable `ident` starts with a number, appending `g` to ensure valid variable names
#> This message is displayed once every 8 hours.
#> 6 x 3 sparse Matrix of class "dgCMatrix"
#>                 g0         g1        g2
#> MS4A1     .          2.083443  171.6152
#> CD79B    10.814657  17.548842  152.1344
#> CD79A     .         11.618333  215.0869
#> HLA-DRA  37.105857 405.850522 1158.0852
#> TCL1A     .          3.463203  142.0748
#> HLA-DQB1  3.968254  45.353183  169.2762
head(AverageExpression(object = pbmc_small, group.by = c('ident', 'groups'))$RNA)
#> 6 x 6 sparse Matrix of class "dgCMatrix"
#>             g0_g1     g0_g2      g1_g1      g1_g2      g2_g1     g2_g2
#> MS4A1     .        .          3.720434   .          83.27443  269.7716
#> CD79B    12.32353  8.928571  16.783660  18.522712   80.07761  232.1975
#> CD79A     .        .         14.204794   8.326474  174.12523  260.5998
#> HLA-DRA  44.81837 27.465213 473.313733 319.988254 1217.90859 1091.6148
#> TCL1A     .        .          6.184292   .          60.19691  233.0502
#> HLA-DQB1  .        8.928571  51.863218  37.067684  170.88236  167.4915
```

Example 10 (r):
```r
data("pbmc_small")
head(AverageExpression(object = pbmc_small)$RNA)
#> As of Seurat v5, we recommend using AggregateExpression to perform pseudo-bulk analysis.
#> This message is displayed once per session.
#> First group.by variable `ident` starts with a number, appending `g` to ensure valid variable names
#> This message is displayed once every 8 hours.
#> 6 x 3 sparse Matrix of class "dgCMatrix"
#>                 g0         g1        g2
#> MS4A1     .          2.083443  171.6152
#> CD79B    10.814657  17.548842  152.1344
#> CD79A     .         11.618333  215.0869
#> HLA-DRA  37.105857 405.850522 1158.0852
#> TCL1A     .          3.463203  142.0748
#> HLA-DQB1  3.968254  45.353183  169.2762
head(AverageExpression(object = pbmc_small, group.by = c('ident', 'groups'))$RNA)
#> 6 x 6 sparse Matrix of class "dgCMatrix"
#>             g0_g1     g0_g2      g1_g1      g1_g2      g2_g1     g2_g2
#> MS4A1     .        .          3.720434   .          83.27443  269.7716
#> CD79B    12.32353  8.928571  16.783660  18.522712   80.07761  232.1975
#> CD79A     .        .         14.204794   8.326474  174.12523  260.5998
#> HLA-DRA  44.81837 27.465213 473.313733 319.988254 1217.90859 1091.6148
#> TCL1A     .        .          6.184292   .          60.19691  233.0502
#> HLA-DQB1  .        8.928571  51.863218  37.067684  170.88236  167.4915
```

Example 11 (r):
```r
data("pbmc_small")
head(AverageExpression(object = pbmc_small)$RNA)
#> As of Seurat v5, we recommend using AggregateExpression to perform pseudo-bulk analysis.
#> This message is displayed once per session.
#> First group.by variable `ident` starts with a number, appending `g` to ensure valid variable names
#> This message is displayed once every 8 hours.
#> 6 x 3 sparse Matrix of class "dgCMatrix"
#>                 g0         g1        g2
#> MS4A1     .          2.083443  171.6152
#> CD79B    10.814657  17.548842  152.1344
#> CD79A     .         11.618333  215.0869
#> HLA-DRA  37.105857 405.850522 1158.0852
#> TCL1A     .          3.463203  142.0748
#> HLA-DQB1  3.968254  45.353183  169.2762
head(AverageExpression(object = pbmc_small, group.by = c('ident', 'groups'))$RNA)
#> 6 x 6 sparse Matrix of class "dgCMatrix"
#>             g0_g1     g0_g2      g1_g1      g1_g2      g2_g1     g2_g2
#> MS4A1     .        .          3.720434   .          83.27443  269.7716
#> CD79B    12.32353  8.928571  16.783660  18.522712   80.07761  232.1975
#> CD79A     .        .         14.204794   8.326474  174.12523  260.5998
#> HLA-DRA  44.81837 27.465213 473.313733 319.988254 1217.90859 1091.6148
#> TCL1A     .        .          6.184292   .          60.19691  233.0502
#> HLA-DQB1  .        8.928571  51.863218  37.067684  170.88236  167.4915
```

---

## Compute Moran's I value. — RunMoransI • Seurat

**URL:** http://127.0.0.1:9173/seurat/reference/runmoransi/index.html

**Contents:**
- Compute Moran's I value.
- Arguments
- Contents

Wraps the functionality of the Moran.I function from the ape package. Weights are computed as 1/distance.

Display messages/progress

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/preprocessing.R
```

Example 2 (unknown):
```unknown
RunMoransI.Rd
```

Example 3 (unknown):
```unknown
RunMoransI(data, pos, verbose = TRUE)
```

Example 4 (r):
```r
RunMoransI(data, pos, verbose = TRUE)
```

Example 5 (r):
```r
RunMoransI(data, pos, verbose = TRUE)
```

---

## Project full data to the sketch assay — ProjectData • Seurat

**URL:** http://127.0.0.1:9173/seurat/reference/projectdata/index.html

**Contents:**
- Project full data to the sketch assay
- Arguments
- Value
- Contents

This function allows projection of high-dimensional single-cell RNA expression data from a full dataset onto the lower-dimensional embedding of the sketch of the dataset.

Assay name for the full data. Default is 'RNA'.

Sketched assay name to project onto. Default is 'sketch'.

Dimensional reduction results of the sketched assay to project onto.

Dimensional reduction name for the projected full dataset.

Dimensions to include in the projection.

Normalization method to use. Can be 'LogNormalize' or 'SCT'. Default is 'LogNormalize'.

An optional list for label transfer from sketch to full data. Default is NULL. Similar to refdata in `MapQuery`

Number of neighbors to consider when weighting labels for transfer. Default is 50.

An optional pre-computed UMAP model. Default is NULL.

Whether to recompute the neighbors for label transfer. Default is FALSE.

Whether to recompute the weights for label transfer. Default is FALSE.

Print progress and diagnostic messages.

A Seurat object with the full data projected onto the sketched dimensional reduction results. The projected data are stored in the specified full reduction.

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/sketching.R
```

Example 2 (unknown):
```unknown
ProjectData.Rd
```

Example 3 (unknown):
```unknown
ProjectData(
  object,
  assay = "RNA",
  sketched.assay = "sketch",
  sketched.reduction,
  full.reduction,
  dims,
  normalization.method = c("LogNormalize", "SCT"),
  refdata = NULL,
  k.weight = 50,
  umap.model = NULL,
  recompute.neighbors = FALSE,
  recompute.weights = FALSE,
  verbose = TRUE
)
```

Example 4 (r):
```r
ProjectData(
  object,
  assay = "RNA",
  sketched.assay = "sketch",
  sketched.reduction,
  full.reduction,
  dims,
  normalization.method = c("LogNormalize", "SCT"),
  refdata = NULL,
  k.weight = 50,
  umap.model = NULL,
  recompute.neighbors = FALSE,
  recompute.weights = FALSE,
  verbose = TRUE
)
```

Example 5 (r):
```r
ProjectData(
  object,
  assay = "RNA",
  sketched.assay = "sketch",
  sketched.reduction,
  full.reduction,
  dims,
  normalization.method = c("LogNormalize", "SCT"),
  refdata = NULL,
  k.weight = 50,
  umap.model = NULL,
  recompute.neighbors = FALSE,
  recompute.weights = FALSE,
  verbose = TRUE
)
```

---

## Run Principal Component Analysis — RunPCA • Seurat

**URL:** http://127.0.0.1:9173/reference_runpca.html

**Contents:**
- Run Principal Component Analysis
- Arguments
- Value
- Contents

Run a PCA dimensionality reduction. For details about stored PCA calculation parameters, see PrintPCAParams.

Arguments passed to other methods and IRLBA

Name of Assay PCA is being run on

Total Number of PCs to compute and store (50 by default)

By default computes the PCA on the cell x gene matrix. Setting to true will compute it on gene x cell matrix.

Weight the cell embeddings by the variance of each PC (weights the gene loadings if rev.pca is TRUE)

Print the top genes associated with high/low loadings for the PCs

PCs to print genes for

Number of genes to print for each PC

dimensional reduction key, specifies the string before the number for the dimension names. PC by default

Set a random seed. By default, sets the seed to 42. Setting NULL will not set a seed.

Use truncated singular value decomposition to approximate PCA

Features to compute PCA on. If features=NULL, PCA will be run using the variable features for the Assay. Note that the features must be present in the scaled data. Any requested features that are not scaled or have 0 variance will be dropped, and the PCA will be run using the remaining features.

dimensional reduction name, pca by default

Returns Seurat object with the PCA calculation stored in the reductions slot

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/generics.R
```

Example 2 (unknown):
```unknown
R/dimensional_reduction.R
```

Example 3 (unknown):
```unknown
PrintPCAParams
```

Example 4 (python):
```python
RunPCA(object, ...)

# Default S3 method
RunPCA(
  object,
  assay = NULL,
  npcs = 50,
  rev.pca = FALSE,
  weight.by.var = TRUE,
  verbose = TRUE,
  ndims.print = 1:5,
  nfeatures.print = 30,
  reduction.key = "PC_",
  seed.use = 42,
  approx = TRUE,
  ...
)

# S3 method for class 'Assay'
RunPCA(
  object,
  assay = NULL,
  features = NULL,
  npcs = 50,
  rev.pca = FALSE,
  weight.by.var = TRUE,
  verbose = TRUE,
  ndims.print = 1:5,
  nfeatures.print = 30,
  reduction.key = "PC_",
  seed.use = 42,
  ...
)

# S3 method for class 'Seurat'
RunPCA(
  object,
  assay = NULL,
  features = NULL,
  npcs = 50,
  rev.pca = FALSE,
  weight.by.var = TRUE,
  verbose = TRUE,
  ndims.print = 1:5,
  nfeatures.print = 30,
  reduction.name = "pca",
  reduction.key = "PC_",
  seed.use = 42,
  ...
)
```

Example 5 (r):
```r
RunPCA(object, ...)

# Default S3 method
RunPCA(
  object,
  assay = NULL,
  npcs = 50,
  rev.pca = FALSE,
  weight.by.var = TRUE,
  verbose = TRUE,
  ndims.print = 1:5,
  nfeatures.print = 30,
  reduction.key = "PC_",
  seed.use = 42,
  approx = TRUE,
  ...
)

# S3 method for class 'Assay'
RunPCA(
  object,
  assay = NULL,
  features = NULL,
  npcs = 50,
  rev.pca = FALSE,
  weight.by.var = TRUE,
  verbose = TRUE,
  ndims.print = 1:5,
  nfeatures.print = 30,
  reduction.key = "PC_",
  seed.use = 42,
  ...
)

# S3 method for class 'Seurat'
RunPCA(
  object,
  assay = NULL,
  features = NULL,
  npcs = 50,
  rev.pca = FALSE,
  weight.by.var = TRUE,
  verbose = TRUE,
  ndims.print = 1:5,
  nfeatures.print = 30,
  reduction.name = "pca",
  reduction.key = "PC_",
  seed.use = 42,
  ...
)
```

Example 6 (r):
```r
RunPCA(object, ...)

# Default S3 method
RunPCA(
  object,
  assay = NULL,
  npcs = 50,
  rev.pca = FALSE,
  weight.by.var = TRUE,
  verbose = TRUE,
  ndims.print = 1:5,
  nfeatures.print = 30,
  reduction.key = "PC_",
  seed.use = 42,
  approx = TRUE,
  ...
)

# S3 method for class 'Assay'
RunPCA(
  object,
  assay = NULL,
  features = NULL,
  npcs = 50,
  rev.pca = FALSE,
  weight.by.var = TRUE,
  verbose = TRUE,
  ndims.print = 1:5,
  nfeatures.print = 30,
  reduction.key = "PC_",
  seed.use = 42,
  ...
)

# S3 method for class 'Seurat'
RunPCA(
  object,
  assay = NULL,
  features = NULL,
  npcs = 50,
  rev.pca = FALSE,
  weight.by.var = TRUE,
  verbose = TRUE,
  ndims.print = 1:5,
  nfeatures.print = 30,
  reduction.name = "pca",
  reduction.key = "PC_",
  seed.use = 42,
  ...
)
```

---

## Seurat-CCA Integration — CCAIntegration • Seurat

**URL:** http://127.0.0.1:9173/reference_ccaintegration.html

**Contents:**
- Seurat-CCA Integration
- Arguments
- Examples
- Contents

Seurat-CCA Integration

Name of Assay in the Seurat object

Names of layers in assay

A DimReduc to correct

Name of new integrated dimensional reduction

A reference Seurat object

A vector of features to use for integration

Name of normalization method used: LogNormalize or SCT

Dimensions of dimensional reduction to use for integration

Number of anchors to filter

Name of scaled layer in Assay

Number of dimensions to return integrated values for

Number of neighbors to consider when weighting anchors

Dimension reduction to use when calculating anchor weights. This can be one of:

A string, specifying the name of a dimension reduction present in all objects to be integrated

A vector of strings, specifying the name of a dimension reduction to use for each object to be integrated

A vector of DimReduc objects, specifying the object to use for each object in the integration

NULL, in which case the full corrected space is used for computing anchor weights.

Controls the bandwidth of the Gaussian kernel for weighting

Specify the order of integration. Order of integration should be encoded in a matrix, where each row represents one of the pairwise integration steps. Negative numbers specify a dataset, positive numbers specify the integration results from a given row (the format of the merge matrix included in the hclust function output). For example: matrix(c(-2, 1, -3, -1), ncol = 2) gives:

Which would cause dataset 2 and 3 to be integrated first, then the resulting object integrated with dataset 1.

If NULL, the sample tree will be computed automatically.

Do not reorder objects based on size for each pairwise integration.

Arguments passed on to FindIntegrationAnchors

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/integration5.R
```

Example 2 (unknown):
```unknown
CCAIntegration.Rd
```

Example 3 (unknown):
```unknown
CCAIntegration(
  object = NULL,
  assay = NULL,
  layers = NULL,
  orig = NULL,
  new.reduction = "integrated.dr",
  reference = NULL,
  features = NULL,
  normalization.method = c("LogNormalize", "SCT"),
  dims = 1:30,
  k.filter = NA,
  scale.layer = "scale.data",
  dims.to.integrate = NULL,
  k.weight = 100,
  weight.reduction = NULL,
  sd.weight = 1,
  sample.tree = NULL,
  preserve.order = FALSE,
  verbose = TRUE,
  ...
)
```

Example 4 (r):
```r
CCAIntegration(
  object = NULL,
  assay = NULL,
  layers = NULL,
  orig = NULL,
  new.reduction = "integrated.dr",
  reference = NULL,
  features = NULL,
  normalization.method = c("LogNormalize", "SCT"),
  dims = 1:30,
  k.filter = NA,
  scale.layer = "scale.data",
  dims.to.integrate = NULL,
  k.weight = 100,
  weight.reduction = NULL,
  sd.weight = 1,
  sample.tree = NULL,
  preserve.order = FALSE,
  verbose = TRUE,
  ...
)
```

Example 5 (r):
```r
CCAIntegration(
  object = NULL,
  assay = NULL,
  layers = NULL,
  orig = NULL,
  new.reduction = "integrated.dr",
  reference = NULL,
  features = NULL,
  normalization.method = c("LogNormalize", "SCT"),
  dims = 1:30,
  k.filter = NA,
  scale.layer = "scale.data",
  dims.to.integrate = NULL,
  k.weight = 100,
  weight.reduction = NULL,
  sd.weight = 1,
  sample.tree = NULL,
  preserve.order = FALSE,
  verbose = TRUE,
  ...
)
```

Example 6 (unknown):
```unknown
matrix(c(-2, 1, -3, -1), ncol = 2)
```

Example 7 (unknown):
```unknown
[,1]  [,2]
       [1,]   -2   -3
       [2,]    1   -1
```

Example 8 (unknown):
```unknown
[,1]  [,2]
       [1,]   -2   -3
       [2,]    1   -1
```

Example 9 (unknown):
```unknown
[,1]  [,2]
       [1,]   -2   -3
       [2,]    1   -1
```

Example 10 (unknown):
```unknown
FindIntegrationAnchors
```

Example 11 (unknown):
```unknown
if (FALSE) { # \dontrun{
# Preprocessing
obj <- SeuratData::LoadData("pbmcsca")
obj[["RNA"]] <- split(obj[["RNA"]], f = obj$Method)
obj <- NormalizeData(obj)
obj <- FindVariableFeatures(obj)
obj <- ScaleData(obj)
obj <- RunPCA(obj)

# After preprocessing, we integrate layers.
obj <- IntegrateLayers(object = obj, method = CCAIntegration,
  orig.reduction = "pca", new.reduction = "integrated.cca",
  verbose = FALSE)

# Modifying parameters
# We can also specify parameters such as `k.anchor` to increase the strength of integration
obj <- IntegrateLayers(object = obj, method = CCAIntegration,
  orig.reduction = "pca", new.reduction = "integrated.cca",
  k.anchor = 20, verbose = FALSE)

# Integrating SCTransformed data
obj <- SCTransform(object = obj)
obj <- IntegrateLayers(object = obj, method = CCAIntegration,
  orig.reduction = "pca", new.reduction = "integrated.cca",
  assay = "SCT", verbose = FALSE)
} # }
```

Example 12 (r):
```r
if (FALSE) { # \dontrun{
# Preprocessing
obj <- SeuratData::LoadData("pbmcsca")
obj[["RNA"]] <- split(obj[["RNA"]], f = obj$Method)
obj <- NormalizeData(obj)
obj <- FindVariableFeatures(obj)
obj <- ScaleData(obj)
obj <- RunPCA(obj)

# After preprocessing, we integrate layers.
obj <- IntegrateLayers(object = obj, method = CCAIntegration,
  orig.reduction = "pca", new.reduction = "integrated.cca",
  verbose = FALSE)

# Modifying parameters
# We can also specify parameters such as `k.anchor` to increase the strength of integration
obj <- IntegrateLayers(object = obj, method = CCAIntegration,
  orig.reduction = "pca", new.reduction = "integrated.cca",
  k.anchor = 20, verbose = FALSE)

# Integrating SCTransformed data
obj <- SCTransform(object = obj)
obj <- IntegrateLayers(object = obj, method = CCAIntegration,
  orig.reduction = "pca", new.reduction = "integrated.cca",
  assay = "SCT", verbose = FALSE)
} # }
```

Example 13 (r):
```r
if (FALSE) { # \dontrun{
# Preprocessing
obj <- SeuratData::LoadData("pbmcsca")
obj[["RNA"]] <- split(obj[["RNA"]], f = obj$Method)
obj <- NormalizeData(obj)
obj <- FindVariableFeatures(obj)
obj <- ScaleData(obj)
obj <- RunPCA(obj)

# After preprocessing, we integrate layers.
obj <- IntegrateLayers(object = obj, method = CCAIntegration,
  orig.reduction = "pca", new.reduction = "integrated.cca",
  verbose = FALSE)

# Modifying parameters
# We can also specify parameters such as `k.anchor` to increase the strength of integration
obj <- IntegrateLayers(object = obj, method = CCAIntegration,
  orig.reduction = "pca", new.reduction = "integrated.cca",
  k.anchor = 20, verbose = FALSE)

# Integrating SCTransformed data
obj <- SCTransform(object = obj)
obj <- IntegrateLayers(object = obj, method = CCAIntegration,
  orig.reduction = "pca", new.reduction = "integrated.cca",
  assay = "SCT", verbose = FALSE)
} # }
```

---

## Transfer embeddings from sketched cells to the full data — UnSketchEmbeddings • Seurat

**URL:** http://127.0.0.1:9173/reference_unsketchembeddings.html

**Contents:**
- Transfer embeddings from sketched cells to the full data
- Arguments
- Contents

Transfer embeddings from sketched cells to the full data

Embeddings of atom cells

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/integration.R
```

Example 2 (unknown):
```unknown
UnSketchEmbeddings.Rd
```

Example 3 (unknown):
```unknown
UnSketchEmbeddings(
  atom.data,
  atom.cells = NULL,
  orig.data,
  embeddings,
  sketch.matrix = NULL
)
```

Example 4 (r):
```r
UnSketchEmbeddings(
  atom.data,
  atom.cells = NULL,
  orig.data,
  embeddings,
  sketch.matrix = NULL
)
```

Example 5 (r):
```r
UnSketchEmbeddings(
  atom.data,
  atom.cells = NULL,
  orig.data,
  embeddings,
  sketch.matrix = NULL
)
```

---

## Update pre-V4 Assays generated with SCTransform in the Seurat to the new SCTAssay class — UpdateSCTAssays • Seurat

**URL:** http://127.0.0.1:9173/reference_updatesctassays.html

**Contents:**
- Update pre-V4 Assays generated with SCTransform in the Seurat to the new SCTAssay class
- Arguments
- Value
- Contents

Update pre-V4 Assays generated with SCTransform in the Seurat to the new SCTAssay class

A Seurat object with updated SCTAssays

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/objects.R
```

Example 2 (unknown):
```unknown
UpdateSCTAssays.Rd
```

Example 3 (unknown):
```unknown
UpdateSCTAssays(object)
```

Example 4 (r):
```r
UpdateSCTAssays(object)
```

Example 5 (r):
```r
UpdateSCTAssays(object)
```

---

## Load a 10X Genomics Visium Image — Read10X_Image • Seurat

**URL:** http://127.0.0.1:9173/seurat/reference/read10x_image/index.html

**Contents:**
- Load a 10X Genomics Visium Image
- Arguments
- Value
- See also
- Contents

Load a 10X Genomics Visium Image

Path to directory with 10X Genomics visium image data; should include files tissue_lowres_image.png, scalefactors_json.json and tissue_positions_list.csv

Name of associated assay

Name for the image, used to populate the instance's key

Filter spot/feature matrix to only include spots that have been determined to be over tissue

Image type to return, one of: "VisiumV1" or "VisiumV2"

VisiumV2 Load10X_Spatial

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/preprocessing.R
```

Example 2 (unknown):
```unknown
Read10X_Image.Rd
```

Example 3 (unknown):
```unknown
Read10X_Image(
  image.dir,
  image.name = "tissue_lowres_image.png",
  assay = "Spatial",
  slice = "slice1",
  filter.matrix = TRUE,
  image.type = "VisiumV2"
)
```

Example 4 (r):
```r
Read10X_Image(
  image.dir,
  image.name = "tissue_lowres_image.png",
  assay = "Spatial",
  slice = "slice1",
  filter.matrix = TRUE,
  image.type = "VisiumV2"
)
```

Example 5 (r):
```r
Read10X_Image(
  image.dir,
  image.name = "tissue_lowres_image.png",
  assay = "Spatial",
  slice = "slice1",
  filter.matrix = TRUE,
  image.type = "VisiumV2"
)
```

Example 6 (unknown):
```unknown
tissue_lowres_image.png
```

Example 7 (unknown):
```unknown
scalefactors_json.json
```

Example 8 (unknown):
```unknown
tissue_positions_list.csv
```

Example 9 (unknown):
```unknown
Load10X_Spatial
```

---

## Quickly Pick Relevant Dimensions — ElbowPlot • Seurat

**URL:** http://127.0.0.1:9173/reference_elbowplot.html

**Contents:**
- Quickly Pick Relevant Dimensions
- Arguments
- Value
- Examples
- Contents

Plots the standard deviations (or approximate singular values if running PCAFast) of the principle components for easy identification of an elbow in the graph. This elbow often corresponds well with the significant dims and is much faster to run than Jackstraw

Number of dimensions to plot standard deviation for

Reduction technique to plot standard deviation for

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/visualization.R
```

Example 2 (unknown):
```unknown
ElbowPlot.Rd
```

Example 3 (unknown):
```unknown
ElbowPlot(object, ndims = 20, reduction = "pca")
```

Example 4 (r):
```r
ElbowPlot(object, ndims = 20, reduction = "pca")
```

Example 5 (r):
```r
ElbowPlot(object, ndims = 20, reduction = "pca")
```

Example 6 (unknown):
```unknown
data("pbmc_small")
ElbowPlot(object = pbmc_small)
#> Warning: The object only has information for 19 reductions
```

Example 7 (r):
```r
data("pbmc_small")
ElbowPlot(object = pbmc_small)
#> Warning: The object only has information for 19 reductions
```

Example 8 (r):
```r
data("pbmc_small")
ElbowPlot(object = pbmc_small)
#> Warning: The object only has information for 19 reductions
```

---

## Convert Neighbor class to an asymmetrical Graph class — NNtoGraph • Seurat

**URL:** http://127.0.0.1:9173/reference_nntograph.html

**Contents:**
- Convert Neighbor class to an asymmetrical Graph class
- Arguments
- Value
- Contents

Convert Neighbor class to an asymmetrical Graph class

A neighbor class object

Cells names of the neighbors, cell names in nn.object is used by default

Determine if use distance in the Graph

Returns a Graph object

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/integration.R
```

Example 2 (unknown):
```unknown
NNtoGraph.Rd
```

Example 3 (unknown):
```unknown
NNtoGraph(nn.object, col.cells = NULL, weighted = FALSE)
```

Example 4 (r):
```r
NNtoGraph(nn.object, col.cells = NULL, weighted = FALSE)
```

Example 5 (r):
```r
NNtoGraph(nn.object, col.cells = NULL, weighted = FALSE)
```

---

## Find integration anchors — FindIntegrationAnchors • Seurat

**URL:** http://127.0.0.1:9173/seurat/reference/findintegrationanchors/index.html

**Contents:**
- Find integration anchors
- Arguments
- Value
- Details
- References
- Examples
- Contents

Find a set of anchors between a list of Seurat objects. These anchors can later be used to integrate the objects using the IntegrateData function.

A list of Seurat objects between which to find anchors for downstream integration.

A vector of assay names specifying which assay to use when constructing anchors. If NULL, the current default assay for each object is used.

A vector specifying the object/s to be used as a reference during integration. If NULL (default), all pairwise anchors are found (no reference/s). If not NULL, the corresponding objects in object.list will be used as references. When using a set of specified references, anchors are first found between each query and each reference. The references are then integrated through pairwise integration. Each query is then mapped to the integrated reference.

A numeric value. This will call SelectIntegrationFeatures to select the provided number of features to be used in anchor finding

A vector of features to be used as input to the anchor finding process

Whether or not to scale the features provided. Only set to FALSE if you have previously scaled the features you want to use for each object in the object.list

Name of normalization method used: LogNormalize or SCT

Numeric of length two specifying the min and max values the Pearson residual will be clipped to

Dimensional reduction to perform when finding anchors. Can be one of:

cca: Canonical correlation analysis

Perform L2 normalization on the CCA cell embeddings after dimensional reduction

Which dimensions to use from the CCA to specify the neighbor search space

How many neighbors (k) to use when picking anchors

How many neighbors (k) to use when filtering anchors

How many neighbors (k) to use when scoring anchors

The maximum number of features to use when specifying the neighborhood search space in the anchor filtering

Method for nearest neighbor finding. Options include: rann, annoy

More trees gives higher precision when using annoy approximate nearest neighbor search

Error bound on the neighbor finding algorithm (from RANN/Annoy)

Print progress bars and output

Returns an AnchorSet object that can be used as input to IntegrateData.

The main steps of this procedure are outlined below. For a more detailed description of the methodology, please see Stuart, Butler, et al Cell 2019: doi:10.1016/j.cell.2019.05.031 ; doi:10.1101/460147

First, determine anchor.features if not explicitly specified using SelectIntegrationFeatures. Then for all pairwise combinations of reference and query datasets:

Perform dimensional reduction on the dataset pair as specified via the reduction parameter. If l2.norm is set to TRUE, perform L2 normalization of the embedding vectors.

Identify anchors - pairs of cells from each dataset that are contained within each other's neighborhoods (also known as mutual nearest neighbors).

Filter low confidence anchors to ensure anchors in the low dimension space are in broad agreement with the high dimensional measurements. This is done by looking at the neighbors of each query cell in the reference dataset using max.features to define this space. If the reference cell isn't found within the first k.filter neighbors, remove the anchor.

Assign each remaining anchor a score. For each anchor cell, determine the nearest k.score anchors within its own dataset and within its pair's dataset. Based on these neighborhoods, construct an overall neighbor graph and then compute the shared neighbor overlap between anchor and query cells (analogous to an SNN graph). We use the 0.01 and 0.90 quantiles on these scores to dampen outlier effects and rescale to range between 0-1.

Stuart T, Butler A, et al. Comprehensive Integration of Single-Cell Data. Cell. 2019;177:1888-1902 doi:10.1016/j.cell.2019.05.031

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/integration.R
```

Example 2 (unknown):
```unknown
FindIntegrationAnchors.Rd
```

Example 3 (unknown):
```unknown
IntegrateData
```

Example 4 (unknown):
```unknown
FindIntegrationAnchors(
  object.list = NULL,
  assay = NULL,
  reference = NULL,
  anchor.features = 2000,
  scale = TRUE,
  normalization.method = c("LogNormalize", "SCT"),
  sct.clip.range = NULL,
  reduction = c("cca", "rpca", "jpca", "rlsi"),
  l2.norm = TRUE,
  dims = 1:30,
  k.anchor = 5,
  k.filter = 200,
  k.score = 30,
  max.features = 200,
  nn.method = "annoy",
  n.trees = 50,
  eps = 0,
  verbose = TRUE
)
```

Example 5 (r):
```r
FindIntegrationAnchors(
  object.list = NULL,
  assay = NULL,
  reference = NULL,
  anchor.features = 2000,
  scale = TRUE,
  normalization.method = c("LogNormalize", "SCT"),
  sct.clip.range = NULL,
  reduction = c("cca", "rpca", "jpca", "rlsi"),
  l2.norm = TRUE,
  dims = 1:30,
  k.anchor = 5,
  k.filter = 200,
  k.score = 30,
  max.features = 200,
  nn.method = "annoy",
  n.trees = 50,
  eps = 0,
  verbose = TRUE
)
```

Example 6 (r):
```r
FindIntegrationAnchors(
  object.list = NULL,
  assay = NULL,
  reference = NULL,
  anchor.features = 2000,
  scale = TRUE,
  normalization.method = c("LogNormalize", "SCT"),
  sct.clip.range = NULL,
  reduction = c("cca", "rpca", "jpca", "rlsi"),
  l2.norm = TRUE,
  dims = 1:30,
  k.anchor = 5,
  k.filter = 200,
  k.score = 30,
  max.features = 200,
  nn.method = "annoy",
  n.trees = 50,
  eps = 0,
  verbose = TRUE
)
```

Example 7 (unknown):
```unknown
object.list
```

Example 8 (unknown):
```unknown
SelectIntegrationFeatures
```

Example 9 (unknown):
```unknown
IntegrateData
```

Example 10 (unknown):
```unknown
SelectIntegrationFeatures
```

Example 11 (unknown):
```unknown
max.features
```

Example 12 (unknown):
```unknown
if (FALSE) { # \dontrun{
# to install the SeuratData package see https://github.com/satijalab/seurat-data
library(SeuratData)
data("panc8")

# panc8 is a merged Seurat object containing 8 separate pancreas datasets
# split the object by dataset
pancreas.list <- SplitObject(panc8, split.by = "tech")

# perform standard preprocessing on each object
for (i in 1:length(pancreas.list)) {
  pancreas.list[[i]] <- NormalizeData(pancreas.list[[i]], verbose = FALSE)
  pancreas.list[[i]] <- FindVariableFeatures(
    pancreas.list[[i]], selection.method = "vst",
    nfeatures = 2000, verbose = FALSE
  )
}

# find anchors
anchors <- FindIntegrationAnchors(object.list = pancreas.list)

# integrate data
integrated <- IntegrateData(anchorset = anchors)
} # }
```

Example 13 (r):
```r
if (FALSE) { # \dontrun{
# to install the SeuratData package see https://github.com/satijalab/seurat-data
library(SeuratData)
data("panc8")

# panc8 is a merged Seurat object containing 8 separate pancreas datasets
# split the object by dataset
pancreas.list <- SplitObject(panc8, split.by = "tech")

# perform standard preprocessing on each object
for (i in 1:length(pancreas.list)) {
  pancreas.list[[i]] <- NormalizeData(pancreas.list[[i]], verbose = FALSE)
  pancreas.list[[i]] <- FindVariableFeatures(
    pancreas.list[[i]], selection.method = "vst",
    nfeatures = 2000, verbose = FALSE
  )
}

# find anchors
anchors <- FindIntegrationAnchors(object.list = pancreas.list)

# integrate data
integrated <- IntegrateData(anchorset = anchors)
} # }
```

Example 14 (r):
```r
if (FALSE) { # \dontrun{
# to install the SeuratData package see https://github.com/satijalab/seurat-data
library(SeuratData)
data("panc8")

# panc8 is a merged Seurat object containing 8 separate pancreas datasets
# split the object by dataset
pancreas.list <- SplitObject(panc8, split.by = "tech")

# perform standard preprocessing on each object
for (i in 1:length(pancreas.list)) {
  pancreas.list[[i]] <- NormalizeData(pancreas.list[[i]], verbose = FALSE)
  pancreas.list[[i]] <- FindVariableFeatures(
    pancreas.list[[i]], selection.method = "vst",
    nfeatures = 2000, verbose = FALSE
  )
}

# find anchors
anchors <- FindIntegrationAnchors(object.list = pancreas.list)

# integrate data
integrated <- IntegrateData(anchorset = anchors)
} # }
```

---

## Rename Cells in an Object — RenameCells.SCTAssay • Seurat

**URL:** http://127.0.0.1:9173/seurat/reference/renamecells/index.html

**Contents:**
- Rename Cells in an Object
- Arguments
- See also
- Contents

Rename Cells in an Object

vector of new cell names

Arguments passed to other methods

SeuratObject::RenameCells

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/objects.R
```

Example 2 (unknown):
```unknown
RenameCells.Rd
```

Example 3 (python):
```python
# S3 method for class 'SCTAssay'
RenameCells(object, new.names = NULL, ...)

# S3 method for class 'SlideSeq'
RenameCells(object, new.names = NULL, ...)

# S3 method for class 'STARmap'
RenameCells(object, new.names = NULL, ...)

# S3 method for class 'VisiumV1'
RenameCells(object, new.names = NULL, ...)
```

Example 4 (r):
```r
# S3 method for class 'SCTAssay'
RenameCells(object, new.names = NULL, ...)

# S3 method for class 'SlideSeq'
RenameCells(object, new.names = NULL, ...)

# S3 method for class 'STARmap'
RenameCells(object, new.names = NULL, ...)

# S3 method for class 'VisiumV1'
RenameCells(object, new.names = NULL, ...)
```

Example 5 (r):
```r
# S3 method for class 'SCTAssay'
RenameCells(object, new.names = NULL, ...)

# S3 method for class 'SlideSeq'
RenameCells(object, new.names = NULL, ...)

# S3 method for class 'STARmap'
RenameCells(object, new.names = NULL, ...)

# S3 method for class 'VisiumV1'
RenameCells(object, new.names = NULL, ...)
```

Example 6 (unknown):
```unknown
SeuratObject::RenameCells
```

---

## Normalize raw data to fractions — RelativeCounts • Seurat

**URL:** http://127.0.0.1:9173/seurat/reference/relativecounts/index.html

**Contents:**
- Normalize raw data to fractions
- Arguments
- Value
- Examples
- Contents

Normalize count data to relative counts per cell by dividing by the total per cell. Optionally use a scale factor, e.g. for counts per million (CPM) use scale.factor = 1e6.

Matrix with the raw count data

Scale the result. Default is 1

Returns a matrix with the relative counts

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/preprocessing.R
```

Example 2 (unknown):
```unknown
RelativeCounts.Rd
```

Example 3 (unknown):
```unknown
scale.factor = 1e6
```

Example 4 (unknown):
```unknown
RelativeCounts(data, scale.factor = 1, verbose = TRUE)
```

Example 5 (r):
```r
RelativeCounts(data, scale.factor = 1, verbose = TRUE)
```

Example 6 (r):
```r
RelativeCounts(data, scale.factor = 1, verbose = TRUE)
```

Example 7 (python):
```python
mat <- matrix(data = rbinom(n = 25, size = 5, prob = 0.2), nrow = 5)
mat
#>      [,1] [,2] [,3] [,4] [,5]
#> [1,]    0    2    0    1    2
#> [2,]    1    3    0    1    0
#> [3,]    1    1    1    3    1
#> [4,]    2    1    1    1    0
#> [5,]    0    0    2    2    0
mat_norm <- RelativeCounts(data = mat)
mat_norm
#> 5 x 5 sparse Matrix of class "dgCMatrix"
#>                                         
#> [1,] .    0.2857143 .    0.125 0.6666667
#> [2,] 0.25 0.4285714 .    0.125 .        
#> [3,] 0.25 0.1428571 0.25 0.375 0.3333333
#> [4,] 0.50 0.1428571 0.25 0.125 .        
#> [5,] .    .         0.50 0.250 .
```

Example 8 (r):
```r
mat <- matrix(data = rbinom(n = 25, size = 5, prob = 0.2), nrow = 5)
mat
#>      [,1] [,2] [,3] [,4] [,5]
#> [1,]    0    2    0    1    2
#> [2,]    1    3    0    1    0
#> [3,]    1    1    1    3    1
#> [4,]    2    1    1    1    0
#> [5,]    0    0    2    2    0
mat_norm <- RelativeCounts(data = mat)
mat_norm
#> 5 x 5 sparse Matrix of class "dgCMatrix"
#>                                         
#> [1,] .    0.2857143 .    0.125 0.6666667
#> [2,] 0.25 0.4285714 .    0.125 .        
#> [3,] 0.25 0.1428571 0.25 0.375 0.3333333
#> [4,] 0.50 0.1428571 0.25 0.125 .        
#> [5,] .    .         0.50 0.250 .
```

Example 9 (r):
```r
mat <- matrix(data = rbinom(n = 25, size = 5, prob = 0.2), nrow = 5)
mat
#>      [,1] [,2] [,3] [,4] [,5]
#> [1,]    0    2    0    1    2
#> [2,]    1    3    0    1    0
#> [3,]    1    1    1    3    1
#> [4,]    2    1    1    1    0
#> [5,]    0    0    2    2    0
mat_norm <- RelativeCounts(data = mat)
mat_norm
#> 5 x 5 sparse Matrix of class "dgCMatrix"
#>                                         
#> [1,] .    0.2857143 .    0.125 0.6666667
#> [2,] 0.25 0.4285714 .    0.125 .        
#> [3,] 0.25 0.1428571 0.25 0.375 0.3333333
#> [4,] 0.50 0.1428571 0.25 0.125 .        
#> [5,] .    .         0.50 0.250 .
```

---

## Load Curio Seeker data — LoadCurioSeeker • Seurat

**URL:** http://127.0.0.1:9173/seurat/reference/loadcurioseeker/index.html

**Contents:**
- Load Curio Seeker data
- Arguments
- Value
- Contents

Load Curio Seeker data

location of data directory that contains the counts matrix, gene names, barcodes/beads, and barcodes/bead location files.

Name of assay to associate spatial data to

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/preprocessing.R
```

Example 2 (unknown):
```unknown
LoadCurioSeeker.Rd
```

Example 3 (unknown):
```unknown
LoadCurioSeeker(data.dir, assay = "Spatial")
```

Example 4 (r):
```r
LoadCurioSeeker(data.dir, assay = "Spatial")
```

Example 5 (r):
```r
LoadCurioSeeker(data.dir, assay = "Spatial")
```

---

## Transfer data — TransferData • Seurat

**URL:** http://127.0.0.1:9173/seurat/reference/transferdata/index.html

**Contents:**
- Transfer data
- Arguments
- Value
- Details
- References
- Examples
- Contents

Transfer categorical or continuous data across single-cell datasets. For transferring categorical information, pass a vector from the reference dataset (e.g. refdata = reference$celltype). For transferring continuous information, pass a matrix from the reference dataset (e.g. refdata = GetAssayData(reference[['RNA']])).

An AnchorSet object generated by FindTransferAnchors

Data to transfer. This can be specified in one of two ways:

The reference data itself as either a vector where the names correspond to the reference cells, or a matrix, where the column names correspond to the reference cells.

The name of the metadata field or assay from the reference object provided. This requires the reference parameter to be specified. If pulling assay data in this manner, it will pull the data from the data slot. To transfer data from other slots, please pull the data explicitly with GetAssayData and provide that matrix here.

Reference object from which to pull data to transfer

Query object into which the data will be transferred.

Name of the Assay to use from query

Dimensional reduction to use for the weighting anchors. Options are:

pcaproject: Use the projected PCA used for anchor building

lsiproject: Use the projected LSI used for anchor building

pca: Use an internal PCA on the query only

cca: Use the CCA used for anchor building

custom DimReduc: User provided \[SeuratObject]{DimReduc} object computed on the query cells

Perform L2 normalization on the cell embeddings after dimensional reduction

Set of dimensions to use in the anchor weighting procedure. If NULL, the same dimensions that were used to find anchors will be used for weighting.

Number of neighbors to consider when weighting anchors

Controls the bandwidth of the Gaussian kernel for weighting

Error bound on the neighbor finding algorithm (from RANN)

More trees gives higher precision when using annoy approximate nearest neighbor search

Print progress bars and output

Slot to store the imputed data. Must be either "data" (default) or "counts"

Return an Assay object with the prediction scores for each class stored in the data slot.

Only return weights matrix

Optionally store the weights matrix used for predictions in the returned query object.

If query is not provided, for the categorical data in refdata, returns a data.frame with label predictions. If refdata is a matrix, returns an Assay object where the imputed data has been stored in the provided slot.

If query is provided, a modified query object is returned. For the categorical data in refdata, prediction scores are stored as Assays (prediction.score.NAME) and two additional metadata fields: predicted.NAME and predicted.NAME.score which contain the class prediction and the score for that predicted class. For continuous data, an Assay called NAME is returned. NAME here corresponds to the name of the element in the refdata list.

The main steps of this procedure are outlined below. For a more detailed description of the methodology, please see Stuart, Butler, et al Cell 2019. doi:10.1016/j.cell.2019.05.031 ; doi:10.1101/460147

For both transferring discrete labels and also feature imputation, we first compute the weights matrix.

Construct a weights matrix that defines the association between each query cell and each anchor. These weights are computed as 1 - the distance between the query cell and the anchor divided by the distance of the query cell to the k.weightth anchor multiplied by the anchor score computed in FindIntegrationAnchors. We then apply a Gaussian kernel width a bandwidth defined by sd.weight and normalize across all k.weight anchors.

The main difference between label transfer (classification) and feature imputation is what gets multiplied by the weights matrix. For label transfer, we perform the following steps:

Create a binary classification matrix, the rows corresponding to each possible class and the columns corresponding to the anchors. If the reference cell in the anchor pair is a member of a certain class, that matrix entry is filled with a 1, otherwise 0.

Multiply this classification matrix by the transpose of weights matrix to compute a prediction score for each class for each cell in the query dataset.

For feature imputation, we perform the following step:

Multiply the expression matrix for the reference anchor cells by the weights matrix. This returns a predicted expression matrix for the specified features for each cell in the query dataset.

Stuart T, Butler A, et al. Comprehensive Integration of Single-Cell Data. Cell. 2019;177:1888-1902 doi:10.1016/j.cell.2019.05.031

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/integration.R
```

Example 2 (unknown):
```unknown
TransferData.Rd
```

Example 3 (unknown):
```unknown
refdata = reference$celltype
```

Example 4 (unknown):
```unknown
refdata = GetAssayData(reference[['RNA']])
```

Example 5 (unknown):
```unknown
TransferData(
  anchorset,
  refdata,
  reference = NULL,
  query = NULL,
  query.assay = NULL,
  weight.reduction = "pcaproject",
  l2.norm = FALSE,
  dims = NULL,
  k.weight = 50,
  sd.weight = 1,
  eps = 0,
  n.trees = 50,
  verbose = TRUE,
  slot = "data",
  prediction.assay = FALSE,
  only.weights = FALSE,
  store.weights = TRUE
)
```

Example 6 (r):
```r
TransferData(
  anchorset,
  refdata,
  reference = NULL,
  query = NULL,
  query.assay = NULL,
  weight.reduction = "pcaproject",
  l2.norm = FALSE,
  dims = NULL,
  k.weight = 50,
  sd.weight = 1,
  eps = 0,
  n.trees = 50,
  verbose = TRUE,
  slot = "data",
  prediction.assay = FALSE,
  only.weights = FALSE,
  store.weights = TRUE
)
```

Example 7 (r):
```r
TransferData(
  anchorset,
  refdata,
  reference = NULL,
  query = NULL,
  query.assay = NULL,
  weight.reduction = "pcaproject",
  l2.norm = FALSE,
  dims = NULL,
  k.weight = 50,
  sd.weight = 1,
  eps = 0,
  n.trees = 50,
  verbose = TRUE,
  slot = "data",
  prediction.assay = FALSE,
  only.weights = FALSE,
  store.weights = TRUE
)
```

Example 8 (unknown):
```unknown
FindTransferAnchors
```

Example 9 (unknown):
```unknown
GetAssayData
```

Example 10 (unknown):
```unknown
\[SeuratObject]{DimReduc}
```

Example 11 (unknown):
```unknown
FindIntegrationAnchors
```

Example 12 (python):
```python
if (FALSE) { # \dontrun{
# to install the SeuratData package see https://github.com/satijalab/seurat-data
library(SeuratData)
data("pbmc3k")

# for demonstration, split the object into reference and query
pbmc.reference <- pbmc3k[, 1:1350]
pbmc.query <- pbmc3k[, 1351:2700]

# perform standard preprocessing on each object
pbmc.reference <- NormalizeData(pbmc.reference)
pbmc.reference <- FindVariableFeatures(pbmc.reference)
pbmc.reference <- ScaleData(pbmc.reference)

pbmc.query <- NormalizeData(pbmc.query)
pbmc.query <- FindVariableFeatures(pbmc.query)
pbmc.query <- ScaleData(pbmc.query)

# find anchors
anchors <- FindTransferAnchors(reference = pbmc.reference, query = pbmc.query)

# transfer labels
predictions <- TransferData(anchorset = anchors, refdata = pbmc.reference$seurat_annotations)
pbmc.query <- AddMetaData(object = pbmc.query, metadata = predictions)
} # }
```

Example 13 (r):
```r
if (FALSE) { # \dontrun{
# to install the SeuratData package see https://github.com/satijalab/seurat-data
library(SeuratData)
data("pbmc3k")

# for demonstration, split the object into reference and query
pbmc.reference <- pbmc3k[, 1:1350]
pbmc.query <- pbmc3k[, 1351:2700]

# perform standard preprocessing on each object
pbmc.reference <- NormalizeData(pbmc.reference)
pbmc.reference <- FindVariableFeatures(pbmc.reference)
pbmc.reference <- ScaleData(pbmc.reference)

pbmc.query <- NormalizeData(pbmc.query)
pbmc.query <- FindVariableFeatures(pbmc.query)
pbmc.query <- ScaleData(pbmc.query)

# find anchors
anchors <- FindTransferAnchors(reference = pbmc.reference, query = pbmc.query)

# transfer labels
predictions <- TransferData(anchorset = anchors, refdata = pbmc.reference$seurat_annotations)
pbmc.query <- AddMetaData(object = pbmc.query, metadata = predictions)
} # }
```

Example 14 (r):
```r
if (FALSE) { # \dontrun{
# to install the SeuratData package see https://github.com/satijalab/seurat-data
library(SeuratData)
data("pbmc3k")

# for demonstration, split the object into reference and query
pbmc.reference <- pbmc3k[, 1:1350]
pbmc.query <- pbmc3k[, 1351:2700]

# perform standard preprocessing on each object
pbmc.reference <- NormalizeData(pbmc.reference)
pbmc.reference <- FindVariableFeatures(pbmc.reference)
pbmc.reference <- ScaleData(pbmc.reference)

pbmc.query <- NormalizeData(pbmc.query)
pbmc.query <- FindVariableFeatures(pbmc.query)
pbmc.query <- ScaleData(pbmc.query)

# find anchors
anchors <- FindTransferAnchors(reference = pbmc.reference, query = pbmc.query)

# transfer labels
predictions <- TransferData(anchorset = anchors, refdata = pbmc.reference$seurat_annotations)
pbmc.query <- AddMetaData(object = pbmc.query, metadata = predictions)
} # }
```

---

## Color dimensional reduction plot by tree split — ColorDimSplit • Seurat

**URL:** http://127.0.0.1:9173/seurat/reference/colordimsplit/index.html

**Contents:**
- Color dimensional reduction plot by tree split
- Arguments
- Value
- See also
- Examples
- Contents

Returns a DimPlot colored based on whether the cells fall in clusters to the left or to the right of a node split in the cluster tree.

Node in cluster tree on which to base the split

Color for the left side of the split

Color for the right side of the split

Color for all other cells

Arguments passed on to DimPlot

Dimensions to plot, must be a two-length numeric vector specifying x- and y-dimensions

Vector of cells to plot (default is all cells)

Vector of colors, each color corresponds to an identity class. This may also be a single character or numeric value corresponding to a palette as specified by brewer.pal.info. By default, ggplot2 assigns colors. We also include a number of palettes from the pals package. See DiscretePalette for details.

Adjust point size for plotting

Which dimensionality reduction to use. If not specified, first searches for umap, then tsne, then pca

Name of one or more metadata columns to group (color) cells by (for example, orig.ident); pass 'ident' to group by identity class

A factor in object metadata to split the plot by, pass 'ident' to split by cell identity

If NULL, all points are circles (default). You can specify any cell attribute (that can be pulled with FetchData) allowing for both different colors and different shapes on cells. Only applicable if raster = FALSE.

Specify the order of plotting for the idents. This can be useful for crowded plots if points of interest are being buried. Provide either a full list of valid idents or a subset to be plotted last (on top)

Whether to randomly shuffle the order of points. This can be useful for crowded plots if points of interest are being buried. (default is FALSE)

Sets the seed if randomly shuffling the order of points.

Whether to label the clusters

Sets the color of the label text

Whether to put a box around the label text (geom_text vs geom_label)

Alpha value for plotting (default is 1)

Adjust stroke (outline) size of points

A list of character or numeric vectors of cells to highlight. If only one group of cells desired, can simply pass a vector instead of a list. If set, colors selected cells to the color(s) in cols.highlight and other cells black (white if dark.theme = TRUE); will also resize to the size(s) passed to sizes.highlight

A vector of colors to highlight the cells as; will repeat to the length groups in cells.highlight

Size of highlighted cells; will repeat to the length groups in cells.highlight. If sizes.highlight = TRUE size of all points will be this value.

Color value for NA points when using custom scale

Number of columns for display when combining plots

Combine plots into a single patchworked ggplot object. If FALSE, return a list of ggplot objects

Convert points to raster format, default is NULL which automatically rasterizes if plotting more than 100,000 cells

Pixel resolution for rasterized plots, passed to geom_scattermore(). Default is c(512, 512).

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/visualization.R
```

Example 2 (unknown):
```unknown
ColorDimSplit.Rd
```

Example 3 (unknown):
```unknown
ColorDimSplit(
  object,
  node,
  left.color = "red",
  right.color = "blue",
  other.color = "grey50",
  ...
)
```

Example 4 (r):
```r
ColorDimSplit(
  object,
  node,
  left.color = "red",
  right.color = "blue",
  other.color = "grey50",
  ...
)
```

Example 5 (r):
```r
ColorDimSplit(
  object,
  node,
  left.color = "red",
  right.color = "blue",
  other.color = "grey50",
  ...
)
```

Example 6 (unknown):
```unknown
brewer.pal.info
```

Example 7 (unknown):
```unknown
DiscretePalette
```

Example 8 (unknown):
```unknown
raster = FALSE
```

Example 9 (unknown):
```unknown
label.color
```

Example 10 (unknown):
```unknown
stroke.size
```

Example 11 (unknown):
```unknown
cells.highlight
```

Example 12 (unknown):
```unknown
cols.highlight
```

Example 13 (unknown):
```unknown
sizes.highlight
```

Example 14 (unknown):
```unknown
cols.highlight
```

Example 15 (unknown):
```unknown
sizes.highlight
```

Example 16 (unknown):
```unknown
sizes.highlight = TRUE
```

Example 17 (unknown):
```unknown
patchworked
```

Example 18 (unknown):
```unknown
if (FALSE) { # \dontrun{
if (requireNamespace("ape", quietly = TRUE)) {
  data("pbmc_small")
  pbmc_small <- BuildClusterTree(object = pbmc_small, verbose = FALSE)
  PlotClusterTree(pbmc_small)
  ColorDimSplit(pbmc_small, node = 5)
}
} # }
```

Example 19 (r):
```r
if (FALSE) { # \dontrun{
if (requireNamespace("ape", quietly = TRUE)) {
  data("pbmc_small")
  pbmc_small <- BuildClusterTree(object = pbmc_small, verbose = FALSE)
  PlotClusterTree(pbmc_small)
  ColorDimSplit(pbmc_small, node = 5)
}
} # }
```

Example 20 (r):
```r
if (FALSE) { # \dontrun{
if (requireNamespace("ape", quietly = TRUE)) {
  data("pbmc_small")
  pbmc_small <- BuildClusterTree(object = pbmc_small, verbose = FALSE)
  PlotClusterTree(pbmc_small)
  ColorDimSplit(pbmc_small, node = 5)
}
} # }
```

---

## The BridgeReferenceSet Class The BridgeReferenceSet is an output from PrepareBridgeReference — BridgeReferenceSet-class • Seurat

**URL:** http://127.0.0.1:9173/seurat/reference/bridgereferenceset-class/index.html

**Contents:**
- The BridgeReferenceSet Class The BridgeReferenceSet is an output from PrepareBridgeReference
- Slots
- Contents

The BridgeReferenceSet Class The BridgeReferenceSet is an output from PrepareBridgeReference

The multi-omic object

The Reference object only containing bridge representation assay

A list of parameters used in the PrepareBridgeReference

Store log of parameters that were used

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/objects.R
```

Example 2 (unknown):
```unknown
BridgeReferenceSet-class.Rd
```

---

## Dot plot visualization — DotPlot • Seurat

**URL:** http://127.0.0.1:9173/seurat/reference/dotplot/index.html

**Contents:**
- Dot plot visualization
- Arguments
- Value
- See also
- Examples
- Contents

Intuitive way of visualizing how feature expression changes across different identity classes (clusters). The size of the dot encodes the percentage of cells within a class, while the color encodes the AverageExpression level across all cells within a class (blue is high).

Input vector of features, or named list of feature vectors if feature-grouped panels are desired (replicates the functionality of the old SplitDotPlotGG)

Name of assay to use, defaults to the active assay

Colors to plot: the name of a palette from RColorBrewer::brewer.pal.info, a pair of colors defining a gradient, or 3+ colors defining multiple gradients (if split.by is set)

Minimum scaled average expression threshold (everything smaller will be set to this)

Maximum scaled average expression threshold (everything larger will be set to this)

The fraction of cells at which to draw the smallest dot (default is 0). All cell groups with less than this expressing the given gene will have no dot drawn.

Scale the size of the points, similar to cex

Identity classes to include in plot (default is all)

Factor to group the cells by

A factor in object metadata to split the plot by, pass 'ident' to split by cell identity see FetchData for more details

Whether to order identities by hierarchical clusters based on given features, default is FALSE

Determine whether the data is scaled, TRUE for default

Scale the size of the points by 'size' or by 'radius'

Set lower limit for scaling, use NA for default

Set upper limit for scaling, use NA for default

RColorBrewer::brewer.pal.info

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/visualization.R
```

Example 2 (unknown):
```unknown
DotPlot(
  object,
  features,
  assay = NULL,
  cols = c("lightgrey", "blue"),
  col.min = -2.5,
  col.max = 2.5,
  dot.min = 0,
  dot.scale = 6,
  idents = NULL,
  group.by = NULL,
  split.by = NULL,
  cluster.idents = FALSE,
  scale = TRUE,
  scale.by = "radius",
  scale.min = NA,
  scale.max = NA
)
```

Example 3 (r):
```r
DotPlot(
  object,
  features,
  assay = NULL,
  cols = c("lightgrey", "blue"),
  col.min = -2.5,
  col.max = 2.5,
  dot.min = 0,
  dot.scale = 6,
  idents = NULL,
  group.by = NULL,
  split.by = NULL,
  cluster.idents = FALSE,
  scale = TRUE,
  scale.by = "radius",
  scale.min = NA,
  scale.max = NA
)
```

Example 4 (r):
```r
DotPlot(
  object,
  features,
  assay = NULL,
  cols = c("lightgrey", "blue"),
  col.min = -2.5,
  col.max = 2.5,
  dot.min = 0,
  dot.scale = 6,
  idents = NULL,
  group.by = NULL,
  split.by = NULL,
  cluster.idents = FALSE,
  scale = TRUE,
  scale.by = "radius",
  scale.min = NA,
  scale.max = NA
)
```

Example 5 (unknown):
```unknown
RColorBrewer::brewer.pal.info
```

Example 6 (unknown):
```unknown
RColorBrewer::brewer.pal.info
```

Example 7 (unknown):
```unknown
data("pbmc_small")
cd_genes <- c("CD247", "CD3E", "CD9")
DotPlot(object = pbmc_small, features = cd_genes)
#> Warning: Scaling data with a low number of groups may produce misleading results

pbmc_small[['groups']] <- sample(x = c('g1', 'g2'), size = ncol(x = pbmc_small), replace = TRUE)
DotPlot(object = pbmc_small, features = cd_genes, split.by = 'groups')
```

Example 8 (r):
```r
data("pbmc_small")
cd_genes <- c("CD247", "CD3E", "CD9")
DotPlot(object = pbmc_small, features = cd_genes)
#> Warning: Scaling data with a low number of groups may produce misleading results

pbmc_small[['groups']] <- sample(x = c('g1', 'g2'), size = ncol(x = pbmc_small), replace = TRUE)
DotPlot(object = pbmc_small, features = cd_genes, split.by = 'groups')
```

Example 9 (r):
```r
data("pbmc_small")
cd_genes <- c("CD247", "CD3E", "CD9")
DotPlot(object = pbmc_small, features = cd_genes)
#> Warning: Scaling data with a low number of groups may produce misleading results

pbmc_small[['groups']] <- sample(x = c('g1', 'g2'), size = ncol(x = pbmc_small), replace = TRUE)
DotPlot(object = pbmc_small, features = cd_genes, split.by = 'groups')
```

---

## Run t-distributed Stochastic Neighbor Embedding — RunTSNE • Seurat

**URL:** http://127.0.0.1:9173/seurat/reference/runtsne/index.html

**Contents:**
- Run t-distributed Stochastic Neighbor Embedding
- Arguments
- Contents

Run t-SNE dimensionality reduction on selected features. Has the option of running in a reduced dimensional space (i.e. spectral tSNE, recommended), or running based on a set of genes. For details about stored TSNE calculation parameters, see PrintTSNEParams.

Arguments passed to other methods and to t-SNE call (most commonly used is perplexity)

Name of assay that that t-SNE is being run on

Random seed for the t-SNE. If NULL, does not set the seed

Select the method to use to compute the tSNE. Available methods are:

“Rtsne”: Use the Rtsne package Barnes-Hut implementation of tSNE (default)

“FIt-SNE”: Use the FFT-accelerated Interpolation-based t-SNE. Based on Kluger Lab code found here: https://github.com/KlugerLab/FIt-SNE

The dimensional space of the resulting tSNE embedding (default is 2). For example, set to 3 for a 3d tSNE

dimensional reduction key, specifies the string before the number for the dimension names. “tSNE_” by default

Which cells to analyze (default, all cells)

Which dimensions to use as input features

Which dimensional reduction (e.g. PCA, ICA) to use for the tSNE. Default is PCA

If set, run the tSNE on this subset of features (instead of running on a set of reduced dimensions). Not set (NULL) by default; dims must be NULL to run on features

If set, runs tSNE on the given distance matrix instead of data matrix (experimental)

dimensional reduction name, specifies the position in the object$dr list. tsne by default

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/generics.R
```

Example 2 (unknown):
```unknown
R/dimensional_reduction.R
```

Example 3 (unknown):
```unknown
PrintTSNEParams
```

Example 4 (python):
```python
RunTSNE(object, ...)

# S3 method for class 'matrix'
RunTSNE(
  object,
  assay = NULL,
  seed.use = 1,
  tsne.method = "Rtsne",
  dim.embed = 2,
  reduction.key = "tSNE_",
  ...
)

# S3 method for class 'DimReduc'
RunTSNE(
  object,
  cells = NULL,
  dims = 1:5,
  seed.use = 1,
  tsne.method = "Rtsne",
  dim.embed = 2,
  reduction.key = "tSNE_",
  ...
)

# S3 method for class 'dist'
RunTSNE(
  object,
  assay = NULL,
  seed.use = 1,
  tsne.method = "Rtsne",
  dim.embed = 2,
  reduction.key = "tSNE_",
  ...
)

# S3 method for class 'Seurat'
RunTSNE(
  object,
  reduction = "pca",
  cells = NULL,
  dims = 1:5,
  features = NULL,
  seed.use = 1,
  tsne.method = "Rtsne",
  dim.embed = 2,
  distance.matrix = NULL,
  reduction.name = "tsne",
  reduction.key = "tSNE_",
  ...
)
```

Example 5 (r):
```r
RunTSNE(object, ...)

# S3 method for class 'matrix'
RunTSNE(
  object,
  assay = NULL,
  seed.use = 1,
  tsne.method = "Rtsne",
  dim.embed = 2,
  reduction.key = "tSNE_",
  ...
)

# S3 method for class 'DimReduc'
RunTSNE(
  object,
  cells = NULL,
  dims = 1:5,
  seed.use = 1,
  tsne.method = "Rtsne",
  dim.embed = 2,
  reduction.key = "tSNE_",
  ...
)

# S3 method for class 'dist'
RunTSNE(
  object,
  assay = NULL,
  seed.use = 1,
  tsne.method = "Rtsne",
  dim.embed = 2,
  reduction.key = "tSNE_",
  ...
)

# S3 method for class 'Seurat'
RunTSNE(
  object,
  reduction = "pca",
  cells = NULL,
  dims = 1:5,
  features = NULL,
  seed.use = 1,
  tsne.method = "Rtsne",
  dim.embed = 2,
  distance.matrix = NULL,
  reduction.name = "tsne",
  reduction.key = "tSNE_",
  ...
)
```

Example 6 (r):
```r
RunTSNE(object, ...)

# S3 method for class 'matrix'
RunTSNE(
  object,
  assay = NULL,
  seed.use = 1,
  tsne.method = "Rtsne",
  dim.embed = 2,
  reduction.key = "tSNE_",
  ...
)

# S3 method for class 'DimReduc'
RunTSNE(
  object,
  cells = NULL,
  dims = 1:5,
  seed.use = 1,
  tsne.method = "Rtsne",
  dim.embed = 2,
  reduction.key = "tSNE_",
  ...
)

# S3 method for class 'dist'
RunTSNE(
  object,
  assay = NULL,
  seed.use = 1,
  tsne.method = "Rtsne",
  dim.embed = 2,
  reduction.key = "tSNE_",
  ...
)

# S3 method for class 'Seurat'
RunTSNE(
  object,
  reduction = "pca",
  cells = NULL,
  dims = 1:5,
  features = NULL,
  seed.use = 1,
  tsne.method = "Rtsne",
  dim.embed = 2,
  distance.matrix = NULL,
  reduction.name = "tsne",
  reduction.key = "tSNE_",
  ...
)
```

---

## Cell Selector — CellSelector • Seurat

**URL:** http://127.0.0.1:9173/reference_cellselector.html

**Contents:**
- Cell Selector
- Arguments
- Value
- See also
- Examples
- Contents

Select points on a scatterplot and get information about them

An optional Seurat object; if passes, will return an object with the identities of selected cells set to ident

An optional new identity class to assign the selected cells

If object is NULL, the names of the points selected; otherwise, a Seurat object with the selected cells identity classes set to ident

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/visualization.R
```

Example 2 (unknown):
```unknown
CellSelector.Rd
```

Example 3 (unknown):
```unknown
CellSelector(plot, object = NULL, ident = "SelectedCells", ...)

FeatureLocator(plot, ...)
```

Example 4 (r):
```r
CellSelector(plot, object = NULL, ident = "SelectedCells", ...)

FeatureLocator(plot, ...)
```

Example 5 (r):
```r
CellSelector(plot, object = NULL, ident = "SelectedCells", ...)

FeatureLocator(plot, ...)
```

Example 6 (unknown):
```unknown
FeaturePlot
```

Example 7 (python):
```python
if (FALSE) { # \dontrun{
data("pbmc_small")
plot <- DimPlot(object = pbmc_small)
# Follow instructions in the terminal to select points
cells.located <- CellSelector(plot = plot)
cells.located
# Automatically set the identity class of selected cells and return a new Seurat object
pbmc_small <- CellSelector(plot = plot, object = pbmc_small, ident = 'SelectedCells')
} # }
```

Example 8 (r):
```r
if (FALSE) { # \dontrun{
data("pbmc_small")
plot <- DimPlot(object = pbmc_small)
# Follow instructions in the terminal to select points
cells.located <- CellSelector(plot = plot)
cells.located
# Automatically set the identity class of selected cells and return a new Seurat object
pbmc_small <- CellSelector(plot = plot, object = pbmc_small, ident = 'SelectedCells')
} # }
```

Example 9 (r):
```r
if (FALSE) { # \dontrun{
data("pbmc_small")
plot <- DimPlot(object = pbmc_small)
# Follow instructions in the terminal to select points
cells.located <- CellSelector(plot = plot)
cells.located
# Automatically set the identity class of selected cells and return a new Seurat object
pbmc_small <- CellSelector(plot = plot, object = pbmc_small, ident = 'SelectedCells')
} # }
```

---

## Calculate the percentage of a vector above some threshold — PercentAbove • Seurat

**URL:** http://127.0.0.1:9173/seurat/reference/percentabove/index.html

**Contents:**
- Calculate the percentage of a vector above some threshold
- Arguments
- Value
- Examples
- Contents

Calculate the percentage of a vector above some threshold

Threshold to use when calculating percentage

Returns the percentage of x values above the given threshold

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/utilities.R
```

Example 2 (unknown):
```unknown
PercentAbove.Rd
```

Example 3 (unknown):
```unknown
PercentAbove(x, threshold)
```

Example 4 (r):
```r
PercentAbove(x, threshold)
```

Example 5 (r):
```r
PercentAbove(x, threshold)
```

Example 6 (unknown):
```unknown
set.seed(42)
PercentAbove(sample(1:100, 10), 75)
#> [1] 0.2
```

Example 7 (r):
```r
set.seed(42)
PercentAbove(sample(1:100, 10), 75)
#> [1] 0.2
```

Example 8 (r):
```r
set.seed(42)
PercentAbove(sample(1:100, 10), 75)
#> [1] 0.2
```

---

## Spatial Cluster Plots — ImageDimPlot • Seurat

**URL:** http://127.0.0.1:9173/reference_imagedimplot.html

**Contents:**
- Spatial Cluster Plots
- Arguments
- Value
- Contents

Visualize clusters or other categorical groupings in a spatial context

A vector of segmentation boundaries per image to plot; can be a character vector, a named character vector, or a named list. Names should be the names of FOVs and values should be the names of segmentation boundaries

Name of one or more metadata columns to group (color) cells by (for example, orig.ident); pass 'ident' to group by identity class

A factor in object metadata to split the plot by, pass 'ident' to split by cell identity

Vector of colors, each color corresponds to an identity class. This may also be a single character or numeric value corresponding to a palette as specified by brewer.pal.info. By default, ggplot2 assigns colors. We also include a number of palettes from the pals package. See DiscretePalette for details.

Randomly shuffle colors when a palette or vector of colors is provided to cols

Point size for cells when plotting centroids

A vector of molecules to plot

Point size for molecules

A vector of color for molecules. The "Set1" palette from RColorBrewer is used by default.

Alpha value for molecules, should be between 0 and 1

Max number of each molecule specified in `molecules` to plot

Alpha value for plotting (default is 1)

Color of cell segmentation border; pass NA to suppress borders for segmentation-based plots

Thickness of cell segmentation borders; pass NA to suppress borders for centroid-based plots

Color value for NA points when using custom scale

Set plot background to black

Crop the plots to area with cells only

Vector of cells to plot (default is all cells)

Overlay boundaries from a single image to create a single plot; if TRUE, then boundaries are stacked in the order they're given (first is lowest)

Keep axes and panel background

Combine plots into a single patchwork ggplot object.If FALSE, return a list of ggplot objects

Plot cartesian coordinates with fixed aspect ratio

Flag to flip X and Y axes. Default is TRUE.

If combine = TRUE, a patchwork ggplot object; otherwise, a list of ggplot objects

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/visualization.R
```

Example 2 (unknown):
```unknown
ImageDimPlot.Rd
```

Example 3 (unknown):
```unknown
ImageDimPlot(
  object,
  fov = NULL,
  boundaries = NULL,
  group.by = NULL,
  split.by = NULL,
  cols = NULL,
  shuffle.cols = FALSE,
  size = 0.5,
  molecules = NULL,
  mols.size = 0.1,
  mols.cols = NULL,
  mols.alpha = 1,
  nmols = 1000,
  alpha = 1,
  border.color = "white",
  border.size = NULL,
  na.value = "grey50",
  dark.background = TRUE,
  crop = FALSE,
  cells = NULL,
  overlap = FALSE,
  axes = FALSE,
  combine = TRUE,
  coord.fixed = TRUE,
  flip_xy = TRUE
)
```

Example 4 (r):
```r
ImageDimPlot(
  object,
  fov = NULL,
  boundaries = NULL,
  group.by = NULL,
  split.by = NULL,
  cols = NULL,
  shuffle.cols = FALSE,
  size = 0.5,
  molecules = NULL,
  mols.size = 0.1,
  mols.cols = NULL,
  mols.alpha = 1,
  nmols = 1000,
  alpha = 1,
  border.color = "white",
  border.size = NULL,
  na.value = "grey50",
  dark.background = TRUE,
  crop = FALSE,
  cells = NULL,
  overlap = FALSE,
  axes = FALSE,
  combine = TRUE,
  coord.fixed = TRUE,
  flip_xy = TRUE
)
```

Example 5 (r):
```r
ImageDimPlot(
  object,
  fov = NULL,
  boundaries = NULL,
  group.by = NULL,
  split.by = NULL,
  cols = NULL,
  shuffle.cols = FALSE,
  size = 0.5,
  molecules = NULL,
  mols.size = 0.1,
  mols.cols = NULL,
  mols.alpha = 1,
  nmols = 1000,
  alpha = 1,
  border.color = "white",
  border.size = NULL,
  na.value = "grey50",
  dark.background = TRUE,
  crop = FALSE,
  cells = NULL,
  overlap = FALSE,
  axes = FALSE,
  combine = TRUE,
  coord.fixed = TRUE,
  flip_xy = TRUE
)
```

Example 6 (unknown):
```unknown
brewer.pal.info
```

Example 7 (unknown):
```unknown
DiscretePalette
```

Example 8 (unknown):
```unknown
combine = TRUE
```

---

## Cluster Determination — FindClusters • Seurat

**URL:** http://127.0.0.1:9173/seurat/reference/findclusters/index.html

**Contents:**
- Cluster Determination
- Arguments
- Value
- Details
- Contents

Identify clusters of cells by a shared nearest neighbor (SNN) modularity optimization based clustering algorithm. First calculate k-nearest neighbors and construct the SNN graph. Then optimize the modularity function to determine clusters. For a full description of the algorithms, see Waltman and van Eck (2013) The European Physical Journal B. Thanks to Nigel Delaney (evolvedmicrobe@github) for the rewrite of the Java modularity optimizer code in Rcpp!

Arguments passed to other methods

Modularity function (1 = standard; 2 = alternative).

Passed to the `initial_membership` parameter of `leidenbase::leiden_find_partition`.

Passed to the `node_sizes` parameter of `leidenbase::leiden_find_partition`.

Value of the resolution parameter, use a value above (below) 1.0 if you want to obtain a larger (smaller) number of communities.

Algorithm for modularity optimization (1 = original Louvain algorithm; 2 = Louvain algorithm with multilevel refinement; 3 = SLM algorithm; 4 = Leiden algorithm).

Number of random starts.

Maximal number of iterations per random start.

Seed of the random number generator.

Group singletons into nearest cluster. If FALSE, assign all singletons to a "singleton" group

Directory where intermediate files will be written. Specify the ABSOLUTE path.

Edge file to use as input for modularity optimizer jar.

Name of graph to use for the clustering algorithm

Name of output clusters

Returns a Seurat object where the idents have been updated with new cluster info; latest clustering results will be stored in object metadata under 'seurat_clusters'. Note that 'seurat_clusters' will be overwritten everytime FindClusters is run

To run Leiden algorithm, you must first install the leidenalg python package (e.g. via pip install leidenalg), see Traag et al (2018).

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/generics.R
```

Example 2 (unknown):
```unknown
R/clustering.R
```

Example 3 (unknown):
```unknown
FindClusters.Rd
```

Example 4 (python):
```python
FindClusters(object, ...)

# Default S3 method
FindClusters(
  object,
  modularity.fxn = 1,
  initial.membership = NULL,
  node.sizes = NULL,
  resolution = 0.8,
  method = deprecated(),
  algorithm = 1,
  n.start = 10,
  n.iter = 10,
  random.seed = 0,
  group.singletons = TRUE,
  temp.file.location = NULL,
  edge.file.name = NULL,
  verbose = TRUE,
  ...
)

# S3 method for class 'Seurat'
FindClusters(
  object,
  graph.name = NULL,
  cluster.name = NULL,
  modularity.fxn = 1,
  initial.membership = NULL,
  node.sizes = NULL,
  resolution = 0.8,
  method = NULL,
  algorithm = 1,
  n.start = 10,
  n.iter = 10,
  random.seed = 0,
  group.singletons = TRUE,
  temp.file.location = NULL,
  edge.file.name = NULL,
  verbose = TRUE,
  ...
)
```

Example 5 (r):
```r
FindClusters(object, ...)

# Default S3 method
FindClusters(
  object,
  modularity.fxn = 1,
  initial.membership = NULL,
  node.sizes = NULL,
  resolution = 0.8,
  method = deprecated(),
  algorithm = 1,
  n.start = 10,
  n.iter = 10,
  random.seed = 0,
  group.singletons = TRUE,
  temp.file.location = NULL,
  edge.file.name = NULL,
  verbose = TRUE,
  ...
)

# S3 method for class 'Seurat'
FindClusters(
  object,
  graph.name = NULL,
  cluster.name = NULL,
  modularity.fxn = 1,
  initial.membership = NULL,
  node.sizes = NULL,
  resolution = 0.8,
  method = NULL,
  algorithm = 1,
  n.start = 10,
  n.iter = 10,
  random.seed = 0,
  group.singletons = TRUE,
  temp.file.location = NULL,
  edge.file.name = NULL,
  verbose = TRUE,
  ...
)
```

Example 6 (r):
```r
FindClusters(object, ...)

# Default S3 method
FindClusters(
  object,
  modularity.fxn = 1,
  initial.membership = NULL,
  node.sizes = NULL,
  resolution = 0.8,
  method = deprecated(),
  algorithm = 1,
  n.start = 10,
  n.iter = 10,
  random.seed = 0,
  group.singletons = TRUE,
  temp.file.location = NULL,
  edge.file.name = NULL,
  verbose = TRUE,
  ...
)

# S3 method for class 'Seurat'
FindClusters(
  object,
  graph.name = NULL,
  cluster.name = NULL,
  modularity.fxn = 1,
  initial.membership = NULL,
  node.sizes = NULL,
  resolution = 0.8,
  method = NULL,
  algorithm = 1,
  n.start = 10,
  n.iter = 10,
  random.seed = 0,
  group.singletons = TRUE,
  temp.file.location = NULL,
  edge.file.name = NULL,
  verbose = TRUE,
  ...
)
```

---

## Set integration data — SetIntegrationData • Seurat

**URL:** http://127.0.0.1:9173/seurat/reference/setintegrationdata/index.html

**Contents:**
- Set integration data
- Arguments
- Value
- Contents

Name of integration object

Which slot in integration object to set

Returns a Seurat object

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/objects.R
```

Example 2 (unknown):
```unknown
SetIntegrationData.Rd
```

Example 3 (unknown):
```unknown
SetIntegrationData(object, integration.name, slot, new.data)
```

Example 4 (r):
```r
SetIntegrationData(object, integration.name, slot, new.data)
```

Example 5 (r):
```r
SetIntegrationData(object, integration.name, slot, new.data)
```

---

## DE and EnrichR pathway visualization barplot — DEenrichRPlot • Seurat

**URL:** http://127.0.0.1:9173/seurat/reference/deenrichrplot/index.html

**Contents:**
- DE and EnrichR pathway visualization barplot
- Arguments
- Value
- Contents

DE and EnrichR pathway visualization barplot

Name of object class Seurat.

Cell class identity 1.

Cell class identity 2.

Option to display pathway enrichments for both negative and positive DE genes.If false, only positive DE gene will be displayed.

Limit testing to genes which show, on average, at least X-fold difference (log-scale) between the two groups of cells. Default is 0.25. Increasing logfc.threshold speeds up the function, but can miss weaker signals.

Assay to use in differential expression testing

Maximum number of genes to use as input to enrichR.

Denotes which test to use. Available options are:

"wilcox" : Identifies differentially expressed genes between two groups of cells using a Wilcoxon Rank Sum test (default); will use a fast implementation by Presto if installed

"wilcox_limma" : Identifies differentially expressed genes between two groups of cells using the limma implementation of the Wilcoxon Rank Sum test; set this option to reproduce results from Seurat v4

"bimod" : Likelihood-ratio test for single cell gene expression, (McDavid et al., Bioinformatics, 2013)

"roc" : Identifies 'markers' of gene expression using ROC analysis. For each gene, evaluates (using AUC) a classifier built on that gene alone, to classify between two groups of cells. An AUC value of 1 means that expression values for this gene alone can perfectly classify the two groupings (i.e. Each of the cells in cells.1 exhibit a higher level than each of the cells in cells.2). An AUC value of 0 also means there is perfect classification, but in the other direction. A value of 0.5 implies that the gene has no predictive power to classify the two groups. Returns a 'predictive power' (abs(AUC-0.5) * 2) ranked matrix of putative differentially expressed genes.

"t" : Identify differentially expressed genes between two groups of cells using the Student's t-test.

"negbinom" : Identifies differentially expressed genes between two groups of cells using a negative binomial generalized linear model. Use only for UMI-based datasets

"poisson" : Identifies differentially expressed genes between two groups of cells using a poisson generalized linear model. Use only for UMI-based datasets

"LR" : Uses a logistic regression framework to determine differentially expressed genes. Constructs a logistic regression model predicting group membership based on each feature individually and compares this to a null model with a likelihood ratio test.

"MAST" : Identifies differentially expressed genes between two groups of cells using a hurdle model tailored to scRNA-seq data. Utilizes the MAST package to run the DE testing.

"DESeq2" : Identifies differentially expressed genes between two groups of cells based on a model using DESeq2 which uses a negative binomial distribution (Love et al, Genome Biology, 2014).This test does not support pre-filtering of genes based on average difference (or percent detection rate) between cell groups. However, genes may be pre-filtered based on their minimum detection rate (min.pct) across both cell groups. To use this method, please install DESeq2, using the instructions at https://bioconductor.org/packages/release/bioc/html/DESeq2.html

Cutoff to select DE genes.

A list of colors to use for barplots.

Database to use from enrichR.

Number of pathways to display in barplot.

Return list of DE genes

Arguments passed to other methods and to specific DE methods

Returns one (only enriched) or two (both enriched and depleted) barplots with the top enriched/depleted GO terms from EnrichR.

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/mixscape.R
```

Example 2 (unknown):
```unknown
DEenrichRPlot.Rd
```

Example 3 (unknown):
```unknown
DEenrichRPlot(
  object,
  ident.1 = NULL,
  ident.2 = NULL,
  balanced = TRUE,
  logfc.threshold = 0.25,
  assay = NULL,
  max.genes,
  test.use = "wilcox",
  p.val.cutoff = 0.05,
  cols = NULL,
  enrich.database = NULL,
  num.pathway = 10,
  return.gene.list = FALSE,
  ...
)
```

Example 4 (r):
```r
DEenrichRPlot(
  object,
  ident.1 = NULL,
  ident.2 = NULL,
  balanced = TRUE,
  logfc.threshold = 0.25,
  assay = NULL,
  max.genes,
  test.use = "wilcox",
  p.val.cutoff = 0.05,
  cols = NULL,
  enrich.database = NULL,
  num.pathway = 10,
  return.gene.list = FALSE,
  ...
)
```

Example 5 (r):
```r
DEenrichRPlot(
  object,
  ident.1 = NULL,
  ident.2 = NULL,
  balanced = TRUE,
  logfc.threshold = 0.25,
  assay = NULL,
  max.genes,
  test.use = "wilcox",
  p.val.cutoff = 0.05,
  cols = NULL,
  enrich.database = NULL,
  num.pathway = 10,
  return.gene.list = FALSE,
  ...
)
```

---

## Read10x Probe Metadata — Read10X_probe_metadata • Seurat

**URL:** http://127.0.0.1:9173/reference_read10x_probe_metadata.html

**Contents:**
- Read10x Probe Metadata
- Arguments
- Value
- Contents

This function reads the probe metadata from a 10x Genomics probe barcode matrix file in HDF5 format.

The directory where the file is located.

The name of the file containing the raw probe barcode matrix in HDF5 format. The default filename is 'raw_probe_bc_matrix.h5'.

Returns a data.frame containing the probe metadata.

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/preprocessing.R
```

Example 2 (python):
```python
Read10X_probe_metadata.Rd
```

Example 3 (python):
```python
Read10X_probe_metadata(data.dir, filename = "raw_probe_bc_matrix.h5")
```

Example 4 (r):
```r
Read10X_probe_metadata(data.dir, filename = "raw_probe_bc_matrix.h5")
```

Example 5 (r):
```r
Read10X_probe_metadata(data.dir, filename = "raw_probe_bc_matrix.h5")
```

---

## Differential expression heatmap for mixscape — MixscapeHeatmap • Seurat

**URL:** http://127.0.0.1:9173/reference_mixscapeheatmap.html

**Contents:**
- Differential expression heatmap for mixscape
- Arguments
- Value
- Contents

Draws a heatmap of single cell feature expression with cells ordered by their mixscape ko probabilities.

Identity class to define markers for; pass an object of class phylo or 'clustertree' to find markers for a node in a cluster tree; passing 'clustertree' requires BuildClusterTree to have been run

A second identity class for comparison; if NULL, use all other cells for comparison; if an object of class phylo or 'clustertree' is passed to ident.1, must pass a node to find markers for

Plot an equal number of genes with both groups of cells.

Limit testing to genes which show, on average, at least X-fold difference (log-scale) between the two groups of cells. Default is 0.25. Increasing logfc.threshold speeds up the function, but can miss weaker signals.

Assay to use in differential expression testing

Total number of DE genes to plot.

Denotes which test to use. Available options are:

"wilcox" : Identifies differentially expressed genes between two groups of cells using a Wilcoxon Rank Sum test (default); will use a fast implementation by Presto if installed

"wilcox_limma" : Identifies differentially expressed genes between two groups of cells using the limma implementation of the Wilcoxon Rank Sum test; set this option to reproduce results from Seurat v4

"bimod" : Likelihood-ratio test for single cell gene expression, (McDavid et al., Bioinformatics, 2013)

"roc" : Identifies 'markers' of gene expression using ROC analysis. For each gene, evaluates (using AUC) a classifier built on that gene alone, to classify between two groups of cells. An AUC value of 1 means that expression values for this gene alone can perfectly classify the two groupings (i.e. Each of the cells in cells.1 exhibit a higher level than each of the cells in cells.2). An AUC value of 0 also means there is perfect classification, but in the other direction. A value of 0.5 implies that the gene has no predictive power to classify the two groups. Returns a 'predictive power' (abs(AUC-0.5) * 2) ranked matrix of putative differentially expressed genes.

"t" : Identify differentially expressed genes between two groups of cells using the Student's t-test.

"negbinom" : Identifies differentially expressed genes between two groups of cells using a negative binomial generalized linear model. Use only for UMI-based datasets

"poisson" : Identifies differentially expressed genes between two groups of cells using a poisson generalized linear model. Use only for UMI-based datasets

"LR" : Uses a logistic regression framework to determine differentially expressed genes. Constructs a logistic regression model predicting group membership based on each feature individually and compares this to a null model with a likelihood ratio test.

"MAST" : Identifies differentially expressed genes between two groups of cells using a hurdle model tailored to scRNA-seq data. Utilizes the MAST package to run the DE testing.

"DESeq2" : Identifies differentially expressed genes between two groups of cells based on a model using DESeq2 which uses a negative binomial distribution (Love et al, Genome Biology, 2014).This test does not support pre-filtering of genes based on average difference (or percent detection rate) between cell groups. However, genes may be pre-filtered based on their minimum detection rate (min.pct) across both cell groups. To use this method, please install DESeq2, using the instructions at https://bioconductor.org/packages/release/bioc/html/DESeq2.html

Number of cells per identity to plot.

Order cells on heatmap based on their mixscape knockout probability from highest to lowest score.

(Deprecated) Option to split densities based on mixscape classification. Please use mixscape.class instead

metadata column with mixscape classifications.

specify type of CRISPR perturbation expected for labeling mixscape classifications. Default is KO.

Name of the fold change, average difference, or custom function column in the output data.frame. Default is avg_log2FC

P-value cut-off for selection of significantly DE genes.

Arguments passed to other methods and to specific DE methods

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/mixscape.R
```

Example 2 (unknown):
```unknown
MixscapeHeatmap.Rd
```

Example 3 (python):
```python
MixscapeHeatmap(
  object,
  ident.1 = NULL,
  ident.2 = NULL,
  balanced = TRUE,
  logfc.threshold = 0.25,
  assay = "RNA",
  max.genes = 100,
  test.use = "wilcox",
  max.cells.group = NULL,
  order.by.prob = TRUE,
  group.by = NULL,
  mixscape.class = "mixscape_class",
  prtb.type = "KO",
  fc.name = "avg_log2FC",
  pval.cutoff = 0.05,
  ...
)
```

Example 4 (r):
```r
MixscapeHeatmap(
  object,
  ident.1 = NULL,
  ident.2 = NULL,
  balanced = TRUE,
  logfc.threshold = 0.25,
  assay = "RNA",
  max.genes = 100,
  test.use = "wilcox",
  max.cells.group = NULL,
  order.by.prob = TRUE,
  group.by = NULL,
  mixscape.class = "mixscape_class",
  prtb.type = "KO",
  fc.name = "avg_log2FC",
  pval.cutoff = 0.05,
  ...
)
```

Example 5 (r):
```r
MixscapeHeatmap(
  object,
  ident.1 = NULL,
  ident.2 = NULL,
  balanced = TRUE,
  logfc.threshold = 0.25,
  assay = "RNA",
  max.genes = 100,
  test.use = "wilcox",
  max.cells.group = NULL,
  order.by.prob = TRUE,
  group.by = NULL,
  mixscape.class = "mixscape_class",
  prtb.type = "KO",
  fc.name = "avg_log2FC",
  pval.cutoff = 0.05,
  ...
)
```

Example 6 (unknown):
```unknown
BuildClusterTree
```

---

## The SCTModel Class — SCTAssay-class • Seurat

**URL:** http://127.0.0.1:9173/seurat/reference/sctassay-class/index.html

**Contents:**
- The SCTModel Class
- Arguments
- Value
- Slots
- Get and set SCT model names
- Creating an SCTAssay from an Assay
- See also
- Examples
- Contents

The SCTModel object is a model and parameters storage from SCTransform. It can be used to calculate Pearson residuals for new genes.

The SCTAssay object contains all the information found in an Assay object, with extra information from the results of SCTransform

New levels, must be in the same order as the levels present

levels: SCT model names

levels<-: x with updated SCT model names

A data.frame with feature attributes in SCTransform

A data.frame with cell attributes in SCTransform

A list of two numeric of length two specifying the min and max values the Pearson residual will be clipped to. One for vst and one for SCTransform

Name of the assay of the seurat object containing UMI matrix and the default is RNA

A formula used in SCTransform

other information used in SCTransform

Median UMI (or scale factor) used to calculate corrected counts

A list containing SCT models

SCT results are named by initial run of SCTransform in order to keep SCT parameters straight between runs. When working with merged SCTAssay objects, these model names are important. levels allows querying the models present. levels<- allows the changing of the names of the models present, useful when merging SCTAssay objects. Note: unlike normal levels<-, levels<-.SCTAssay allows complete changing of model names, not reordering.

Conversion from an Assay object to an SCTAssay object by is done by adding the additional slots to the object. If from has results generated by SCTransform from Seurat v3.0.0 to v3.1.1, the conversion will automagically fill the new slots with the data

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/objects.R
```

Example 2 (unknown):
```unknown
SCTAssay-class.Rd
```

Example 3 (unknown):
```unknown
SCTransform
```

Example 4 (python):
```python
# S3 method for class 'SCTAssay'
levels(x)

# S3 method for class 'SCTAssay'
levels(x) <- value
```

Example 5 (r):
```r
# S3 method for class 'SCTAssay'
levels(x)

# S3 method for class 'SCTAssay'
levels(x) <- value
```

Example 6 (r):
```r
# S3 method for class 'SCTAssay'
levels(x)

# S3 method for class 'SCTAssay'
levels(x) <- value
```

Example 7 (unknown):
```unknown
feature.attributes
```

Example 8 (unknown):
```unknown
cell.attributes
```

Example 9 (unknown):
```unknown
SCTModel.list
```

Example 10 (unknown):
```unknown
SCTransform
```

Example 11 (unknown):
```unknown
levels<-.SCTAssay
```

Example 12 (unknown):
```unknown
SCTransform
```

Example 13 (python):
```python
if (FALSE) { # \dontrun{
# SCTAssay objects are generated from SCTransform
pbmc_small <- SCTransform(pbmc_small)
} # }

if (FALSE) { # \dontrun{
# SCTAssay objects are generated from SCTransform
pbmc_small <- SCTransform(pbmc_small)
pbmc_small[["SCT"]]
} # }

if (FALSE) { # \dontrun{
# Query and change SCT model names
levels(pbmc_small[['SCT']])
levels(pbmc_small[['SCT']]) <- '3'
levels(pbmc_small[['SCT']])
} # }
```

Example 14 (r):
```r
if (FALSE) { # \dontrun{
# SCTAssay objects are generated from SCTransform
pbmc_small <- SCTransform(pbmc_small)
} # }

if (FALSE) { # \dontrun{
# SCTAssay objects are generated from SCTransform
pbmc_small <- SCTransform(pbmc_small)
pbmc_small[["SCT"]]
} # }

if (FALSE) { # \dontrun{
# Query and change SCT model names
levels(pbmc_small[['SCT']])
levels(pbmc_small[['SCT']]) <- '3'
levels(pbmc_small[['SCT']])
} # }
```

Example 15 (r):
```r
if (FALSE) { # \dontrun{
# SCTAssay objects are generated from SCTransform
pbmc_small <- SCTransform(pbmc_small)
} # }

if (FALSE) { # \dontrun{
# SCTAssay objects are generated from SCTransform
pbmc_small <- SCTransform(pbmc_small)
pbmc_small[["SCT"]]
} # }

if (FALSE) { # \dontrun{
# Query and change SCT model names
levels(pbmc_small[['SCT']])
levels(pbmc_small[['SCT']]) <- '3'
levels(pbmc_small[['SCT']])
} # }
```

---

## The STARmap class — STARmap-class • Seurat

**URL:** http://127.0.0.1:9173/reference_starmap-class.html

**Contents:**
- The STARmap class
- Slots
- Contents

Name of assay to associate image data with; will give this image priority for visualization when the assay is set as the active/default assay in a Seurat object

A one-length character vector with the object's key; keys must be one or more alphanumeric characters followed by an underscore “_” (regex pattern “^[a-zA-Z][a-zA-Z0-9]*_$”)

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/objects.R
```

Example 2 (unknown):
```unknown
STARmap-class.Rd
```

Example 3 (unknown):
```unknown
^[a-zA-Z][a-zA-Z0-9]*_$
```

---

## Convert objects to SingleCellExperiment objects — as.SingleCellExperiment • Seurat

**URL:** http://127.0.0.1:9173/reference_as.singlecellexperiment.html

**Contents:**
- Convert objects to SingleCellExperiment objects
- Arguments
- Contents

Convert objects to SingleCellExperiment objects

An object to convert to class SingleCellExperiment

Arguments passed to other methods

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/generics.R
```

Example 2 (unknown):
```unknown
R/objects.R
```

Example 3 (unknown):
```unknown
as.SingleCellExperiment.Rd
```

Example 4 (python):
```python
as.SingleCellExperiment(x, ...)

# S3 method for class 'Seurat'
as.SingleCellExperiment(x, assay = NULL, ...)
```

Example 5 (r):
```r
as.SingleCellExperiment(x, ...)

# S3 method for class 'Seurat'
as.SingleCellExperiment(x, assay = NULL, ...)
```

Example 6 (r):
```r
as.SingleCellExperiment(x, ...)

# S3 method for class 'Seurat'
as.SingleCellExperiment(x, assay = NULL, ...)
```

Example 7 (unknown):
```unknown
SingleCellExperiment
```

---

## Calculate the percentage of all counts that belong to a given set of features — PercentageFeatureSet • Seurat

**URL:** http://127.0.0.1:9173/seurat/reference/percentagefeatureset/index.html

**Contents:**
- Calculate the percentage of all counts that belong to a given set of features
- Arguments
- Value
- Examples
- Contents

This function enables you to easily calculate the percentage of all the counts belonging to a subset of the possible features for each cell. This is useful when trying to compute the percentage of transcripts that map to mitochondrial genes for example. The calculation here is simply the column sum of the matrix present in the counts slot for features belonging to the set divided by the column sum for all features times 100.

A regex pattern to match features against

A defined feature set. If features provided, will ignore the pattern matching

Name in meta.data column to assign. If this is not null, returns a Seurat object with the proportion of the feature set stored in metadata.

Returns a vector with the proportion of the feature set or if md.name is set, returns a Seurat object with the proportion of the feature set stored in metadata.

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/utilities.R
```

Example 2 (unknown):
```unknown
PercentageFeatureSet.Rd
```

Example 3 (unknown):
```unknown
PercentageFeatureSet(
  object,
  pattern = NULL,
  features = NULL,
  col.name = NULL,
  assay = NULL
)
```

Example 4 (r):
```r
PercentageFeatureSet(
  object,
  pattern = NULL,
  features = NULL,
  col.name = NULL,
  assay = NULL
)
```

Example 5 (r):
```r
PercentageFeatureSet(
  object,
  pattern = NULL,
  features = NULL,
  col.name = NULL,
  assay = NULL
)
```

Example 6 (unknown):
```unknown
data("pbmc_small")
# Calculate the proportion of transcripts mapping to mitochondrial genes
# NOTE: The pattern provided works for human gene names. You may need to adjust depending on your
# system of interest
pbmc_small[["percent.mt"]] <- PercentageFeatureSet(object = pbmc_small, pattern = "^MT-")
```

Example 7 (r):
```r
data("pbmc_small")
# Calculate the proportion of transcripts mapping to mitochondrial genes
# NOTE: The pattern provided works for human gene names. You may need to adjust depending on your
# system of interest
pbmc_small[["percent.mt"]] <- PercentageFeatureSet(object = pbmc_small, pattern = "^MT-")
```

Example 8 (r):
```r
data("pbmc_small")
# Calculate the proportion of transcripts mapping to mitochondrial genes
# NOTE: The pattern provided works for human gene names. You may need to adjust depending on your
# system of interest
pbmc_small[["percent.mt"]] <- PercentageFeatureSet(object = pbmc_small, pattern = "^MT-")
```

---

## Run t-distributed Stochastic Neighbor Embedding — RunTSNE • Seurat

**URL:** http://127.0.0.1:9173/reference_runtsne.html

**Contents:**
- Run t-distributed Stochastic Neighbor Embedding
- Arguments
- Contents

Run t-SNE dimensionality reduction on selected features. Has the option of running in a reduced dimensional space (i.e. spectral tSNE, recommended), or running based on a set of genes. For details about stored TSNE calculation parameters, see PrintTSNEParams.

Arguments passed to other methods and to t-SNE call (most commonly used is perplexity)

Name of assay that that t-SNE is being run on

Random seed for the t-SNE. If NULL, does not set the seed

Select the method to use to compute the tSNE. Available methods are:

“Rtsne”: Use the Rtsne package Barnes-Hut implementation of tSNE (default)

“FIt-SNE”: Use the FFT-accelerated Interpolation-based t-SNE. Based on Kluger Lab code found here: https://github.com/KlugerLab/FIt-SNE

The dimensional space of the resulting tSNE embedding (default is 2). For example, set to 3 for a 3d tSNE

dimensional reduction key, specifies the string before the number for the dimension names. “tSNE_” by default

Which cells to analyze (default, all cells)

Which dimensions to use as input features

Which dimensional reduction (e.g. PCA, ICA) to use for the tSNE. Default is PCA

If set, run the tSNE on this subset of features (instead of running on a set of reduced dimensions). Not set (NULL) by default; dims must be NULL to run on features

If set, runs tSNE on the given distance matrix instead of data matrix (experimental)

dimensional reduction name, specifies the position in the object$dr list. tsne by default

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/generics.R
```

Example 2 (unknown):
```unknown
R/dimensional_reduction.R
```

Example 3 (unknown):
```unknown
PrintTSNEParams
```

Example 4 (python):
```python
RunTSNE(object, ...)

# S3 method for class 'matrix'
RunTSNE(
  object,
  assay = NULL,
  seed.use = 1,
  tsne.method = "Rtsne",
  dim.embed = 2,
  reduction.key = "tSNE_",
  ...
)

# S3 method for class 'DimReduc'
RunTSNE(
  object,
  cells = NULL,
  dims = 1:5,
  seed.use = 1,
  tsne.method = "Rtsne",
  dim.embed = 2,
  reduction.key = "tSNE_",
  ...
)

# S3 method for class 'dist'
RunTSNE(
  object,
  assay = NULL,
  seed.use = 1,
  tsne.method = "Rtsne",
  dim.embed = 2,
  reduction.key = "tSNE_",
  ...
)

# S3 method for class 'Seurat'
RunTSNE(
  object,
  reduction = "pca",
  cells = NULL,
  dims = 1:5,
  features = NULL,
  seed.use = 1,
  tsne.method = "Rtsne",
  dim.embed = 2,
  distance.matrix = NULL,
  reduction.name = "tsne",
  reduction.key = "tSNE_",
  ...
)
```

Example 5 (r):
```r
RunTSNE(object, ...)

# S3 method for class 'matrix'
RunTSNE(
  object,
  assay = NULL,
  seed.use = 1,
  tsne.method = "Rtsne",
  dim.embed = 2,
  reduction.key = "tSNE_",
  ...
)

# S3 method for class 'DimReduc'
RunTSNE(
  object,
  cells = NULL,
  dims = 1:5,
  seed.use = 1,
  tsne.method = "Rtsne",
  dim.embed = 2,
  reduction.key = "tSNE_",
  ...
)

# S3 method for class 'dist'
RunTSNE(
  object,
  assay = NULL,
  seed.use = 1,
  tsne.method = "Rtsne",
  dim.embed = 2,
  reduction.key = "tSNE_",
  ...
)

# S3 method for class 'Seurat'
RunTSNE(
  object,
  reduction = "pca",
  cells = NULL,
  dims = 1:5,
  features = NULL,
  seed.use = 1,
  tsne.method = "Rtsne",
  dim.embed = 2,
  distance.matrix = NULL,
  reduction.name = "tsne",
  reduction.key = "tSNE_",
  ...
)
```

Example 6 (r):
```r
RunTSNE(object, ...)

# S3 method for class 'matrix'
RunTSNE(
  object,
  assay = NULL,
  seed.use = 1,
  tsne.method = "Rtsne",
  dim.embed = 2,
  reduction.key = "tSNE_",
  ...
)

# S3 method for class 'DimReduc'
RunTSNE(
  object,
  cells = NULL,
  dims = 1:5,
  seed.use = 1,
  tsne.method = "Rtsne",
  dim.embed = 2,
  reduction.key = "tSNE_",
  ...
)

# S3 method for class 'dist'
RunTSNE(
  object,
  assay = NULL,
  seed.use = 1,
  tsne.method = "Rtsne",
  dim.embed = 2,
  reduction.key = "tSNE_",
  ...
)

# S3 method for class 'Seurat'
RunTSNE(
  object,
  reduction = "pca",
  cells = NULL,
  dims = 1:5,
  features = NULL,
  seed.use = 1,
  tsne.method = "Rtsne",
  dim.embed = 2,
  distance.matrix = NULL,
  reduction.name = "tsne",
  reduction.key = "tSNE_",
  ...
)
```

---

## Get image scale factors — ScaleFactors • Seurat

**URL:** http://127.0.0.1:9173/reference_scalefactors.html

**Contents:**
- Get image scale factors
- Arguments
- Value
- Note
- Contents

Get image scale factors

An object to get scale factors from

Arguments passed to other methods

Spot full resolution scale factor

Fiducial full resolution scale factor

High resolutoin scale factor

Low resolution scale factor

An object of class scalefactors

scalefactors objects can be created with scalefactors()

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/generics.R
```

Example 2 (unknown):
```unknown
R/objects.R
```

Example 3 (unknown):
```unknown
ScaleFactors.Rd
```

Example 4 (python):
```python
ScaleFactors(object, ...)

scalefactors(spot, fiducial, hires, lowres)

# S3 method for class 'VisiumV1'
ScaleFactors(object, ...)

# S3 method for class 'VisiumV2'
ScaleFactors(object, ...)
```

Example 5 (r):
```r
ScaleFactors(object, ...)

scalefactors(spot, fiducial, hires, lowres)

# S3 method for class 'VisiumV1'
ScaleFactors(object, ...)

# S3 method for class 'VisiumV2'
ScaleFactors(object, ...)
```

Example 6 (r):
```r
ScaleFactors(object, ...)

scalefactors(spot, fiducial, hires, lowres)

# S3 method for class 'VisiumV1'
ScaleFactors(object, ...)

# S3 method for class 'VisiumV2'
ScaleFactors(object, ...)
```

Example 7 (unknown):
```unknown
scalefactors
```

Example 8 (unknown):
```unknown
scalefactors
```

Example 9 (unknown):
```unknown
scalefactors()
```

---

## Seurat: Tools for Single Cell Genomics — Seurat-package • Seurat

**URL:** http://127.0.0.1:9173/seurat/reference/seurat-package/index.html

**Contents:**
- Seurat: Tools for Single Cell Genomics
- Package options
- See also
- Author
- Contents

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.

Seurat uses the following [options()] to configure behaviour:

global option to call gc() after many operations. This can be helpful in cleaning up the memory status of the R session and prevent use of swap space. However, it does add to the computational overhead and setting to FALSE can speed things up if you're working in an environment where RAM availability is not a concern.

Show warning about the default backend for RunUMAP changing from Python UMAP via reticulate to UWOT

For functions that have ... as a parameter, this controls the behavior when an item isn't used. Can be one of warn, stop, or silent.

Show message about more efficient Wilcoxon Rank Sum test available via the limma package

Show message about more efficient Moran's I function available via the Rfast2 package

Show message about changes to default behavior of split/multi violin plots

https://satijalab.org/seurat

https://github.com/satijalab/seurat

Report bugs at https://github.com/satijalab/seurat/issues

Maintainer: Rahul Satija seurat@nygenome.org (ORCID)

Andrew Butler abutler@nygenome.org (ORCID) [contributor]

Saket Choudhary schoudhary@nygenome.org (ORCID) [contributor]

David Collins dcollins@nygenome.org (ORCID) [contributor]

Charlotte Darby cdarby@nygenome.org (ORCID) [contributor]

Jeff Farrell jfarrell@g.harvard.edu [contributor]

Isabella Grabski igrabski@nygenome.org (ORCID) [contributor]

Christoph Hafemeister chafemeister@nygenome.org (ORCID) [contributor]

Yuhan Hao yhao@nygenome.org (ORCID) [contributor]

Austin Hartman ahartman@nygenome.org (ORCID) [contributor]

Paul Hoffman hoff0792@umn.edu (ORCID) [contributor]

Jaison Jain jjain@nygenome.org (ORCID) [contributor]

Longda Jiang ljiang@nygenome.org (ORCID) [contributor]

Madeline Kowalski mkowalski@nygenome.org (ORCID) [contributor]

Skylar Li sli@nygenome.org [contributor]

Gesmira Molla gmolla@nygenome.org (ORCID) [contributor]

Efthymia Papalexi epapalexi@nygenome.org (ORCID) [contributor]

Patrick Roelli proelli@nygenome.org [contributor]

Karthik Shekhar kshekhar@berkeley.edu [contributor]

Avi Srivastava asrivastava@nygenome.org (ORCID) [contributor]

Tim Stuart tstuart@nygenome.org (ORCID) [contributor]

Kristof Torkenczy (ORCID) [contributor]

Shiwei Zheng szheng@nygenome.org (ORCID) [contributor]

Satija Lab and Collaborators [funder]

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
Seurat-package.Rd
```

Example 2 (unknown):
```unknown
Seurat.memsafe
```

Example 3 (unknown):
```unknown
Seurat.warn.umap.uwot
```

Example 4 (unknown):
```unknown
Seurat.checkdots
```

Example 5 (unknown):
```unknown
Seurat.limma.wilcox.msg
```

Example 6 (unknown):
```unknown
Seurat.Rfast2.msg
```

Example 7 (unknown):
```unknown
Seurat.warn.vlnplot.split
```

---

## Hover Locator — HoverLocator • Seurat

**URL:** http://127.0.0.1:9173/seurat/reference/hoverlocator/index.html

**Contents:**
- Hover Locator
- Arguments
- See also
- Examples
- Contents

Get quick information from a scatterplot by hovering over points

An optional dataframe or matrix of extra information to be displayed on hover

Display or hide x- and y-axes

Plot using a dark theme?

Extra parameters to be passed to layout

layout ggplot_build DimPlot FeaturePlot

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/visualization.R
```

Example 2 (unknown):
```unknown
HoverLocator.Rd
```

Example 3 (unknown):
```unknown
HoverLocator(plot, information = NULL, axes = TRUE, dark.theme = FALSE, ...)
```

Example 4 (r):
```r
HoverLocator(plot, information = NULL, axes = TRUE, dark.theme = FALSE, ...)
```

Example 5 (r):
```r
HoverLocator(plot, information = NULL, axes = TRUE, dark.theme = FALSE, ...)
```

Example 6 (unknown):
```unknown
ggplot_build
```

Example 7 (unknown):
```unknown
FeaturePlot
```

Example 8 (unknown):
```unknown
if (FALSE) { # \dontrun{
data("pbmc_small")
plot <- DimPlot(object = pbmc_small)
HoverLocator(plot = plot, information = FetchData(object = pbmc_small, vars = 'percent.mito'))
} # }
```

Example 9 (r):
```r
if (FALSE) { # \dontrun{
data("pbmc_small")
plot <- DimPlot(object = pbmc_small)
HoverLocator(plot = plot, information = FetchData(object = pbmc_small, vars = 'percent.mito'))
} # }
```

Example 10 (r):
```r
if (FALSE) { # \dontrun{
data("pbmc_small")
plot <- DimPlot(object = pbmc_small)
HoverLocator(plot = plot, information = FetchData(object = pbmc_small, vars = 'percent.mito'))
} # }
```

---

## Leverage Score Calculation — LeverageScore • Seurat

**URL:** http://127.0.0.1:9173/reference_leveragescore.html

**Contents:**
- Leverage Score Calculation
- Arguments
- References
- Contents

This function computes the leverage scores for a given object It uses the concept of sketching and random projections. The function provides an approximation to the leverage scores using a scalable method suitable for large matrices.

Arguments passed to other methods

A positive integer. The number of sketches to be used in the approximation. Default is 5000.

A positive integer or NULL. The number of dimensions to use. If NULL, the number of dimensions will default to the number of columns in the object.

The sketching method to use, defaults to CountSketch.

A numeric. The error tolerance for the approximation in Johnson–Lindenstrauss embeddings, defaults to 0.5.

A positive integer. The seed for the random number generator, defaults to 123.

Print progress and diagnostic messages

VariableFeatures method

A vector of feature names to use for calculating leverage score.

name of slot to store leverage scores

whether to overwrite slot that currently stores leverage scores. Defaults to FALSE, in which case the 'var.name' is modified if it already exists in the object

Clarkson, K. L. & Woodruff, D. P. Low-rank approximation and regression in input sparsity time. JACM 63, 1–45 (2017). https://dl.acm.org/doi/10.1145/3019134;

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/generics.R
```

Example 2 (unknown):
```unknown
R/sketching.R
```

Example 3 (unknown):
```unknown
LeverageScore.Rd
```

Example 4 (python):
```python
LeverageScore(object, ...)

# Default S3 method
LeverageScore(
  object,
  nsketch = 5000L,
  ndims = NULL,
  method = CountSketch,
  eps = 0.5,
  seed = 123L,
  verbose = TRUE,
  ...
)

# S3 method for class 'StdAssay'
LeverageScore(
  object,
  nsketch = 5000L,
  ndims = NULL,
  method = CountSketch,
  vf.method = NULL,
  layer = "data",
  eps = 0.5,
  seed = 123L,
  verbose = TRUE,
  features = NULL,
  ...
)

# S3 method for class 'Assay'
LeverageScore(
  object,
  nsketch = 5000L,
  ndims = NULL,
  method = CountSketch,
  vf.method = NULL,
  layer = "data",
  eps = 0.5,
  seed = 123L,
  verbose = TRUE,
  features = NULL,
  ...
)

# S3 method for class 'Seurat'
LeverageScore(
  object,
  assay = NULL,
  nsketch = 5000L,
  ndims = NULL,
  var.name = "leverage.score",
  over.write = FALSE,
  method = CountSketch,
  vf.method = NULL,
  layer = "data",
  eps = 0.5,
  seed = 123L,
  verbose = TRUE,
  features = NULL,
  ...
)
```

Example 5 (r):
```r
LeverageScore(object, ...)

# Default S3 method
LeverageScore(
  object,
  nsketch = 5000L,
  ndims = NULL,
  method = CountSketch,
  eps = 0.5,
  seed = 123L,
  verbose = TRUE,
  ...
)

# S3 method for class 'StdAssay'
LeverageScore(
  object,
  nsketch = 5000L,
  ndims = NULL,
  method = CountSketch,
  vf.method = NULL,
  layer = "data",
  eps = 0.5,
  seed = 123L,
  verbose = TRUE,
  features = NULL,
  ...
)

# S3 method for class 'Assay'
LeverageScore(
  object,
  nsketch = 5000L,
  ndims = NULL,
  method = CountSketch,
  vf.method = NULL,
  layer = "data",
  eps = 0.5,
  seed = 123L,
  verbose = TRUE,
  features = NULL,
  ...
)

# S3 method for class 'Seurat'
LeverageScore(
  object,
  assay = NULL,
  nsketch = 5000L,
  ndims = NULL,
  var.name = "leverage.score",
  over.write = FALSE,
  method = CountSketch,
  vf.method = NULL,
  layer = "data",
  eps = 0.5,
  seed = 123L,
  verbose = TRUE,
  features = NULL,
  ...
)
```

Example 6 (r):
```r
LeverageScore(object, ...)

# Default S3 method
LeverageScore(
  object,
  nsketch = 5000L,
  ndims = NULL,
  method = CountSketch,
  eps = 0.5,
  seed = 123L,
  verbose = TRUE,
  ...
)

# S3 method for class 'StdAssay'
LeverageScore(
  object,
  nsketch = 5000L,
  ndims = NULL,
  method = CountSketch,
  vf.method = NULL,
  layer = "data",
  eps = 0.5,
  seed = 123L,
  verbose = TRUE,
  features = NULL,
  ...
)

# S3 method for class 'Assay'
LeverageScore(
  object,
  nsketch = 5000L,
  ndims = NULL,
  method = CountSketch,
  vf.method = NULL,
  layer = "data",
  eps = 0.5,
  seed = 123L,
  verbose = TRUE,
  features = NULL,
  ...
)

# S3 method for class 'Seurat'
LeverageScore(
  object,
  assay = NULL,
  nsketch = 5000L,
  ndims = NULL,
  var.name = "leverage.score",
  over.write = FALSE,
  method = CountSketch,
  vf.method = NULL,
  layer = "data",
  eps = 0.5,
  seed = 123L,
  verbose = TRUE,
  features = NULL,
  ...
)
```

---

## Map query cells to a reference — MapQuery • Seurat

**URL:** http://127.0.0.1:9173/seurat/reference/mapquery/index.html

**Contents:**
- Map query cells to a reference
- Arguments
- Value
- Contents

This is a convenience wrapper function around the following three functions that are often run together when mapping query data to a reference: TransferData, IntegrateEmbeddings, ProjectUMAP. Note that by default, the weight.reduction parameter for all functions will be set to the dimension reduction method used in the FindTransferAnchors function call used to construct the anchor object, and the dims parameter will be the same dimensions used to find anchors.

Query object used in anchorset construction

Reference object used in anchorset construction

Data to transfer. This can be specified in one of two ways:

The reference data itself as either a vector where the names correspond to the reference cells, or a matrix, where the column names correspond to the reference cells.

The name of the metadata field or assay from the reference object provided. This requires the reference parameter to be specified. If pulling assay data in this manner, it will pull the data from the data slot. To transfer data from other slots, please pull the data explicitly with GetAssayData and provide that matrix here.

Name for new integrated dimensional reduction.

Name of reduction to use from the reference for neighbor finding

Dimensions (columns) to use from reference

Dimensions (columns) to use from query

Determine if the weight and anchor matrices are stored.

DimReduc object that contains the umap model

A named list of additional arguments to TransferData

A named list of additional arguments to IntegrateEmbeddings

A named list of additional arguments to ProjectUMAP

Print progress bars and output

Returns a modified query Seurat object containing:#'

New Assays corresponding to the features transferred and/or their corresponding prediction scores from TransferData

An integrated reduction from IntegrateEmbeddings

A projected UMAP reduction of the query cells projected into the reference UMAP using ProjectUMAP

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/integration.R
```

Example 2 (unknown):
```unknown
MapQuery.Rd
```

Example 3 (unknown):
```unknown
TransferData
```

Example 4 (unknown):
```unknown
IntegrateEmbeddings
```

Example 5 (unknown):
```unknown
ProjectUMAP
```

Example 6 (unknown):
```unknown
weight.reduction
```

Example 7 (unknown):
```unknown
FindTransferAnchors
```

Example 8 (unknown):
```unknown
MapQuery(
  anchorset,
  query,
  reference,
  refdata = NULL,
  new.reduction.name = NULL,
  reference.reduction = NULL,
  reference.dims = NULL,
  query.dims = NULL,
  store.weights = FALSE,
  reduction.model = NULL,
  transferdata.args = list(),
  integrateembeddings.args = list(),
  projectumap.args = list(),
  verbose = TRUE
)
```

Example 9 (r):
```r
MapQuery(
  anchorset,
  query,
  reference,
  refdata = NULL,
  new.reduction.name = NULL,
  reference.reduction = NULL,
  reference.dims = NULL,
  query.dims = NULL,
  store.weights = FALSE,
  reduction.model = NULL,
  transferdata.args = list(),
  integrateembeddings.args = list(),
  projectumap.args = list(),
  verbose = TRUE
)
```

Example 10 (r):
```r
MapQuery(
  anchorset,
  query,
  reference,
  refdata = NULL,
  new.reduction.name = NULL,
  reference.reduction = NULL,
  reference.dims = NULL,
  query.dims = NULL,
  store.weights = FALSE,
  reduction.model = NULL,
  transferdata.args = list(),
  integrateembeddings.args = list(),
  projectumap.args = list(),
  verbose = TRUE
)
```

Example 11 (unknown):
```unknown
GetAssayData
```

Example 12 (unknown):
```unknown
TransferData
```

Example 13 (unknown):
```unknown
IntegrateEmbeddings
```

Example 14 (unknown):
```unknown
ProjectUMAP
```

Example 15 (unknown):
```unknown
TransferData
```

Example 16 (unknown):
```unknown
IntegrateEmbeddings
```

Example 17 (unknown):
```unknown
ProjectUMAP
```

---

## Hashtag oligo heatmap — HTOHeatmap • Seurat

**URL:** http://127.0.0.1:9173/reference_htoheatmap.html

**Contents:**
- Hashtag oligo heatmap
- Arguments
- Value
- See also
- Examples
- Contents

Draws a heatmap of hashtag oligo signals across singlets/doublets/negative cells. Allows for the visualization of HTO demultiplexing results.

Seurat object. Assumes that the hash tag oligo (HTO) data has been added and normalized, and demultiplexing has been run with HTODemux().

The naming for metadata column with classification result from HTODemux().

The slot for metadata column specifying a cell as singlet/doublet/negative.

Number of cells to plot. Default is to choose 5000 cells by random subsampling, to avoid having to draw exceptionally large heatmaps.

Namings for the singlets. Default is to use the same names as HTOs.

If true, plot with geom_raster, else use geom_tile. geom_raster may look blurry on some viewing applications such as Preview due to how the raster is interpolated. Set this to FALSE if you are encountering that issue (note that plots may take longer to produce/render).

Returns a ggplot2 plot object.

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/visualization.R
```

Example 2 (unknown):
```unknown
HTOHeatmap.Rd
```

Example 3 (unknown):
```unknown
HTOHeatmap(
  object,
  assay = "HTO",
  classification = paste0(assay, "_classification"),
  global.classification = paste0(assay, "_classification.global"),
  ncells = 5000,
  singlet.names = NULL,
  raster = TRUE
)
```

Example 4 (r):
```r
HTOHeatmap(
  object,
  assay = "HTO",
  classification = paste0(assay, "_classification"),
  global.classification = paste0(assay, "_classification.global"),
  ncells = 5000,
  singlet.names = NULL,
  raster = TRUE
)
```

Example 5 (r):
```r
HTOHeatmap(
  object,
  assay = "HTO",
  classification = paste0(assay, "_classification"),
  global.classification = paste0(assay, "_classification.global"),
  ncells = 5000,
  singlet.names = NULL,
  raster = TRUE
)
```

Example 6 (unknown):
```unknown
if (FALSE) { # \dontrun{
object <- HTODemux(object)
HTOHeatmap(object)
} # }
```

Example 7 (r):
```r
if (FALSE) { # \dontrun{
object <- HTODemux(object)
HTOHeatmap(object)
} # }
```

Example 8 (r):
```r
if (FALSE) { # \dontrun{
object <- HTODemux(object)
HTOHeatmap(object)
} # }
```

---

## Perform integration on the joint PCA cell embeddings. — FastRPCAIntegration • Seurat

**URL:** http://127.0.0.1:9173/reference_fastrpcaintegration.html

**Contents:**
- Perform integration on the joint PCA cell embeddings.
- Arguments
- Value
- Contents

This is a convenience wrapper function around the following three functions that are often run together when perform integration. FindIntegrationAnchors, RunPCA, IntegrateEmbeddings.

A list of Seurat objects between which to find anchors for downstream integration.

A vector specifying the object/s to be used as a reference during integration. If NULL (default), all pairwise anchors are found (no reference/s). If not NULL, the corresponding objects in object.list will be used as references. When using a set of specified references, anchors are first found between each query and each reference. The references are then integrated through pairwise integration. Each query is then mapped to the integrated reference.

A numeric value. This will call SelectIntegrationFeatures to select the provided number of features to be used in anchor finding

A vector of features to be used as input to the anchor finding process

How many neighbors (k) to use when picking anchors

Which dimensions to use from the CCA to specify the neighbor search space

Whether or not to scale the features provided. Only set to FALSE if you have previously scaled the features you want to use for each object in the object.list

Name of normalization method used: LogNormalize or SCT

Name of integrated dimensional reduction

Total Number of PCs to compute and store (50 by default)

A named list of additional arguments to FindIntegrationAnchors

Print messages and progress

Returns a Seurat object with integrated dimensional reduction

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/integration.R
```

Example 2 (unknown):
```unknown
FastRPCAIntegration.Rd
```

Example 3 (unknown):
```unknown
FindIntegrationAnchors
```

Example 4 (unknown):
```unknown
IntegrateEmbeddings
```

Example 5 (unknown):
```unknown
FastRPCAIntegration(
  object.list,
  reference = NULL,
  anchor.features = 2000,
  k.anchor = 20,
  dims = 1:30,
  scale = TRUE,
  normalization.method = c("LogNormalize", "SCT"),
  new.reduction.name = "integrated_dr",
  npcs = 50,
  findintegrationanchors.args = list(),
  verbose = TRUE
)
```

Example 6 (r):
```r
FastRPCAIntegration(
  object.list,
  reference = NULL,
  anchor.features = 2000,
  k.anchor = 20,
  dims = 1:30,
  scale = TRUE,
  normalization.method = c("LogNormalize", "SCT"),
  new.reduction.name = "integrated_dr",
  npcs = 50,
  findintegrationanchors.args = list(),
  verbose = TRUE
)
```

Example 7 (r):
```r
FastRPCAIntegration(
  object.list,
  reference = NULL,
  anchor.features = 2000,
  k.anchor = 20,
  dims = 1:30,
  scale = TRUE,
  normalization.method = c("LogNormalize", "SCT"),
  new.reduction.name = "integrated_dr",
  npcs = 50,
  findintegrationanchors.args = list(),
  verbose = TRUE
)
```

Example 8 (unknown):
```unknown
object.list
```

Example 9 (unknown):
```unknown
SelectIntegrationFeatures
```

Example 10 (unknown):
```unknown
FindIntegrationAnchors
```

---

## Perform sctransform-based normalization — SCTransform • Seurat

**URL:** http://127.0.0.1:9173/seurat/reference/sctransform/index.html

**Contents:**
- Perform sctransform-based normalization
- Arguments
- Value
- See also
- Contents

This function calls sctransform::vst. The sctransform package is available at https://github.com/satijalab/sctransform. Use this function as an alternative to the NormalizeData, FindVariableFeatures, ScaleData workflow. Results are saved in a new assay (named SCT by default) with counts being (corrected) counts, data being log1p(counts), scale.data being pearson residuals; sctransform::vst intermediate results are saved in misc slot of new assay.

Additional parameters passed to sctransform::vst

A metadata with cell attributes

If not NULL, compute residuals for the object using the provided SCT model; supports only log_umi as the latent variable. If residual.features are not specified, compute for the top variable.features.n specified in the model which are also present in the object. If residual.features are specified, the variable features of the resulting SCT assay are set to the top variable.features.n in the model.

Place corrected UMI matrix in assay counts slot; default is TRUE

Number of subsampling cells used to build NB regression; default is 5000

Genes to calculate residual features for; default is NULL (all genes). If specified, will be set to VariableFeatures of the returned object.

Use this many features as variable features after ranking by residual variance; default is 3000. Only applied if residual.features is not set.

Instead of setting a fixed number of variable features, use this residual variance cutoff; this is only used when variable.features.n is set to NULL; default is 1.3. Only applied if residual.features is not set.

Variables to regress out in a second non-regularized linear

Extra data to regress out, should be cells x latent data regression. For example, percent.mito. Default is NULL

Whether to scale residuals to have unit variance; default is FALSE

Whether to center residuals to have mean zero; default is TRUE

Range to clip the residuals to; default is c(-sqrt(n/30), sqrt(n/30)), where n is the number of cells

When set to 'v2' sets method = glmGamPoi_offset, n_cells=2000, and exclude_poisson = TRUE which causes the model to learn theta and intercept only besides excluding poisson genes from learning and regularization

If set to TRUE the residual matrix for all genes is never created in full; useful for large data sets, but will take longer to run; this will also set return.only.var.genes to TRUE; default is FALSE

If set to TRUE the scale.data matrices in output assay are subset to contain only the variable genes; default is TRUE

Set a random seed. By default, sets the seed to 1448145. Setting NULL will not set a seed.

Whether to print messages and progress bars

Name of assay to pull the count data from; default is 'RNA'

Name for the new assay containing the normalized data; default is 'SCT'

Returns a Seurat object with a new assay (named SCT by default) with counts being (corrected) counts, data being log1p(counts), scale.data being pearson residuals; sctransform::vst intermediate results are saved in misc slot of the new assay.

correct_counts get_residuals

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/generics.R
```

Example 2 (unknown):
```unknown
R/preprocessing.R
```

Example 3 (unknown):
```unknown
R/preprocessing5.R
```

Example 4 (unknown):
```unknown
SCTransform.Rd
```

Example 5 (python):
```python
SCTransform(object, ...)

# Default S3 method
SCTransform(
  object,
  cell.attr,
  reference.SCT.model = NULL,
  do.correct.umi = TRUE,
  ncells = 5000,
  residual.features = NULL,
  variable.features.n = 3000,
  variable.features.rv.th = 1.3,
  vars.to.regress = NULL,
  latent.data = NULL,
  do.scale = FALSE,
  do.center = TRUE,
  clip.range = c(-sqrt(x = ncol(x = umi)/30), sqrt(x = ncol(x = umi)/30)),
  vst.flavor = "v2",
  conserve.memory = FALSE,
  return.only.var.genes = TRUE,
  seed.use = 1448145,
  verbose = TRUE,
  ...
)

# S3 method for class 'Assay'
SCTransform(
  object,
  cell.attr,
  reference.SCT.model = NULL,
  do.correct.umi = TRUE,
  ncells = 5000,
  residual.features = NULL,
  variable.features.n = 3000,
  variable.features.rv.th = 1.3,
  vars.to.regress = NULL,
  latent.data = NULL,
  do.scale = FALSE,
  do.center = TRUE,
  clip.range = c(-sqrt(x = ncol(x = object)/30), sqrt(x = ncol(x = object)/30)),
  vst.flavor = "v2",
  conserve.memory = FALSE,
  return.only.var.genes = TRUE,
  seed.use = 1448145,
  verbose = TRUE,
  ...
)

# S3 method for class 'Seurat'
SCTransform(
  object,
  assay = "RNA",
  new.assay.name = "SCT",
  reference.SCT.model = NULL,
  do.correct.umi = TRUE,
  ncells = 5000,
  residual.features = NULL,
  variable.features.n = 3000,
  variable.features.rv.th = 1.3,
  vars.to.regress = NULL,
  do.scale = FALSE,
  do.center = TRUE,
  clip.range = c(-sqrt(x = ncol(x = object[[assay]])/30), sqrt(x = ncol(x =
    object[[assay]])/30)),
  vst.flavor = "v2",
  conserve.memory = FALSE,
  return.only.var.genes = TRUE,
  seed.use = 1448145,
  verbose = TRUE,
  ...
)

# S3 method for class 'IterableMatrix'
SCTransform(
  object,
  cell.attr,
  reference.SCT.model = NULL,
  do.correct.umi = TRUE,
  ncells = 5000,
  residual.features = NULL,
  variable.features.n = 3000,
  variable.features.rv.th = 1.3,
  vars.to.regress = NULL,
  latent.data = NULL,
  do.scale = FALSE,
  do.center = TRUE,
  clip.range = c(-sqrt(x = ncol(x = object)/30), sqrt(x = ncol(x = object)/30)),
  vst.flavor = "v2",
  conserve.memory = FALSE,
  return.only.var.genes = TRUE,
  seed.use = 1448145,
  verbose = TRUE,
  ...
)
```

Example 6 (r):
```r
SCTransform(object, ...)

# Default S3 method
SCTransform(
  object,
  cell.attr,
  reference.SCT.model = NULL,
  do.correct.umi = TRUE,
  ncells = 5000,
  residual.features = NULL,
  variable.features.n = 3000,
  variable.features.rv.th = 1.3,
  vars.to.regress = NULL,
  latent.data = NULL,
  do.scale = FALSE,
  do.center = TRUE,
  clip.range = c(-sqrt(x = ncol(x = umi)/30), sqrt(x = ncol(x = umi)/30)),
  vst.flavor = "v2",
  conserve.memory = FALSE,
  return.only.var.genes = TRUE,
  seed.use = 1448145,
  verbose = TRUE,
  ...
)

# S3 method for class 'Assay'
SCTransform(
  object,
  cell.attr,
  reference.SCT.model = NULL,
  do.correct.umi = TRUE,
  ncells = 5000,
  residual.features = NULL,
  variable.features.n = 3000,
  variable.features.rv.th = 1.3,
  vars.to.regress = NULL,
  latent.data = NULL,
  do.scale = FALSE,
  do.center = TRUE,
  clip.range = c(-sqrt(x = ncol(x = object)/30), sqrt(x = ncol(x = object)/30)),
  vst.flavor = "v2",
  conserve.memory = FALSE,
  return.only.var.genes = TRUE,
  seed.use = 1448145,
  verbose = TRUE,
  ...
)

# S3 method for class 'Seurat'
SCTransform(
  object,
  assay = "RNA",
  new.assay.name = "SCT",
  reference.SCT.model = NULL,
  do.correct.umi = TRUE,
  ncells = 5000,
  residual.features = NULL,
  variable.features.n = 3000,
  variable.features.rv.th = 1.3,
  vars.to.regress = NULL,
  do.scale = FALSE,
  do.center = TRUE,
  clip.range = c(-sqrt(x = ncol(x = object[[assay]])/30), sqrt(x = ncol(x =
    object[[assay]])/30)),
  vst.flavor = "v2",
  conserve.memory = FALSE,
  return.only.var.genes = TRUE,
  seed.use = 1448145,
  verbose = TRUE,
  ...
)

# S3 method for class 'IterableMatrix'
SCTransform(
  object,
  cell.attr,
  reference.SCT.model = NULL,
  do.correct.umi = TRUE,
  ncells = 5000,
  residual.features = NULL,
  variable.features.n = 3000,
  variable.features.rv.th = 1.3,
  vars.to.regress = NULL,
  latent.data = NULL,
  do.scale = FALSE,
  do.center = TRUE,
  clip.range = c(-sqrt(x = ncol(x = object)/30), sqrt(x = ncol(x = object)/30)),
  vst.flavor = "v2",
  conserve.memory = FALSE,
  return.only.var.genes = TRUE,
  seed.use = 1448145,
  verbose = TRUE,
  ...
)
```

Example 7 (r):
```r
SCTransform(object, ...)

# Default S3 method
SCTransform(
  object,
  cell.attr,
  reference.SCT.model = NULL,
  do.correct.umi = TRUE,
  ncells = 5000,
  residual.features = NULL,
  variable.features.n = 3000,
  variable.features.rv.th = 1.3,
  vars.to.regress = NULL,
  latent.data = NULL,
  do.scale = FALSE,
  do.center = TRUE,
  clip.range = c(-sqrt(x = ncol(x = umi)/30), sqrt(x = ncol(x = umi)/30)),
  vst.flavor = "v2",
  conserve.memory = FALSE,
  return.only.var.genes = TRUE,
  seed.use = 1448145,
  verbose = TRUE,
  ...
)

# S3 method for class 'Assay'
SCTransform(
  object,
  cell.attr,
  reference.SCT.model = NULL,
  do.correct.umi = TRUE,
  ncells = 5000,
  residual.features = NULL,
  variable.features.n = 3000,
  variable.features.rv.th = 1.3,
  vars.to.regress = NULL,
  latent.data = NULL,
  do.scale = FALSE,
  do.center = TRUE,
  clip.range = c(-sqrt(x = ncol(x = object)/30), sqrt(x = ncol(x = object)/30)),
  vst.flavor = "v2",
  conserve.memory = FALSE,
  return.only.var.genes = TRUE,
  seed.use = 1448145,
  verbose = TRUE,
  ...
)

# S3 method for class 'Seurat'
SCTransform(
  object,
  assay = "RNA",
  new.assay.name = "SCT",
  reference.SCT.model = NULL,
  do.correct.umi = TRUE,
  ncells = 5000,
  residual.features = NULL,
  variable.features.n = 3000,
  variable.features.rv.th = 1.3,
  vars.to.regress = NULL,
  do.scale = FALSE,
  do.center = TRUE,
  clip.range = c(-sqrt(x = ncol(x = object[[assay]])/30), sqrt(x = ncol(x =
    object[[assay]])/30)),
  vst.flavor = "v2",
  conserve.memory = FALSE,
  return.only.var.genes = TRUE,
  seed.use = 1448145,
  verbose = TRUE,
  ...
)

# S3 method for class 'IterableMatrix'
SCTransform(
  object,
  cell.attr,
  reference.SCT.model = NULL,
  do.correct.umi = TRUE,
  ncells = 5000,
  residual.features = NULL,
  variable.features.n = 3000,
  variable.features.rv.th = 1.3,
  vars.to.regress = NULL,
  latent.data = NULL,
  do.scale = FALSE,
  do.center = TRUE,
  clip.range = c(-sqrt(x = ncol(x = object)/30), sqrt(x = ncol(x = object)/30)),
  vst.flavor = "v2",
  conserve.memory = FALSE,
  return.only.var.genes = TRUE,
  seed.use = 1448145,
  verbose = TRUE,
  ...
)
```

Example 8 (unknown):
```unknown
sctransform::vst
```

Example 9 (unknown):
```unknown
variable.features.n
```

Example 10 (unknown):
```unknown
c(-sqrt(n/30), sqrt(n/30))
```

Example 11 (unknown):
```unknown
correct_counts
```

Example 12 (unknown):
```unknown
get_residuals
```

---

## The SeuratCommand Class — SeuratCommand-class • Seurat

**URL:** http://127.0.0.1:9173/reference_seuratcommand-class.html

**Contents:**
- The SeuratCommand Class
- See also
- Contents

For more details, please see the documentation in SeuratObject

SeuratObject::SeuratCommand-class

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/reexports.R
```

Example 2 (unknown):
```unknown
SeuratCommand-class.Rd
```

Example 3 (unknown):
```unknown
SeuratObject
```

Example 4 (unknown):
```unknown
SeuratObject::SeuratCommand-class
```

---

## Find bridge anchors between query and extended bridge-reference — FindBridgeTransferAnchors • Seurat

**URL:** http://127.0.0.1:9173/reference_findbridgetransferanchors.html

**Contents:**
- Find bridge anchors between query and extended bridge-reference
- Arguments
- Value
- Contents

Find a set of anchors between unimodal query and the other unimodal reference using a pre-computed BridgeReferenceSet. This function performs three steps: 1. Harmonize the bridge and query cells in the bridge query reduction space 2. Construct the bridge dictionary representations for query cells 3. Find a set of anchors between query and reference in the bridge graph laplacian eigenspace These anchors can later be used to integrate embeddings or transfer data from the reference to query object using the MapQuery object.

BridgeReferenceSet object generated from PrepareBridgeReference

A query Seurat object

Assay name for query-bridge integration

Number of dimensions for query-bridge integration

Determine if scale the query data for projection

Dimensional reduction to perform when finding anchors. Options are:

pcaproject: Project the PCA from the bridge onto the query. We recommend using PCA when bridge and query datasets are from scRNA-seq

lsiproject: Project the LSI from the bridge onto the query. We recommend using LSI when bridge and query datasets are from scATAC-seq or scCUT&TAG data. This requires that LSI or supervised LSI has been computed for the bridge dataset, and the same features (eg, peaks or genome bins) are present in both the bridge and query.

Dimensional reduction to perform when finding anchors. Can be one of:

cca: Canonical correlation analysis

direct: Use assay data as a dimensional reduction

Print messages and progress

Returns an AnchorSet object that can be used as input to TransferData, IntegrateEmbeddings and MapQuery.

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/integration.R
```

Example 2 (unknown):
```unknown
FindBridgeTransferAnchors.Rd
```

Example 3 (unknown):
```unknown
BridgeReferenceSet
```

Example 4 (unknown):
```unknown
FindBridgeTransferAnchors(
  extended.reference,
  query,
  query.assay = NULL,
  dims = 1:30,
  scale = FALSE,
  reduction = c("lsiproject", "pcaproject"),
  bridge.reduction = c("direct", "cca"),
  verbose = TRUE
)
```

Example 5 (r):
```r
FindBridgeTransferAnchors(
  extended.reference,
  query,
  query.assay = NULL,
  dims = 1:30,
  scale = FALSE,
  reduction = c("lsiproject", "pcaproject"),
  bridge.reduction = c("direct", "cca"),
  verbose = TRUE
)
```

Example 6 (r):
```r
FindBridgeTransferAnchors(
  extended.reference,
  query,
  query.assay = NULL,
  dims = 1:30,
  scale = FALSE,
  reduction = c("lsiproject", "pcaproject"),
  bridge.reduction = c("direct", "cca"),
  verbose = TRUE
)
```

Example 7 (unknown):
```unknown
PrepareBridgeReference
```

Example 8 (unknown):
```unknown
TransferData
```

Example 9 (unknown):
```unknown
IntegrateEmbeddings
```

---

## Find cells with highest scores for a given dimensional reduction technique — TopCells • Seurat

**URL:** http://127.0.0.1:9173/seurat/reference/topcells/index.html

**Contents:**
- Find cells with highest scores for a given dimensional reduction technique
- Arguments
- Value
- Examples
- Contents

Return a list of genes with the strongest contribution to a set of components

Number of cells to return

Return an equal number of cells with both + and - scores.

Extra parameters passed to Embeddings

Returns a vector of cells

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/objects.R
```

Example 2 (unknown):
```unknown
TopCells.Rd
```

Example 3 (unknown):
```unknown
TopCells(object, dim = 1, ncells = 20, balanced = FALSE, ...)
```

Example 4 (r):
```r
TopCells(object, dim = 1, ncells = 20, balanced = FALSE, ...)
```

Example 5 (r):
```r
TopCells(object, dim = 1, ncells = 20, balanced = FALSE, ...)
```

Example 6 (python):
```python
data("pbmc_small")
pbmc_small
#> An object of class Seurat 
#> 230 features across 80 samples within 1 assay 
#> Active assay: RNA (230 features, 20 variable features)
#>  3 layers present: counts, data, scale.data
#>  2 dimensional reductions calculated: pca, tsne
head(TopCells(object = pbmc_small[["pca"]]))
#> [1] "ACGTGATGCCATGA" "ATACCACTCTAAGC" "ATTGCACTTGCTTT" "CTAGGTGATGGTTG"
#> [5] "GACATTCTCCACCT" "ATAGGAGAAACAGA"
# Can specify which dimension and how many cells to return
TopCells(object = pbmc_small[["pca"]], dim = 2, ncells = 5)
#> [1] "ACAGGTACTGGTGT" "GTTGACGATATCGG" "GGCATATGCTTATC" "CTAACGGAACCGAT"
#> [5] "CATTACACCAACTG"
```

Example 7 (r):
```r
data("pbmc_small")
pbmc_small
#> An object of class Seurat 
#> 230 features across 80 samples within 1 assay 
#> Active assay: RNA (230 features, 20 variable features)
#>  3 layers present: counts, data, scale.data
#>  2 dimensional reductions calculated: pca, tsne
head(TopCells(object = pbmc_small[["pca"]]))
#> [1] "ACGTGATGCCATGA" "ATACCACTCTAAGC" "ATTGCACTTGCTTT" "CTAGGTGATGGTTG"
#> [5] "GACATTCTCCACCT" "ATAGGAGAAACAGA"
# Can specify which dimension and how many cells to return
TopCells(object = pbmc_small[["pca"]], dim = 2, ncells = 5)
#> [1] "ACAGGTACTGGTGT" "GTTGACGATATCGG" "GGCATATGCTTATC" "CTAACGGAACCGAT"
#> [5] "CATTACACCAACTG"
```

Example 8 (r):
```r
data("pbmc_small")
pbmc_small
#> An object of class Seurat 
#> 230 features across 80 samples within 1 assay 
#> Active assay: RNA (230 features, 20 variable features)
#>  3 layers present: counts, data, scale.data
#>  2 dimensional reductions calculated: pca, tsne
head(TopCells(object = pbmc_small[["pca"]]))
#> [1] "ACGTGATGCCATGA" "ATACCACTCTAAGC" "ATTGCACTTGCTTT" "CTAGGTGATGGTTG"
#> [5] "GACATTCTCCACCT" "ATAGGAGAAACAGA"
# Can specify which dimension and how many cells to return
TopCells(object = pbmc_small[["pca"]], dim = 2, ncells = 5)
#> [1] "ACAGGTACTGGTGT" "GTTGACGATATCGG" "GGCATATGCTTATC" "CTAACGGAACCGAT"
#> [5] "CATTACACCAACTG"
```

---

## Move outliers towards center on dimension reduction plot — CollapseEmbeddingOutliers • Seurat

**URL:** http://127.0.0.1:9173/seurat/reference/collapseembeddingoutliers/index.html

**Contents:**
- Move outliers towards center on dimension reduction plot
- Arguments
- Value
- Examples
- Contents

Move outliers towards center on dimension reduction plot

Name of DimReduc to adjust

Dimensions to visualize

Group (color) cells in different ways (for example, orig.ident)

Controls the outlier distance

Key for DimReduc that is returned

Returns a DimReduc object with the modified embeddings

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/visualization.R
```

Example 2 (unknown):
```unknown
CollapseEmbeddingOutliers.Rd
```

Example 3 (unknown):
```unknown
CollapseEmbeddingOutliers(
  object,
  reduction = "umap",
  dims = 1:2,
  group.by = "ident",
  outlier.sd = 2,
  reduction.key = "UMAP_"
)
```

Example 4 (r):
```r
CollapseEmbeddingOutliers(
  object,
  reduction = "umap",
  dims = 1:2,
  group.by = "ident",
  outlier.sd = 2,
  reduction.key = "UMAP_"
)
```

Example 5 (r):
```r
CollapseEmbeddingOutliers(
  object,
  reduction = "umap",
  dims = 1:2,
  group.by = "ident",
  outlier.sd = 2,
  reduction.key = "UMAP_"
)
```

Example 6 (unknown):
```unknown
if (FALSE) { # \dontrun{
data("pbmc_small")
pbmc_small <- FindClusters(pbmc_small, resolution = 1.1)
pbmc_small <- RunUMAP(pbmc_small, dims = 1:5)
DimPlot(pbmc_small, reduction = "umap")
pbmc_small[["umap_new"]] <- CollapseEmbeddingOutliers(pbmc_small,
    reduction = "umap", reduction.key = 'umap_', outlier.sd = 0.5)
DimPlot(pbmc_small, reduction = "umap_new")
} # }
```

Example 7 (r):
```r
if (FALSE) { # \dontrun{
data("pbmc_small")
pbmc_small <- FindClusters(pbmc_small, resolution = 1.1)
pbmc_small <- RunUMAP(pbmc_small, dims = 1:5)
DimPlot(pbmc_small, reduction = "umap")
pbmc_small[["umap_new"]] <- CollapseEmbeddingOutliers(pbmc_small,
    reduction = "umap", reduction.key = 'umap_', outlier.sd = 0.5)
DimPlot(pbmc_small, reduction = "umap_new")
} # }
```

Example 8 (r):
```r
if (FALSE) { # \dontrun{
data("pbmc_small")
pbmc_small <- FindClusters(pbmc_small, resolution = 1.1)
pbmc_small <- RunUMAP(pbmc_small, dims = 1:5)
DimPlot(pbmc_small, reduction = "umap")
pbmc_small[["umap_new"]] <- CollapseEmbeddingOutliers(pbmc_small,
    reduction = "umap", reduction.key = 'umap_', outlier.sd = 0.5)
DimPlot(pbmc_small, reduction = "umap_new")
} # }
```

---

## Scale and center the data. — ScaleData • Seurat

**URL:** http://127.0.0.1:9173/reference_scaledata.html

**Contents:**
- Scale and center the data.
- Arguments
- Details
- Contents

Scales and centers features in the dataset. If variables are provided in vars.to.regress, they are individually regressed against each feature, and the resulting residuals are then scaled and centered.

Arguments passed to other methods

Vector of features names to scale/center. Default is variable features.

Variables to regress out (previously latent.vars in RegressOut). For example, nUMI, or percent.mito.

Extra data to regress out, should be cells x latent data

Name of variable in object metadata or a vector or factor defining grouping of cells. See argument f in split for more details

Use a linear model or generalized linear model (poisson, negative binomial) for the regression. Options are 'linear' (default), 'poisson', and 'negbinom'

Regress on UMI count data. Default is FALSE for linear modeling, but automatically set to TRUE if model.use is 'negbinom' or 'poisson'

Whether to scale the data.

Whether to center the data.

Max value to return for scaled data. The default is 10. Setting this can help reduce the effects of features that are only expressed in a very small number of cells. If regressing out latent variables and using a non-linear model, the default is 50.

Default size for number of features to scale at in a single computation. Increasing block.size may speed up calculations but at an additional memory cost.

If object contains fewer than this number of cells, don't block for scaling calculations.

Displays a progress bar for scaling procedure

Name of Assay to scale

ScaleData now incorporates the functionality of the function formerly known as RegressOut (which regressed out given the effects of provided variables and then scaled the residuals). To make use of the regression functionality, simply pass the variables you want to remove to the vars.to.regress parameter.

Setting center to TRUE will center the expression for each feature by subtracting the average expression for that feature. Setting scale to TRUE will scale the expression level for each feature by dividing the centered feature expression levels by their standard deviations if center is TRUE and by their root mean square otherwise.

Developed by Rahul Satija, Satija Lab and Collaborators.

Site built with pkgdown 2.1.1.

**Examples:**

Example 1 (unknown):
```unknown
R/generics.R
```

Example 2 (unknown):
```unknown
R/preprocessing.R
```

Example 3 (unknown):
```unknown
ScaleData.Rd
```

Example 4 (python):
```python
ScaleData(object, ...)

# Default S3 method
ScaleData(
  object,
  features = NULL,
  vars.to.regress = NULL,
  latent.data = NULL,
  split.by = NULL,
  model.use = "linear",
  use.umi = FALSE,
  do.scale = TRUE,
  do.center = TRUE,
  scale.max = 10,
  block.size = 1000,
  min.cells.to.block = 3000,
  verbose = TRUE,
  ...
)

# S3 method for class 'IterableMatrix'
ScaleData(
  object,
  features = NULL,
  do.scale = TRUE,
  do.center = TRUE,
  scale.max = 10,
  ...
)

# S3 method for class 'Assay'
ScaleData(
  object,
  features = NULL,
  vars.to.regress = NULL,
  latent.data = NULL,
  split.by = NULL,
  model.use = "linear",
  use.umi = FALSE,
  do.scale = TRUE,
  do.center = TRUE,
  scale.max = 10,
  block.size = 1000,
  min.cells.to.block = 3000,
  verbose = TRUE,
  ...
)

# S3 method for class 'Seurat'
ScaleData(
  object,
  features = NULL,
  assay = NULL,
  vars.to.regress = NULL,
  split.by = NULL,
  model.use = "linear",
  use.umi = FALSE,
  do.scale = TRUE,
  do.center = TRUE,
  scale.max = 10,
  block.size = 1000,
  min.cells.to.block = 3000,
  verbose = TRUE,
  ...
)
```

Example 5 (r):
```r
ScaleData(object, ...)

# Default S3 method
ScaleData(
  object,
  features = NULL,
  vars.to.regress = NULL,
  latent.data = NULL,
  split.by = NULL,
  model.use = "linear",
  use.umi = FALSE,
  do.scale = TRUE,
  do.center = TRUE,
  scale.max = 10,
  block.size = 1000,
  min.cells.to.block = 3000,
  verbose = TRUE,
  ...
)

# S3 method for class 'IterableMatrix'
ScaleData(
  object,
  features = NULL,
  do.scale = TRUE,
  do.center = TRUE,
  scale.max = 10,
  ...
)

# S3 method for class 'Assay'
ScaleData(
  object,
  features = NULL,
  vars.to.regress = NULL,
  latent.data = NULL,
  split.by = NULL,
  model.use = "linear",
  use.umi = FALSE,
  do.scale = TRUE,
  do.center = TRUE,
  scale.max = 10,
  block.size = 1000,
  min.cells.to.block = 3000,
  verbose = TRUE,
  ...
)

# S3 method for class 'Seurat'
ScaleData(
  object,
  features = NULL,
  assay = NULL,
  vars.to.regress = NULL,
  split.by = NULL,
  model.use = "linear",
  use.umi = FALSE,
  do.scale = TRUE,
  do.center = TRUE,
  scale.max = 10,
  block.size = 1000,
  min.cells.to.block = 3000,
  verbose = TRUE,
  ...
)
```

Example 6 (r):
```r
ScaleData(object, ...)

# Default S3 method
ScaleData(
  object,
  features = NULL,
  vars.to.regress = NULL,
  latent.data = NULL,
  split.by = NULL,
  model.use = "linear",
  use.umi = FALSE,
  do.scale = TRUE,
  do.center = TRUE,
  scale.max = 10,
  block.size = 1000,
  min.cells.to.block = 3000,
  verbose = TRUE,
  ...
)

# S3 method for class 'IterableMatrix'
ScaleData(
  object,
  features = NULL,
  do.scale = TRUE,
  do.center = TRUE,
  scale.max = 10,
  ...
)

# S3 method for class 'Assay'
ScaleData(
  object,
  features = NULL,
  vars.to.regress = NULL,
  latent.data = NULL,
  split.by = NULL,
  model.use = "linear",
  use.umi = FALSE,
  do.scale = TRUE,
  do.center = TRUE,
  scale.max = 10,
  block.size = 1000,
  min.cells.to.block = 3000,
  verbose = TRUE,
  ...
)

# S3 method for class 'Seurat'
ScaleData(
  object,
  features = NULL,
  assay = NULL,
  vars.to.regress = NULL,
  split.by = NULL,
  model.use = "linear",
  use.umi = FALSE,
  do.scale = TRUE,
  do.center = TRUE,
  scale.max = 10,
  block.size = 1000,
  min.cells.to.block = 3000,
  verbose = TRUE,
  ...
)
```

---
