fit.CP {HeritSeq} | R Documentation |
Fit compound Poisson mixed effect models (CPMM) for one or more features.
Description
Fit a CPMM for one or more features and output the fit parameters. It is used before the function computeVPC.CP(). This function also allows to test the presence of heritability via random effect variance of the model.
Usage
fit.CP(CountMatrix, Strains, test = FALSE, optimizer = "nlminb")
Arguments
CountMatrix |
Sequencing count matrix for one or more features. Each row is for one feature, and the columns are for samples. |
Strains |
Strain labels for the samples. |
test |
TRUE or FALSE (default). Test the presence of heritability
through examining the random effect variance |
optimizer |
A character string that determines which optimization routine is to be used. Possible choices are "nlminb" (default), "L-BFGS-B", and "bobyqa". |
Value
A list with two objects. The first object is a
G \times 4
matrix indicating the fitted parameters for each
feature. The columns are ordered by intercept \alpha_g
, tweedie
parameter p_g
, random effect variance \sigma^2_g
, and dispersion
\phi_g
. Row names are feature names. If the argument test is set to
be true, the second object of the list consists of p-values for testing
the hypothesis that random effects \sigma_a^2 = 0
;
otherwise, the second object is NULL.
Examples
## Fit CPMM for the first two features and test the presence of
## heritability.
result.cp <- fit.CP(simData[1:2, ], strains, test = TRUE)
## Extract parameters
para.cp <- result.cp[[1]]
## Extract p-values
pval.cp <- result.cp[[2]]