% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/main.R
\name{make.reference}
\alias{make.reference}
\title{Make a ProjecTILs reference}
\usage{
make.reference(
  ref,
  assay = NULL,
  assay.raw = "RNA",
  atlas.name = "custom_reference",
  annotation.column = "functional.cluster",
  recalculate.umap = FALSE,
  umap.method = c("umap", "uwot"),
  metric = "cosine",
  min_dist = 0.3,
  n_neighbors = 30,
  ndim = 20,
  dimred = "umap",
  nfeatures = 1000,
  color.palette = NULL,
  scGate.model.human = NULL,
  scGate.model.mouse = NULL,
  store.markers = FALSE,
  n.markers = 10,
  seed = 123,
  layer1_link = NULL
)
}
\arguments{
\item{ref}{Seurat object with reference atlas}

\item{assay}{The assay storing the reference expression data (e.g. "integrated")}

\item{assay.raw}{The assay storing raw expression data (e.g. "RNA")}

\item{atlas.name}{An optional name for your reference}

\item{annotation.column}{The metadata column with the cluster annotations for this atlas}

\item{recalculate.umap}{If TRUE, run the `umap` or `uwot` algorithm to generate embeddings.
Otherwise use the embeddings stored in the `dimred` slot.}

\item{umap.method}{Which method to use for calculating the umap reduction}

\item{metric}{Distance metric to use to find nearest neighbors for UMAP}

\item{min_dist}{Effective minimum distance between UMAP embedded points}

\item{n_neighbors}{Size of local neighborhood for UMAP}

\item{ndim}{Number of PCA dimensions}

\item{dimred}{Use the pre-calculated embeddings stored at `Embeddings(ref, dimred)`}

\item{nfeatures}{Number of variable features (only calculated if not already present)}

\item{color.palette}{A (named) vector of colors for the reference plotting functions.
One color for each cell type in 'functional.cluster'}

\item{scGate.model.human}{A mouse \link[scGate]{scGate} model to purify the cell types represented in the
map.}

\item{store.markers}{Whether to store the top differentially expressed genes in `ref@misc$gene.panel`}

\item{n.markers}{Store the top `n.markers` for each subtype given by differential
expression analysis}

\item{seed}{Random seed}

\item{layer1_link}{Broad cell type contained in this reference atlas (i.e. CD4T, CL:0000624...) to link with broad cell type annotation (layer1).}
}
\value{
A reference atlas compatible with ProjecTILs
}
\description{
Converts a Seurat object to a ProjecTILs reference atlas. You can preserve your low-dimensionality embeddings
(e.g. UMAP) in the reference atlas by setting `recalculate.umap=FALSE`, or recalculate the UMAP using one of
the two methods (\link[umap]{umap::umap} or  \link[uwot]{uwot::umap}). Recalculation allows exploting the
'predict' functionalities of these methods for embedding of new points; skipping recalculation will
make the projection use an approximation for UMAP embedding of the query.
}
\examples{
custom_reference <- ProjecTILs::make.reference(myref, recalculate.umap=T)
}
