I am very new to R, so please carry me if something is unclear in my question.
I have a data.frame"protein" with 5 columns, namely:
1.protein_name, 2.protein_FC, 3.protein_pval, 4.mRNA_FC, 5.mRNA_pval and 6.freq.
I am trying to plot a volcano with x = log2 (protein_FC), y = -log10 (protein_pval). Then match the size of the dots with the frequency and color of mRNA_FC. All this works great, and here is the code I used:
ggplot( protein [ which ( protein$freq <= 0.05 ),] , aes( x = log2( protein_FC ) ,
y = -log10 ( protein_pval ) , size = freq , colour = mRNA_FC ,
label = paste(protein_name,",",mRNA_pval), alpha=1/1000)) +
geom_point() + geom_text( hjust = 0 , vjust = 0 , colour = "black" , size = 2.5 ) +
geom_abline( intercept = 1.3 , slope = 0) +
scale_colour_gradient(limits=c(-3,3))
everything is fine. But due to the nature of the experiment, the data is tight around mRNA_FC = 0. There, the default color scheme used by ggplot does not distinguish different points very well.
, low="colour1" high="colour2". , mRNA_FC, - . -3<mRNA<-0.2, -0.2<mRNA_FC<0, 0<mRNA_FC<0.2 0.2<mRNA_FC<3.
.
.
!