computeRSquared: Compute R and R^2 between rows of two SummarizedExperiment...

Description Usage Arguments Value Examples

View source: R/AffiXcan.R

Description

Compute R and R^2 between rows of two SummarizedExperiment assays

Usage

1
2
3
4
5
6
7
computeRSquared(
  realExpr,
  imputedExpr,
  assay,
  testingSamples = NULL,
  BPPARAM = bpparam()
)

Arguments

realExpr

A SummarizedExperiment object containing expression data

imputedExpr

The returning object of affiXcanImpute()

assay

A string with the name of the object in SummarizedExperiment::assays(realExpr) that contains expression values

testingSamples

A vector of strings. The identifiers of the samples that have to be considered by the function; default is NULL; if is.null(testingSamples)==TRUE then no filtering is performed

BPPARAM

A BiocParallelParam object. Default is bpparam(). For details on BiocParallelParam virtual base class see browseVignettes("BiocParallel")

Value

A list of lists; inner lists are named after the rows for which the correlation between realExpr and imputedExpr have been computed; inner lists contain two objects:

Examples

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

correlation <- computeRSquared(realExpr, imputedExpr, assay)
}

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