diff --git a/NAMESPACE b/NAMESPACE index 5f95423cace998181e1ddad87be195def953238e..8dd6ef884d4a6b1bd85aeee1e6d70b4f4818dd8a 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -1,10 +1,14 @@ # Generated by roxygen2: do not edit by hand +export(app) export(concurrency) export(conf_trans) export(create_plots) export(extr_data) export(extract) +export(get_fn_comp) +export(get_fn_extr) +export(get_fn_summ) export(launch) export(list2rev) export(load_compound_input) diff --git a/R/api.R b/R/api.R index ba9ba5d44c33bcab0a5a880103d179d0f5135ee9..2ca3094c189c57bab4b171cb884b6685840b687f 100644 --- a/R/api.R +++ b/R/api.R @@ -147,7 +147,7 @@ mk_comp_tab <- function(m) { setnames(comp,names(COMP_NAME_MAP), function(o) COMP_NAME_MAP[[o]]) setcolorder(comp,COMP_NAME_FIRST) - fn_out <- m$conf$fn_comp + fn_out <- get_fn_comp(m) tab2file(tab=comp,file=fn_out) message("Generation of comp table finished.") setkeyv(comp,c("set","tag","mz")) @@ -340,8 +340,9 @@ extr_data <- function(m) { ## ztmp[[nn]]$Files <- fn ## } m$extr$ms <- data.table::rbindlist(ztmp) - message('Saving extracted data to ', m$extr$fn) - saveRDS(object = m$extr, file = m$extr$fn) + fn_ex <- get_fn_extr(m) + message('Saving extracted data to ', fn_ex) + saveRDS(object = m$extr, file = fn_ex) message('Done saving extracted data.') m$extr$tmp <- NULL @@ -777,3 +778,12 @@ report <- function(m) { m$out$report$export('report.pdf') m } + + +#' @export +app <- function() { + unlink(list.files(pattern = "app_run.*html$")) + unlink(list.files(pattern = "app_run.*Rmd$")) + file.copy(system.file(file.path("rmd","app.Rmd"),package = "shinyscreen"),"app_run.Rmd") + rmarkdown::run(file = "app_run.Rmd") +} diff --git a/R/mix.R b/R/mix.R index d757c040f5223ef0cc10edc6d09cc424c5c546d5..d05d778f9895cf8258d23cdbc4b16cac0de1e1fa 100644 --- a/R/mix.R +++ b/R/mix.R @@ -715,12 +715,24 @@ read_conf <- function(fn) { } + +##' @export +get_fn_comp <- function(m) { + file.path(m$conf$project,FN_COMP_TAB) +} + +##' @export +get_fn_summ <- function(m) { + file.path(m$conf$project, FN_SUMM) +} + +##' @export +get_fn_extr <- function(m) { + file.path(m$conf$project, "extracted.rds") +} + + init_state <- function(m) { - if (is.null(m$conf$debug)) m$conf$debug <- F - m$conf$fn_comp <- file.path(m$conf$project, FN_COMP_TAB) - m$conf$fn_summ <- file.path(m$conf$project, FN_SUMM) - - m$extr$fn <- file.path(m$conf$project, "extracted.rds") m$out$tab <- list() m$input$tab$mzml <- EMPTY_MZML lab <- gen_uniq_lab(list(),pref="L") @@ -737,7 +749,8 @@ base_conf <- function () { data="", fn_comp="", fn_summ=""), - extr=list(fn="")) + extr=list(fn=""), + debug = F) m }