changeset 13:8f7d918586bc draft

Uploaded
author greg
date Wed, 28 Feb 2018 13:39:44 -0500
parents bd5e35775e20
children 4aadc28100b0
files insect_phenology_model.xml
diffstat 1 files changed, 39 insertions(+), 21 deletions(-) [+]
line wrap: on
line diff
--- a/insect_phenology_model.xml	Wed Feb 28 08:28:43 2018 -0500
+++ b/insect_phenology_model.xml	Wed Feb 28 13:39:44 2018 -0500
@@ -4,18 +4,28 @@
         <requirement type="package" version="1.4.4">r-optparse</requirement>
     </requirements>
     <command detect_errors="exit_code"><![CDATA[
-#set stages = list()
+#set life_stages_nymph = "None"
 #set life_stages_adult = "None"
-#set life_stage_nymph = "None"
-#set life_stages = $life_stages_cond.life_stages
-#for life_stage in str($life_stages).split(","):
-    #if $life_stage == "Adult":
-        #set life_stages_adult = $life_stages_cond.life_stages_adult
-    #else if $life_stage == "Nymph":
-        #set life_stage_nymph = $life_stages_cond.life_stage_nymph
+#set stages = list()
+#set plot_adult_life_stage = $plot_adult_life_stage_cond.plot_adult_life_stage
+#set plot_nymph_life_stage = $plot_nymph_life_stage_cond.plot_nymph_life_stage
+#if str($plot_egg_life_stage) == "yes" and str($plot_nymph_life_stage) == "yes" and str($plot_adult_life_stage) == "yes":
+    $stages.append("Total")
+    #set life_stage_nymph = $plot_nymph_life_stage_cond.life_stage_nymph
+    #set life_stages_adult = $plot_adult_life_stage_cond.life_stages_adult
+#else:
+    #if str($plot_egg_life_stage) == "yes":
+        $stages.append("Egg")
     #end if
-    $stages.append($life_stage)
-#end for
+    #if str($plot_nymph_life_stage) == "yes":
+        $stages.append("Nymph")
+        #set life_stage_nymph = $plot_nymph_life_stage_cond.life_stage_nymph
+    #end if
+    #if str($plot_adult_life_stage) == "yes":
+        $stages.append("Adult")
+        #set life_stages_adult = $plot_adult_life_stage_cond.life_stages_adult
+    #end if
+#end if
 #set stages = ",".join($stages)
 mkdir output_dir &&
 Rscript '$__tool_directory__/insect_phenology_model.R'
@@ -29,7 +39,7 @@
 #if str($life_stages_adult) != "None":
     --life_stages_adult $life_stages_adult
 #end if
-#if str($life_stage_nymph) != "None":
+#if str($life_stage_nymph) != "no":
     --life_stage_nymph $life_stage_nymph
 #end if
 --location '$location'
@@ -66,23 +76,30 @@
             <option value="yes" selected="True">Yes</option>
             <option value="no">No</option>
         </param>
-        <conditional name="life_stages_cond" label="Select life_stages for plotting">
-            <param name="life_stages" type="select" label="Select life stages for plotting">
-                <option value="Total" selected="true">All</option>
-                <option value="Egg">Egg</option>
-                <option value="Nymph">Nymph</option>
-                <option value="Adult">Adult</option>
+        <param name="plot_egg_life_stage" type="select" label="Plot egg life stage?">
+            <option value="yes" selected="true">Yes</option>
+            <option value="no">No</option>
+        </param>
+        <conditional name="plot_nymph_life_stage_cond">
+            <param name="plot_nymph_life_stage" type="select" label="Plot nymph life stage?">
+                <option value="yes" selected="true">Yes</option>
+                <option value="no">No</option>
             </param>
-            <when value="Total"/>
-            <when value="Egg"/>
-            <when value="Nymph">
+            <when value="yes">
                 <param name="life_stage_nymph" type="select" label="Select nymph life stage">
                     <option value="Total" selected="true">All</option>
                     <option value="Young">Young</option>
                     <option value="Old">Old</option>
                 </param>
             </when>
-            <when value="Adult">
+            <when value="no"/>
+        </conditional>
+        <conditional name="plot_adult_life_stage_cond">
+            <param name="plot_adult_life_stage" type="select" label="Plot adult life stage?">
+                <option value="yes" selected="true">Yes</option>
+                <option value="no">No</option>
+            </param>
+            <when value="yes">
                 <param name="life_stages_adult" type="select" label="Select adult life stage">
                     <option value="Total" selected="true">All</option>
                     <option value="Pre-vittelogenic">Pre-vittelogenic</option>
@@ -90,6 +107,7 @@
                     <option value="Diapausing">Diapausing</option>
                 </param>
             </when>
+            <when value="no"/>
         </conditional>
         <param name="plot_std_error" type="select" label="Plot standard error?">
             <option value="yes" selected="True">Yes</option>