.calcqdata <- function(.cguienv, fly){
if(fly){
.calcqdataLoad(.cguienv, list(.cguienv$cpdata$loaddata[[1]]))
.calcqdataGen(.cguienv, list(.cguienv$cpdata$genprofdata[[1]]))
.calcqdataRmBase(.cguienv, list(.cguienv$cpdata$rmbasedata[[1]]),
list(.cguienv$cpdata$genprofdata[[1]]))
} else {
.calcqdataLoad(.cguienv, .cguienv$cpdata$loaddata)
.calcqdataGen(.cguienv, .cguienv$cpdata$genprofdata)
.calcqdataRmBase(.cguienv, .cguienv$cpdata$rmbasedata, .cguienv$cpdata$genprofdata)
}
}
.calcqdataLoad <- function(.cguienv, x){
.cguienv$cpdata$loadplot <- lapply(x, FUN = function(y){qdata(rawMat(y),
size = .5, color = log(intensity))})
}
.calcqdataGen <- function(.cguienv, x){
.cguienv$cpdata$genprofplot <- lapply(x, FUN = function(y){
prof <- y@env$profile
minprof <- ifelse(min(prof)>=0, min(prof), 0)
temp <- data.frame(time = rep(y@scantime, each = nrow(prof)),
mz = rep(profMz(y), ncol(prof)),
intensity = as.vector(prof))
qdata(temp[prof > minprof,], size = .5, color = log(intensity))
})
}
.calcqdataRmBase <- function(.cguienv, prof, raw){
if(length(prof) != length(raw)) stop("args must be of same length")
.cguienv$cpdata$rmbaseplot <- lapply(1:length(prof), FUN = function(x){qdata(data.frame(x = 1:10, y = 11:20))
# time <- raw[[x]]@scantime
# mzmin <- raw[[x]]@mzrange[1]
# rawint <- raw[[x]]@env$profile[mz-mzmin+1,]
# chrom <- data.frame(time = time, intensity = rawint)
# #p <- qplot(time,rawint,data=chrom,geom="point")
# #p$title=NULL
# corint <- object[[x]]@env$profile[mz-mzmin+1,]
# if (subtract) {
# res <- corint
# fit <- rawint - corint
# } else {
# res <- rawint - corint
# fit <- corint
# }
# qdata(data.frame( time = rep( raw[[x]]@scantime,
# each = nrow(raw[[x]]@env$profile)),
# mz = rep( seq(from = raw[[x]]@mzrange[1],
# to = raw[[x]]@mzrange[2]),
# ncol(raw[[x]]@env$profile)),
# prof = as.vector(prof[[x]]@env$profile),
# raw = as.vector(raw[[x]]@env$profile)), size = .5)
})
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.