Skip to content
Snippets Groups Projects
Commit 69338819 authored by Francesco Sabatini's avatar Francesco Sabatini
Browse files

Updated 01b to save intermediate steps

parent d1cb8fbe
No related branches found
No related tags found
No related merge requests found
......@@ -72,9 +72,9 @@ Mesobromion <- function(species.path, traits.path, output, myfunction="get.corXY
species <- read_delim(species.path, delim="\t") %>%
as.data.frame()
traits <- read_delim(traits.path, delim="\t") %>%
as.data.frame()# %>%
as.data.frame() %>%
### TEMPORARY FOR TESTING!
# dplyr::select(1:11)
dplyr::select(1:11)
traits <- traits %>%
......@@ -115,8 +115,9 @@ Mesobromion <- function(species.path, traits.path, output, myfunction="get.corXY
if(combinations=="sequential"){
corXY.output <- NULL
corXY.ci <- NULL
for(nround in 1:max.inter.t){
corXY.output <- NULL
## select combination of traits based on best
if(nround==1) {
allcomb.t <- lapply(1:ncol(traits), function(x){return(x)})
......@@ -167,7 +168,8 @@ Mesobromion <- function(species.path, traits.path, output, myfunction="get.corXY
#save(corXY.output, file = paste(output, "_", nround, ".RData", sep=""))
print(paste("Summarize after round", nround, "and find best, significant trait combos"))
corXY.ci <- get.ci(corXY.output)
corXY.ci <- corXY.ci %>%
bind_rows(get.ci(corXY.output))
##get best or new best
if(nround==1) {
traits.sign.alone <- corXY.ci %>%
......@@ -208,9 +210,9 @@ Mesobromion <- function(species.path, traits.path, output, myfunction="get.corXY
print(paste("new best at round=", nround, "is trait combination", best))
} else {print(paste("no new best at round=", nround))}
}
}
save(corXY.output, file = paste(output, ".RData", sep=""))
print(paste("save intermediate results at round", nround))
save(corXY.output, file = paste(output, "_round_",nround, ".RData", sep=""))
}
}
if(ncores>1){stopCluster(cl)}
}
species.path <- "_data/Mesobromion/species.out.10perc.txt"
traits.path <- "_data/Mesobromion/traits.out.10perc.txt"
output <- "test"
output <- "test99"
myfunction <- "get.corXY.bootstrap"
max.inter.t <- 4
chunkn <- 1
max.inter.t <- 3
chunk.i <- NA
nperm <- 25
nperm <- 20
ncores <- 10
chunkn <- 3*ncores
combinations <- "sequential"
source("01b_MesobromionCluster.R")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment