Description Usage Arguments Value Examples
View source: R/run.all.lmers.R
Function that will run a regression for your variable of interest across all genes/metabolites/CpGs, in parallel. Adapted from Vamsee (github.com/vkp3/pillalamarRi)
1 2 3 4 5 6 7 8 9 | run.all.lmers(
tx_expr,
cov,
rcov,
gene.ids,
SCORE,
omit.outlier = T,
num.cores = 10
)
|
tx_expr |
Expression matrix in form: genes x samples. Will be converted to a list(!) of gene-expr vectors (if not input as list) |
cov |
Regression covariates (fixed effects) cov x samples |
rcov |
Regression covariates to be treated as random effects |
gene.ids |
Character vector of gene IDs, corresponding to rows in |
SCORE |
Main covariate to be permuted (not included in |
omit.outlier |
Whether or not you want to omit gene expression outliers |
num.cores |
The number of cores you would like to use |
All regression coefficients for lmer(gene expression ~ SCORE + cov + (1|rcov)) for all genes
1 2 3 4 5 | tx_expr <- w.mt[,which(colnames(w.mt) %in% make.names(metablist))]
cov <- w.mt[,which(colnames(w.mt) %in% c('sex', 'age1c', 'PC1', 'PC2', 'PC3', 'bmi', 'Exam'))]
rcov <- w.mt[,which(colnames(w.mt) %in% c('idno'))]
SCORE <- w.mt[,which(colnames(w.mt) == "dpcrAdjMetric")]
lm_res.sort <- run.all.lmers(tx_expr, cov, rcov, colnames(tx_expr), SCORE, omit.outlier = T, num.cores = 10)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.