computeCorrelation: Compute R and R^2 on a particular row of two...

Description Usage Arguments Value Examples

View source: R/AffiXcan.R

Description

Compute R and R^2 on a particular row of two SummarizedExperiment assays

Usage

1
computeCorrelation(geneName, realExpr, imputedExpr)

Arguments

geneName

A string. The row name in realExpr and imputedExpr objects that identifies the vectors between which R and R^2 have to be computed

realExpr

A SummarizedExperiment object containing expression data

imputedExpr

The returning object of affiXcanImpute()

Value

A list of two objects:

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

imputedExpr <- affiXcanImpute(tbaPaths=trainingTbaPaths,
affiXcanTraining=training, scale=TRUE)
realExpr <- exprMatrix

geneName <- "ENSG00000256377.1"
imputedExpr <- SummarizedExperiment::assays(imputedExpr)$GReX
realExpr <- SummarizedExperiment::assays(realExpr)[[assay]]

correlation <- computeCorrelation(geneName, realExpr, imputedExpr) 
}

alussana/AffiXcan documentation built on Oct. 20, 2020, 12:08 a.m.