Description Usage Arguments Details Value Note Examples
View source: R/05_compute_power.R
Computes power for single cell data that is cell-type specifc and hierarchical. This function computes power using random effects to account for the correlation structure that exists among measures from cells within an individual. The power calculations will borrow information from the input data (or the package default data) to simulate data under a variety of pre-determined conditions. These conditions include the mean and standard deviation of the continuous measure of interest, number of genes, number of samples (i.e., independent experimental units), correlation between the outcome and fold change, and the mean number of cells per individual.
1 2 3 4 5 6 7 8 9 10 11 12 | power_hierarchicell_continuous(
data_summaries,
n_genes = 10000,
n_individuals = 3,
cells_per_individual = 100,
ncells_variation_type = "Poisson",
pval = 0.05,
rho = 1,
continuous_mean = 0,
continuous_sd = 1,
decrease_dropout = 0
)
|
data_summaries |
an R object that has been output by the package's compute_data_summaries function. No default |
n_genes |
an integer. The number of genes you would like to simulate for your dataset. Too large of a number may cause memory failure and may slow the simulation down tremendously. We recommend an integer less than 40,000. Defaults to 10,000. |
n_individuals |
an integer. The number of independent samples for simulation. If not specifying a foldchange, the number of cases and controls does not matter. Defaults to 3. |
cells_per_individual |
an integer. The mean number of cells per control you would like to simulate. Too large of a number may cause memory failure and may slow the simulation down tremendously. We recommend an integer less than 300, but more is possible. We note that anything greater than 100, brings marginal improvements in power. Defaults to 100. |
ncells_variation_type |
either "Poisson", "NB", or "Fixed". Allows the number of cells per individual to be fixed at exactly the specified number of cells per individual, vary slightly with a poisson distribution with a lambda equal to the specified number of cells per individual, or a negative binomial with a mean equal to the specified number of cells and dispersion size equal to one.Defaults to "Poisson". |
pval |
a number. The significance threshold (alpha) to use for significance. Defaults to 0.05. Can also be a vector of pvalue - up to a length of 5. |
rho |
a number between -1 and 1. The amount of correlation between fold change and the continuous measure of interest.Defaults to 1. |
continuous_mean |
A number. The mean for your continuous measure of interest. Assumes a normal distribution.Defaults to 0. |
continuous_sd |
A number. The standard deviation for your continuous measure of interest. Assumes a normal distribution.Defaults to 1. |
decrease_dropout |
a numeric proportion between 0 and 1. The proportion by which you would like to simulate decreasing the amount of dropout in your data. For example, if you would like to simulate a decrease in the amount of dropout in your data by twenty percent, then 0.2 would be appropriate. This component of the simulation allows the user to adjust the proportion of dropout if they believe future experiments or runs will have improved calling rates (due to improved methods or improved cell viability) and thereby lower dropout rates. Defaults to 0. |
Prior to running the power_hierarchicell
function, it
is important to run the filter_counts
function followed by the
compute_data_summaries
function to build an R object that is
in the right format for the following simulation function to properly work.
The estimated power under the specified conditions when using random effects to account for the correlation structure that exists among measures from cells within an individual.
Data should be only for cells of the specific cell-type you are interested in simulating or computing power for. Data should also contain as many unique sample identifiers as possible. If you are inputing data that has less than 5 unique values for sample identifier (i.e., independent experimental units), then the empirical estimation of the inter-individual heterogeneity is going to be very unstable. Finding such a dataset will be difficult at this time, but, over time (as experiments grow in sample size and the numbers of publically available single-cell RNAseq datasets increase), this should improve dramatically.
1 2 3 4 5 6 | clean_expr_data <- filter_counts()
data_summaries <- compute_data_summaries(clean_expr_data)
power_hierarchicell_continuous(data_summaries,
n_genes = 100,
n_individuals = 2,
cells_per_individual = 50)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.