runPCA: Custom PCA function for analyzing gene expression data.

Description Usage Arguments Value Examples

View source: R/runPCA.R

Description

Performing PCA on a dataset and create a list object with results.

Usage

1
runPCA(pheno_mx = NULL, assay_idx = NULL, scale_pheno = FALSE)

Arguments

pheno_mx

Phenotype matrix with diemnsions g x N, where g is the number of genes and N is the number of samples.

assay_idx

The assay index to be used to retrieved a single assay from the SummarizedExperiment object.

scale_pheno

Logical value specifying the scaling of row of the pheno_mx. Default is set to FALSE.

Value

The following entries will be generated in the output list pca_result after running the example above.
rotation : Matrix of principal component gene weights where each column represents a single component. (standard prcomp() output)
x : Matrix of the projections of the original data onto principal componets. Each column holds a projection. (standard prcomp() output)
sdev: The standard deviation (square root of the eigen values) of each principal components. (standard prcomp() output)
percent_var : The percent variance each principal component is explaining. Calculated based on sdev.
peaks : Indicating which gene has a gene weight larger than 2 standard deviations of its component gene weights.
center : The mean values for each gene used to center the data. (standard prcomp() output)
scale : TRUE or FALSE value indicating whether the data was scaled. (standard prcomp() output)
Three attributes are set within the list object. "PCAobject" for class, "pca" for method and "no" for covar_cor.

Examples

1
2
3
data(expr_data)

pca_result <- runPCA(expr_data)

jinhyunju/picaplot documentation built on May 19, 2019, 10:35 a.m.