Learn R Programming

rliger (version 1.0.0)

subsetLiger: Construct a liger object with a specified subset

Description

The subset can be based on cell names or clusters. This function applies the subsetting to raw.data, norm.data, scale.data, cell.data, H, W, V, H.norm, tsne.coords, and clusters. Note that it does NOT reoptimize the factorization. See optimizeSubset for this functionality.

Usage

subsetLiger(
  object,
  clusters.use = NULL,
  cells.use = NULL,
  remove.missing = TRUE
)

Arguments

object

liger object. Should run quantileAlignSNF and runTSNE before calling.

clusters.use

Clusters to use for subset.

cells.use

Vector of cell names to keep from any dataset.

remove.missing

Whether to remove genes/cells with no expression when creating new object (default TRUE).

Value

liger object with subsetting applied to raw.data, norm.data, scale.data, H, W, V, H.norm, tsne.coords, and clusters.

Examples

Run this code
# NOT RUN {
# ligerex (liger object based on in-memory datasets), with clusters 0:10
# factorization, alignment, and t-SNE calculation have been performed
# subset by clusters
ligerex_subset <- subsetLiger(ligerex, clusters.use = c(1, 4, 5))
# }

Run the code above in your browser using DataLab