Description Usage Arguments Value
View source: R/generateFrequencies.R
Given a batchStructure and baseline frequency distribution (in log space), this function will generate a cell state frequency distribution for each sample. This function also allows users to induce a designated fold change (fc) into either case samples or control samples, and control the magnitude of covariance that cell states have with each other via cf_sigma (e.g. increase or decrease the cell state frequency variation across samples). The magnitude of the fold change will be the ratio of case to control cells (e.g. inducing a fold change of 2 in cases will result in there being, on average, 2 times more case cells than control cells of that cluster
1 2 3 4 5 6 7 8 | generateFreqs(
batchStructure,
log_prior,
clus,
fc = 1,
cond_induce = "cases",
cf_sigma
)
|
batchStructure |
The structure of the study design in which cases and controls are split into batches. These structures are output by the "distributeSample" functions (which can then be modified if specific structure is desired). |
log_prior |
A named vector containing the mean frequencies of the prototype dataset's cell states (log space). The "estimateFreqVar" function returns this a mean frequency vector in linear space (can be transformed into log space via the "log" function). |
clus |
The name of the cluster in which a fold change will be induced. |
fc |
The magnitude of the fold change that will be induced in the chosen cluster. If no fold change is desired, set fc = 1. |
cond_induce |
The condition you wish to induce a fold change in. Setting cond_induce = "cases" will induce a fold change into cases, while setting cond_induce = "ctrls" will induce a fold change into controls. |
cf_sigma |
A matrix containing the covariance between cell states. This matrix is received as output from the "estimateFreqVar" function |
Returns a list containing: a list of cell state frequencies for all case samples and a list of cell state frequencies for all control samples
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.