.load1data <- function(x, includeMSn){
if('chromatoplots' %in% loadedNamespaces()){
loadSample(x, includeMSn = includeMSn )
} else{
.loadSample(x, includeMSn)
}
}
.loadSample <- function(x, includeMSn){
xraw <- xcmsRaw(x, profstep = 1, profmethod = "intlin",
profparam = list(), includeMSn = includeMSn)
}
.poploadsamples <- function(.cguienv, fly, dir){
if(!fly){ ## calculate data objects for all the files
# case 1: if dir is all CDFS
fileinfos <- file.info(dir)$isdir
if(length(fileinfos[!fileinfos]) == length(dir) ){
.cguienv$cpdata$loaddata <- lapply(dir, FUN = function(x){.load1data(x, .cguienv$cpdata$includeMSn)})
} else {
# case 2: if cur dir is all dirs
sapply(dir, function(x){
setwd(x)
.cguienv$cpdata$loaddata <- c(.cguienv$cpdata$loaddata, lapply(dir(),
FUN = function(x){.load1data(x, .cguienv$cpdata$includeMSn)}))
setwd('..')
})
}
} else { ## calculate on the fly
if(file.info(dir[1])$isdir){
up <- FALSE
setwd(dir[1])
if(file.info(dir()[1])$isdir){
setwd(dir()[1])
up <- TRUE
}
.cguienv$cpdata$loaddata <- list(.load1data(dir()[1], .cguienv$cpdata$includeMSn))
if(up) setwd('..')
setwd('..')
} else {
.cguienv$cpdata$loaddata <- list(.load1data(dir()[1], .cguienv$cpdata$includeMSn))
}
}
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.