Description Usage Arguments Details Value Examples
counts2PCA
Run principal component analysis on matrix of
voom-normalized counts
1 2 | counts2PCA(counts, info, ids, plotit = TRUE, pcas2return = 3,
plot.cols = "black", ...)
|
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 |
This function uses the R function princomp to calculate principal components
a list containing a dataframe with the experimental design data, merged with the 1st 3 principal component axes and a vector of
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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.