Skip to contents

Based on the results of the MatrixFactorization and the clustering information, the CellTopics representing each domain are calculated.

Usage

FindCellTopic(
  dt_topic_data,
  ct_topic_data,
  spot_clusters,
  cluster = NULL,
  percent = NULL,
  Binarization = FALSE
)

Arguments

dt_topic_data

A data frame, row is topic and col is domain. The result of function MatrixFactorization.

ct_topic_data

A data frame, row is celltype and col is topic. The result of function MatrixFactorization.

spot_clusters

A data frame contains clustering information for spots, row is spots.

cluster

A character. Use the first column in spot_clusters as the column name if NULL. Or provide your own column names that represent clustering information in spot_clusters.

percent

A numeric from 0 to 1. The percent of topics. Default is 0.6.

Binarization

Logical indicating if to choose one topic for each CellTopic. Default is FALSE.

Value

A list with three data frame and one vector. "CellTopic" is a data frame which can be add to a Seurat object. The "domain_topic" is a data frame, row is CellTopic. and col is domain. The "celltype_topic" is a data frame, row is celltype and col is CellTopic. The "Cell_topic" is a vector of which topic be chosen in each CellTopic.