Learn R Programming

rliger (version 2.0.1)

as.ligerDataset.ligerDataset: Converting other classes of data to a ligerDataset object

Description

Works for converting a matrix or container object to a single ligerDataset, and can also convert the modality preset of a ligerDataset. When used with a dense matrix object, it automatically converts the matrix to sparse form (dgCMatrix-class). When used with container objects such as Seurat or SingleCellExperiment, it is highly recommended that the object contains only one dataset/sample which is going to be integrated with LIGER. For multi-sample objects, please use as.liger with dataset source variable specified.

Usage

# S3 method for ligerDataset
as.ligerDataset(
  object,
  modal = c("default", "rna", "atac", "spatial", "meth"),
  ...
)

# S3 method for default as.ligerDataset( object, modal = c("default", "rna", "atac", "spatial", "meth"), ... )

# S3 method for matrix as.ligerDataset( object, modal = c("default", "rna", "atac", "spatial", "meth"), ... )

# S3 method for Seurat as.ligerDataset( object, modal = c("default", "rna", "atac", "spatial", "meth"), assay = NULL, ... )

# S3 method for SingleCellExperiment as.ligerDataset( object, modal = c("default", "rna", "atac", "spatial", "meth"), ... )

as.ligerDataset(object, ...)

Value

a liger object.

Arguments

object

Object.

modal

Modality setting for each dataset. Choose from "default", "rna", "atac", "spatial", "meth".

...

Additional arguments passed to createLigerDataset

assay

Name of assay to use. Default NULL uses current active assay.

Examples

Run this code
ctrl <- dataset(pbmc, "ctrl")
ctrl
# Convert the modality preset
as.ligerDataset(ctrl, modal = "atac")
rawCounts <- rawData(ctrl)
class(rawCounts)
as.ligerDataset(rawCounts)

Run the code above in your browser using DataLab