% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/Object_Conversion.R
\name{as.Seurat.liger}
\alias{as.Seurat.liger}
\title{Convert objects to \code{Seurat} objects}
\usage{
\method{as.Seurat}{liger}(
  x,
  nms = names(x@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 = "_",
  ...
)
}
\arguments{
\item{x}{\code{liger} object.}

\item{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)).}

\item{renormalize}{Whether to log-normalize raw data using Seurat defaults (default TRUE).}

\item{use.liger.genes}{Whether to carry over variable genes (default TRUE).}

\item{by.dataset}{Include dataset of origin in cluster identity in Seurat object (default FALSE).}

\item{keep_meta}{logical. Whether to transfer additional metadata (nGene/nUMI/dataset already transferred)
to new Seurat Object.  Default is TRUE.}

\item{reduction_label}{Name of dimensionality reduction technique used.  Enables accurate transfer
or name to Seurat object instead of defaulting to "tSNE".}

\item{seurat_assay}{Name to set for assay in Seurat Object.  Default is "RNA".}

\item{assay_type}{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 \code{\link{Convert_Assay}} parameter \code{convert_to} for acceptable values.}

\item{add_barcode_names}{logical, whether to add dataset names to the cell barcodes when
creating Seurat object, default is FALSE.}

\item{barcode_prefix}{logical, if \code{add_barcode_names = TRUE} should the names be added as
prefix to current cell barcodes/names or a suffix (default is TRUE; prefix).}

\item{barcode_cell_id_delimiter}{The delimiter to use when adding dataset id to barcode
prefix/suffix.  Default is "_".}

\item{...}{unused.}
}
\value{
Seurat object with raw.data, scale.data, reduction_label, iNMF, and ident slots set.

Seurat object.
}
\description{
Merges raw.data and scale.data of object, and creates Seurat object with these values along with slots
containing dimensionality reduction coordinates, iNMF factorization, and cluster assignments.
Supports Seurat V3/4 and V4.
}
\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".
}
\examples{
\dontrun{
seurat_object <- as.Seurat(x = liger_object)
}

}
\references{
Original function is part of LIGER package \url{https://github.com/welch-lab/liger} (Licence: GPL-3).
Function was modified for use in scCustomize with additional parameters/functionality.
}
\concept{object_conversion}
