PS - if you prefer to have the lines connecting the gene names to the points, then un-comment the following lines in my function:
#segment.color="black", #This and the next parameter spread out the labels and join them to their points by a line
#segment.size=0.01




Could you edit your question by adding some test data and also what you already tried.
You can check ggplot2 documentation, ggplot2 tutorial, ggrepel. These are enough to plot what you have asked for.
Another link: Creating Interactive Volcano Plots with R and Plot.ly
One more: Repel overlapping text labels in ggplot2
Hi Kevin, I am trying to use your code with my data but I am not being able to produce any plot (eventhough I don't get any error messages back). So I wonder wether you could help me to localize my problem. The code I am using is the following
The DEseq2 output has the regular structure, being: Contig baseMean log2FoldChange lfcSE stat pvalue padj NReads FBgn0000003 135701.1304 3.841593895 0.218300714 17.59771566 2.56E-69 3.72E-66 513393 etc.
Thanks in advance,
Jordi Planells
Hi Jordi,
First ensure that all devices are switched off by running
dev.off()until there are no more devices to close.Then, you should try to run the function like this:
Does that work?
Sorry for late reply I've been out for some days. I am afraid it doesn't work, I have used dev.off() untill I got this message back: Error in dev.off() : cannot shut down device 1 (the null device). Still I don't get any output. I am not able to figure out why
Can you show the exact sequence of commands that you're using? - sorry
Of course!
and the plot commands exactly the same code you posted in github
Thank you so much again