changeset 7:b2df381a6004 draft

"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/scanpy/ commit 150c96596b94f9658c8b7c44814c420d38fbee0c"
author iuc
date Wed, 20 May 2020 16:11:15 -0400
parents 77b91b9bdf52
children 35bc2eb568ed
files cluster_reduce_dimension.xml macros.xml
diffstat 2 files changed, 89 insertions(+), 29 deletions(-) [+]
line wrap: on
line diff
--- a/cluster_reduce_dimension.xml	Thu Feb 20 08:23:29 2020 -0500
+++ b/cluster_reduce_dimension.xml	Wed May 20 16:11:15 2020 -0400
@@ -4,7 +4,9 @@
         <import>macros.xml</import>
         <xml name="pca_inputs">
             <param argument="n_comps" type="integer" min="0" value="50" label="Number of principal components to compute" help=""/>
-            <param argument="dtype" type="text" value="float32" label="Numpy data type string to which to convert the result" help=""/>
+            <param argument="dtype" type="text" value="float32" label="Numpy data type string to which to convert the result" help="">
+                <expand macro="sanitize_query" />
+            </param>
             <conditional name="pca">
                 <param argument="chunked" type="select" label="Type of PCA?">
                     <option value="True">Incremental PCA on segments (incremental PCA automatically zero centers and ignores settings of 'random_seed' and 'svd_solver')</option>
@@ -210,14 +212,18 @@
                     <when value="igraph"/>
                 </conditional>
                 <expand macro="param_random_state"/>
-                <param argument="key_added" type="text" value="louvain" optional="true" label="Key under which to add the cluster labels" help=""/>
+                <param argument="key_added" type="text" value="louvain" optional="true" label="Key under which to add the cluster labels" help="">
+                    <expand macro="sanitize_query" />
+                </param>
                 <param argument="directed" type="boolean" truevalue="True" falsevalue="False" checked="true" label="Interpret the adjacency matrix as directed graph?"/>
                 <expand macro="param_use_weights"/>
             </when>
             <when value="tl.leiden">
                 <param argument="resolution" type="float" value="1" label="Coarseness of the clusterin" help="Higher values lead to more clusters"/>
                 <expand macro="param_random_state"/>
-                <param argument="key_added" type="text" value="leiden" label="Key under which to add the cluster labels" help=""/>
+                <param argument="key_added" type="text" value="leiden" label="Key under which to add the cluster labels" help="">
+                    <expand macro="sanitize_query" />
+                </param>
                 <expand macro="param_use_weights"/>
                 <param argument="n_iterations" type="integer" value="-1" label="How many iterations of the Leiden clustering algorithm to perform." help="Positive values above 2 define the total number of iterations to perform, -1 has the algorithm run until it reaches its optimal clustering."/>
             </when>
@@ -257,9 +263,13 @@
                 <expand macro="param_layout"/>
                 <expand macro="param_root"/>
                 <expand macro="param_random_state"/>
-                <param argument="init_pos" type="text" optional="true" value="" label="Precomputed coordinates for initialization" help="It should be a valid 2d observation (e.g. paga)"/>
+                <param argument="init_pos" type="text" optional="true" value="" label="Precomputed coordinates for initialization" help="It should be a valid 2d observation (e.g. paga)">
+                    <expand macro="sanitize_query" />
+                </param>
                 <param argument="adjacency" type="data" format="mtx" optional="true" label="Sparse adjacency matrix of the graph" help="If not set, it uses the unstructured annotation (uns) / neighbors / connectivities"/>
-                <param argument="key_ext" type="text" optional="true" value="" label="External key" help="If not set, it appends 'layout'"/>
+                <param argument="key_ext" type="text" optional="true" value="" label="External key" help="If not set, it appends 'layout'">
+                    <expand macro="sanitize_query" />
+                </param>
             </when>
             <when value="tl.dpt">
                 <param argument="n_dcs" type="integer" min="0" value="10" label="Number of diffusion components to use" help=""/>
