Subset_LIGER: Subset LIGER object

View source: R/LIGER_Utilities.R

Subset_LIGERR Documentation

Subset LIGER object

Description

Subset LIGER object by cluster or other meta data variable.

Usage

Subset_LIGER(
  liger_object,
  cluster = NULL,
  cluster_col = "leiden_cluster",
  ident = NULL,
  ident_col = NULL,
  invert = FALSE
)

Arguments

liger_object

LIGER object name.

cluster

Name(s) of cluster to subset from object.

cluster_col

name of ⁠@cellMeta⁠ column containing cluster names, default is "leiden_cluster".

ident

variable within ident_col to use in sub-setting object.

ident_col

column in ⁠@cellMeta⁠ that contains values provided to ident.

invert

logical, whether to subset the inverse of the clusters or idents provided, default is FALSE.

Value

liger object

Examples

## Not run: 
# subset clusters 3 and 5
sub_liger <- subset_liger(liger_object = liger_object, cluster = c(3, 5))

# subset control samples from column "Treatment"
sub_liger <- subset_liger(liger_object = liger_object, ident = "control",
ident_col = "Treatment")

# subset control samples from column "Treatment" in clusters 3 and 5
sub_liger <- subset_liger(liger_object = liger_object, ident = "control",
ident_col = "Treatment", cluster = c(3, 5))

# Remove cluster 9
sub_liger <- subset_liger(liger_object = liger_object, cluster = 9, invert = TRUE)

## End(Not run)


samuel-marsh/scCustomize documentation built on Dec. 20, 2024, 7:41 a.m.