Skip to content

Commit a2cd7b8

Browse files
author
nthomasCUBE
authored
Add files via upload
1 parent 6df8efc commit a2cd7b8

File tree

1 file changed

+29
-5
lines changed

1 file changed

+29
-5
lines changed

methods.R

+29-5
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,11 @@ calc_cmp_transcriptomics_traits=function(v){
4545
appendTab(inputId = "tabset",
4646
tabPanel("Linear model",
4747
isolate(selectInput("phen6", "Phenotype-1",choices=cn)),
48-
isolate(selectInput("opt1", "operator-1",choices=c("","*","+"))),
48+
isolate(selectInput("opt1", "operator-1",choices=c("---","*","+"))),
4949
isolate(selectInput("phen7", "Phenotype-2",choices=cn)),
50-
isolate(selectInput("opt2", "operator-2",choices=c("","*","+"))),
50+
isolate(selectInput("opt2", "operator-2",choices=c("---","*","+"))),
5151
isolate(selectInput("phen8", "Phenotype-3",choices=cn)),
52-
isolate(textAreaInput("phen5_area", "Result", "Data Summary", height = "400px")),
52+
isolate(textAreaInput("phen5_area", "Result", "", height = "400px")),
5353
isolate(actionButton("go_alpha5", "Go!"))
5454
))
5555
appendTab(inputId = "tabset",
@@ -173,17 +173,41 @@ linear_model=function(v, phen6, phen7, phen8, opt1, opt2){
173173
L1=colnames(expr)[2:length(colnames(expr))]
174174
L2=trait[,1]
175175
L12=L1[L1%in%L2]
176-
176+
177177
ix1=which(colnames(trait)==phen6)
178178
ix2=which(colnames(trait)==phen7)
179179
ix3=which(colnames(trait)==phen8)
180180

181+
print(c("phen6=",phen6))
182+
print(c("phen7=",phen7))
183+
print(c("phen8=",phen8))
184+
print(c("ix1=",ix1))
185+
print(c("ix2=",ix2))
186+
print(c("ix3=",ix3))
187+
181188
t1=trait[L12,ix1]
182189
t2=trait[L12,ix2]
190+
t3=trait[L12,ix3]
183191
t0=expr[1,L12]
184192
t0_r=(t(t0))
193+
194+
print(length(t1))
195+
print(length(t2))
196+
print(length(t3))
185197

186-
df=data.frame(t0_r,t1,t2)
198+
df=data.frame(t0_r,t1,t2,t3)
199+
print(dim(df))
200+
print(head(df))
201+
202+
if(dim(df)[2]>3){
203+
colnames(df)=c("expression",phen6,phen7,phen8)
204+
}else if(dim(df)[2]>2){
205+
colnames(df)=c("expression",phen6,phen7)
206+
}else{
207+
colnames(df)=c("expression",phen6)
208+
}
209+
210+
print(summary(df))
187211

188212
if(phen8=="---"){
189213
if(opt1=="*"){

0 commit comments

Comments
 (0)