counts2PCA: PCA of voom-transformed counts.

Description Usage Arguments Details Value Examples

Description

counts2PCA Run principal component analysis on matrix of voom-normalized counts

Usage

1
2
counts2PCA(counts, info, ids, plotit = TRUE, pcas2return = 3,
  plot.cols = "black", ...)

Arguments

counts

Counts matrix, typically transformed by limma::voom. Possibly output from pipelimma, in the slot "voom".

info

The experimental design information matrix

ids

A vector of the individual names

plotit

Logical, should the pca be plotted?

...

additional arguments passed on to pairs, for example, the colors of bars

Details

This function uses the R function princomp to calculate principal components

Value

a list containing a dataframe with the experimental design data, merged with the 1st 3 principal component axes and a vector of

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
## Not run: 
data(kidney) #from the simseq package
counts<-kidney$counts
counts<-counts[sample(1:nrow(counts),1000),]
info<-data.frame(rep=kidney$replic,
                 treatment=kidney$treatment)
stats<-pipeLIMMA(counts=counts,
                 info=info,
                 formula = " ~ treatment",
                 block=NULL)
pc <- voom2PCA(counts=stats$voom[["E"]],
               info=info,
               ids=rownames(info),
               plotit=TRUE)
library(ggplot2)
ggplot(pc, aes(x=PC1, y=PC2, col=treatment))+
   geom_point()

## End(Not run)

jtlovell/limmaDE2 documentation built on May 20, 2019, 3:14 a.m.