scmapCell2Cluster: Approximate k-NN cell-type classification using scfinemap

Description Usage Arguments Value Examples

Description

Each cell in the query dataset is assigned a cell-type if the similarity between its nearest neighbour exceeds a threshold AND its w nearest neighbours have the same cell-type.

Usage

1
2
3
4
5
6
7
8
9
scmapCell2Cluster(scmapCell_results = NULL, cluster_list = NULL, w = 3,
  threshold = 0.5)

scmapCell2Cluster.SingleCellExperiment(scmapCell_results, cluster_list, w,
  threshold)

## S4 method for signature 'list'
scmapCell2Cluster(scmapCell_results = NULL,
  cluster_list = NULL, w = 3, threshold = 0.5)

Arguments

scmapCell_results

the output of 'scmapCell()' with 'projection' as its input.

cluster_list

list of cell cluster labels correspondint to each index against which the 'projection' has been projected

w

an integer specifying the number of nearest neighbours to find

threshold

the threshold which the maximum similarity between the query and a reference cell must exceed for the cell-type to be assigned

Value

The query dataset with the predicted labels attached to colData(query_dat)$cell_type1

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
library(SingleCellExperiment)
sce <- SingleCellExperiment(assays = list(normcounts = as.matrix(yan)), colData = ann)
# this is needed to calculate dropout rate for feature selection
# important: normcounts have the same zeros as raw counts (fpkm)
counts(sce) <- normcounts(sce)
logcounts(sce) <- log2(normcounts(sce) + 1)
# use gene names as feature symbols
rowData(sce)$feature_symbol <- rownames(sce)
# remove features with duplicated names
sce <- sce[!duplicated(rownames(sce)), ]
sce <- selectFeatures(sce)
sce <- indexCell(sce)
scmapCell_results <- scmapCell(sce, list(metadata(sce)$scmap_cell_index))
sce <- scmapCell2Cluster(scmapCell_results, cluster_list = list(colData(sce)$cell_type1))

scmap documentation built on Nov. 8, 2020, 8:07 p.m.