diff macros.xml @ 25:a4c5dc437558 draft

"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/hyphy/ commit 3908306ffa6f6cbc7b83303b2d4c581406d2fad9"
author iuc
date Tue, 27 Apr 2021 18:03:51 +0000
parents 801547975424
children 3415a580926d
line wrap: on
line diff
--- a/macros.xml	Tue Apr 20 19:55:48 2021 +0000
+++ b/macros.xml	Tue Apr 27 18:03:51 2021 +0000
@@ -93,13 +93,45 @@
         </param>
     </xml>
 
+    <xml name="srv">
+        <conditional name="advanced" label="Advanced options">
+            <param name="srv_options" type="select" label="Set advanced parameters" help="If these parameters are not set, RELAX will calculate appropriate values at runtime">
+                <option value="defaults">Calculate</option>
+                <option value="specify">Specify values</option>
+            </param>
+            <when value="defaults" />
+            <when value="specify">
+                <param argument="--grid-size" type="integer" value="250" label="Points in the initial distributional guess for likelihood fitting" />
+                <param argument="--starting-points" type="integer" value="1" label="Initial random guesses to seed rate values optimization" />
+                <param argument="--syn-rates" type="integer" min="1" max="10" value="3" label="Alpha rate classes to include in the model" />
+                <param argument="--rates" type="integer" min="2" max="10" value="3" label="Omega rate classes to include in the model" />
+                <param argument="--srv" type="boolean" truevalue="Yes" falsevalue="No" label="Include synonymous rate variation" />
+                <param name="save_alternative_model" type="boolean" label="Save alternative model fit" />
+            </when>
+        </conditional>
+    </xml>
+
     <xml name="branches">
-        <param name="branches" type="select" label="Set of branches to test">
-            <option value="All">All branches</option>
-            <option value="Internal">Internal branches</option>
-            <option value="Leaves">Leaf branches</option>
-            <option value="'Unlabeled-branches'">Unlabeled branches</option>
-        </param>
+        <conditional name="branch_cond">
+            <param name="branch_sel" type="select" label="Set of branches to test">
+                <option value="All">All branches</option>
+                <option value="Internal">Internal branches</option>
+                <option value="Leaves">Leaf branches</option>
+                <option value="'Unlabeled-branches'">Unlabeled branches</option>
+                <option value="specify">Enter a branch label</option>
+            </param>
+            <when value="specify">
+                <param name="branch_label" type="text" value="Test" optional="false" label="Branch label">
+                    <sanitizer invalid_char="">
+                        <valid initial="default" />
+                    </sanitizer>
+                </param>
+            </when>
+            <when value="All" />
+            <when value="Internal" />
+            <when value="Leaves" />
+            <when value="'Unlabeled-branches'" />
+        </conditional>
     </xml>
     <xml name="citations">
         <citations>
@@ -114,17 +146,40 @@
             <yield/>
         </requirements>
     </xml>
+    <xml name="alternative_model_output">
+        <data name="alternative_model" format="hyphy_results.json" from_work_dir="alternative_model.json">
+            <filter>advanced['save_alternative_model']</filter>
+        </data>
+    </xml>
+    <token name="@INPUT_TREE@"><![CDATA[
+            #if $input_nhx:
+                --tree input.nhx
+            #end if
+        ]]>
+    </token>
+    <token name="@branch_options@"><![CDATA[
+        #if $branch_cond.branch_sel == 'specify':
+            --branches '$branch_cond.branch_label'
+        #else:
+            --branches $branch_cond.branch_sel
+        #end if
+        ]]>
+    </token>
+    <token name="@advanced_options@"><![CDATA[
+        #if $advanced.srv_options == 'specify':
+            --grid-size $advanced.grid_size
+            --starting-points $advanced.starting_points
+            --syn-rates $advanced.syn_rates
+            --rates $advanced.rates
+            --srv $advanced.srv
+            #if $advanced.save_alternative_model:
+                --save-fit alternative_model.json
+            #end if
+        #end if
+    ]]></token>
     <token name="@HYPHYMPI@">\${GALAXY_MPIRUN:-mpirun -mca orte_tmpdir_base "\${TMPDIR:-.}" -np \${GALAXY_SLOTS:-1}} HYPHYMPI</token>
-    <token name="@CATCH_ERROR@"><![CDATA[
-        EC=\$? ;
-        if [ \$EC -ne 0 ] ; then
-            if [ -f errors.log.mpinode0 ] ; then
-                cat errors.log.mpinode0 >&2 ;
-            else 
-                cat errors.log >&2 ;
-            fi ;
-        fi ;
-        exit \$EC
+    <token name="@ERRORS@"><![CDATA[
+        ; EC=\$? ; [[ -f errors.* ]] && cat errors.* >&2 ; exit \$EC
     ]]></token>
     <token name="@HYPHY_ENVIRONMENT@"><![CDATA[
         export HYPHY=`which hyphy` &&
@@ -134,11 +189,10 @@
         @HYPHY_ENVIRONMENT@ hyphy LIBPATH=\$HYPHY_LIB
     ]]></token>
     <token name="@SYMLINK_FILES@"><![CDATA[
-        ln -s '$input_file' input.$input_file.extension &&
-        ln -s '$@operation@_output' input.${input_file.extension}.@OPERATION@.json &&
-        #set $input_file = 'input.%s' % $input_file.extension
-        #if $input_nhx:
+        #if $input_nhx is not None:
             ln -s '$input_nhx' input.nhx &&
         #end if
+        ln -s '$input_file' input.$input_file.extension &&
+        #set $input_file = 'input.%s' % $input_file.extension
     ]]></token>
 </macros>