DESeq2::plotPCA plotting error
1
0
Entering edit mode
960942 • 0
@e6da1b66
Last seen 22 months ago
United Kingdom

Hi all, I have an error when plotting a PCA graph on R studio. My graph seems to come back where the height dimension is very small making a thin rectangular graph compared to a square. I believe it is due to the scaling on the y and x axis being the same yet PC1 represents 96% variance compared to PC2% representing 2%. Is there a way to change the scaling size within DESeq2:plotPCA without using other programs? I have tried exporting or copying the graph but it still has this issue.

Thanks!

FaultyPCAplot sessionInfo( )

```

RStudio PCA DESeq2 • 1.9k views
ADD COMMENT
3
Entering edit mode
swbarnes2 ★ 1.3k
@swbarnes2-14086
Last seen 14 hours ago
San Diego

Plot PCA is a pretty bare bones simple little plotter, and you can't change much with it. To get more control, you are going to have to make the plot yourself, then you can control its dimensions, and stretch that Y axis like you want. I can tell you that with ggplot2, you can add coord_fixed(ratio = 1.5) to fix the proportions. I don't know how to do it with plot or plotly, so you'll have to google that.

ADD COMMENT
1
Entering edit mode

The output is ggplot, so yes, you can just add extra config functions with “+ …”

Re the OP question. The coordinate in the plot are actually correct this way. This is giving a fixed aspect ratio. Other plots would be distorted.

ADD REPLY
0
Entering edit mode

Hi there, I did think this afterwards, I am not use to seeing PC1 having such high variability on data! ;-P

Thank you!

ADD REPLY
0
Entering edit mode

Sure, the plot is correct as it is, but if they want it distorted, then it can be done.

(By "fix" I mean "force them to be what you want" not "correct them").

ADD REPLY

Login before adding your answer.

Traffic: 686 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