computeExpr: Compute the imputed GReX for a certain gene on a set of...

Description Usage Arguments Value Examples

View source: R/AffiXcan.R

Description

Compute the imputed GReX for a certain gene on a set of individuals

Usage

1

Arguments

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()

  • p.val: The uncorrected anova pvalue of the model

  • 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()

Value

A vector of imputed GReX values

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
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)

region <- "ENSG00000256377.1"
bs <- training$bs[[region]]

exprmatrix <- computeExpr(bs=bs, pcs=pcs)
}

AffiXcan documentation built on Nov. 8, 2020, 8:07 p.m.