forked from MikeJSeo/SAM
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGSA.plot.revised.R
More file actions
23 lines (18 loc) · 903 Bytes
/
GSA.plot.revised.R
File metadata and controls
23 lines (18 loc) · 903 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
GSA.plot.revised=function(GSA.obj, fac=1, FDRcut=1){
eps=.001
a=GSA.listsets(GSA.obj, geneset.names=NULL, FDRcut=FDRcut)
neg=matrix(as.numeric(as.character(a$negative[,-2])),ncol=4)+eps
pos=matrix(as.numeric(as.character(a$positive[,-2])),ncol=4)+eps
ymax=max(c(neg[,4],pos[,4]))
xmax=max(c(neg[,3],pos[,3]))
ymin=min(c(neg[,4],pos[,4]))
xmin=min(c(neg[,3],pos[,3]))
o1=order(neg[,3])
o2=order(pos[,3])
plot(jitter(neg[o1,3],factor=fac),jitter(neg[o1,4],factor=fac),xlab="p-value",ylab="False discovery rate", type="n",log="x", xlim=c(xmin,xmax),
ylim=c(ymin,ymax))
points(jitter(neg[o1,3],factor=fac),jitter(neg[o1,4],factor=fac),col=3,cex=.7,type="b")
points(jitter(pos[o2,3],factor=fac),jitter(pos[o2,4],factor=fac),col=4, cex=.7,type="b")
#axis(3, at = res[,3], lab = paste(round(res[,3],0)), srt = 90, adj = 0,cex=.5)
legend("bottomright",c("Negative","Positive"),col=3:4, pch=c("o","o"))
}