regress_out_and_recalculate_seurat: Regress Out and Recalculate Seurat

View source: R/Seurat.utils.less.used.R

regress_out_and_recalculate_seuratR Documentation

Regress Out and Recalculate Seurat

Description

The function performs a series of calculations and manipulations on a Seurat object, including identifying variable features, scaling data, running PCA, setting up reductions, finding neighbors, and finding clusters. It optionally performs t-SNE and saves the object.

Usage

regress_out_and_recalculate_seurat(
  obj,
  n.var.features = p$n.var.genes,
  features.scale = n.var.features,
  vars.to.regress,
  suffix,
  nPCs = p$n.PC,
  clust_resolutions = p$snn_res,
  calc_tSNE = FALSE,
  plot_umaps = TRUE,
  save_obj = TRUE,
  assayX = "RNA"
)

Arguments

obj

The Seurat object.

n.var.features

The number of variable features to use. Default: the 'n.var.genes' element from a list 'p'.

features.scale

A logical value indicating whether to scale the data. Default: TRUE.

vars.to.regress

A vector of variable names to be regressed out.

suffix

A character string to be used as a suffix when saving the object.

nPCs

The number of principal components to use. Default: the 'n.PC' element from a list 'p'.

clust_resolutions

The resolution for clustering. Default: the 'snn_res' element from a list 'p'.

calc_tSNE

Logical, if TRUE, t-SNE will be performed. Default: FALSE.

plot_umaps

Logical, if TRUE, UMAP plots will be generated. Default: TRUE.

save_obj

Logical, if TRUE, the object will be saved. Default: TRUE.

assayX

The assay to be used in scaling data. Default: 'RNA'.

Value

Seurat object after calculations and manipulations.

Examples

## Not run: 
# Assuming 'seurat_obj' is a valid Seurat object and 'vars' is a vector of variable names to be regressed out.
result <- regress_out_and_recalculate_seurat(seurat_obj, vars, suffix = "_regressed")

## End(Not run)

vertesy/Seurat.utils documentation built on Dec. 4, 2024, 5:20 p.m.