Entering edit mode
6.7 years ago
mkh
▴
60
Hi all,
Do you know how do I plot PCA for top500 genes by prcomp() the same as PCAplot in Desq2?
I would like to plot the PCA for top 500 genes for PCA3 and PCA4.
Thanks
IIRC prcomp gives you a rotation matrix, from which you can get genes that contribute the most to PC3 and PC4. You could then use that subset to plot.
pcaExplorer is a cool package which can do it.
You can find more information here: pcaExplorer
As per Ram, you can easily do it with the rotation matrix from prcomp. For example:
Note that DESeq2's
plotPCA()
function removes genes based on low variance prior to performing PCA. So, which do you want:prcomp()
)?This is very helpful, thanks! I'm really new to prcomp and am having trouble figuring out what the x represents? Do you perhaps have a longer stretch of code I could look at? Thanks!
In this case,
x
represents your input data-matrix. By the way, my PCAtools package was accepted to Bioconductor since this post, and will be officially released at the end of this month. Details here: https://github.com/kevinblighe/PCAtoolsIt is awesome!!! Thank you!