@@ -268,7 +278,9 @@
                 <param argument="allow_kendall_tau_shift" type="boolean" truevalue="True" falsevalue="False" checked="true" label="Allow Kendal tau shift?" help="If a very small branch is detected upon splitting, shift away from maximum correlation in Kendall tau criterion of Haghverdi et al (2016) to stabilize the splitting."/>
             </when>
             <when value="tl.paga">
-                <param argument="groups" type="text" value="louvain" label="Key for categorical in the input" help="You can pass your predefined groups by choosing any categorical annotation of observations ('adata.obs')."/>
+                <param argument="groups" type="text" value="louvain" label="Key for categorical in the input" help="You can pass your predefined groups by choosing any categorical annotation of observations ('adata.obs').">
+                    <expand macro="sanitize_query" />
+                </param>
                 <param argument="use_rna_velocity" type="boolean" truevalue="False" falsevalue="False" checked="false" label="Use RNA velocity to orient edges in the abstracted graph and estimate transitions?" help="Requires that 'adata.uns' contains a directed single-cell graph with key '['velocyto_transitions']'. This feature might be subject to change in the future."/>
                 <param argument="model" type="select" label="PAGA connectivity model" help="">
                     <option value="v1.2">v1.2</option>
--- a/macros.xml	Thu Feb 20 08:23:29 2020 -0500
+++ b/macros.xml	Wed May 20 16:11:15 2020 -0400
@@ -1,7 +1,7 @@
 <macros>
     <token name="@version@">1.4.4.post1</token>
     <token name="@profile@">19.01</token>
-    <token name="@galaxy_version@"><![CDATA[@version@+galaxy2]]></token>
+    <token name="@galaxy_version@"><![CDATA[@version@+galaxy3]]></token>
     <xml name="requirements">
         <requirements>
             <requirement type="package" version="@version@">scanpy</requirement>
@@ -37,6 +37,20 @@
 import numpy as np
     ]]>
     </token>
+    <xml name="sanitize_query" token_validinitial="string.printable">
+        <sanitizer>
+            <valid initial="@VALIDINITIAL@">
+                <remove value="&apos;" />
+            </valid>
+       </sanitizer>
+    </xml>
+    <xml name="sanitize_vectors" token_validinitial="string.digits">
+        <sanitizer>
+            <valid initial="@VALIDINITIAL@">
+                <add value=","/>
+            </valid>
+        </sanitizer>
+    </xml>
     <xml name="inputs_anndata">
         <param name="adata" type="data" format="h5ad" label="Annotated data matrix"/>
     </xml>
@@ -368,7 +382,9 @@
         <option value="gist_ncar">gist_ncar (Miscellaneous)</option>
     </xml>
     <xml name="param_groupby">
-        <param argument="groupby" type="text" value="" optional="true" label="The key of the observation grouping to consider" help="If it is given, the plot is ordered by the respective group. It is expected that to be a categorical. If it is not a categorical observation, it would be subdivided into 'num_categories'."/>
+        <param argument="groupby" type="text" value="" optional="true" label="The key of the observation grouping to consider" help="If it is given, the plot is ordered by the respective group. It is expected that to be a categorical. If it is not a categorical observation, it would be subdivided into 'num_categories'.">
+            <expand macro="sanitize_query" />
+        </param>
     </xml>
     <xml name="param_use_raw">
         <param argument="use_raw" type="boolean" truevalue="True" falsevalue="False" checked="false" label="Use 'raw' attribute of input if present" help=""/>
@@ -400,7 +416,9 @@
             </param>
             <when value="all"/>
             <when value="custom">
-                <param argument="var_names" type="text" value="" label="List of variables to plot" help="They should be a valid subset of 'adata.var_names', and separated by comma"/>
+                <param argument="var_names" type="text" value="" label="List of variables to plot" help="They should be a valid subset of 'adata.var_names', and separated by comma">
+                    <expand macro="sanitize_query" />
+                </param>
             </when>
         </conditional>
     </xml>
