Deseq2 PCA plot customize
1
0
Entering edit mode
@jarod_v6liberoit-6654
Last seen 2.7 years ago
Italy

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 • 8.7k views
4
Entering edit mode
@mikelove
Last seen 2 days ago
United States

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")