diff macros.xml @ 15:70fa84e99463 draft

planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/scanpy/ commit c21958f44b81d740191999fb6015d5ae69538ee0
author iuc
date Wed, 31 Jul 2024 18:11:37 +0000
parents f7446fd8d5e7
children 1072ce66b426
line wrap: on
line diff
--- a/macros.xml	Sat May 18 18:32:22 2024 +0000
+++ b/macros.xml	Wed Jul 31 18:11:37 2024 +0000
@@ -1,6 +1,6 @@
 <macros>
     <token name="@TOOL_VERSION@">1.9.6</token>
-    <token name="@VERSION_SUFFIX@">3</token>
+    <token name="@VERSION_SUFFIX@">4</token>
     <token name="@profile@">21.09</token>
     <xml name="requirements">
         <requirements>
@@ -425,6 +425,7 @@
             <param name="type" type="select" label="Variables to plot (columns of the heatmaps)" >
                 <option value="all">All variables in 'adata.var_names'</option>
                 <option value="custom">Subset of variables in 'adata.var_names'</option>
+                <option value="customfile">Subset of variables as a tabular file</option>
             </param>
             <when value="all"/>
             <when value="custom">
@@ -432,6 +433,9 @@
                     <expand macro="sanitize_query" />
                 </param>
             </when>
+            <when value="customfile">
+                <param argument="var_names" type="data" format="tabular" label="List of variables to plot" help="This should be a tsv where row = group (e.g. celltypes) and columns = variables."></param>
+            </when>
         </conditional>
     </xml>
     <xml name="param_num_categories">
@@ -468,11 +472,13 @@
         <expand macro="param_num_categories"/>
     </xml>
     <token name="@CMD_params_inputs@"><![CDATA[
-    #if $method.var_names.type == 'all'
-    var_names=adata.var_names,
-    #else
+    #if $method.var_names.type == 'custom'
     #set $var_names = ([x.strip() for x in str($method.var_names.var_names).split(',')])
     var_names=$var_names,
+    #else if $method.var_names.type == 'customfile'
+    var_names={key: [v for v in list(value.values()) if pd.notna(v)] for key, value in pd.read_csv('$var_names', sep='\t', index_col=0).to_dict(orient='index').items()},
+    #else
+    var_names=adata.var_names,
     #end if
     #if $method.groupby
     groupby='$method.groupby',
@@ -1122,7 +1128,7 @@
         </param>
     </xml>
     <xml name="param_n_genes">
-        <param argument="n_genes" type="integer" min="0" value="10" label="Number of genes to show" help=""/>
+        <param argument="n_genes" type="integer" min="0" value="10" label="Number of genes to show" help="It is only used if you are not specifying certain variable names"/>
     </xml>
     <xml name="pl_dotplot">
         <param argument="color_map" type="select" optional="true" label="Color palette">