@@ -414,14 +432,18 @@
         <repeat name="var_group_positions" title="Group of variables to highlight" help="This will draw a 'bracket' on top of the plot between the given start and end positions. If a label is given, it will be added on top of the bracket. ">
             <param name="start" type="integer" min="0" value="" label="Start" help=""/>
             <param name="end" type="integer" min="0" value="" label="End" help=""/>
-            <param argument="label" type="text" value="" label="Label" help=""/>
+            <param argument="label" type="text" value="" label="Label" help="">
+                <expand macro="sanitize_query" />
+            </param>
         </repeat>
     </xml>
     <xml name="param_var_group_rotation">
         <param argument="var_group_rotation" type="float" value="" optional="true" label="Label rotation degrees" help="By default, labels larger than 4 characters are rotated 90 degrees"/>
     </xml>
     <xml name="param_layer">
-        <param argument="layer" type="text" value="" label="Name of the AnnData object layer that wants to be plotted" help="By default 'adata.raw.X' is plotted. If 'use_raw=False' is set, then 'adata.X' is plotted. If layer is set to a valid layer name, then the layer is plotted. layer takes precedence over 'use_raw'."/>
+        <param argument="layer" type="text" value="" label="Name of the AnnData object layer that wants to be plotted" help="By default 'adata.raw.X' is plotted. If 'use_raw=False' is set, then 'adata.X' is plotted. If layer is set to a valid layer name, then the layer is plotted. layer takes precedence over 'use_raw'.">
+            <expand macro="sanitize_query" />
+        </param>
     </xml>
     <token name="@CMD_param_plot_inputs@"><![CDATA[
     adata,
@@ -643,7 +665,7 @@
     </xml>
     <xml name="param_vmax">
         <param argument="vmax" type="float" value="" optional="true" label="Maximum value to normalize luminance data" help="If not set, it is inferred from the data and other keyword arguments"/>
-    </xml>    
+    </xml>
     <xml name="section_matplotlib_pyplot_scatter">
         <section name="matplotlib_pyplot_scatter" title="Parameters for matplotlib.pyplot.scatter">
             <!--<param argument="marker" type="select" label="Marker style" help="">
@@ -726,7 +748,7 @@
     size=$method.violin_plot.stripplot.jitter.size,
     #end if
 #end if
-    multi_panel=$method.violin_plot.multi_panel.multi_panel, 
+    multi_panel=$method.violin_plot.multi_panel.multi_panel,
 #if $method.multi_panel.violin_plot.multi_panel == "True" and str($method.violin_plot.multi_panel.width) != '' and str($method.violin_plot.multi_panel.height) != ''
     figsize=($method.violin_plot.multi_panel.width, $method.violin_plot.multi_panel.height)
 #end if
@@ -763,7 +785,9 @@
     saturation=$method.seaborn_violinplot.saturation
     ]]></token>
     <xml name="param_color">
-        <param argument="color" type="text" value="" optional="true" label="Keys for annotations of observations/cells or variables/genes" help="One or a list of comma-separated index or key from either '.obs' or '.var'"/>
+        <param argument="color" type="text" value="" optional="true" label="Keys for annotations of observations/cells or variables/genes" help="One or a list of comma-separated index or key from either '.obs' or '.var'">
+            <expand macro="sanitize_query" />
+        </param>
     </xml>
     <token name="@CMD_param_color@"><![CDATA[
 #if str($method.color) != ''
@@ -772,7 +796,9 @@
 #end if
     ]]></token>
     <xml name="param_groups">
-        <param argument="groups" type="text" value="" optional="true" label="Categorical observation annotations to plot" help="Comma-separated"/>
+        <param argument="groups" type="text" value="" optional="true" label="Categorical observation annotations to plot" help="Comma-separated">
+            <expand macro="sanitize_query" />
+        </param>
     </xml>
     <token name="@CMD_params_groups@"><![CDATA[
 #if str($method.groups) != ''
@@ -782,8 +808,12 @@
     ]]></token>
     <xml name="pl_components">
         <repeat name="components" title="Component">
