pca: pca - Principal Component Analysis (PCA)

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/pca.R

Description

pca - This is a wrapper function around prcomp from stats package. It will prepare the DNA micro array data, run the principal component analysis and return an object of type 'pca'

plot.pca - Makes a score plot with legend of object type 'pca'.

getProbeIds.pca - Get probe ids from PCA loadings.

pcaInfoPlot - Makes a informative score plot with optional overrepresented GO terms and predicted transcription factor binding sites annotated along the axis.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
pca(eData, printDropped = TRUE, scale=TRUE, center=TRUE)

## S3 method for class 'pca'
plot(x, groups, PCs = c(1,2), printNames = TRUE,
     symbolColors = TRUE, plotCI = TRUE, GOtreeObjs, primoObjs,
     main, ...)

## S3 method for class 'pca'
getRankedProbeIds(x, pc = 1, decreasing = TRUE)

pcaInfoPlot(eData, inputType = "hgu133plus2", org = "Hs", groups,
            printNames = TRUE, plotCI = TRUE, noProbes = 1365,
            GOtermsAnnotation = TRUE, primoAnnotation = TRUE)

Arguments

eData

an ExpressionSet object or a table with expression data with variables in rows and observations in columns. Row names should be probe identifiers (Affymetrix probe set ID, Gene Symbol or Entrez IDs), column names should be sample identifiers.

printDropped

a logical value determination whether or not dropped probes should be printed. Probes are dropped if all values are equal.

scale

a logical value determination whether or not input values should be scaled. Default is TRUE.

center

a logical value determination whether or not input values should be centered. Default is TRUE.

x

Object of type 'pca'. Created by function pca.

groups

a factor containing group information.

PCs

an integer vector indication which principal components to use in the score plot. Exactly two principal components should be given.

printNames

a logical value indicating whether observation names should be printed. Default is TRUE.

symbolColors

a logical value indicating whether the symbols should be plotted with colors. Default is TRUE.

plotCI

a logical value indicating whether the confidence intervals for each group should be plotted. Default is TRUE.

GOtreeObjs

a list of GOtree objects which is used for annotation of the axis in the PCA plot - used by function pcaInfoPlot().

primoObjs

a list of primo objects which is used for annotation of the axis in the PCA plot - used by function pcaInfoPlot().

main

a character vector with the title of the plot. If no title is given, a default one will be provided. Set to NULL for no title.

...

other parameters to be passed through to plotting functions.

pc

a number indication which principal component to extract the probe identifiers from.

decreasing

a logical value indication whether the probe identifiers from PCA loadings should be sorted in decreasing of ascending order ( decreasing == FALSE ).

inputType

a character vector with the input type. See '?primo' for details. Default is "hgu133plus2".

org

a character vector with the organism. See '?primo' for details. Default is "Hs".

noProbes

a numeric value indication the number of probes to use for GOtree and primo.

GOtermsAnnotation

a logical value to select GO terms annotation along the axis. The default is TRUE.

primoAnnotation

a logical value to select predicted transcription factor binding site annotation along the axis. The default is TRUE.

Details

pca uses prcomp to do the principal component analysis. The input data (x) is scaled and centered, so constant variables (sd = 0) will be removed to avoid divison by zero.

plot.pca makes a PCA score plot. The input data is an object of type 'pca'. The score plot is formatted and the observations are colored according to the class. A legend describing the class is placed below the plot. The proportion of variance is plotted along the axis.

getRankedProbeIds.pca extract the probe identifiers from PCA loadings from an object of type pca. The purpose of this function is to ease the extraction of probe identifiers from an object of type pca. It generally just gets the rownames from the loadings and sort it according to pc and decreasing.

Value

pca returns the an object of type 'pca'.

getRankedProbeIds return a vector with the probe ids sorted from higher to lower if decreasing = TRUE or from lower to higher if decreasing = FALSE.

Author(s)

Morten Hansen mhansen@sund.ku.dk and Jorgen Olsen jolsen@sund.ku.dk

See Also

prcomp.

Examples

1
2
3
4
5
6
7
8
library(serumStimulation)
data(serumStimulation)
groups <- as.factor(c(rep("control", 5), rep("serumInhib", 5),
                    rep("serumOnly", 3)))
pcaOutput <- pca(serumStimulation)
pcaOutput
plot(pcaOutput, groups=groups)
posLoadings <- getRankedProbeIds(pcaOutput)

pcaGoPromoter documentation built on Oct. 31, 2019, 5:31 a.m.