ReclusterCells: Identify subpopulations in single cell clusters.

View source: R/ReclusterCells.R

ReclusterCellsR Documentation

Identify subpopulations in single cell clusters.

Description

This function identifies subclusters of cell types by recalculating the n most highly variable genes for each cluster using SCTransform. The function returns a list of Seurat objects, one for each cluster the user wants to investigate.

Usage

ReclusterCells(
  seurat.object = NULL,
  which.clust = NULL,
  auto = FALSE,
  merge.clusters = FALSE,
  use.parallel = TRUE,
  n.cores = 3,
  use.sct = FALSE,
  n.HVG = 4000,
  n.PC = "auto",
  redo.embedding = TRUE,
  resolution.vals = c(0.1, 0.2, 0.3, 0.4),
  k.vals = c(10, 25, 50),
  is.integrated = FALSE,
  integration.ident = NULL,
  cutoff.score = 0.25,
  nn.metric = "cosine",
  regress.mt = FALSE,
  regress.cc = FALSE,
  random.seed = 312
)

Arguments

seurat.object

The Seurat object containing cells and their assigned cluster IDs.

which.clust

Which clusters should undergo subpopulation detection analysis? A user-provided list or single integer. Leave NULL if setting auto = TRUE. Defaults to NULL.

auto

Should the clusters on which to run SCISSORS be determined automatically? If so, which.clust will be chosen through silhouette score analysis. Not recommended for large datasets as the distance matrix calculation is computationally expensive. Defaults to FALSE.

merge.clusters

If multiple clusters are specified, should the clusters be grouped as one before running SCISSORS? Defaults to FALSE.

use.parallel

Should the Seurat data reprocessing & the main reclustering loop be parallelized? Defaults to TRUE.

n.cores

The number of cores to be used in parallel computation is use.parallel = TRUE. Defaults to 3.

use.sct

Should SCTransform be used for normalization / HVG selection? Defaults to FALSE, which equates to using typical log1p-normalization.

n.HVG

How many variable genes should be detected in each subcluster? Defaults to 4000.

n.PC

How many PCs should be used as input to non-linear to non-linear dimension reduction and clustering algorithms. Can be provided by the user, or set automatically by ChoosePCs. Defaults to "auto".

redo.embedding

(Optional) Should a cluster-specific dimension reduction embeddings be generated? Sometimes subpopulations appear mixed together on the original coordinates, but separate clearly when re-embedded. Defaults to TRUE.

resolution.vals

A user-defined vector of resolution values to compare when clustering cells. Defaults to c(.1, .2, .3, .4).

k.vals

The values of the number of nearest neighbors k to be tested. Defaults to c(10, 25, 50).

is.integrated

Do the data come from multiple samples & need to be re-integrated? See https://github.com/satijalab/seurat/issues/1883 for discussion on this topic. Defaults to FALSE.

integration.ident

If the data are to be re-integrated, what metadata column contains the sample identity? Defaults to NULL.

cutoff.score

The lowest mean silhouette score accepted as evidence of subclusters. Defaults to .25, reasonable values are [.1, .3].

nn.metric

(Optional) The distance metric to be used in computing the SNN graph. Defaults to "cosine".

regress.mt

(Optional) Should the percentage of mitochondrial DNA be computed and regressed out? Works for mouse / human gene names. Defaults to FALSE.

regress.cc

(Optional) Should cell cycle scores be computed & regressed out? NOTE: uses human cell cycle genes. Defaults to FALSE.

random.seed

The seed used to control stochasticity in several functions. Defaults to 312

Value

If the number of clusters to be re-clustered is 1, returns the re-clustered Seurat object, else returns a list of re-clustered Seurat objects.

Author(s)

Jack Leary

See Also

ComputeSilhouetteScores

IntegrateSubclusters

Examples

## Not run: 
ReclusterCells(seurat.object,
               which.clust = 5,
               resolution.vals = c(.1, .2, .5),
               k.vals = c(10, 20, 30))
ReclusterCells(seurat.object,
               which.clust = c(0, 3, 5),
               merge.clusters = TRUE,
               n.HVG = 2000,
               n.PC = 20,
               cutoff.score = 0.1)
ReclusterCells(seurat.object,
               auto = TRUE,
               use.parallel = TRUE,
               n.cores = 6,
               is.integrated = TRUE,
               integration.ident = "samplename")

## End(Not run)

jr-leary7/SCISSORS documentation built on April 20, 2023, 8:21 p.m.