View source: R/PRIOR_FUNCTIONS.R
Prior_fun | R Documentation |
EstPrior
and AdjustSIZE_fun
A wrapper function for estimating the parameters of prior using the hybrid method adjusted MME estimates based on maximization of marginal likelihood. Input raw data and a vector of capture efficiencies of cells.
Prior_fun( Data, BETA_vec, parallel = TRUE, NCores = 5, FIX_MU = TRUE, GR = FALSE, BB_SIZE = TRUE, verbose = TRUE )
Data |
A matrix of single-cell expression where rows
are genes and columns are samples (cells). |
BETA_vec |
A vector of capture efficiencies of cells. |
parallel |
If TRUE, 5 cores will be used for parallelization. Default is TRUE. |
NCores |
number of cores to use, default is 5.
This will be used to set up a parallel environment
using either MulticoreParam (Linux, Mac) or
SnowParam (Windows) with |
FIX_MU |
If TRUE, then 1D optimization, otherwise 2D optimization (slow). Default is TRUE. |
GR |
If TRUE, the gradient function will be used in optimization. However since the gradient function itself is very complicated, it does not help too much in speeding up. Default is FALSE. |
BB_SIZE |
If TRUE, estimate BB size, and then use it for adjusting MME SIZE. Use the adjusted MME size for bayNorm. Default is TRUE. |
verbose |
Print out status messages. Default is TRUE. |
By Default, this function will estimate mu and
size for each gene using MME method. If BB_size
is enable, spectral projected gradient method from BB
package will be implemented to estimate 'BB size' by
maximizing marginal likelihood function. MME estimated
size will be adjusted according to BB size. BB size itself
will not be used in bayNorm this is because that in
our simulation we found that MME estimated mu and size
have more accurate relationship, but MME estimated
size deviates from the true value. BB size is overall
more close to the true size but it does not possess a
reasonable relationship with either MME estimated mu or
BB estimated mu.
List of estimated parameters: mean expression of genes and size of each gene.
data('EXAMPLE_DATA_list') PRIOR_RESULT<-Prior_fun(Data=EXAMPLE_DATA_list$inputdata[,seq(1,30)], BETA_vec = EXAMPLE_DATA_list$inputbeta[seq(1,30)],parallel=FALSE, NCores=5,FIX_MU=TRUE,GR=FALSE,BB_SIZE=TRUE,verbose=TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.