forked from Sage-Bionetworks/vdsDrugSensitivityShiny
-
Notifications
You must be signed in to change notification settings - Fork 0
/
getData.R
34 lines (32 loc) · 810 Bytes
/
getData.R
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
31
32
33
listFiles <- list.files("out",full.names = T)
###Extract VDS rho estimates
drugs = c()
for (x in listFiles) {
load(x)
perf <- vds$perf
rhovalues <- sapply(names(perf), function(y) {
return(perf[[y]]$rho$estimate)
})
rhovalues <- data.frame(t(rhovalues),row.names = drug)
colnames(rhovalues) = names(perf)
if (which(x==listFiles) == 1) {
test = rhovalues
} else {
test = merge(test,rhovalues,all = T,sort = F)
}
drugs = c(drugs, drug)
}
row.names(test) = drugs
## Extract dataframe from R object
model2 <- lapply(listFiles, function(x) {
load(x)
df <- lapply(names(R), function(y) {
diseaseArea=R[[y]]$df
diseaseArea$drug = drug
diseaseArea$disease = y
return(diseaseArea)
})
temp <- do.call(rbind,df)
return(temp)
})
model2<- do.call(rbind, model2)