DESeq2::plotPCA()
1
0
Entering edit mode
Kai Hu ▴ 70
@kai
Last seen 7 months ago
Worcester

Hi Michael,

For the DESeq2::plotPCA() function, it calls the pca <- prcomp(t(assay(object)[select, ])) internally. I compared the results from prcomp and that of FactoMineR::PCA, the variances explained by PC1 from the two functions differ. Specifically, PC1 from DESeq2::plotPCA() is 99%, which is concerning high while PC1 from FactoMineR::PCA is a more reasonable 70% or so. The discrepancy seems to boil down to the fact that the scale. argument is set to FALSE in the prcomp function, whereas FactoMineR::PCA seems to scale by default.

I read the prcomp documentation, it actually recommends setting scale. = TRUE:

scale. a logical value indicating whether the variables should be 
scaled to have unit variance before the analysis takes place. 
The default is FALSE for consistency with S, but in general scaling 
is advisable. Alternatively, a vector of length equal the number of 
columns of x can be supplied. The value is passed to scale.

Therefore, I am wondering if is intentional to use the default scale. = FALSE in the DESeq2::plotPCA(). And should I scale the data before using DESeq2::plotPCA()?

Thanks and best,

DESeq2 • 3.6k views
ADD COMMENT
1
Entering edit mode
ATpoint ★ 4.6k
@atpoint-13662
Last seen 13 hours ago
Germany

Hi, this has been asked and answered before, e.g. Is DESeq2 PCAplot already scaled?

You can probably find other answers using google or the search function.

ADD COMMENT
0
Entering edit mode

Thanks very much! Simply put, after vst transformation, it is not recommended to scale if using DESeq2::plotPCA().

By default, base::prcomp() set scale. to FALSE, whereas FactoMineR::PCA() set scale.unit to TRUE. This causes the plotting discrepancies that I observed. But why my PC1 is counting for 99% of the variance is another question.

ADD REPLY

Login before adding your answer.

Traffic: 857 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6