FRmatch_cell2cluster: FR-Match cell-to-cluster matching

View source: R/FRmatch_cell2cluster.R

FRmatch_cell2clusterR Documentation

FR-Match cell-to-cluster matching

Description

This is a user-end wrapper function that implements the steps of cell type matching between two single cell RNA-seq experiments (namely, query and reference) using the cell-to-cluster FR-Match approach that matches each query cell to a reference cluster.

Usage

FRmatch_cell2cluster(
  sce.query,
  sce.ref,
  use.cosine = TRUE,
  feature.selection = "reference.markers",
  filter.size = 5,
  filter.fscore = NULL,
  filter.nomarker = FALSE,
  add.pseudo.marker = FALSE,
  pseudo.expr = 1,
  subsamp.size = 10,
  subsamp.iter = 2000,
  subsamp.seed = 1,
  numCores = NULL,
  prefix = c("query.", "ref."),
  verbose = 1,
  ...
)

Arguments

sce.query

Data object of the SingleCellExperiment class for query experiment. See details in sce.example.

sce.ref

Data object of the SingleCellExperiment class for reference experiment. See details in sce.example.

feature.selection

Which set of features to use for the matching space? Default: feature.selection="reference.markers", use reference marker genes. If feature.selection="query.genes", use all query genes as the feature space, e.g. the query genes are probe genes for spatial transcriptomics experiment

filter.size, filter.fscore, filter.nomarker

Filtering out small/poor-quality/no-marker clusters. Default: filter.size=5, filter based on the number of cells per cluster; filter.fscore=NULL, do not filter based on the F-beta score, otherwise specify a numeric value between 0 and 1; filter.nomarker=FALSE, filter based on the boolean variable indicating if to filter reference clusters with no marker genes available in query in the case feature.selection="reference.markers".

add.pseudo.marker, pseudo.expr

Adding pseudo marker to stabilize no expression clusters in the marker gene feature space. Default: add.pseudo.marker=FALSE, boolean. Pseudo marker expression values are drawn from uniform distribution from 0 to pseudo.expr. Default: pseudo.expr=1, numeric, for the min-max scaled data after normalization.

subsamp.size, subsamp.iter, subsamp.seed

Numeric variables for iterative subsampling size, number of iterations, and random seed for iterations. YMMV.

numCores

Number of cores for parallel computing. Default: NULL, use the maximum number of cores detected by detectCores. Otherwise, specify by an integer value.

prefix

Prefix names for query and reference clusters. Default: prefix=c("query.", "ref.").

verbose

Numeric value indicating levels of details to be printed. Default: 1, only print major steps. If 0, no verbose; if 2, print all, including warnings.

...

Additional arguments passed to FRtest, including use.cosine.

Details

This implementation is FRmatch with an iterative subsampling scheme, which is a bootstrap-like approach to randomly select a smaller set of cells from a query cluster and quantify the confidence score of the selected cells belonging to certain reference cell type using the p-value outputted from FRtest (i.e. a larger p-value indicates higher probability of a match, and vice versa).

This function assigns the cluster-level p-value to each selected query cell, and updates the assigned p-value if the query cell is reselected from the iterative procedure and assigned a higher p-value. The output from this implementation includes a cell-by-cluster (a.k.a. query cell by reference cluster) matrix of p-values.

Value

A list of:

settings

Record of customized parameter settings specified in the function.

pmat

A cell-by-cluster (a.k.a. query cell by reference cluster) matrix of p-values retained from the iterative procedure.

cell2cluster

A data frame of cell-to-cluster matches summarized from the pmat.

Columns in cell2cluster are:

query.cell

Query cell ID.

query.cluster

Cluster membership of query cells.

match

Matched reference cluster for the query cell.

score

Confidence score of match.cell2cluster, which is the maximum value of the corresponding row in pmat.

See Also

Visualization of matching results using plot_FRmatch_cell2cluster.

Examples

## Not run: 
data("sce.example")
FRmatch_cell2cluster(sce.example, sce.example)

## End(Not run)


JCVenterInstitute/FRmatch documentation built on Dec. 15, 2022, 2:30 p.m.