get_random_structure | R Documentation |
Compute structure of dependency from a given data
get_random_structure(datasets, method, rank = 2, types = "normal")
datasets |
A list of data matrices that we will mimic. All datasets have samples in the columns and features (e.g., genes, proteins) in the rows. All datasets must have the same samples in corresponding columns. |
method |
One of 'pca', 'spiked Wishart', or 'corp.cor', for the method of determining a dependency structure |
rank |
Number of PCA components to approximate the dependence structure of. Only used if method = 'pca'. |
types |
The marginal distribution types ('normal', 'poisson', 'DESeq2', or 'empirical'), as a list with entries corresponding to datasets. If just a single value is provided, then it is used for all datasets. |
A random structure element suitable for use with draw_from_multivariate_corr().
# Simple data to mimic
true_means <- c(0, 1, 10, 1000)
data <- rpois(4*12, true_means) |> matrix(4, 12)
# Simulate draws mimicking that data
rs <- get_random_structure(list(data=data), method="pca", rank=2, type="poisson")
draws <- draw_from_multivariate_corr(rs, n_samples=30)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.