View source: R/function_generate_random_data.R
generate_random_data | R Documentation |
'generate_random_data' simulates data which can be used exemplary for
digital tissue deconvolution. It will generate a numeric matrix with '
n.features' rows, and ('n.types' * 'n.samples.per.type') columns.
Each column represents a sample of special type. The function will generate
'n.types', and for each type 'n.samples.per.type'.
Mathematically, each feature is drawn from a poisson distribution.
For each feature in every cell type, a lambda is drawn randomly.
Then it generates multiple samples per type. This ensures that samples
from the same cell type have similar counts for the same feature.
generate_random_data( n.types = 5, n.samples.per.type = 10, n.features = 1000, sample.type = "Cell", feature.type = "gene", seed = 1310 )
n.types |
integer, 2 <= 'n.types', how many different types should be included in the data set |
n.samples.per.type |
integer 1 <= 'n.samples.per.type', how many samples should be generated per type |
n.features |
integer, 1 <= 'n.features', how many features should be included |
sample.type |
string, name of samples |
feature.type |
string, name of features |
seed |
integer, will be passed to "set_seed" |
matrix with ('n.types' * 'n.samples.per.type') columns, and 'n.features' rows
library(DTD) random.data <- generate_random_data( n.types = 5, n.samples.per.type = 10, n.features = 100, sample.type = "Cell", feature.type = "gene" ) # normalize all samples to the same amount of counts: random.data <- normalize_to_count(random.data)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.