library(tximport)
library(DESeq2)
library(tidyverse)
library(ggfortify)

5. Principal Component Analysis

Exercise

The plot we have generated shows us the first two principle components. This shows us the relationship between the samples according to the two greatest sources of variation. Sometime, particularly with more complex experiments with more than two experimental factors, or where there might be confounding factors, it is helpful to look at more principle components.

  1. Redraw the plot, but this time plot the 2nd principle component on the x-axis and the 3rd prinicple component on the y axis. To find out how to do the consult the help page for the prcomp data method for the autoplot function: ?autoplot.prcomp.
autoplot(pcDat,
         data = sampleinfo, 
         colour="Status", 
         shape="TimePoint",
         x=2,
         y=3,
         size=5)