Entering edit mode
5.4 years ago
BioBaby
▴
20
Hi, I am new to R and need to generate MDS plot for 4 different sample with 3 replicates each, indicate with four different color (replicate should have color).I tried this code:
library("limma")
library("edgeR")
library("ggplot2")
x <- read.delim("IR_all",row.names="gene")
group <- factor(c(1,1,1,2,2,2,3,3,3,4,4,4))
y <- DGEList(counts=x,group=group)
y <- calcNormFactors(y)
design <- model.matrix(~group)
y <- estimateDisp(y,design)
plotMDS(y,col=c(rep("green",3),rep("blue",3),rep("green",3), rep("black",3)))
...and, voilĂ !, what happened when you tried that code?
Take a look at the example in the EdgeR vignette: MDS plot
i did not generate plot
Which system are you using? Also, is it a remote server? Ensure that you have not already opened the output stream somewhere else by running
dev.off()
multiple timesno i did not use dev.off().....yes I am using server which give mds plot very late but I got after 6-8 hrs. i already got mds plot with column name itself but i want to define column by specific color and I try this code. but no output even after one day.
You have configured X11 protocol so that the R plot window will open up in your local OS, right? Is there any message after you run
plotMDS()
? Check that it has not saved the figure to a default PDF name in your working directory on the server itself.no R plot window open even at local OS......no message came after running plotMDS()...Outfile generate but it is 0 kb.
What is the output of
dev.off()
?now I got output...thanks Kevin....now I want to mention that which sample representing which color (legend)....after above code I am giving this code:
but it is giving "a", "b", "c" in Red color and "d" in blue.I want a in red, b in blue, c in green, d in black color....how to do that?
thanks kevin...it works....can you tell me how to give 16 different color......if I am giving by this way ...it goes to new line then it is error.
Your colour vector there produces 48 colours (?) Sorry, I now have to catch the train / metro.
yes...i am having 16 sample with 3 replicates....whenever you get time please tell me how to deal with this.
Why don't you try to solve it yourself. This is basic R and solving it yourself using google will help improving yourself.