I have a list of deferentially expressed genes (DEGs) (dSeq2 generated) with normalized counts (for each replicate in each experimental condition), fold change, pvalue and padj. I want to do a PCA plot on R. Any simple script to do this please will help.
Thanks.
You can use the functions in the factoextra R package to make a PCA plot. Notably, the fviz_PCA_ind() function should do the trick. But just to double-check: are you sure you want to do a PCA on the DEGs? If you only input genes that you already know to be differentially expressed, then there's every reason to believe that the PCA will simply show clustering based on what-ever variable you used as the predictor in the differential gene expression analysis. So you wouldn't really learn very much from this PCA. I can imagine situations where this analysis could make sense so maybe this is what you want to do, I just figured I'd point this out just in case... Typically, we would want to choose the genes for the PCA in an unbiased manner (e.g. picking the 500 most variable genes), so as to get an unbiased view of the major drivers of gene expression variability in the data set.
Thanks for the swift response and advise. I have already done PCA before DEG.