Mercurial > repos > iuc > scanpy_plot
changeset 7:7647e5cd1b8b 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:08:18 -0400 |
parents | dbbe1ea8ecb1 |
children | 6adf98e782f3 |
files | macros.xml plot.xml |
diffstat | 2 files changed, 133 insertions(+), 45 deletions(-) [+] |
line wrap: on
line diff
--- a/macros.xml Thu Feb 20 08:22:46 2020 -0500 +++ b/macros.xml Wed May 20 16:08:18 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="'" /> + </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"/>
--- a/plot.xml Thu Feb 20 08:22:46 2020 -0500 +++ b/plot.xml Wed May 20 16:08:18 2020 -0400 @@ -25,6 +25,9 @@ #if $method.type.type == 'xy' x='$method.type.x', y='$method.type.y', + #if str($method.type.color) != '' + color='$method.type.color', + #end if #if str('$method.type.layers.use_layers') == 'true' layers=('$method.type.layers.layer_x', '$method.type.layers.layer_y', '$method.type.layers.layer_color'), #end if @@ -41,15 +44,17 @@ @CMD_params_pl_components@ projection='$method.plot.projection', legend_loc='$method.plot.legend_loc', + #if $method.plot.palette != 'default' + palette='$method.plot.palette', + #end if + #if $method.plot.color_map != 'None' + color_map='$method.plot.color_map', + #end if @CMD_param_legend_fontsize@ legend_fontweight='$method.plot.legend_fontweight', - color_map='$method.plot.color_map', - #if str($method.plot.palette) != '' - palette='$method.plot.palette', - #end if - frameon=$method.plot.frameon, @CMD_param_title@ - @CMD_param_size@) + @CMD_param_size@ + frameon=$method.plot.frameon) #else if $method.method == 'pl.heatmap' sc.pl.heatmap( @@ -412,17 +417,30 @@ <option value="basis">Using tool that computes coordinates</option> </param> <when value="xy"> - <param argument="x" type="text" value="" label="x coordinate" help="Index or key from either '.obs' or '.var'"/> - <param argument="y" type="text" value="" label="y coordinate" help="Index or key from either '.obs' or '.var'"/> + <param argument="x" type="text" value="" label="x coordinate" help="Index or key from either '.obs' or '.var'"> + <expand macro="sanitize_query" /> + </param> + <param argument="y" type="text" value="" label="y coordinate" help="Index or key from either '.obs' or '.var'"> + <expand macro="sanitize_query" /> + </param> + <param argument="color" type="text" value="" label="Color by" help="Color points by single variable in `.obs` or `.var`"> + <expand macro="sanitize_query" /> + </param> <conditional name="layers"> <param argument="use_layers" type="select" label="Use the layers attribute?"> <option value="true">Yes</option> <option value="false" selected="true">No</option> </param> <when value="true"> - <param argument="layer_x" type="text" value="" optional="true" label="Layers for x coordinate" help="Use the 'layers' attribute of 'adata' if present"/> - <param argument="layer_y" type="text" value="" optional="true" label="Layers for y coordinate" help="Use the 'layers' attribute of 'adata' if present"/> - <param argument="layer_color" type="text" value="" optional="true" label="Layers for color" help="Use the 'layers' attribute of 'adata' if present"/> + <param argument="layer_x" type="text" value="" optional="true" label="Layers for x coordinate" help="Use the 'layers' attribute of 'adata' if present"> + <expand macro="sanitize_query" /> + </param> + <param argument="layer_y" type="text" value="" optional="true" label="Layers for y coordinate" help="Use the 'layers' attribute of 'adata' if present"> + <expand macro="sanitize_query" /> + </param> + <param argument="layer_color" type="text" value="" optional="true" label="Layers for color" help="Use the 'layers' attribute of 'adata' if present"> + <expand macro="sanitize_query" /> + </param> </when> <when value="false"/> </conditional> @@ -474,7 +492,9 @@ <when value="var_names"/> <when value="obs"/> <when value="custom"> - <param argument="keys" type="text" value="" label="Keys for accessing variables" help="One or a list of comma-separated index or key from '.var_names' or fields of '.obs'"/> + <param argument="keys" type="text" value="" label="Keys for accessing variables" help="One or a list of comma-separated index or key from '.var_names' or fields of '.obs'"> + <expand macro="sanitize_query" /> + </param> </when> </conditional> <expand macro="param_groupby"/> @@ -495,7 +515,9 @@ </conditional> <expand macro="param_scale"/> </section> - <param argument="xlabel" type="text" value="" optional="true" label="Label of the x axis" help="Defaults to 'groupby' if 'rotation' is 'None', otherwise, no label is shown."/> + <param argument="xlabel" type="text" value="" optional="true" label="Label of the x axis" help="Defaults to 'groupby' if 'rotation' is 'None', otherwise, no label is shown."> + <expand macro="sanitize_query" /> + </param> <param argument="rotation" type="float" value="" optional="true" label="Rotation of xtick labels" help=""/> <expand macro="seaborn_violinplot"/> </when> @@ -510,7 +532,9 @@ <expand macro="pl_matrixplot"/> </when> <when value="pl.clustermap"> - <param argument="obs_keys" type="text" value="" optional="true" label="Categorical annotation to plot with a different color map" help="Currently, only a single key is supported."/> + <param argument="obs_keys" type="text" value="" optional="true" label="Categorical annotation to plot with a different color map" help="Currently, only a single key is supported."> + <expand macro="sanitize_query" /> + </param> <expand macro="param_use_raw"/> <section name="seaborn_clustermap" title="Parameters for seaborn.clustermap"> <param name="method" type="select" label="Linkage method to use for calculating clusters" help="More details in https://docs.scipy.org/doc/scipy/reference/generated/scipy.cluster.hierarchy.linkage.html"> @@ -545,9 +569,13 @@ </when> <when value="pl.highest_expr_genes"> <param argument="n_top" type="integer" min="0" value="30" label="Number of top genes" help=""/> - <param argument="gene_symbols" type="text" optional="true" label="Key for field in '.var' that stores gene symbols" help="Fill it if you do not want to use '.var_names'."/> + <param argument="gene_symbols" type="text" optional="true" label="Key for field in '.var' that stores gene symbols" help="Fill it if you do not want to use '.var_names'."> + <expand macro="sanitize_query" /> + </param> <section name="setseaborn_boxplot" title="Plot settings" expanded="false"> - <param argument="color" type="text" value="" optional="true" label="Color for all of the elements, or seed for a gradient palette" help=""/> + <param argument="color" type="text" value="" optional="true" label="Color for all of the elements, or seed for a gradient palette" help=""> + <expand macro="sanitize_query" /> + </param> <param argument="palette" type="select" optional="true" label="Colors to use for the different levels of the hue variable" help="See https://seaborn.pydata.org/tutorial/color_palettes.html for more details."> <expand macro="seaborn_color_palette_options"/> </param> @@ -563,7 +591,9 @@ <expand macro="section_matplotlib_pyplot_scatter"/> </when> <when value="pl.pca_loadings"> - <param argument="components" type="text" value="1,2,3" label="List of comma-separated components" help="1, 2, 3 means first, second and third principal components"/> + <param argument="components" type="text" value="1,2,3" label="List of comma-separated components" help="1, 2, 3 means first, second and third principal components"> + <expand macro="sanitize_query" /> + </param> </when> <when value="pl.pca_variance_ratio"> <param argument="n_pcs" type="integer" min="0" value="30" label="Number of PCs to show" help=""/> @@ -642,13 +672,21 @@ </when> <when value="pl.paga_path"> <param argument="nodes" type="text" value="" label="A path through nodes of the abstracted graph" - help="Each node is represented by its indice (within .categories) for the groups that have been used to run PAGA. Comma-separated"/> - <param argument="keys" type="text" value="" label="Keys for accessing variables" help="One or a list of comma-separated index or key from '.var_names' or fields of '.obs'"/> + help="Each node is represented by its indice (within .categories) for the groups that have been used to run PAGA. Comma-separated"> + <expand macro="sanitize_query" /> + </param> + <param argument="keys" type="text" value="" label="Keys for accessing variables" help="One or a list of comma-separated index or key from '.var_names' or fields of '.obs'"> + <expand macro="sanitize_query" /> + </param> <expand macro="param_use_raw"/> - <param argument="annotations" type="text" value="" optional="true" label="Key to plot" help="Keys for obs, comma-separated"/> + <param argument="annotations" type="text" value="" optional="true" label="Key to plot" help="Keys for obs, comma-separated"> + <expand macro="sanitize_query" /> + </param> <expand macro="param_color_map"/> <param argument="n_avg" type="integer" value="1" label="Number of data points to include in computation of running average"/> - <param argument="groups_key" type="text" value="" optional="true" label="Key of the grouping used to run PAGA" help="If not set, use uns/page/groups"/> + <param argument="groups_key" type="text" value="" optional="true" label="Key of the grouping used to run PAGA" help="If not set, use uns/page/groups"> + <expand macro="sanitize_query" /> + </param> <param argument="as_heatmap" type="boolean" truevalue="True" falsevalue="False" checked="true" label="Plot the timeseries as heatmap?" help="If not, annotations have no effect."/> <param argument="show_node_names" type="boolean" truevalue="True" falsevalue="False" checked="true" label="Plot the node names on the nodes bar?"/> <param argument="show_colorbar" type="boolean" truevalue="True" falsevalue="False" checked="true" label="Show the colorbar?"/> @@ -674,7 +712,9 @@ <expand macro="param_n_genes"/> </when> <when value="gene_names"> - <param argument="gene_names" type="text" value="" label="List of genes to plot" help="A list of comma-separated names"/> + <param argument="gene_names" type="text" value="" label="List of genes to plot" help="A list of comma-separated names"> + <expand macro="sanitize_query" /> + </param> </when> </conditional> <expand macro="gene_symbols"/>