calculate.pseudocells: Calculates pseudocells from a Seurat object

View source: R/Pseudocells.R

calculate.pseudocellsR Documentation

Calculates pseudocells from a Seurat object

Description

This function calculates pseudocells from a Seurat object, based on pre-calculated cell clusters and dimentionality reduction. WARNING: This might be time consuming, depending on the size of the dataset.

Usage

calculate.pseudocells(
  s.cells,
  seeds = 0.2,
  nn = 10,
  reduction = "pca",
  dims = 1:20,
  features = NULL,
  cells = NULL,
  rseed = 42
)

Arguments

s.cells

The seurat object, with pre-computed PCA or other reductions, and the relevant clustering as IDs

seeds

The proportion of cells to be used as seeds. Alternatively, a string with the name of the seeds to use. Numeric between 0.1 and 0.9 or string. Default 0.2

nn

Number of nearest neighbors to compute and use for pseudocell aggregation. Default 10

reduction

The name of the reduction to use. Should be present in the @reductions slot of the seurat object. Default is "pca"

dims

The relevant dimensions that will be used to compute nearest neighbors. Default 1:20

features

The features to be used. Takes a string of feature names as present in the expression matrices. Defaults to NULL, which will use all the genes.

cells

The clusters or identities to be used. Takes a string of identities as present in the @active.ident slot. Defaults to NULL, which will use all the identities.

rseed

Numeric. The random number generator of R, used to sample the seed cells. Makes the function replicable.

Value

A seurat object of aggregated pseudocells. With average expression. The slot misc contains the pseudocells dataframe, with each original cell and its assigned pseudocell, if no pseudocell is assigned then 00

Examples

MmLimbE155.ps=calculate.pseudocells(my.small_MmLimbE155, dims = 1:10)

CFeregrino/scWGCNA documentation built on Nov. 21, 2022, 2:31 a.m.