match_cells | R Documentation |
This function is used to match cells in reference data with those in simulation data. Each cell in reference data corresponds to only one cell in simulation data and the correlation between them is also calculated and returned.
match_cells(ref_data, sim_data, t = FALSE, algorithm = "Improved_Hungarian")
ref_data, sim_data |
A matrix or dynwrap object created by |
t |
Whether the data matrix should be transposed when performing the PCA. |
algorithm |
Optional. Which algorithm used for matching cells in simulated and real data. Improved_Hungarian (default), Hungarian. |
A list contains the correlation matrix and a dataframe of the paired cells in reference and simulation data.
# Generate a reference data
set.seed(1)
ref_data <- matrix(rpois(n = 2500, lambda = 2), nrow = 50)
rownames(ref_data) <- paste0("cell_", 1:ncol(ref_data))
colnames(ref_data) <- paste0("gene_", 1:nrow(ref_data))
# Generate a simulation data
set.seed(1)
sim_data <- matrix(rpois(n = 2500, lambda = 1.5), nrow = 50)
rownames(sim_data) <- paste0("fcell_", 1:ncol(sim_data))
colnames(sim_data) <- paste0("fgene_", 1:nrow(sim_data))
# Match cells
match_result <- match_cells(ref_data = ref_data, sim_data)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.