diff rdeval_report.xml @ 5:7cfeba6facd1 draft

planemo upload for repository https://github.com/vgl-hub/rdeval commit d55c4b3d6b91d0418950ed6b7806ef779a916099
author richard-burhans
date Fri, 02 May 2025 22:49:30 +0000
parents 7bf95986aaa4
children fdad714d7caf
line wrap: on
line diff
--- a/rdeval_report.xml	Wed Apr 23 19:31:12 2025 +0000
+++ b/rdeval_report.xml	Fri May 02 22:49:30 2025 +0000
@@ -10,23 +10,46 @@
     export RDEVAL_SHARE_DIR="\$(dirname \$(dirname \$(type -P rdeval)))/share/rdeval" &&
     ln -s "\$RDEVAL_SHARE_DIR/figures.Rmd" &&
     ln -s "\$RDEVAL_SHARE_DIR/rdeval_interface.R" &&
-    #set $num_files = 0
-    #for $input_file in $input_files
-        ln -s '$input_file' '${num_files}.rd' &&
-        #set $num_files += 1
+    #set $input_file_list = []
+    #for $idx, $input_file in enumerate($input_files)
+        ln -s '$input_file' '${idx}.rd' &&
+        #silent $input_file_list.append(f"'{idx}.rd'")
     #end for
-    R -e "rmarkdown::render('figures.Rmd', output_file='$html_outfile')" --args #for $idx in range($num_files)# '${idx}.rd' #end for
+    #set $r_vector = "c(" + ",".join(input_file_list) + ")"
+    #set $interactive_value = "FALSE"
+    #if $output_format.format_selector == "html" and $output_format.interactive
+        #set $interactive_value = "TRUE"
+    #end if
+    R -e "rmarkdown::render('figures.Rmd', output_file='$outfile', output_format='${output_format.format_selector}_document', params=list(input_files=$r_vector, interactive='$interactive_value'))"
 	]]></command>
     <inputs>
         <param name="input_files" type="data" format="data" multiple="true" label="Input dataset" help="RD files"/>
+        <conditional name="output_format">
+            <param name="format_selector" type="select" label="output format" help="output format">
+                <option value="html" selected="true">html</option>
+                <option value="pdf">pdf</option>
+            </param>
+            <when value="html">
+                <param name="interactive" type="boolean" value="true" label="interactive" help="interactive"/>
+            </when>
+            <when value="pdf"/>
+        </conditional>
     </inputs>
     <outputs>
-        <data name="html_outfile" format="html" label="Rdeval report"/>
+        <data name="outfile" format="html" label="Rdeval report">
+            <change_format>
+                <when input="output_format" value="pdf" format="pdf"/>
+            </change_format>
+        </data>
     </outputs>
     <tests>
         <test expect_num_outputs="1">
-            <param name="input_files" value="test.rd"/>
-            <output name="html_outfile" ftype="html">
+            <param name="input_files" value="input1.rd"/>
+            <conditional name="output_format">
+                <param name="format_selector" value="html"/>
+            </conditional>
+
+            <output name="outfile" ftype="html">
                 <assert_contents>
                     <has_size size="833000" delta="8330"/>
                 </assert_contents>