-            <param argument="axis1" type="text" value="1" label="X-Axis" help=""/>
-            <param argument="axis2" type="text" value="2" label="Y-Axis" help=""/>
+            <param argument="axis1" type="text" value="1" label="X-Axis" help="">
+                <expand macro="sanitize_query" />
+            </param>
+            <param argument="axis2" type="text" value="2" label="Y-Axis" help="">
+                <expand macro="sanitize_query" />
+            </param>
         </repeat>
     </xml>
     <token name="@CMD_params_pl_components@"><![CDATA[
@@ -842,13 +872,13 @@
     </xml>
     <xml name="param_palette">
         <param argument="palette" type="select" label="Colors to use for plotting categorical annotation groups" help="">
-            <option value="">Default</option>
+            <option value="default">Default</option>
             <expand macro="matplotlib_pyplot_colormap"/>
         </param>
     </xml>
     <xml name="param_color_map">
         <param argument="color_map" type="select" label="Color map to use for continous variables" help="">
-            <option value="">Default</option>
+            <option value="None">Default</option>
             <expand macro="matplotlib_pyplot_colormap"/>
         </param>
     </xml>
@@ -871,7 +901,9 @@
     ]]>
     </token>
     <xml name="param_title">
-        <param argument="title" type="text" value="" optional="true" label="Title for panels" help="Titles must be separated by a comma"/>
+        <param argument="title" type="text" value="" optional="true" label="Title for panels" help="Titles must be separated by a comma">
+            <expand macro="sanitize_query" />
+        </param>
     </xml>
     <token name="@CMD_param_title@"><![CDATA[
     #if $method.plot.title
@@ -950,7 +982,7 @@
     @CMD_param_legend_fontsize@
     legend_fontweight='$method.plot.legend_fontweight',
     @CMD_param_size@
-    #if str($method.plot.color_map) != ''
+    #if str($method.plot.color_map) != 'None'
     color_map='$method.plot.color_map',
     #end if
     #if str($method.plot.palette) != ''
@@ -978,7 +1010,9 @@
         </param>
     </xml>
     <xml name="param_root">
-        <param argument="root" type="text" value="" label="Comma-separated roots" help="If choosing a tree layout, this is the index of the root node or a list of root node indices. If this is a non-empty vector then the supplied node IDs are used as the roots of the trees (or a single tree if the graph is connected). If this is 'None' or an empty list, the root vertices are automatically calculated based on topological sorting."/>
+        <param argument="root" type="text" value="" label="Comma-separated roots" help="If choosing a tree layout, this is the index of the root node or a list of root node indices. If this is a non-empty vector then the supplied node IDs are used as the roots of the trees (or a single tree if the graph is connected). If this is 'None' or an empty list, the root vertices are automatically calculated based on topological sorting.">
+            <expand macro="sanitize_query" />
+        </param>
     </xml>
     <xml name="param_random_state">
         <param argument="random_state" type="integer" value="0" label="Random state" help="For layouts with random initialization like 'fr', change this to use different intial states for the optimization. If 'None', the initial state is not reproducible."/>
@@ -986,16 +1020,26 @@
     <xml name="inputs_paga">
         <param argument="threshold" type="float" min="0" value="0.01" label="Threshold to draw edges" help="Do not draw edges for weights below this threshold. Set to 0 if you want all edges. Discarding low-connectivity edges helps in getting a much clearer picture of the graph."/>
         <expand macro="param_groups"/>
-        <param argument="color" type="text" value="" label="The node colors" help="Gene name or obs. annotation, and also plots the degree of the abstracted graph when passing 'degree_dashed', 'degree_solid'."/>
+        <param argument="color" type="text" value="" label="The node colors" help="Gene name or obs. annotation, and also plots the degree of the abstracted graph when passing 'degree_dashed', 'degree_solid'.">
+            <expand macro="sanitize_query" />
+        </param>
         <param argument="pos" type="data" format="tabular,csv,tsv" optional="true" label="Two-column tabular file storing the x and y coordinates for drawing" help=""/>
-        <param argument="labels" type="text" value="" label="Comma-separated node labels" help="If none is provided, this defaults to the group labels stored in the categorical for which 'tl.paga' has been computed."/>
+        <param argument="labels" type="text" value="" label="Comma-separated node labels" help="If none is provided, this defaults to the group labels stored in the categorical for which 'tl.paga' has been computed.">
+            <expand macro="sanitize_query" />
+        </param>
         <expand macro="param_layout"/>
         <param argument="init_pos" type="data" format="tabular,csv,tsv" optional="true" label="Two-column tabular file storing the x and y coordinates for initializing the layout" help=""/>
         <expand macro="param_random_state"/>
         <expand macro="param_root"/>
-        <param argument="transitions" type="text" value="" label="Key corresponding to the matrix storing the arrows" help="Key for '.uns['paga']', e.g. 'transistions_confidence'"/>
-        <param argument="solid_edges" type="text" value="connectivities" label="Key corresponding to the matrix storing the edges to be drawn solid black" help="Key for uns/paga"/>
-        <param argument="dashed_edges" type="text" value="" optional="true" label="Key corresponding to the matrix storing the edges to be drawn dashed grey" help="Key for uns/paga. If not set, no dashed edges are drawn."/>
+        <param argument="transitions" type="text" value="" label="Key corresponding to the matrix storing the arrows" help="Key for '.uns['paga']', e.g. 'transistions_confidence'">
+            <expand macro="sanitize_query" />
+        </param>
+        <param argument="solid_edges" type="text" value="connectivities" label="Key corresponding to the matrix storing the edges to be drawn solid black" help="Key for uns/paga">
+            <expand macro="sanitize_query" />
+        </param>
+        <param argument="dashed_edges" type="text" value="" optional="true" label="Key corresponding to the matrix storing the edges to be drawn dashed grey" help="Key for uns/paga. If not set, no dashed edges are drawn.">
+            <expand macro="sanitize_query" />
+        </param>
         <param argument="single_component" type="boolean" truevalue="True" falsevalue="False" checked="false" label="Restrict to largest connected component?" help=""/>
         <param argument="fontsize" type="integer" min="0" value="1" label="Font size for node labels" help=""/>
         <param argument="node_size_scale" type="float" min="0" value="1.0" label="Size of the nodes" help=""/>
@@ -1066,7 +1110,9 @@
         <param argument="swap_axes" type="boolean" truevalue="True" falsevalue="False" checked="false" label="Swap axes?" help="By default, the x axis contains 'var_names' (e.g. genes) and the y axis the 'groupby' categories (if any). By setting 'swap_axes' then x are the 'groupby' categories and y the 'var_names'."/>
     </xml>
     <xml name="gene_symbols">
-        <param argument="gene_symbols" type="text" value="" optional="true" label="Key for field in '.var' that stores gene symbols"/>
+        <param argument="gene_symbols" type="text" value="" optional="true" label="Key for field in '.var' that stores gene symbols">
+            <expand macro="sanitize_query" />
+        </param>
     </xml>
     <xml name="param_n_genes">
         <param argument="n_genes" type="integer" min="0" value="10" label="Number of genes to show" help=""/>
@@ -1091,7 +1137,9 @@
     ]]>
     </token>
     <xml name="param_key">
-        <param argument="key" type="text" value="" label="Key used to store the ranking results in 'uns'"/>
+        <param argument="key" type="text" value="" label="Key used to store the ranking results in 'uns'">
+            <expand macro="sanitize_query" />
+        </param>
     </xml>
     <xml name="pl_heatmap">
         <expand macro="param_swap_axes"/>