Skip to contents

Creates a subset of a Seurat object based on either categorical or numeric thresholds in metadata. Allows for subsetting by specifying the ident column, group name, or threshold criteria. Ideal for extracting specific cell populations or clusters based on custom conditions. Returns a new Seurat object containing only the subsetted cells and does not come with the Seuratv5 subset issue Please be aware that right now, after using this function the subset might be treated with Seuv5=False in other functions.

Usage

DO.Subset(
  Seu_object,
  assay = "RNA",
  ident,
  ident_name = NULL,
  ident_thresh = NULL
)

Arguments

Seu_object

The seurat object

assay

assay to subset by

ident

meta data column to subset for

ident_name

name of group of barcodes in ident of subset for

ident_thresh

numeric thresholds as character, e.g ">5" or c(">5", "<200"), to subset barcodes in ident for

Value

a subsetted Seurat object

Author

Mariano Ruz Jurado

Examples

if (FALSE) { # \dontrun{


DO.Subset(
  Seu_object = Seurat,
  ident="condition",
  ident_name="CTRL"
)

DO.Subset(
  Seu_object = Seurat,
  ident="nFeature_RNA",
  ident_thresh=c(">5", "<200")
)
} # }