Deseq2 PCA plot customize
1
0
Entering edit mode
@jarod_v6liberoit-6654
Last seen 5.2 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 • 14k views
ADD COMMENT
5
Entering edit mode
@mikelove
Last seen 7 hours 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")
ADD COMMENT

Login before adding your answer.

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