Convert objects (Seurat & lists of Seurat Objects) to anndata objects

as.LIGER(x, ...)

# S3 method for Seurat
as.LIGER(
  x,
  group.by = "orig.ident",
  layers_name = NULL,
  assay = "RNA",
  remove_missing = FALSE,
  renormalize = TRUE,
  use_seurat_var_genes = FALSE,
  use_seurat_dimreduc = FALSE,
  reduction = NULL,
  keep_meta = TRUE,
  verbose = TRUE,
  ...
)

# S3 method for list
as.LIGER(
  x,
  group.by = "orig.ident",
  dataset_names = NULL,
  assay = "RNA",
  remove_missing = FALSE,
  renormalize = TRUE,
  use_seurat_var_genes = FALSE,
  var_genes_method = "intersect",
  keep_meta = TRUE,
  verbose = TRUE,
  ...
)

Arguments

x

An object to convert to class liger

...

Arguments passed to other methods

group.by

Variable in meta data which contains variable to split data by, (default is "orig.ident").

layers_name

name of meta.data column used to split layers if setting group.by = "layers".

assay

Assay containing raw data to use, (default is "RNA").

remove_missing

logical, whether to remove missing genes with no counts when converting to LIGER object (default is FALSE).

renormalize

logical, whether to perform normalization after LIGER object creation (default is TRUE).

use_seurat_var_genes

logical, whether to transfer variable features from Seurat object to new LIGER object (default is FALSE).

use_seurat_dimreduc

logical, whether to transfer dimensionality reduction coordinates from Seurat to new LIGER object (default is FALSE).

reduction

Name of Seurat reduction to transfer if use_seurat_dimreduc = TRUE.

keep_meta

logical, whether to transfer columns in Seurat meta.data slot to LIGER cell.data slot (default is TRUE).

verbose

logical, whether to print status messages during object conversion (default is TRUE).

dataset_names

optional, vector of names to use for naming datasets.

var_genes_method

how variable genes should be selected from Seurat objects if use_seurat_var_genes = TRUE. Can be either "intersect" or "union", (default is "intersect").

Value

a liger object generated from x

References

modified and enhanced version of rliger::seuratToLiger.

Examples

if (FALSE) {
liger_object <- as.LIGER(x = seurat_object)
}

if (FALSE) {
liger_object <- as.LIGER(x = seurat_object_list)
}