Search
Question: displaying UP, DOWN, and NON-regulated genes
0
gravatar for Bogdan Tanasa
13 months ago by
Bogdan Tanasa460
Palo Alto, CA, USA
Bogdan Tanasa460 wrote:

Dear all,

 

may I ask for a simple advice on how to make a scatter plot in ggplot2 that colours differently UP, DOWN and NON-regulated genes (in total, 5000 genes). BUT would like to show the NON-reg genes in the background (perhaps in a GREY transparent color), and bring in the foreground only UP-- and DOWN- genes.

a piece of example at a smaller scale is below, although we work with > 5000 genes. thanks a lot !

 

mycolours <- c("U" = "green", "D" = "red", "U"="grey")

x <- c(1,2,3,4,5,6)
y <- c(1,2,3,4,5,6)
z <- c("U","U","D","D","N", "N")
t <- data.frame(x,y,z)

ggplot(data = t, aes(y = y, x = x)) +
                 geom_point(size=2, aes(colour=z)) +
                 scale_color_manual("Status", values = mycolours)

 

 

ADD COMMENTlink modified 13 months ago • written 13 months ago by Bogdan Tanasa460
0
gravatar for Gordon Smyth
13 months ago by
Gordon Smyth30k
Walter and Eliza Hall Institute of Medical Research, Melbourne, Australia
Gordon Smyth30k wrote:

ggplot2 is not a Bioconductor package so, if you want help with it, better to consult the ggplot2 documentation:

  http://docs.ggplot2.org/current/

or post to the ggplot2 forum:

  https://groups.google.com/forum/#!forum/ggplot2

or write to the package authors.

Personally I use the plotWithHighlights() and plotMD() functions of the limma package, which are specifically designed for the purpose you describe. For example:

plotWithHighlights(x,y,status=z,values=c("U","D"),hl.col=c("green","red"))

The argument 'values' specifies the foreground points. Any other values of 'status' not listed by 'values' are assumed to be background. The foreground colors are specified by hl.col and the background by bg.col. If you are using diffHic, for example, you'll find that these functions are already loaded for you.

ADD COMMENTlink modified 13 months ago • written 13 months ago by Gordon Smyth30k
0
gravatar for Bogdan Tanasa
13 months ago by
Bogdan Tanasa460
Palo Alto, CA, USA
Bogdan Tanasa460 wrote:

thank you Gordon ! it is a very good suggestion, thanks a lot !

will get back to you shall I have any questions regarding how to set the genes display in the BACKGROUND vs FOREGROUND.

ADD COMMENTlink written 13 months ago by Bogdan Tanasa460
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: 145 users visited in the last hour