forked from vittorioperduca/mediation-challenge
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgenerate_figure_challenge1.R
More file actions
30 lines (21 loc) · 1.04 KB
/
generate_figure_challenge1.R
File metadata and controls
30 lines (21 loc) · 1.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#write(candidate<-names(data)[p_sobel<0.05/5000],file="candidate.txt")
#write(p_sobel,file="pval.txt",ncolumns=1)
pval<-scan("pval.txt")
set<-as.character(read.table("candidate.txt",header=F)[,1])
require(data.table)
nb_med<-5000
data<-fread("data/challenge1.txt",header=TRUE,data.table=FALSE)
truess<-as.character(read.table("https://www.dropbox.com/s/z3rtupgqdndgdb1/true_challenge1.txt?raw=1")[,1])
truess<-which(names(data)%in%truess)
EtoM<-as.character(read.table("https://www.dropbox.com/s/7vk64u1040bij5y/EtoM_challenge1.txt?raw=1")[,1])
EtoM<-which(names(data)%in%EtoM)
set<-which(names(data)%in%set)
pdf("bla.pdf")
ml<-(-log10(pval))
par(mar=c(5.1, 4.1, 4.1, 8.1), xpd=TRUE)
plot(ml,xlab="Markers",ylab="-log10(Pval)",cex.lab=1.5,cex.axis=2,cex=2)
points((1:5000)[EtoM],ml[EtoM],pch=19,col=4,cex=1)
points((1:5000)[truess],ml[truess],pch=19,col=2,cex=1)
points((1:5000)[set],ml[set],col=6,pch=0,cex=3)
legend("topright", inset=c(-0.35,0), legend=c("All marks","True XtoM","True Mediation","Candidate"),pch=c(1,19,19,0), col=c(1,4,2,6))
dev.off()