Skip to contents

Generate scores for cell types for each level

Usage

hitype_assign(
  clusters,
  scores,
  gs = NULL,
  fallback = "Unknown",
  threshold = 0.05,
  top = 10
)

Arguments

clusters

A named vector of original cluster assignments (names - cell names, values - cluster assignments)

scores

A list of matrices of cell type scores for each level

gs

The gene sets prepared by gs_prepare The cell_names is actually used. One could also pass gs$cell_names directly.

fallback

A fallback cell type if no cell type is assigned

threshold

A threshold for low confidence cell type assignment The cell types are only assigned for cells with scores higher than the threshold * ncells. (0 - 1, default 0.05)

top

The number of top cell types to assign for each cluster in the result.

Value

A dataframe with columns: Level, Cluster, CellType and Score. For each level and cluster, the top cell types are returned. You can use summary.hitype_result to print the combination of cell types for each cluster.