title: Different colors of points in Volcano plot using R
body: <p>This is quick a simple question and I am not able to somehow get the desired result. I want to construct a volcano plot, which I was able to do. Here is the code:</p>
  
  <pre><code>CSCJFCTable &lt;- read.table("volcano_plot_valuesCSCJ.csv", header = TRUE, sep = ",") 
  with(CSCJFCTable, plot(log2.FC., -log10(raw.pval), pch=20, main=""))
  abline(h = 1.0, col = "blue
  ", lty = 2, lwd = 1)
  abline(v = c(-1,1), col = "blue
  ", lty = 2, lwd = 1)
  with(subset(CSCJFCTable, X.log10.p.&lt;1.0), points(log2.FC., -log10(raw.pval), pch=20, col="gray"))
  with(subset(CSCJFCTable, abs(log2.FC.)&gt;1), points(log2.FC., -log10(raw.pval), pch=20, col="orange"))
  </code></pre>
  
  <p>And, here is the resulting plot
  <a href="https://i.stack.imgur.com/0XCzb.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/0XCzb.png" alt="enter image description here"></a></p>
  
  <p>I want to change the color of points in the first box and the third box to two different colors. So, basically, <code>log2.FC. &lt; -1 &amp; -log10(raw.pval) &gt; 1.0</code> should have a color say red and <code>log2.FC. &gt; 1 &amp; -log10(raw.pval) &gt; 1.0</code> should have a color green. And, all the points below -log10(raw.pval) = 1.0 should be gray. How can I do this? I tired different combinations but it did not work.</p>