% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/main.R
\name{ProjecTILs.classifier}
\alias{ProjecTILs.classifier}
\title{Annotate query dataset using a reference object}
\usage{
ProjecTILs.classifier(
  query,
  ref = NULL,
  filter.cells = TRUE,
  split.by = NULL,
  reduction = "pca",
  ndim = NULL,
  k = 5,
  nn.decay = 0.1,
  min.confidence = 0.2,
  labels.col = "functional.cluster",
  overwrite = TRUE,
  ncores = 1,
  ...
)
}
\arguments{
\item{query}{Query data, either as single Seurat object or as a list of Seurat object}

\item{ref}{Reference Atlas - if NULL, downloads the default TIL reference atlas}

\item{filter.cells}{Pre-filter cells using `scGate`. Only set to FALSE if the dataset has
been previously subset to cell types represented in the reference.}

\item{split.by}{Grouping variable to split the query object (e.g. if the object contains multiple samples)}

\item{reduction}{The dimensionality reduction used to assign cell type labels}

\item{ndim}{The number of dimensions used for cell type classification}

\item{k}{Number of neighbors for cell type classification}

\item{nn.decay}{Weight decay for internal nearest neighbors (between 0 and 1)}

\item{min.confidence}{Minimum confidence score to return cell type labels (otherwise NA)}

\item{labels.col}{The metadata field with label annotations of the reference, which will
be transferred to the query dataset}

\item{overwrite}{Replace any existing labels in \code{labels.col} with new labels.
This may be useful for predicting cell types using multiple reference maps; run
this function with \code{overwrite=FALSE} to combine existing labels
with new labels from a second reference map.}

\item{ncores}{Number of cores for parallel processing}

\item{...}{Additional parameters to \link[ProjecTILs]{make.projection}}
}
\value{
The query object with a additional metadata columns containing predicted cell labels
    and confidence scores for the predicted cell labels
    If cells were filtered prior to projection, they will be labeled as 'NA'
}
\description{
Apply label transfer to annotate a query dataset with the cell types of a reference object.
Compared to \link{Run.ProjecTILs}, only cell labels are returned. The low-dim embeddings of
the query object (PCA, UMAP) are not modified.
}
\details{
See \link{load.reference.map} to load or download a reference atlas.
See \link{Run.ProjecTILs} to embed the query in the same space of the reference
}
\examples{
data(query_example_seurat)
ref <- load.reference.map()
q <- ProjecTILs.classifier(query_example_seurat, ref=ref)
table(q$functional.cluster, useNA="ifany")
}
