R/Object_Conversion.R
Liger_to_Seurat.Rd
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.
Liger_to_Seurat(
liger_object,
nms = names(liger_object@H),
renormalize = TRUE,
use.liger.genes = TRUE,
by.dataset = FALSE,
keep_meta = TRUE,
reduction_label = "UMAP",
seurat_assay = "RNA",
assay_type = NULL,
add_barcode_names = FALSE,
barcode_prefix = TRUE,
barcode_cell_id_delimiter = "_"
)
liger
object.
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)).
Whether to log-normalize raw data using Seurat defaults (default TRUE).
Whether to carry over variable genes (default TRUE).
Include dataset of origin in cluster identity in Seurat object (default FALSE).
logical. Whether to transfer additional metadata (nGene/nUMI/dataset already transferred) to new Seurat Object. Default is TRUE.
Name of dimensionality reduction technique used. Enables accurate transfer or name to Seurat object instead of defaulting to "tSNE".
Name to set for assay in Seurat Object. Default is "RNA".
what type of Seurat assay to create in new object (Assay vs Assay5).
Default is NULL which will default to the current user settings.
See Convert_Assay
parameter convert_to
for acceptable values.
logical, whether to add dataset names to the cell barcodes when creating Seurat object, default is FALSE.
logical, if add_barcode_names = TRUE
should the names be added as
prefix to current cell barcodes/names or a suffix (default is TRUE; prefix).
The delimiter to use when adding dataset id to barcode prefix/suffix. Default is "_".
Seurat object with raw.data, scale.data, reduction_label, iNMF, and ident slots set.
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".
Original function is part of LIGER package https://github.com/welch-lab/liger (Licence: GPL-3). Function was slightly modified for use in scCustomize with keep.meta parameter. Also posted as PR to liger GitHub.
if (FALSE) {
seurat_object <- Liger_to_Seurat(liger_object = LIGER_OBJ, reduction_label = "UMAP")
}