computeExpr {AffiXcan} | R Documentation |
Compute the imputed GReX for a certain gene on a set of individuals
computeExpr(bs, pcs)
bs |
A list containing three objects: coefficients: An object containing the coefficients of the principal components used in the model, completely similar to the "coefficients" object from the results of lm() pval: The uncorrected anova pvalue of the model, retrieved from anova(model, modelReduced, test="F")$'Pr(>F)'[2] r.sq: The coefficient of determination between the real total expression values and the imputed GReX, retrived from summary(model)$r.squared |
pcs |
A list, which is the returning object of affiXcanPcs() |
A summarizedExperiment object; SummarizedExperiment::assays(returningObject)$GReX is a matrix containing the imputed GReX values
if (interactive()) { trainingTbaPaths <- system.file("extdata","training.tba.toydata.rds", package="AffiXcan") data(exprMatrix) data(regionAssoc) data(trainingCovariates) assay <- "values" training <- affiXcanTrain(exprMatrix=exprMatrix, assay=assay, tbaPaths=trainingTbaPaths, regionAssoc=regionAssoc, cov=trainingCovariates, varExplained=80, scale=TRUE) testingTbaPaths <- system.file("extdata","testing.tba.toydata.rds", package="AffiXcan") pcs <- affiXcanPcs(tbaPaths=testingTbaPaths, affiXcanTraining=training, scale=TRUE) bs <- training$bs exprmatrix <- computeExpr(bs=bs, pcs=pcs) }