changeset 2:f1f549e6d0bc draft

initial tool
author mingchen0919
date Thu, 22 Feb 2018 23:41:47 -0500
parents da18ae80603c
children 6da0541944de
files extract_fields.xml tool_template.Rmd tool_template_render.R
diffstat 3 files changed, 33 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/extract_fields.xml	Mon Feb 19 12:33:33 2018 -0500
+++ b/extract_fields.xml	Thu Feb 22 23:41:47 2018 -0500
@@ -10,16 +10,17 @@
   <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'
+  <command><![CDATA[                    Rscript '${__tool_directory__}/tool_template_render.R'
+                        -e $echo
+                        -i  $input_txt
+                        -r $report
+                        -d $report.files_path
+                        -s $sink_message
+                        -t '${__tool_directory__}/tool_template.Rmd'
                     ]]></command>
   <inputs>
     <param type="boolean" name="echo" label="Display analysis code in report?" optional="False" checked="False" truevalue="TRUE" falsevalue="FALSE"/>
+    <param type="data" name="input_txt" optional="False" format="txt"/>
   </inputs>
   <outputs>
     <data name="report" format="html" label="tool name report" hidden="false"/>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tool_template.Rmd	Thu Feb 22 23:41:47 2018 -0500
@@ -0,0 +1,16 @@
+---
+title: "r markdown file"
+author: "Ming Chen"
+date: "2/22/2018"
+output: html_document
+---
+
+```{r setup, include=FALSE}
+knitr::opts_chunk$set(echo = TRUE)
+```
+
+
+```{r}
+opt
+```
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tool_template_render.R	Thu Feb 22 23:41:47 2018 -0500
@@ -0,0 +1,9 @@
+zz = file("warnings_and_errors.txt")
+sink(zz)
+sink(zz, type = "message")
+
+## get command line inputs into R
+short_flags = extract_short_flags(xml_file_name = 'extract_fields.xml')
+opt = getopt_specification_matrix(short_flags)
+
+sink()