-
Notifications
You must be signed in to change notification settings - Fork 0
/
GBM.R
85 lines (63 loc) · 2.1 KB
/
GBM.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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
###########################################################################################
### This applies TCGA data set for GBM on ourSBC model ###################################
rm(list = ls())
#### Load Data #########
load("/home/bit/ashar/ExpressionSets/TWO_VIEW/TCGA_GBM/FINAL/DataTCGA-GBM.RData")
Y1 <- relev$Y1
Y2 <- relev$Y2
Y1.test <- relev$Y1.test
Y2.test <- relev$Y2.test
pheno <- relev$pheno
pheno.test <- relev$pheno.test
## Number of points
N.train = nrow(Y1)
N.test = nrow(Y1.test)
N <- N.train
## Number of Clusters
F = 2
######
D1 <- ncol(Y1)
D2 <- ncol(Y2)
####
time <- pheno$Survival
censoring <- pheno$Censoring
time.new <- pheno.test$Survival
censoring.new <- pheno.test$Censoring
###########
c.true <- pheno$Subtype
levels(c.true) <- c(1,2,3,4)
##########
c.true.new <- pheno.test$Subtype
levels(c.true.new) <- c(1,2,3,4)
############################# PARAMETERS for GIBB's SAMPLING ####
iter = 200
iter.burnin = 100
iter.thin = 5
k = 4
K <- as.integer(N)
Time <- cbind(time,censoring)
################# GroundTruth (by pasting togehter columns)
source('TRAINmultiComparison.R')
multigroundtruth()
########### Train the Model #########################################
begin.time <- Sys.time()
source('burninmultiDPMM.R')
burninmultiDPMM()
end.time <- Sys.time()
########### Train the Model #########################################
source('gibbsmultiDPMM.R')
gibbsmultiDPMM()
##### Analyzing the Model #########################################
source('MCMCmultianalyze.R')
analyzemultiDPMM()
##### Predicting the Classes for new Data Points####################################
source('multipredictCLASS.R')
multipredictCLASS(Y1.test, Y2.test)
predicted.rindex <- adjustedRandIndex(c.true.new,apply(posteriorprob,1,which.max))
###### Predicting Survival Times Based on two Molecular Data Sources ####################################
source('multipredictTIME.R')
multipredictchineseAFTtime(Y1.test, Y2.test)
predicted.cindex <- survConcordance(Surv(exp(time.new),censoring.new) ~ exp(-post.time.avg))[1]
########### Check Prediction Ground Truth
source('TESTmultiComparison.R')
predictionGroundTruth()