processSeuratObject: Process Seurat Objects in Parallel

View source: R/Seurat.Utils.R

processSeuratObjectR Documentation

Process Seurat Objects in Parallel

Description

Applies a series of Seurat processing steps to each Seurat object in a list. The operations include scaling data, running PCA, UMAP, finding neighbors, and finding clusters. This is done in parallel using multiple cores.

Usage

processSeuratObject(
  obj,
  param.list = p,
  update_gene_symbols = FALSE,
  add.meta.fractions = FALSE,
  precompute = TRUE,
  compute = TRUE,
  save = TRUE,
  plot = TRUE,
  nfeatures = param.list$n.var.genes,
  variables.2.regress = param.list$variables.2.regress.combined,
  harmony.covariates = variables.2.regress,
  n.PC = param.list$n.PC,
  resolutions = param.list$snn_res,
  reduction_input = "pca",
  WorkingDir = getwd(),
  harmony.seurat.implementation = FALSE,
  ...
)

Arguments

obj

A Seurat object to be processed.

param.list

A list of parameters used in the processing steps.

update_gene_symbols

A boolean indicating whether to update gene symbols from HGNC. Default: FALSE.

add.meta.fractions

A boolean indicating whether to add meta data for fractions of cells in each cluster. Default: FALSE.

precompute

A boolean indicating whether to compute steps: FindVariableFeatures(), calc.q99.Expression.and.set.all.genes(), ScaleData() and RunPCA() Default: TRUE.

compute

A boolean indicating whether to compute the steps: IntegrateLayers() / RunHarmony(), RunUMAP(), FindNeighbors(), and FindClusters(). Default: TRUE.

save

A boolean indicating whether to save the results. Default: TRUE.

plot

A boolean indicating whether to plot the results. Default: TRUE.

nfeatures

The number of variable genes to use. Default: 2000.

variables.2.regress

A list of variables to regress out. Default: NULL.

harmony.covariates

A list of covariates to use for Harmony. Default: variables.2.regress.

n.PC

The number of principal components to use. Default: 30.

resolutions

A list of resolutions to use for clustering. Default: c(0.1, 0.2, 0.3, 0.4, 0.5).

reduction_input

The reduction method to use as input for clustering & UMAP. Default: "pca".

WorkingDir

The working directory to save the results. Default: getwd().

harmony.seurat.implementation

A boolean indicating whether to use the Seurat implementation of Harmony. Default: FALSE.

...

Additional parameters to be passed to ScaleData().

Value

A Seurat object after applying scaling, PCA, UMAP, neighbor finding, and clustering.

Examples

# Assuming ls.Seurat is a list of Seurat objects and params is a list of parameters
# results <- mclapply(ls.Seurat, processSeuratObject, params, mc.cores = 4)


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