############################################################################################################################# ############################################################################################################################# ## ## To rerun the experiments, please comment out the load command for each method, e.g. ## ## load(file=paste("exp_",as.character(i),"_Biclust_plaid_ms_5.RData",sep = "")) ## ## and uncomment the other commands: ## ## #rplaid_ms_5 <- readPlaidResults(paste("exp_",as.character(i),"_plaid_ms_5.res",sep = ""),1000,100,ab="ab",ss="ms",iter="5") ## #save(rplaid_ms_5,file=paste("exp_",as.character(i),"_Biclust_plaid_ms_5.RData",sep = "")) ## ############################################################################################################################## ############################################################################################################################## source("/home/xpoint/fabia/Review/Code/utility_functions.R") m <- 100 n=1000 l=100 alpha_fabia = 0.4 alpha_fabias = 0.6 spl=1.0 spz=1.0 cyc=200 p=13 mean_off = c(0,2,4) for(kk in 1 : length(mean_off)){ setwd(paste("/home/xpoint/fabia/Review/Experiment_mu_offset_",as.character(mean_off[kk]),sep="")) #system("mkdir res_FABIA") #system("mkdir res_FABIA_scale_1") #system("mkdir res_MFSC") #system("mkdir res_FABIAS") #system("mkdir dat_ORIG_biclust") #system("mkdir res_PLAID_ss") #system("mkdir res_PLAID_ms_5") #system("mkdir res_SAMBA") #system("mkdir res_OPSM") #system("mkdir res_ISA") #system("mkdir res_ISA_1") #system("mkdir res_ISA_2") #system("mkdir res_CC") #system("mkdir res_BIMAX") #system("mkdir res_PLAID_turner_ab") #system("mkdir res_PLAID_turner_a") #system("mkdir res_XMOTIF") #system("mkdir res_FLOC") #system("mkdir res_SPEC") #system("mkdir res_SPEC_1") #system("mkdir res_SPEC_2") #system("mkdir Results") res_fabia <- matrix(NA,m,12) res_fabia_scale_1 <- matrix(NA,m,12) res_bimax<- matrix(NA,m,12) res_plaid_ss <- matrix(NA,m,12) res_plaid_ms_5 <- matrix(NA,m,12) res_plaid_turner_ab <- matrix(NA,m,12) res_plaid_turner_a <- matrix(NA,m,12) res_cc <- matrix(NA,m,12) res_xmotif <- matrix(NA,m,12) res_floc <- matrix(NA,m,12) res_spec <- matrix(NA,m,12) res_spec_1 <- matrix(NA,m,12) res_spec_2 <- matrix(NA,m,12) res_mfsc <- matrix(NA,m,12) res_fabias <- matrix(NA,m,12) res_samba_01 <- matrix(NA,m,12) res_opsm <- matrix(NA,m,12) res_isa <- matrix(NA,m,12) res_isa_1 <- matrix(NA,m,12) res_isa_2 <- matrix(NA,m,12) for (i in 1:m) { setwd(paste("/home/xpoint/fabia/Review/Experiment_mu_offset_",as.character(mean_off[kk]),sep="")) load(file=paste("exp_",as.character(i),".RData",sep = "")) rorig <- convertDat(dat,n=1000,l=100) #setwd(paste("/home/xpoint/fabia/Review/Experiment_mu_offset_",as.character(mean_off[kk]),"/dat_ORIG_biclust",sep="")) #save(rorig,file=paste("exp_",as.character(i),"_Biclust_orig.RData",sep = "")) #X <- dat[[1]] ### plaid ms setwd(paste("/home/xpoint/fabia/Review/Experiment_mu_offset_",as.character(mean_off[kk]),"/res_PLAID_ms_5",sep="")) ## to rerun please uncomment: #rplaid_ms_5 <- readPlaidResults(paste("exp_",as.character(i),"_plaid_ms_5.res",sep = ""),1000,100,ab="ab",ss="ms",iter="5") #save(rplaid_ms_5,file=paste("exp_",as.character(i),"_Biclust_plaid_ms_5.RData",sep = "")) ## ## to rerun please comment: load(file=paste("exp_",as.character(i),"_Biclust_plaid_ms_5.RData",sep = "")) ## for(f in 1:3){test <- try(res_plaid_ms_5[i,]<-indices(rorig,rplaid_ms_5), TRUE) if(class(test)!="try-error"){ break } } print(c("plaid_ms_5",round(colMeans(res_plaid_ms_5[,5:8],na.rm=T),digits=4))) ### plaid ss setwd(paste("/home/xpoint/fabia/Review/Experiment_mu_offset_",as.character(mean_off[kk]),"/res_PLAID_ss",sep="")) #rplaid_ss <- readPlaidResults(paste("exp_",as.character(i),"_plaid_ss.res",sep = ""),1000,100,ab="ab",ss="ss",iter="default") #save(rplaid_ss,file=paste("exp_",as.character(i),"_Biclust_plaid_ss.RData",sep = "")) load(file=paste("exp_",as.character(i),"_Biclust_plaid_ss.RData",sep = "")) for(f in 1:3){test <- try(res_plaid_ss[i,]<-indices(rorig,rplaid_ss), TRUE) if(class(test)!="try-error"){ break } } print(c("plaid_ss",round(colMeans(res_plaid_ss[,5:8],na.rm=T),digits=4))) #### fabia #resFab <- fabia(X,cyc=cyc,alpha=alpha_fabia,spl=spl,spz=spz,p=p,center=1, random=1, norm=1 , scale=0) #rFab <- extract_bic(resFab) #rfabia <- convertFabia(rFab,n=n,l=l,minc=5,minr=30,method="fabia",cyc=cyc,alpha=alpha_fabia,spl=spl,spz=spz,p=p,sL=0.0,sZ=0.0,L=resFab@L,Z=resFab@Z,lapla=resFab@lapla,Psi=resFab@Psi) setwd(paste("/home/xpoint/fabia/Review/Experiment_mu_offset_",as.character(mean_off[kk]),"/res_FABIA",sep="")) #save(rfabia,file=paste("exp_",as.character(i),"_Biclust_fabia.RData",sep = "")) load(file=paste("exp_",as.character(i),"_Biclust_fabia.RData",sep = "")) for(f in 1:3){test <- try(res_fabia[i,]<-indices(rorig,rfabia), TRUE) if(class(test)!="try-error"){ break } } print(c("fabia",round(colMeans(res_fabia[,5:8],na.rm=T),digits=4))) #### fabia_scale_1 #resFab <- fabia(X,cyc=cyc,alpha=alpha_fabia,spl=spl,spz=spz,p=p,center=1, random=1, norm=1 , scale=1) #rFab <- extract_bic(resFab) #rfabia_scale_1 <- convertFabia(rFab,n=n,l=l,minc=5,minr=30,method="fabia",cyc=cyc,alpha=alpha_fabia,spl=spl,spz=spz,p=p,sL=0.0,sZ=0.0,L=resFab@L,Z=resFab@Z,lapla=resFab@lapla,Psi=resFab@Psi) setwd(paste("/home/xpoint/fabia/Review/Experiment_mu_offset_",as.character(mean_off[kk]),"/res_FABIA_scale_1",sep="")) #save(rfabia_scale_1,file=paste("exp_",as.character(i),"_Biclust_fabia.RData",sep = "")) load(file=paste("exp_",as.character(i),"_Biclust_fabia.RData",sep = "")) for(f in 1:3){test <- try(res_fabia_scale_1[i,]<-indices(rorig,rfabia_scale_1), TRUE) if(class(test)!="try-error"){ break } } print(c("fabia_scale_1",round(colMeans(res_fabia_scale_1[,5:8],na.rm=T),digits=4))) #### mfsc #resFab <- mfsc(X,cyc=cyc,p=p,sL=alpha_fabias,sZ=alpha_fabias, center=1, norm=1) #rFab <- extract_bic(resFab) #rmfsc <- convertFabia(rFab,n=1000,l=100,minc=5,minr=30,method="mfsc",cyc=0,alpha=0,spl=0,spz=0,p=p,sL=alpha_fabias,sZ=alpha_fabias,L=resFab@L,Z=resFab@Z,lapla=NULL,Psi=NULL) setwd(paste("/home/xpoint/fabia/Review/Experiment_mu_offset_",as.character(mean_off[kk]),"/res_MFSC",sep="")) #save(rmfsc,file=paste("exp_",as.character(i),"_Biclust_mfsc.RData",sep = "")) load(file=paste("exp_",as.character(i),"_Biclust_mfsc.RData",sep = "")) for(f in 1:3){test <- try(res_mfsc[i,]<-indices(rorig,rmfsc), TRUE) if(class(test)!="try-error"){ break } } print(c("mfsc",round(colMeans(res_mfsc[,5:8],na.rm=T),digits=4))) #### fabias #resFab <- fabias(X,cyc=cyc,alpha=alpha_fabias,spz=spz,p=p,center=1, random=1, norm=1) #rFab <- extract_bic(resFab) #rfabias <- convertFabia(rFab,n=n,l=l,minc=5,minr=30,method="fabias",cyc=cyc,alpha=alpha_fabias,spl=0,spz=spz,p=p,sL=0.0,sZ=0.0,L=resFab@L,Z=resFab@Z,lapla=resFab@lapla,Psi=resFab@Psi) setwd(paste("/home/xpoint/fabia/Review/Experiment_mu_offset_",as.character(mean_off[kk]),"/res_FABIAS",sep="")) #save(rfabias,file=paste("exp_",as.character(i),"_Biclust_fabias.RData",sep = "")) load(file=paste("exp_",as.character(i),"_Biclust_fabias.RData",sep = "")) for(f in 1:3){test <- try(res_fabias[i,]<-indices(rorig,rfabias), TRUE) if(class(test)!="try-error"){ break } } print(c("fabias",round(colMeans(res_fabias[,5:8],na.rm=T),digits=4))) #### bimbax #XB <- binarize(X) #rbimax <- biclust(XB, method=BCBimax(), minr=30, minc=5, number=13) setwd(paste("/home/xpoint/fabia/Review/Experiment_mu_offset_",as.character(mean_off[kk]),"/res_BIMAX",sep="")) #save(rbimax,file=paste("exp_",as.character(i),"_Biclust_bimax.RData",sep = "")) load(file=paste("exp_",as.character(i),"_Biclust_bimax.RData",sep = "")) for(f in 1:3){test <- try(res_bimax[i,]<-indices(rorig,rbimax), TRUE) if(class(test)!="try-error"){ break } } print(c("bimax",round(colMeans(res_bimax[,5:8],na.rm=T),digits=4))) #### cheng & church #rcc <- biclust(X, method=BCCC(), delta=0.03, alpha=1.2, number=13) setwd(paste("/home/xpoint/fabia/Review/Experiment_mu_offset_",as.character(mean_off[kk]),"/res_CC",sep="")) #save(rcc,file=paste("exp_",as.character(i),"_Biclust_cc.RData",sep = "")) load(file=paste("exp_",as.character(i),"_Biclust_cc.RData",sep = "")) for(f in 1:3){test <- try(res_cc[i,]<-indices(rorig,rcc), TRUE) if(class(test)!="try-error"){ break } } print(c("cc",round(colMeans(res_cc[,5:8],na.rm=T),digits=4))) #### Xmotif #XD<-discretize(X) #rxmotif <- biclust(XD, method=BCXmotifs(), ns=100, nd=100, sd=5, alpha=0.05, number=13) setwd(paste("/home/xpoint/fabia/Review/Experiment_mu_offset_",as.character(mean_off[kk]),"/res_XMOTIF",sep="")) #save(rxmotif,file=paste("exp_",as.character(i),"_Biclust_xmotif.RData",sep = "")) load(file=paste("exp_",as.character(i),"_Biclust_xmotif.RData",sep = "")) for(f in 1:3){test <- try(res_xmotif[i,]<-indices(rorig,rxmotif), TRUE) if(class(test)!="try-error"){ break } } print(c("xmotif",round(colMeans(res_xmotif[,5:8],na.rm=T),digits=4))) #### plaid turner ab #rplaid_t_ab <-try( biclust(X, method=BCPlaid(), cluster="b", fit.model = y ~ m + a + b, background = TRUE, row.release = 0.7, col.release = 0.7,shuffle = 3, back.fit = 0, max.layers = 13, iter.startup = 5, iter.layer = 10, verbose = TRUE),silent=TRUE) setwd(paste("/home/xpoint/fabia/Review/Experiment_mu_offset_",as.character(mean_off[kk]),"/res_PLAID_turner_ab",sep="")) #save(rplaid_t_ab,file=paste("exp_",as.character(i),"_Biclust_plaid_t_ab.RData",sep = "")) load(file=paste("exp_",as.character(i),"_Biclust_plaid_t_ab.RData",sep = "")) if(class(rplaid_t_ab)!="try-error"){ for(f in 1:3){test <- try(res_plaid_turner_ab[i,]<-indices(rorig,rplaid_t_ab), TRUE) if(class(test)!="try-error"){ break } } print(c("plaid_t_ab",round(colMeans(res_plaid_turner_ab[,5:8],na.rm=T),digits=4))) } #### plaid turner a #rplaid_t_a <- try(biclust(X, method=BCPlaid(), cluster="b", fit.model = y ~ m + a, background = TRUE, row.release = 0.7, col.release = 0.7,shuffle = 3, back.fit = 0, max.layers = 13,iter.startup = 5, iter.layer = 10, verbose = TRUE),silent=TRUE) setwd(paste("/home/xpoint/fabia/Review/Experiment_mu_offset_",as.character(mean_off[kk]),"/res_PLAID_turner_a",sep="")) #save(rplaid_t_a,file=paste("exp_",as.character(i),"_Biclust_plaid_t_a.RData",sep = "")) load(file=paste("exp_",as.character(i),"_Biclust_plaid_t_a.RData",sep = "")) if(class(rplaid_t_ab)!="try-error"){ for(f in 1:3){test <- try(res_plaid_turner_a[i,]<-indices(rorig,rplaid_t_a), TRUE) if(class(test)!="try-error"){ break } } print(c("plaid_t_a",round(colMeans(res_plaid_turner_a[,5:8],na.rm=T),digits=4))) } #### spec #rspec <- biclust(exp(X), method=BCSpectral(), normalization="log", numberOfEigenvalues=6, minr=30, minc=5, withinVar=1) setwd(paste("/home/xpoint/fabia/Review/Experiment_mu_offset_",as.character(mean_off[kk]),"/res_SPEC",sep="")) #save(rspec,file=paste("exp_",as.character(i),"_Biclust_spec.RData",sep = "")) load(file=paste("exp_",as.character(i),"_Biclust_spec.RData",sep = "")) for(f in 1:3){test <- try(res_spec[i,]<-indices(rorig,rspec), TRUE) if(class(test)!="try-error"){ break } } print(c("spec",round(colMeans(res_spec[,5:8],na.rm=T),digits=4))) #### spec_1 #rspec_1<- biclust(exp(X), method=BCSpectral(), normalization="log", numberOfEigenvalues=1, minr=30, minc=5, withinVar=100) setwd(paste("/home/xpoint/fabia/Review/Experiment_mu_offset_",as.character(mean_off[kk]),"/res_SPEC_1",sep="")) #save(rspec_1,file=paste("exp_",as.character(i),"_Biclust_spec_1.RData",sep = "")) load(file=paste("exp_",as.character(i),"_Biclust_spec_1.RData",sep = "")) for(f in 1:3){test <- try(res_spec_1[i,]<-indices(rorig,rspec_1), TRUE) if(class(test)!="try-error"){ break } } print(c("spec_1",round(colMeans(res_spec_1[,5:8],na.rm=T),digits=4))) #### spec_2 #rspec_2<- biclust(exp(X), method=BCSpectral(), normalization="log", numberOfEigenvalues=3, minr=30, minc=5, withinVar=20) setwd(paste("/home/xpoint/fabia/Review/Experiment_mu_offset_",as.character(mean_off[kk]),"/res_SPEC_2",sep="")) #save(rspec_2,file=paste("exp_",as.character(i),"_Biclust_spec_1.RData",sep = "")) load(file=paste("exp_",as.character(i),"_Biclust_spec_1.RData",sep = "")) for(f in 1:3){test <- try(res_spec_2[i,]<-indices(rorig,rspec_2), TRUE) if(class(test)!="try-error"){ break } } print(c("spec_2",round(colMeans(res_spec_2[,5:8],na.rm=T),digits=4))) #### floc #resfloc <- FLOC(X, k = 13, pGene = 0.1, pSample=0.1, N = 30, M = 5, t = 500) setwd(paste("/home/xpoint/fabia/Review/Experiment_mu_offset_",as.character(mean_off[kk]),"/res_FLOC",sep="")) #rfloc <- BiclustResult(as.list(resfloc$param),t(resfloc$bicRow),resfloc$bicCol,as.numeric(resfloc$param[1,2])) #save(rfloc,file=paste("exp_",as.character(i),"_Biclust_floc.RData",sep = "")) load(file=paste("exp_",as.character(i),"_Biclust_floc.RData",sep = "")) for(f in 1:3){test <- try(res_floc[i,]<-indices(rorig,rfloc), TRUE) if(class(test)!="try-error"){ break } } print(c("floc",round(colMeans(res_floc[,5:8],na.rm=T),digits=4))) ### isa setwd(paste("/home/xpoint/fabia/Review/Experiment_mu_offset_",as.character(mean_off[kk]),"/res_ISA",sep="")) #res.isa <- isa(X,thr.row=isa.parameter.thr.row[1],thr.col=isa.parameter.thr.col[1],no.seed=100) #try.isa <- try(risa <-isa.biclust(res.isa)) try.isa <- try(load(file=paste("exp_",as.character(i),"_Biclust_isa.RData",sep = ""))) if(class(try.isa)!="try-error"){ #save(risa,file=paste("exp_",as.character(i),"_Biclust_isa.RData",sep = "")) for(f in 1:5){test <- try(res_isa[i,]<-indices(rorig,risa), TRUE) if(class(test)!="try-error"){ break } } } print(c("isa",round(colMeans(res_isa[,5:8],na.rm=T),digits=4))) ### isa_1 setwd(paste("/home/xpoint/fabia/Review/Experiment_mu_offset_",as.character(mean_off[kk]),"/res_ISA_1",sep="")) #res.isa <- isa(X,thr.row=isa.parameter.thr.row[2],thr.col=isa.parameter.thr.col[2],no.seed=100) #try.isa <- try(risa_1 <-isa.biclust(res.isa)) try.isa <- try(load(file=paste("exp_",as.character(i),"_Biclust_isa_1.RData",sep = ""))) if(class(try.isa)!="try-error"){ # save(risa_1,file=paste("exp_",as.character(i),"_Biclust_isa_1.RData",sep = "")) for(f in 1:5){test <- try(res_isa_1[i,]<-indices(rorig,risa_1), TRUE) if(class(test)!="try-error"){ break } } } print(c("isa_1",round(colMeans(res_isa_1[,5:8],na.rm=T),digits=4))) ### isa_2 setwd(paste("/home/xpoint/fabia/Review/Experiment_mu_offset_",as.character(mean_off[kk]),"/res_ISA_2",sep="")) #res.isa <- isa(X,thr.row=isa.parameter.thr.row[1],thr.col=isa.parameter.thr.col[1],no.seed=100) #try.isa <- try(risa_2 <-isa.biclust(res.isa)) try.isa <- try(load(file=paste("exp_",as.character(i),"_Biclust_isa_2.RData",sep = ""))) if(class(try.isa)!="try-error"){ #save(risa_2,file=paste("exp_",as.character(i),"_Biclust_isa_2.RData",sep = "")) for(f in 1:5){test <- try(res_isa_2[i,]<-indices(rorig,risa_2), TRUE) if(class(test)!="try-error"){ break } } } print(c("isa_2",round(colMeans(res_isa_2[,5:8],na.rm=T),digits=4))) ### samba setwd(paste("/home/xpoint/fabia/Review/Experiment_mu_offset_",as.character(mean_off[kk]),"/res_SAMBA",sep="")) #rsamba_01 <- readSambaResults(paste("exp_",as.character(i),"_samba.res",sep = ""),1000,100) #save(rsamba_01,file=paste("exp_",as.character(i),"_Biclust_samba.RData",sep = "")) try.isa <- try(load(file=paste("exp_",as.character(i),"_Biclust_samba.RData",sep = ""))) if(class(try.isa)!="try-error"){ for(f in 1:3){test <- try(res_samba_01[i,]<-indices(rorig,rsamba_01), TRUE) if(class(test)!="try-error"){ break } } } print(c("samba",round(colMeans(res_samba_01[,5:8],na.rm=T),digits=4))) ### opsm setwd(paste("/home/xpoint/fabia/Review/Experiment_mu_offset_",as.character(mean_off[kk]),"/res_OPSM",sep="")) ropsm <- readBicatResults(paste("exp_",as.character(i),"_bicat.opsm.res",sep = ""),1000,100) save(ropsm,file=paste("exp_",as.character(i),"_Biclust_opsm.RData",sep = "")) for(f in 1:3){test <- try(res_opsm[i,]<-indices(rorig,ropsm), TRUE) if(class(test)!="try-error"){ break } } print(c("opsm",round(colMeans(res_opsm[,5:8],na.rm=T),digits=4))) setwd(paste("/home/xpoint/fabia/Review/Experiment_mu_offset_",as.character(mean_off[kk]),"/Results",sep="")) res_iteration <- list( fabia=res_fabia, fabia_scale_1=res_fabia_scale_1, bimax=res_bimax, plaid_ss=res_plaid_ss, plaid_ms_5=res_plaid_ms_5, plaid_turner_ab=res_plaid_turner_ab, plaid_turner_a=res_plaid_turner_a, cc=res_cc, xmotif=res_xmotif, floc=res_floc, spec=res_spec, spec_1=res_spec_1, spec_2=res_spec_2, mfsc=res_mfsc, fabias=res_fabias, isa= res_isa, isa1=res_isa_1, isa2 = res_isa_2, opsm=res_opsm, samba= res_samba_01) save(res_iteration,file=paste("exp_",as.character(i),"_ind_res.RData",sep = "")) } if(i==100){ score_names <- c("ja", "ku", "oc", "so") setwd(paste("/home/xpoint/fabia/Review/Experiment_mu_offset_",as.character(mean_off[kk]),"/Results",sep="")) load(file=paste("exp_",as.character(100),"_ind_res.RData",sep = "")) methods <- names(res_iteration) methods <- methods[order(methods)] tmp_mean <- tmp_sd <- matrix(NA, length(methods), 4) for(ii in 1 :length(methods)){ tmp_mean[ii,] <- colMeans(res_iteration[[methods[ii]]][,5:8], na.rm=T) rownames(tmp_mean) <- methods colnames(tmp_mean) <- score_names tmp_sd[ii,] <- apply(res_iteration[[methods[ii]]][,5:8],2,sd,na.rm=T) rownames(tmp_sd) <- methods colnames(tmp_sd) <- score_names } assign(paste("ResultsExperiment_mu_offset_",as.character(mean_off[kk]),sep=""), list(means=round(tmp_mean,digits=4), sd=round(tmp_sd,digits=4))) Results <- get(paste("ResultsExperiment_mu_offset_",as.character(mean_off[kk]),sep="")) save(Results,file=paste("Final_Reults_mu_offset_",as.character(mean_off[kk]),sep="")) write.table(get(paste("ResultsExperiment_mu_offset_",as.character(mean_off[kk]),sep="")), file ="final_result.txt", quote = FALSE, sep = "\t",row.names = T,col.names = T,append =TRUE) } }