affiXcanPca {AffiXcan} | R Documentation

## Perform a PCA on each experiment found in MultiAssayExperiment objects

### Description

Perform a PCA on each experiment found in MultiAssayExperiment objects

### Usage

    affiXcanPca(tbaPaths, varExplained, scale, regionsCount,
      BPPARAM = bpparam())

### Arguments

`tbaPaths` | A vector of strings, which are the paths to MultiAssayExperiment RDS files containing the tba values
`varExplained` | An integer between 0 and 100; varExplained=80 means that the principal components selected to fit the models must explain at least 80 percent of variation of TBA values
`scale` | A logical; if scale=FALSE the TBA values will be only centered, not scaled before performing PCA
`regionsCount` | An integer, that is the summation of length(assays()) of every MultiAssayExperiment RDS object indicated in the param tbaPaths; it is the returning value from overlookRegions()
`BPPARAM` | A BiocParallelParam object. Default is bpparam(). For details on BiocParallelParam virtual base class see browseVignettes("BiocParallel")

### Value

pca: A list containing lists named as the MultiAssayExperiment::experiments() found in the MultiAssayExperiment objects listed in the param tbaPaths. Each of these lists contains two objects:

eigenvectors: A matrix containing eigenvectors for those principal components selected according to the param varExplained

pcs: A matrix containing the principal components values selected according to the param varExplained

### Examples

    if (interactive()) {
    tbaPaths <- system.file("extdata","training.tba.toydata.rds",
    package="AffiXcan")
    regionsCount <- overlookRegions(tbaPaths)

    pca <- affiXcanPca(tbaPaths=tbaPaths, varExplained=80, scale=TRUE,
    regionsCount=regionsCount)
    }

[Package AffiXcan version 1.2.0 Index]