affiXcanPcs: Compute PCs in MultiAssayExperiment objects using...

Description Usage Arguments Value Examples

View source: R/AffiXcan.R

Description

Compute PCs in MultiAssayExperiment objects using eigenvectors given by user

Usage

1
2
3
4
5
6
7
affiXcanPcs(
  tbaPaths,
  affiXcanTraining,
  scale,
  BPPARAM = bpparam(),
  testingSamples = NULL
)

Arguments

tbaPaths

A vector of strings, which are the paths to MultiAssayExperiment RDS files containing the tba values

affiXcanTraining

The returning object from affiXcanTrain()

scale

A logical; if scale=FALSE the TBA values will be only centered, not scaled before performing PCA

BPPARAM

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

testingSamples

A vector of strings. The identifiers (e.g. row names of MultiAssayExperiment objects from tbaPaths) of the samples that have not been considered in the training phase, to be used in the cross-validation; default is NULL; if is.null(testingSamples)==TRUE then no filtering is performed

Value

A list of matrices containing the principal components values of TBA for each region; each object of the list is named after the MultiAssayExperiment object from which it derives

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
if (interactive()) {
data(exprMatrix)
data(trainingCovariates)
data(regionAssoc)

trainingTbaPaths <- system.file("extdata","training.tba.toydata.rds",
package="AffiXcan")
testingTbaPaths <- system.file("extdata","testing.tba.toydata.rds",
package="AffiXcan")

assay <- "values"

training <- affiXcanTrain(exprMatrix=exprMatrix, assay=assay,
tbaPaths=trainingTbaPaths, regionAssoc=regionAssoc, cov=trainingCovariates,
varExplained=80, scale=TRUE)

pcs <- affiXcanPcs(tbaPaths=testingTbaPaths, affiXcanTraining=training,
scale=TRUE)
}

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