View source: R/synthesize_cells.R
synthesize_cells | R Documentation |
This function is used to synthesize fake cells via linear combination when the
number of cells is not the power of 2. First, we need cell group information
where real cells are sampled from. If no group information input, we perform
k-means algorithm on the data and use NbClust
funciton
to determin the best cluster number. Finally, we merge the synthesized and
real data as the output result.
synthesize_cells(dataset, group = NULL, seed, verbose = FALSE)
dataset |
A matrix or the result generated by |
group |
A vector. Default is NULL. |
seed |
Integer. A random seed. |
verbose |
If return messages. |
A list generated by wrap_expression
set.seed(1)
a <- matrix(rpois(n = 2500, lambda = 2), nrow = 50)
rownames(a) <- paste0("cell_", 1:ncol(a))
colnames(a) <- paste0("gene_", 1:nrow(a))
dataset_ref <- dynwrap::wrap_expression(
counts = a,
expression = log2(a+1)
)
result <- synthesize_cells(dataset = a, seed = 2)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.