downsampleListSeuObjsNCells: Downsample a List of Seurat Objects to a Specific Number of...

View source: R/Seurat.Utils.R

downsampleListSeuObjsNCellsR Documentation

Downsample a List of Seurat Objects to a Specific Number of Cells

Description

Downsampling each Seurat object in a list to a specified number of cells. This function is particularly useful for creating smaller, more manageable subsets of large single-cell datasets for preliminary analyses or testing.

Usage

downsampleListSeuObjsNCells(
  ls.obj = ls.Seurat,
  NrCells = p$dSample.Organoids,
  save_object = FALSE
)

Arguments

ls.obj

List of Seurat objects to be downsampled. Default: ls.Seurat.

NrCells

Target number of cells to downsample each Seurat object to.

save_object

Logical indicating whether to save the downsampled Seurat objects using isaveRDS or to return them. Default: FALSE.

Examples

## Not run: 
if (interactive()) {
  downsampledSeuratList <- downsampleListSeuObjsNCells(
    ls.obj =
      list(yourSeuratObj1, yourSeuratObj2), NrCells = 2000
  )
  downsampledSeuratList <- downsampleListSeuObjsNCells(NrCells = 200)
}

## End(Not run)


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