Question: Deseq2 PCA plot customize
0
3.9 years ago by
Italy
jarod_v6@libero.it40 wrote:

How can choose the color use on   pca plot. I have many samples but I want to have a set of colors:

data<-DESeq2::plotPCA(rld,intgroup=c("condition"),returnData=TRUE)
p1<-qplot(PC1,PC2,color=condition,data=data,size=I(10))
ggsave("PCA_condition.png",p1)

plotPCA(rld,intgroup=c("condition","id"),ntop=2000,color=brewer.pal(4,"Dark2"))
Error in .local(object, ...) :
unused argument (color = c("#1B9E77", "#D95F02", "#7570B3", "#E7298A"))
> plotPCA(rld,intgroup=c("condition","id"),ntop=2000,col=brewer.pal(4,"Dark2"))
Error in .local(object, ...) :
unused argument (col = c("#1B9E77", "#D95F02", "#7570B3", "#E7298A"))



and how can I plot with the labels of the samples.

Thanks s much!

deseq2 pca • 6.5k views
modified 3.9 years ago by Michael Love26k • written 3.9 years ago by jarod_v6@libero.it40
4
3.9 years ago by
Michael Love26k
United States
Michael Love26k wrote:

The best way to customize the plot is to use plotPCA to return a small data.frame and then use ggplot2 to customize the graph.

If you look in the vignette, search for the sentence "It is also possible to customize the PCA plot using the ggplot function."

vignette("DESeq2")