make_PCs_irlba: Run Principal Component Analysis (PCA) using the irlba...

Description Usage Arguments Value References Examples

View source: R/correlation_matrices.R

Description

A simple wrapper around the irlba() function which computes a partial SVD efficiently. This function's run time depends on the number of eigenvectors requested but scales well. Use this function to generate covariates for use with the okriging or krigr_cross_validation functions.

Usage

1
make_PCs_irlba(X, n.top = 2)

Arguments

X

A correlation matrix.

n.top

Number of top principal compenents to return

Value

A matrix of Principal Components of dimension (# of samples) x (n.top). As expected, eigenvectors are ordered by eigenvalue. Rownames are given as sample IDs.

References

library(irlba)

Examples

1
2
3
4
5
6
7
8
## compute PC's using the  gene expression correlation matrix from vignette
 ## load gene expression values from vignette
 expressionFile <- system.file(package = "OmicKriging",
                     "doc/vignette_data/ig_gene_subset.txt.gz")
 ## compute correlation matrix
 geneCorrelationMatrix <- make_GXM(expressionFile)
 ## find top ten PC's of this matrix using SVD
 topPcs <- make_PCs_irlba(geneCorrelationMatrix, n.top=10)

hakyimlab/OmicKriging documentation built on Nov. 1, 2020, 1:33 a.m.