Description Usage Arguments Value Note Author(s) Examples
A convenient function for generating the full covariate matrix and
preparing the response variables in a format that can be directly used
by function ols.eblup.trim()
.
1 |
GeneExp |
'GeneExp' is a m by n dimensional gene expression matrix, where m is the number of genes, and n is the number of subjects. |
CellProp |
'CellProp' is a n by K dimensional matrix of cell proportions, where K is the number of cell proportions. |
Demo |
|
include.demo |
Whether the demographical covariates should be included as the main effects in the model or not. Default to TRUE. |
w |
The weight matrix. The default value of 'w' is 'iid', which refers to a diagonal weighting matrix that is appropriate for i.i.d. data. |
X |
A combined covariate matrix with cell proportions as main
effects and all the interaction terms between cell proportions and
demographic covariates. If |
Y |
Vectorized gene expressions to be used as the response variable in the model. |
This function checks the numerical singularity of 'X', the combined covariate matrix. If the smallest singular value is less than '1e-7', it stops and asks the user to reduce the complexity of the model.
Hao Sun
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | ## load the data example
data(dat_train)
## preparing the covariate/response (the i.i.d. case)
des1 <- DataPrep(dat_train$GeneExp, dat_train$CellProp, dat_train$Demo,include.demo=TRUE)
dim(des1$X)
## an example of the weighted case.
nsamples <- nrow(dat_train$Demo)
# randomly generate some weights
tnmr <- runif(nsamples, 1, 5)
w = diag(tnmr)
##
des2 <- DataPrep(dat_train$GeneExp, dat_train$CellProp, dat_train$Demo,include.demo=TRUE, w = w)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.