prcomp.DGEList | R Documentation |
Principal component analysis of DGEList
## S3 method for class 'DGEList'
prcomp(x, ntop = NULL, scale = FALSE, verbose = FALSE, ...)
x |
A |
ntop |
Integer, how many top-variable features should be used? If |
scale |
Logical, whether variance of features should be scaled to 1. |
verbose |
Logical, whether the function should print messages. |
... |
Other parameters passed to The function first remove all-zero-count features, because they can make the PCA plot of samples delusive. Next, it applies Finally, PCA is applied to the vsn-transformed matrix. |
The function returns a prcomp
object. The fit object is saved in the vsnFit
field in the returned object, and the transformed matrix is saved in the vsnMat
field.
prcompExprs
myCounts <- matrix(rnbinom(10000, 3, 0.25), nrow=1000)
myDgeList <- DGEList(counts=myCounts,
samples=data.frame(group=gl(5,2)))
myPrcomp <- prcomp(myDgeList)
## Not run:
vsn::meanSdPlot(myPrcomp$vsnFit)
## End(Not run)
## features with zero count in all samples do not contribute to the PCA analysis
myDgeList2 <- DGEList(counts=rbind(myCounts, rep(0, 10)),
samples=data.frame(group=gl(5,2)))
myPrcomp2 <- prcomp(myDgeList2)
stopifnot(identical(myPrcomp, myPrcomp2))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.