% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/makeMetaCategorical.R
\name{makeMetaCategorical}
\alias{makeMetaCategorical}
\title{Updates shinycell config to recognize a metadata as a discrete one}
\usage{
makeMetaCategorical(scConf, meta.to.input, obj, maxLevels = 50)
}
\arguments{
\item{scConf}{shinycell config data.table}

\item{meta.to.input}{metadata from the single-cell metadata to be made 
discrete. Must match one of the following:
\itemize{
  \item{Seurat objects}: column names in \code{seu@meta.data} 
    i.e. \code{colnames(seu@meta.data)}
  \item{SCE objects}: column names in \code{sce@colData} 
    i.e. \code{colnames(sce@colData)}
  \item{h5ad files}: column names in \code{h5ad.obs} 
    i.e. \code{h5ad.obs.columns.values} 
  \item{loom files}: column names in \code{loom/col_attrs} 
    i.e. \code{loom/col_attrs.names}
}}

\item{obj}{input single-cell object for Seurat (v3+) / SingleCellExperiment 
data or input file path for h5ad / loom files}

\item{maxLevels}{maximum number of levels allowed for categorical metadata.
Metadata with nlevels > maxLevels will throw up an error message}
}
\value{
updated shinycell config data.table
}
\description{
Updates shinycell config to recognize a metadata as a discrete one. This 
function is useful when a discrete metadata only contains integers, e.g.
unspervised cluster labels starting from 0 to (n-1) clusters. If these 
metadata are not factored, then ShinyCell is unable to recognise these 
as discrete metadata automatically. This is especially important when 
working with loom files as they do not support factors/levels by default.
}
\examples{
scConf = makeMetaCategorical(scConf, "clusterID", loom_obj)

}
\author{
John F. Ouyang
}
