Search
Question: Deseq2 PCA plot customize
0
gravatar for jarod_v6@libero.it
23 months 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!

 

 

 

 

 

ADD COMMENTlink modified 23 months ago by Michael Love15k • written 23 months ago by jarod_v6@libero.it40
3
gravatar for Michael Love
23 months ago by
Michael Love15k
United States
Michael Love15k 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")
ADD COMMENTlink written 23 months ago by Michael Love15k
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.2.0
Traffic: 123 users visited in the last hour