changeset 12:9cf29b2374a6 draft

1.1.0
author mingchen0919
date Sat, 24 Feb 2018 11:42:37 -0500
parents 670e1591cc65
children b9f08569b8ba
files extract_fields.xml tool_template.Rmd tool_template_render.R
diffstat 3 files changed, 42 insertions(+), 12 deletions(-) [+]
line wrap: on
line diff
--- a/extract_fields.xml	Sat Feb 24 10:44:30 2018 -0500
+++ b/extract_fields.xml	Sat Feb 24 11:42:37 2018 -0500
@@ -1,4 +1,4 @@
-<tool id="tool_template" name="tool name" version="1.0.0">
+<tool id="tool_template" name="tool name" version="1.1.0">
   <requirements>
     <requirement type="package" version="1.15.0.6-0">pandoc</requirement>
     <requirement type="package" version="1.20.0">r-getopt</requirement>
@@ -10,16 +10,16 @@
   <stdio>
     <regex source="stderr" match="XXX" level="warning" description="Check the warnings_and_errors.txt file for more details."/>
   </stdio>
-  <command><![CDATA[                    Rscript '${__tool_directory__}/tool_template_render.R'
-                        -e $echo
-                        -r $report
-                        -d $report.files_path
-                        -s $sink_message
-                        -t '${__tool_directory__}/tool_template.Rmd'
-
-                        -A $input_field_numbers
-                        -B $input_file
-                        -O $output_txt
+  <command><![CDATA[                    Rscript '${__tool_directory__}/tool_template_render.R'
+                        -e $echo
+                        -r $report
+                        -d $report.files_path
+                        -s $sink_message
+                        -t '${__tool_directory__}/tool_template.Rmd'
+
+                        -A $input_field_numbers
+                        -B $input_file
+                        -O $output_txt
                     ]]></command>
   <inputs>
     <param type="boolean" name="echo" label="Display analysis code in report?" optional="False" checked="False" truevalue="TRUE" falsevalue="FALSE"/>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tool_template.Rmd	Sat Feb 24 11:42:37 2018 -0500
@@ -0,0 +1,30 @@
+---
+title: "tool_template.Rmd"
+author: "Ming Chen"
+date: "2/24/2018"
+output: html_document
+---
+
+```{r setup, include=FALSE}
+knitr::opts_chunk$set(echo = TRUE)
+```
+
+## R Markdown
+
+This is an R Markdown document. Markdown is a simple formatting syntax for authoring HTML, PDF, and MS Word documents. For more details on using R Markdown see <http://rmarkdown.rstudio.com>.
+
+When you click the **Knit** button a document will be generated that includes both content as well as the output of any embedded R code chunks within the document. You can embed an R code chunk like this:
+
+```{r cars}
+summary(cars)
+```
+
+## Including Plots
+
+You can also embed plots, for example:
+
+```{r pressure, echo=FALSE}
+plot(pressure)
+```
+
+Note that the `echo = FALSE` parameter was added to the code chunk to prevent printing of the R code that generated the plot.
--- a/tool_template_render.R	Sat Feb 24 10:44:30 2018 -0500
+++ b/tool_template_render.R	Sat Feb 24 11:42:37 2018 -0500
@@ -23,5 +23,5 @@
 extract_field_command = paste0("awk '{print ", X_A, " }' ", opt$X_B, " > ", opt$X_O)
 system(command = extract_field_command)
 
-
+rmarkdown::render(input = opt$X_t, output_file = opt$X_r)
 sink()