ProjecTILs.classifier: Annotate query dataset using a reference object

View source: R/main.R

ProjecTILs.classifierR Documentation

Annotate query dataset using a reference object

Description

Apply label transfer to annotate a query dataset with the cell types of a reference object. Compared to Run.ProjecTILs, only cell labels are returned. The low-dim embeddings of the query object (PCA, UMAP) are not modified.

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

query

Query data, either as single Seurat object or as a list of Seurat object

ref

Reference Atlas - if NULL, downloads the default TIL reference atlas

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.

split.by

Grouping variable to split the query object (e.g. if the object contains multiple samples)

reduction

The dimensionality reduction used to assign cell type labels

ndim

The number of dimensions used for cell type classification

k

Number of neighbors for cell type classification

nn.decay

Weight decay for internal nearest neighbors (between 0 and 1)

min.confidence

Minimum confidence score to return cell type labels (otherwise NA)

labels.col

The metadata field with label annotations of the reference, which will be transferred to the query dataset

overwrite

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

ncores

Number of cores for parallel processing

...

Additional parameters to make.projection

Details

See load.reference.map to load or download a reference atlas. See Run.ProjecTILs to embed the query in the same space of the reference

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'

Examples

data(query_example_seurat)
ref <- load.reference.map()
q <- ProjecTILs.classifier(query_example_seurat, ref=ref)
table(q$functional.cluster, useNA="ifany")

carmonalab/ProjecTILs documentation built on April 13, 2025, 10:04 p.m.