Skip to content

Commit 6af33c5

Browse files
author
nthomasCUBE
authored
Add files via upload
1 parent 7396279 commit 6af33c5

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

methods.R

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,7 @@ cmp_traits=function(v,my_trait1,my_trait2,my_trait3){
143143
n23=SET_B[SET_B%in%SET_C]; n23=length(n23)
144144
n13=SET_A[SET_A%in%SET_C]; n13=length(n13)
145145
n123=SET_A[SET_A%in%SET_B & SET_A%in%SET_C]; n123=length(n123)
146+
par(oma=c(0,20,0,20))
146147
draw.triple.venn(area1=length(SET_A),area2=length(SET_B),area3=length(SET_C),n12,n23,n13,n123,
147148
category = c(my_trait1,my_trait2,my_trait3),
148149
fill = c("blue","yellow","red"),
@@ -152,6 +153,7 @@ cmp_traits=function(v,my_trait1,my_trait2,my_trait3){
152153
cat.dist = -.5,
153154
)
154155
}else{
156+
par(oma=c(0,20,0,20))
155157
draw.pairwise.venn(area1 = area1, area2=area2,cross.area=cross,
156158
category = c(my_trait1,my_trait2),
157159
fill = c("blue","red"),
@@ -271,10 +273,11 @@ regr_analysis=function(v, my_trait1, my_gene1){
271273

272274
ct=cor.test(U1,U2,method="spearman")
273275

274-
plot(U1,U2,xlab=my_gene1,ylab=my_trait1)
276+
par(oma=c(0,20,0,20))
277+
plot(U1,U2,xlab=my_gene1,ylab=my_trait1,pch=20,cex=3,main=my_gene1)
275278
abline(lm(U2~U1))
276-
legend("bottom",paste0("pvalue=",ct$p.value))
277-
legend("top",paste0("r=",ct$estimate))
279+
legend("bottom",paste0("p-value=",round(ct$p.value,3)))
280+
legend("top",paste0("r=",round(ct$estimate,3)))
278281

279282
}
280283

@@ -350,6 +353,7 @@ make_corr=function(v,my_trait,output){
350353
my_col[p.adjust(m3,"BH")<0.001]="red"
351354
m3=-log2(m3)
352355
m3[m3>10]=10
356+
par(oma=c(0,20,0,20))
353357
plot(m_arr_1,m_arr_2,cex=m3,pch=20,col=my_col)
354358
text(m_arr_1,m_arr_2,u_m,cex=2.5)
355359

@@ -376,6 +380,7 @@ make_corr=function(v,my_trait,output){
376380
L[[3]]=n_1pm_sign
377381

378382
output$plot2=renderPlot({
383+
par(oma=c(0,20,0,20))
379384
barplot(c(L[[1]],L[[2]],L[[3]]),col=c("green","#ff000044","#ff0000ff"),names=c("all genes","sign (p<0.05)","sign (p<0.001)"))
380385
})
381386
plot(df[,1],df[,2],pch=20,xlim=c(-1,1),cex=my_size,xlab="correlation coefficient (r)",ylim=c(0,1),ylab="p.value",main=my_trait)

server.R

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ server <- function(input, output, session)
6060
observeEvent(input$goButton,{
6161
source("methods.R")
6262
output$plot=renderPlot({
63+
par(oma=c(0,20,0,20))
6364
calc_cmp_transcriptomics_traits(v)
6465
})
6566
output$plot2=renderPlot({
@@ -74,6 +75,7 @@ server <- function(input, output, session)
7475
observeEvent(input$go_alpha2,{
7576
source("methods.R")
7677
output$plot=renderPlot({
78+
par(oma=c(0,20,0,20))
7779
L=make_corr(v,input$phen0,output)
7880
})
7981
output$plot2=renderPlot({

0 commit comments

Comments
 (0)