# HG changeset patch # User mingchen0919 # Date 1521559768 14400 # Node ID a88f12177e6fdbcadf6764fdd642ed79e8857fb0 planemo upload diff -r 000000000000 -r a88f12177e6f variant_simple_search.Rmd --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/variant_simple_search.Rmd Tue Mar 20 11:29:28 2018 -0400 @@ -0,0 +1,30 @@ +--- +title: 'HTML report title' +output: + html_document: + number_sections: true + toc: true + theme: cosmo + highlight: tango + code_folding: hide +--- + +```{r setup, include=FALSE, warning=FALSE, message=FALSE} +knitr::opts_chunk$set( + echo = TRUE, + error = TRUE +) +``` + + +# Code for computational analysis + +```{r 'step 1'} + +``` + +```{r 'ste[ 2'} + +``` + + diff -r 000000000000 -r a88f12177e6f variant_simple_search.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/variant_simple_search.xml Tue Mar 20 11:29:28 2018 -0400 @@ -0,0 +1,46 @@ + + + some description + + + pandocr-getoptr-rmarkdownr-jsonliter-dtr-curlr-rcurl + + + + + + + + + + diff -r 000000000000 -r a88f12177e6f variant_simple_search_render.R --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/variant_simple_search_render.R Tue Mar 20 11:29:28 2018 -0400 @@ -0,0 +1,51 @@ +##============ Sink warnings and errors to a file ============== +## use the sink() function to wrap all code within it. +##============================================================== +zz = file('warnings_and_errors.txt') +sink(zz) +sink(zz, type = 'message') + +#------------import libraries-------------------- +options(stringsAsFactors = FALSE) + +library(getopt) +library(rmarkdown) +#------------------------------------------------ + + +#------------get arguments into R-------------------- +# load helper function +source(paste0(Sys.getenv('TOOL_DIR'), '/helper.R')) +# import getopt specification matrix from a csv file +spec_csv = paste0(Sys.getenv('TOOL_DIR'), '/getopt_specification.csv') +opt = getopt(getopt_specification_matrix(spec_csv)) +opt$X_t = Sys.getenv('TOOL_DIR') +#---------------------------------------------------- + + +#-----------using passed arguments in R +# to define system environment variables--- +do.call(Sys.setenv, opt[-1]) +#---------------------------------------------------- + +#---------- often used variables ---------------- +# OUTPUT_DIR: path to the output associated directory, which stores all outputs +# TOOL_DIR: path to the tool installation directory +OUTPUT_DIR = opt$X_d +TOOL_DIR = opt$X_t +OUTPUT_REPORT = opt$X_o +RMD_NAME = '' + +# create the output associated directory to store all outputs +dir.create(OUTPUT_DIR, recursive = TRUE) + +#-----------------render Rmd-------------- +render(paste0(TOOL_DIR, '/', RMD_NAME), output_file = OUTPUT_REPORT) +#------------------------------------------ + +#==============the end============== + + +##--------end of code rendering .Rmd templates---------------- +sink() +##=========== End of sinking output============================= \ No newline at end of file