% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/main.R
\name{Run.ProjecTILs}
\alias{Run.ProjecTILs}
\title{Project a query scRNA-seq dataset onto a reference atlas}
\usage{
Run.ProjecTILs(
  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",
  ...
)
}
\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, based on
majority voting of nearest neighbors between reference and query.}

\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 of the reference to annotate the clusters}

\item{...}{Additional parameters to \link[ProjecTILs]{make.projection}}
}
\value{
An augmented Seurat object with projected UMAP coordinates on the reference map and cell classifications
}
\description{
This function allows projecting ("query") single-cell RNA-seq datasets onto a reference map
(i.e. a curated and annotated scRNA-seq dataset).
To project multiple datasets, submit a list of Seurat objects with the query parameter.
The projection consists of 3 steps:
\itemize{
 \item{pre-processing: optional steps which might include pre-filtering of cells by markers using `scGate`,
data normalization, and ortholog conversion.}
 \item{batch-effect correction: uses built-in STACAS algorithm to detect and correct for batch effects
(this step assumes that at least a fraction of the cells in the query are in the same state than cells in
the reference)}
 \item{embedding of corrected query data in the reduced-dimensionality spaces (PCA and UMAP) of the reference map.}
}
This function acts as a wrapper for \link{make.projection} and \link{cellstate.predict}
}
\details{
See \link{load.reference.map} to load or download a reference atlas. See
also \link{ProjecTILs.classifier} to use ProjecTILs as a cell type classifier.
}
\examples{
data(query_example_seurat)
ref <- load.reference.map()
q <- Run.ProjecTILs(query_example_seurat, ref=ref, fast.umap.predict=TRUE)
plot.projection(ref=ref, query=q)
}
