inst/scripts/dr2s.R

#!/usr/bin/env Rscript

#' @name dr2s
#'
#' @usage dr2s [-h] <config>
#'
#' @param config yaml run configuration
#'
#' @author Gerhard Schöfl <schoefl@dkms-lab.de>
#' @date 2017-01-05
#' @version 0.1

## Dependencies ####
suppressPackageStartupMessages(stopifnot(
  require("optparse", quietly = TRUE),
  require("yaml", quietly = TRUE),
  require("DR2S", quietly = TRUE),
  require("foreach", quietly = TRUE)
))

## Options ####
option_list <- list()
oparser <- OptionParser(usage = "%prog [-h] <config>",
                        option_list,
                        epilogue = '')
arguments   <- parse_args(oparser, positional_arguments = TRUE)
config_file <- arguments$args
configs     <- readDR2SConf(config_file)

rs <- foreach(conf = configs) %do% {
  mapper <- InitDR2S(conf)
  cat("\nRunning\n", sep = "")
  #print(mapper$getConfig())
  cat("\n")
  print(mapper)
  cat("\n")
  Sys.sleep(2)
  mapper$runPipeline()
}

quit(status = 0)
gschofl/DR2S documentation built on May 17, 2019, 8:40 a.m.