ligerToSeurat: Create a Seurat object containing the data from a liger...

View source: R/rliger.R

ligerToSeuratR Documentation

Create a Seurat object containing the data from a liger object

Description

Merges raw.data and scale.data of object, and creates Seurat object with these values along with tsne.coords, iNMF factorization, and cluster assignments. Supports Seurat V2 and V3.

Usage

ligerToSeurat(
  object,
  nms = NULL,
  renormalize = FALSE,
  use.liger.genes = TRUE,
  by.dataset = FALSE,
  assay = "RNA"
)

Arguments

object

liger object.

nms

By default, labels cell names with dataset of origin (this is to account for cells in different datasets which may have same name). Other names can be passed here as vector, must have same length as the number of datasets. (default names(H))

renormalize

Whether to log-normalize raw data using Seurat defaults (default FALSE).

use.liger.genes

Whether to carry over variable genes (default TRUE).

by.dataset

Include dataset of origin in cluster identity in Seurat object (default FALSE).

assay

Assay name to set in the Seurat object (default "RNA").

Details

Stores original dataset identity by default in new object metadata if dataset names are passed in nms. iNMF factorization is stored in dim.reduction object with key "iNMF".

Value

Seurat object with raw.data, scale.data, dr$tsne, dr$inmf, and ident slots set.

Examples

ligerex <- createLiger(list(ctrl = ctrl, stim = stim))
if (packageVersion("Matrix") <= package_version("1.6.1.1")) {
  # 1.6.2 is not compatible thus don't test
  # but can use `setOldClass("mMatrix")` as a hack
  srt <- ligerToSeurat(ligerex)
}

rliger documentation built on Nov. 9, 2023, 1:07 a.m.