Skip to content

Commit 3880703

Browse files
author
nthomasCUBE
authored
Add files via upload
1 parent 0285b43 commit 3880703

File tree

1 file changed

+30
-2
lines changed

1 file changed

+30
-2
lines changed

methods.R

+30-2
Original file line numberDiff line numberDiff line change
@@ -223,15 +223,43 @@ make_corr=function(v,my_trait,output){
223223
gene_selected=(df_all[,3])
224224
u_m=unique(v$module[,2])
225225
m_arr=c()
226+
m_arr_1=c()
227+
m_arr_2=c()
226228
for(x in 1:length(u_m)){
227229
g_a=subset(v$module,v$module[,2]==u_m[x])[,1]
228-
g_s=g_a[gene_selected%in%g_a]
230+
g_s=g_a[g_a%in%gene_selected]
229231
m_r=100*length(g_s)/length(g_a)
230232
m_arr=c(m_arr,m_r)
233+
m_arr_1=c(m_arr_1,length(g_s))
234+
m_arr_2=c(m_arr_2,length(g_a))
231235
}
232236

237+
233238
output$plot3=renderPlot({
234-
barplot(m_arr,names=u_m)
239+
#barplot(m_arr,names=u_m)
240+
241+
A=m_arr_1
242+
B=m_arr_2
243+
244+
m3=c()
245+
for(x in 1:length(A)){
246+
x1=A[x]
247+
x2=sum(A)-x1
248+
x3=B[x]
249+
x4=sum(B)-x3
250+
print(c(x1,x2,x3,x4))
251+
m3=c(m3,(phyper(A[x],B[x],sum(B),sum(A),lower.tail=FALSE)))
252+
}
253+
m3=-log2(m3)
254+
m3[m3>10]=10
255+
print(m3)
256+
257+
print(m3)
258+
plot(m_arr_1,m_arr_2,cex=m3,pch=20)
259+
text(m_arr_1,m_arr_2,u_m,cex=2.5)
260+
261+
print(m_arr_1)
262+
print(m_arr_2)
235263
})
236264

237265

0 commit comments

Comments
 (0)