Mercurial > repos > iuc > scanpy_cluster_reduce_dimension
changeset 12:9740d430d9f3 draft
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/scanpy/ commit c21958f44b81d740191999fb6015d5ae69538ee0
line wrap: on
line diff
--- a/cluster_reduce_dimension.xml Wed Sep 22 21:02:36 2021 +0000 +++ b/cluster_reduce_dimension.xml Wed Jul 31 18:05:14 2024 +0000 @@ -1,6 +1,5 @@ -<tool id="scanpy_cluster_reduce_dimension" name="Cluster, infer trajectories and embed" version="@galaxy_version@" profile="@profile@"> +<tool id="scanpy_cluster_reduce_dimension" name="Cluster, infer trajectories and embed" version="@TOOL_VERSION@+galaxy@VERSION_SUFFIX@" profile="@profile@"> <description>with scanpy</description> - <expand macro="bio_tools"/> <macros> <import>macros.xml</import> <xml name="pca_inputs"> @@ -20,7 +19,7 @@ <param argument="zero_center" type="boolean" truevalue="True" falsevalue="False" checked="true" label="Compute standard PCA from covariance matrix?" help="If not, it omits zero-centering variables (uses *TruncatedSVD* from scikit-learn), which allows to handle sparse input efficiently."/> - <expand macro="svd_solver"/> + <expand macro="svd_solver"/> <param argument="random_state" type="integer" value="0" label="Initial states for the optimization" help=""/> </when> </conditional> @@ -61,8 +60,8 @@ use_highly_variable=$method.use_highly_variable ]]></token> </macros> + <expand macro="bio_tools"/> <expand macro="requirements"> - <requirement type="package" version="0.7.0">louvain</requirement> </expand> <expand macro="version_command"/> <command detect_errors="exit_code"><![CDATA[ @@ -111,7 +110,7 @@ #else if $method.method == 'tl.tsne' sc.tl.tsne( adata=adata, - #if $method.n_pcs + #if str($method.n_pcs) != '' n_pcs=$method.n_pcs, #end if perplexity=$method.perplexity, @@ -127,7 +126,7 @@ min_dist=$method.min_dist, spread=$method.spread, n_components=$method.n_components, - #if $method.maxiter + #if str($method.maxiter) != '' maxiter=$method.maxiter, #end if alpha=$method.alpha, @@ -138,7 +137,6 @@ copy=False) #else if $method.method == 'tl.draw_graph' - #if str($method.adjacency) != 'None' from scipy import io adjacency = io.mmread('$method.adjacency') @@ -147,18 +145,18 @@ sc.tl.draw_graph( adata=adata, layout='$method.layout', -#if str($method.root) != '' +#if $method.root #set $root=([int(x.strip()) for x in str($method.root).split(',')]) root=$root, #end if random_state=$method.random_state, - #if str($method.init_pos) != '' + #if $method.init_pos init_pos='$method.init_pos', #end if #if str($method.adjacency) != 'None' adjacency=adjacency, #end if - #if str($method.key_ext) != '' + #if $method.key_ext key_ext='$method.key_ext', #end if copy=False) @@ -179,6 +177,19 @@ min_group_size=$method.min_group_size, allow_kendall_tau_shift=$method.allow_kendall_tau_shift, copy=False) + +#else if $method.method == "tl.embedding_density" +sc.tl.embedding_density( + adata=adata, + basis='$method.basis', +#if $method.groupby + groupby='$method.groupby', +#end if +#if $method.key_added + key_added='$method.key_added', +#end if + ) + #end if @CMD_anndata_write_outputs@ @@ -198,6 +209,7 @@ <option value="tl.draw_graph">Force-directed graph drawing, using 'tl.draw_graph'</option> <option value="tl.dpt">Infer progression of cells through geodesic distance along the graph, using 'tl.dpt'</option> <option value="tl.paga">Generate cellular maps of differentiation manifolds with complex topologies, using 'tl.paga'</option> + <option value="tl.embedding_density">Calculate the density of cells in an embedding (per condition)</option> </param> <when value="tl.louvain"> <conditional name="flavor"> @@ -282,21 +294,32 @@ <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="use_rna_velocity" type="boolean" truevalue="True" 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> <option value="v1.0">v1.0</option> </param> </when> - </conditional> + <when value="tl.embedding_density"> + <param argument="basis" type="text" value="umap" label="The embedding over which the density will be calculated." help="This embedded representation should be found in adata.obsm['X_[basis]']"> + <expand macro="sanitize_query" /> + </param> + <param argument="groupby" type="text" optional="true" value="" label="Key for categorical observation/cell annotation for which densities are calculated per category." > + <expand macro="sanitize_query" /> + </param> + <param argument="key_added" type="text" optional="true" value="" label="Name of the .obs covariate that will be added with the density estimates."> + <expand macro="sanitize_query" /> + </param> + </when> + </conditional> <expand macro="inputs_common_advanced"/> </inputs> <outputs> <expand macro="anndata_outputs"/> </outputs> <tests> - <test> - <!-- test 0 --> + <test expect_num_outputs="2"> + <!-- test 1 --> <param name="adata" value="pp.neighbors_gauss_braycurtis.recipe_weinreb17.paul15_subsample.h5ad" /> <conditional name="method"> <param name="method" value="tl.louvain"/> @@ -326,8 +349,8 @@ </output> <output name="anndata_out" file="tl.louvain.neighbors_gauss_braycurtis.recipe_weinreb17.paul15_subsample.h5ad" ftype="h5ad" compare="sim_size"/> </test> - <test> - <!-- test 1 --> + <test expect_num_outputs="2"> + <!-- test 2 --> <param name="adata" value="pp.neighbors_gauss_braycurtis.recipe_weinreb17.paul15_subsample.h5ad" /> <conditional name="method"> <param name="method" value="tl.leiden"/> @@ -352,8 +375,8 @@ </output> <output name="anndata_out" file="tl.leiden.neighbors_gauss_braycurtis.recipe_weinreb17.paul15_subsample.h5ad" ftype="h5ad" compare="sim_size"/> </test> - <test> - <!-- test 1 --> + <test expect_num_outputs="2"> + <!-- test 3 --> <param name="adata" value="krumsiek11.h5ad" /> <conditional name="method"> <param name="method" value="pp.pca"/> @@ -384,8 +407,8 @@ </output> <output name="anndata_out" file="pp.pca.krumsiek11.h5ad" ftype="h5ad" compare="sim_size" delta="100000" delta_frac="0.15"/> </test> - <!--<test> - < test 3 > + <test expect_num_outputs="2"> + <!-- test 4 --> <param name="adata" value="krumsiek11.h5ad" /> <conditional name="method"> <param name="method" value="pp.pca"/> @@ -397,21 +420,24 @@ </conditional> <param name="use_highly_variable" value="false"/> </conditional> - <assert_stdout> - <has_text_matching expression="sc.pp.pca"/> - <has_text_matching expression="data=adata"/> - <has_text_matching expression="n_comps=20"/> - <has_text_matching expression="dtype='float32'"/> - <has_text_matching expression="copy=False"/> - <has_text_matching expression="chunked=True"/> - <has_text_matching expression="chunk_size=50"/> - <has_text_matching expression="use_highly_variable=False"/> - </assert_stdout> + <section name="advanced_common"> + <param name="show_log" value="true" /> + </section> + <output name="hidden_output"> + <assert_contents> + <has_text_matching expression="sc.pp.pca"/> + <has_text_matching expression="data=adata"/> + <has_text_matching expression="dtype='float32'"/> + <has_text_matching expression="copy=False"/> + <has_text_matching expression="chunked=True"/> + <has_text_matching expression="chunk_size=50"/> + <has_text_matching expression="use_highly_variable=False"/> + </assert_contents> + </output> <output name="anndata_out" file="pp.pca.krumsiek11_chunk.h5ad" ftype="h5ad" compare="sim_size"/> </test> - --> - <test> - <!-- test 2 --> + <test expect_num_outputs="2"> + <!-- test 5 --> <param name="adata" value="krumsiek11.h5ad" /> <conditional name="method"> <param name="method" value="tl.pca"/> @@ -441,8 +467,8 @@ </output> <output name="anndata_out" file="tl.pca.krumsiek11.h5ad" ftype="h5ad" compare="sim_size" delta="100000" delta_frac="0.15"/> </test> - <test> - <!-- test 3 --> + <test expect_num_outputs="2"> + <!-- test 6 --> <param name="adata" value="pp.neighbors_gauss_braycurtis.recipe_weinreb17.paul15_subsample.h5ad" /> <conditional name="method"> <param name="method" value="tl.diffmap"/> @@ -458,8 +484,8 @@ </output> <output name="anndata_out" file="tl.diffmap.neighbors_gauss_braycurtis.recipe_weinreb17.paul15_subsample.h5ad" ftype="h5ad" compare="sim_size"/> </test> - <test> - <!-- test 4 --> + <test expect_num_outputs="2"> + <!-- test 7 --> <param name="adata" value="krumsiek11.h5ad" /> <conditional name="method"> <param name="method" value="tl.tsne"/> @@ -486,8 +512,8 @@ </output> <output name="anndata_out" file="tl.tsne.krumsiek11.h5ad" ftype="h5ad" compare="sim_size"/> </test> - <test> - <!-- test 5 --> + <test expect_num_outputs="2"> + <!-- test 8 --> <param name="adata" value="pp.neighbors_umap_euclidean.recipe_weinreb17.paul15_subsample.h5ad" /> <conditional name="method"> <param name="method" value="tl.umap"/> @@ -524,8 +550,8 @@ </assert_contents> </output> </test> - <test> - <!-- test 6 --> + <test expect_num_outputs="2"> + <!-- test 9 --> <param name="adata" value="pp.neighbors_umap_euclidean.recipe_weinreb17.paul15_subsample.h5ad"/> <conditional name="method"> <param name="method" value="tl.draw_graph"/> @@ -544,8 +570,8 @@ </output> <output name="anndata_out" file="tl.draw_graph.pp.neighbors_umap_euclidean.recipe_weinreb17.paul15_subsample.h5ad" ftype="h5ad" compare="sim_size"/> </test> - <test> - <!-- test 7 --> + <test expect_num_outputs="2"> + <!-- test 10 --> <param name="adata" value="pp.neighbors_gauss_braycurtis.recipe_weinreb17.paul15_subsample.h5ad"/> <conditional name="method"> <param name="method" value="tl.paga"/> @@ -566,8 +592,8 @@ </output> <output name="anndata_out" file="tl.paga.neighbors_gauss_braycurtis.recipe_weinreb17.paul15_subsample.h5ad" ftype="h5ad" compare="sim_size"/> </test> - <test> - <!-- test 8 --> + <test expect_num_outputs="2"> + <!-- test 11 --> <param name="adata" value="tl.diffmap.neighbors_gauss_braycurtis.recipe_weinreb17.paul15_subsample.h5ad" /> <conditional name="method"> <param name="method" value="tl.dpt"/> @@ -590,6 +616,26 @@ </output> <output name="anndata_out" file="tl.dpt.diffmap.neighbors_gauss_braycurtis.recipe_weinreb17.paul15_subsample.h5ad" ftype="h5ad" compare="sim_size"/> </test> + <test expect_num_outputs="2"> + <!-- test 12 --> + <param name="adata" value="tl.umap.neighbors_umap_euclidean.recipe_weinreb17.paul15_subsample.h5ad" /> + <conditional name="method"> + <param name="method" value="tl.embedding_density"/> + <param name="basis" value="umap"/> + <param name="key_added" value="umap_density"/> + </conditional> + <section name="advanced_common"> + <param name="show_log" value="true" /> + </section> + <output name="hidden_output"> + <assert_contents> + <has_text_matching expression="sc.tl.embedding_density"/> + <has_text_matching expression="basis='umap'"/> + <has_text_matching expression="key_added='umap_density'"/> + </assert_contents> + </output> + <output name="anndata_out" file="tl.embedding_density.umap.neighbors_umap_euclidean.recipe_weinreb17.paul15_subsample.h5ad" ftype="h5ad" compare="sim_size"/> + </test> </tests> <help><![CDATA[ Cluster cells into subgroups (`tl.louvain`) @@ -602,7 +648,7 @@ This requires to run `pp.neighbors`, first. More details on the `tl.louvain scanpy documentation -<https://icb-scanpy.readthedocs-hosted.com/en/@version@/api/scanpy.tl.louvain.html>`_ +<https://scanpy.readthedocs.io/en/stable/api/scanpy.tl.louvain.html>`_ Cluster cells into subgroups (`tl.leiden`) ========================================== @@ -612,7 +658,7 @@ The Louvain algorithm has been proposed for single-cell analysis by Levine et al, 2015. More details on the `tl.leiden scanpy documentation -<https://icb-scanpy.readthedocs-hosted.com/en/@version@/api/scanpy.tl.leiden.html>`_ +<https://scanpy.readthedocs.io/en/stable/api/scanpy.tl.leiden.html>`_ Computes PCA (principal component analysis) coordinates, loadings and variance decomposition, using `pp.pca` ============================================================================================================ @@ -620,7 +666,7 @@ @CMD_pca_outputs@ More details on the `pp.pca scanpy documentation -<https://icb-scanpy.readthedocs-hosted.com/en/@version@/api/scanpy.pp.pca.html>`__ +<https://scanpy.readthedocs.io/en/stable/api/scanpy.pp.pca.html>`__ Computes PCA (principal component analysis) coordinates, loadings and variance decomposition, using `tl.pca` ============================================================================================================ @@ -628,7 +674,7 @@ @CMD_pca_outputs@ More details on the `tl.pca scanpy documentation -<https://icb-scanpy.readthedocs-hosted.com/en/@version@/api/scanpy.tl.pca.html>`__ +<https://scanpy.readthedocs.io/en/stable/api/scanpy.tl.pca.html>`__ Diffusion Maps, using `tl.diffmap` ================================== @@ -645,24 +691,24 @@ `method=='umap'`. Differences between these options shouldn't usually be dramatic. -The diffusion map representation of data are added to the return AnnData in the multi-dimensional -observations annotation (obsm). It is the right eigen basis of the transition matrix with eigenvectors +The diffusion map representation of data are added to the return AnnData in the multi-dimensional +observations annotation (obsm). It is the right eigen basis of the transition matrix with eigenvectors as colum. It can be accessed using the inspect tool for AnnData More details on the `tl.diffmap scanpy documentation -<https://icb-scanpy.readthedocs-hosted.com/en/@version@/api/scanpy.tl.diffmap.html>`__ +<https://scanpy.readthedocs.io/en/stable/api/scanpy.tl.diffmap.html>`__ t-distributed stochastic neighborhood embedding (tSNE), using `tl.tsne` ======================================================================= t-distributed stochastic neighborhood embedding (tSNE) (Maaten et al, 2008) has been proposed for visualizating single-cell data by (Amir et al, 2013). Here, by default, -we use the implementation of *scikit-learn* (Pedregosa et al, 2011). +we use the implementation of *scikit-learn* (Pedregosa et al, 2011). It returns `X_tsne`, tSNE coordinates of data. More details on the `tl.tsne scanpy documentation -<https://icb-scanpy.readthedocs-hosted.com/en/@version@/api/scanpy.tl.tsne.html>`__ +<https://scanpy.readthedocs.io/en/stable/api/scanpy.tl.tsne.html>`__ Embed the neighborhood graph using UMAP, using `tl.umap` ======================================================== @@ -678,30 +724,30 @@ (McInnes et al, 2018). For a few comparisons of UMAP with tSNE, see this `preprint <https://doi.org/10.1101/298430>`__. -The UMAP coordinates of data are added to the return AnnData in the multi-dimensional +The UMAP coordinates of data are added to the return AnnData in the multi-dimensional observations annotation (obsm). This data is accessible using the inspect tool for AnnData More details on the `tl.umap scanpy documentation -<https://icb-scanpy.readthedocs-hosted.com/en/@version@/api/scanpy.tl.umap.html>`__ +<https://scanpy.readthedocs.io/en/stable/api/scanpy.tl.umap.html>`__ Force-directed graph drawing, using `tl.draw_graph` =================================================== -Force-directed graph drawing describes a class of long-established algorithms for visualizing graphs. -It has been suggested for visualizing single-cell data by Islam et al, 11. -Many other layouts as implemented in igraph are available. Similar approaches have been used by +Force-directed graph drawing describes a class of long-established algorithms for visualizing graphs. +It has been suggested for visualizing single-cell data by Islam et al, 11. +Many other layouts as implemented in igraph are available. Similar approaches have been used by Zunder et al, 2015 or Weinreb et al, 2016. -This is an alternative to tSNE that often preserves the topology of the data better. +This is an alternative to tSNE that often preserves the topology of the data better. This requires to run `pp.neighbors`, first. The default layout (ForceAtlas2) uses the package fa2. -The coordinates of graph layout are added to the return AnnData in the multi-dimensional +The coordinates of graph layout are added to the return AnnData in the multi-dimensional observations annotation (obsm). This data is accessible using the inspect tool for AnnData. More details on the `tl.draw_graph scanpy documentation -<https://icb-scanpy.readthedocs-hosted.com/en/@version@/api/scanpy.tl.draw_graph.html>`__ +<https://scanpy.readthedocs.io/en/stable/api/scanpy.tl.draw_graph.html>`__ Infer progression of cells through geodesic distance along the graph (`tl.dpt`) =============================================================================== @@ -714,7 +760,7 @@ `n_branchings>1`. We recommend, however, to only use `tl.dpt` for computing pseudotime (`n_branchings=0`) and to detect branchings via `paga`. For pseudotime, you need -to annotate your data with a root cell. +to annotate your data with a root cell. This requires to run `pp.neighbors`, first. In order to reproduce the original implementation of DPT, use `method=='gauss'` in @@ -730,7 +776,7 @@ The tool is similar to the R package `destiny` of Angerer et al (2016). More details on the `tl.dpt scanpy documentation -<https://icb-scanpy.readthedocs-hosted.com/en/@version@/api/scanpy.tl.dpt.html>`_ +<https://scanpy.readthedocs.io/en/stable/api/scanpy.tl.dpt.html>`_ Generate cellular maps of differentiation manifolds with complex topologies (`tl.paga`) @@ -761,7 +807,7 @@ These datasets are stored in the unstructured annotation (uns) and can be accessed using the inspect tool for AnnData objects More details on the `tl.paga scanpy documentation -<https://icb-scanpy.readthedocs-hosted.com/en/@version@/api/scanpy.tl.paga.html>`_ +<https://scanpy.readthedocs.io/en/stable/api/scanpy.tl.paga.html>`_ ]]></help> <expand macro="citations"/> </tool>
--- a/macros.xml Wed Sep 22 21:02:36 2021 +0000 +++ b/macros.xml Wed Jul 31 18:05:14 2024 +0000 @@ -1,12 +1,17 @@ <macros> - <token name="@version@">1.7.1</token> - <token name="@profile@">19.01</token> - <token name="@galaxy_version@"><![CDATA[@version@+galaxy0]]></token> + <token name="@TOOL_VERSION@">1.9.6</token> + <token name="@VERSION_SUFFIX@">4</token> + <token name="@profile@">21.09</token> <xml name="requirements"> <requirements> - <requirement type="package" version="@version@">scanpy</requirement> - <requirement type="package" version="2.0.17">loompy</requirement> - <requirement type="package" version="0.8.3">leidenalg</requirement> + <requirement type="package" version="@TOOL_VERSION@">scanpy</requirement> + <requirement type="package" version="3.0.6">loompy</requirement> + <requirement type="package" version="0.10.1">leidenalg</requirement> + <requirement type="package" version="0.8.1">louvain</requirement> + <requirement type="package" version="1.5.3">pandas</requirement> + <requirement type="package" version="3.7">matplotlib</requirement> + <requirement type="package" version="0.12.2">seaborn</requirement> + <requirement type="package" version="3.0.0">magic-impute</requirement> <yield /> </requirements> </xml> @@ -15,9 +20,15 @@ <xref type="bio.tools">scanpy</xref> </xrefs> </xml> + <xml name="creators"> + <creator> + <organization name="European Galaxy Team" url="https://galaxyproject.org/eu/" /> + </creator> + </xml> <xml name="citations"> <citations> <citation type="doi">10.1186/s13059-017-1382-0</citation> + <citation type="doi">10.1093/gigascience/giaa102</citation> </citations> </xml> <xml name="version_command"> @@ -56,7 +67,7 @@ <param name="adata" type="data" format="h5ad" label="Annotated data matrix"/> </xml> <token name="@CMD_read_inputs@"><![CDATA[ -adata = sc.read('anndata.h5ad') +adata = sc.read_h5ad('anndata.h5ad') ]]> </token> <xml name="inputs_common_advanced"> @@ -66,12 +77,12 @@ </xml> <xml name="anndata_outputs"> <data name="anndata_out" format="h5ad" from_work_dir="anndata.h5ad" label="${tool.name} (${method.method}) on ${on_string}: Annotated data matrix"/> - <data name="hidden_output" format="txt" label="Log file" > + <data name="hidden_output" format="txt" label="Log file" > <filter>advanced_common['show_log']</filter> </data> </xml> <token name="@CMD_anndata_write_outputs@"><![CDATA[ -adata.write('anndata.h5ad') +adata.write_h5ad('anndata.h5ad') with open('anndata_info.txt','w', encoding='utf-8') as ainfo: print(adata, file=ainfo) ]]> @@ -414,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"> @@ -421,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"> @@ -457,15 +472,17 @@ <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, -#end if -#if str($method.groupby) != '' + #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', -#end if + #end if num_categories=$method.num_categories, ]]></token> <xml name="params_plots"> @@ -491,15 +508,15 @@ var_group_positions=$var_group_positions, var_group_labels=$var_group_labels, #end if -#if $method.var_group_rotation - var_group_rotation=$method.var_group_rotation, -#end if -#if $method.figsize.test == 'yes' - figsize=($method.figsize.width, $method.figsize.height), -#end if -#if $method.layer != '' - layer='$method.layer', -#end if + #if str($method.var_group_rotation) != '' + var_group_rotation=$method.var_group_rotation, + #end if + #if $method.figsize.test == 'yes' + figsize=($method.figsize.width, $method.figsize.height), + #end if + #if $method.layer + layer='$method.layer', + #end if ]]></token> <xml name="matplotlib_color"> <option value="AliceBlue">AliceBlue</option> @@ -652,9 +669,8 @@ <option value="YellowGreen">YellowGreen</option> </xml> <xml name="param_matplotlib_pyplot_edgecolors"> - <param argument="edgecolors" type="select" label="Edge color of the marker" help=""> + <param argument="edgecolors" type="select" optional="true" label="Edge color of the marker" help=""> <option value="face">The edge color will always be the same as the face color</option> - <option value="none">No patch boundary will be drawn</option> <expand macro="matplotlib_color"/> </param> </xml> @@ -692,17 +708,19 @@ </section> </xml> <token name="@CMD_params_matplotlib_pyplot_scatter@"><![CDATA[ - #if $method.matplotlib_pyplot_scatter.vmin + #if str($method.matplotlib_pyplot_scatter.vmin) != '' vmin=$method.matplotlib_pyplot_scatter.vmin, #end if - #if $method.matplotlib_pyplot_scatter.vmax + #if str($method.matplotlib_pyplot_scatter.vmax) != '' vmax=$method.matplotlib_pyplot_scatter.vmax, #end if - #if $method.matplotlib_pyplot_scatter.alpha + #if str($method.matplotlib_pyplot_scatter.alpha) != '' alpha=$method.matplotlib_pyplot_scatter.alpha, #end if - linewidths=$method.matplotlib_pyplot_scatter.linewidths, - edgecolors='$method.matplotlib_pyplot_scatter.edgecolors' + lw=$method.matplotlib_pyplot_scatter.linewidths, + #if $method.matplotlib_pyplot_scatter.edgecolors + ec='$method.matplotlib_pyplot_scatter.edgecolors' + #end if ]]></token> <xml name="conditional_stripplot"> <conditional name="stripplot"> @@ -742,13 +760,7 @@ </param> </xml> <token name="@CMD_params_violin_plots@"><![CDATA[ - stripplot=$method.violin_plot.stripplot.stripplot, -#if $method.violin_plot.stripplot.stripplot == "True" - jitter=$method.violin_plot.stripplot.jitter.jitter, - #if $method.violin_plot.stripplot.jitter.jitter == "True" - size=$method.violin_plot.stripplot.jitter.size, - #end if -#end if + @CMD_conditional_stripplot@ 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) @@ -766,7 +778,7 @@ <option value="h">horizontal</option> </param> <param argument="linewidth" type="float" value="0" label="Width of the gray lines that frame the plot elements" help=""/> - <param argument="color" type="select" label="Color for all of the elements" help=""> + <param argument="color" type="select" optional="true" label="Color for all of the elements" help=""> <expand macro="matplotlib_color"/> </param> <param argument="saturation" type="float" value="0.75" min="0" max="1" label="Proportion of the original saturation to draw colors at" help=""/> @@ -778,7 +790,9 @@ orient='$method.seaborn_violinplot.orient', #end if linewidth=$method.seaborn_violinplot.linewidth, + #if $method.seaborn_violinplot.color color='$method.seaborn_violinplot.color', + #end if saturation=$method.seaborn_violinplot.saturation ]]></token> <xml name="param_color"> @@ -787,7 +801,7 @@ </param> </xml> <token name="@CMD_param_color@"><![CDATA[ -#if str($method.color) != '' +#if $method.color #set $color = ([x.strip() for x in str($method.color).split(',')]) color=$color, #end if @@ -798,7 +812,7 @@ </param> </xml> <token name="@CMD_params_groups@"><![CDATA[ -#if str($method.groups) != '' +#if $method.groups #set $groups=([x.strip() for x in str($method.groups).split(',')]) groups=$groups, #end if @@ -868,14 +882,12 @@ </param> </xml> <xml name="param_palette"> - <param argument="palette" type="select" label="Colors to use for plotting categorical annotation groups" help=""> - <option value="default">Default</option> + <param argument="palette" type="select" optional="true" label="Colors to use for plotting categorical annotation groups" help=""> <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="None">Default</option> + <param argument="color_map" type="select" optional="true" label="Color map to use for continous variables" help=""> <expand macro="matplotlib_pyplot_colormap"/> </param> </xml> @@ -931,7 +943,7 @@ </param> <when value="True"> <param argument="edges_width" type="float" min="0" value="0.1" label="Width of edges"/> - <param argument="edges_color" type="select" label="Color of edges"> + <param argument="edges_color" type="select" optional="true" label="Color of edges"> <expand macro="matplotlib_color"/> </param> </when> @@ -942,7 +954,9 @@ #if str($method.edges.edges) == 'True' edges=True, edges_width=$method.edges.edges_width, + #if $method.edges.edges_color edges_color='$method.edges.edges_color', + #end if #else edges=False, #end if @@ -952,7 +966,7 @@ <param argument="arrows" type="boolean" truevalue="True" falsevalue="False" checked="false" label="Show arrows?" help="It requires to run 'tl.rna_velocity' before."/> </xml> <xml name="param_cmap"> - <param argument="cmap" type="select" label="Colors to use for plotting categorical annotation groups" help=""> + <param argument="cmap" type="select" optional="true" label="Colors to use for plotting categorical annotation groups" help=""> <expand macro="matplotlib_pyplot_colormap"/> </param> </xml> @@ -979,10 +993,10 @@ @CMD_param_legend_fontsize@ legend_fontweight='$method.plot.legend_fontweight', @CMD_param_size@ - #if str($method.plot.color_map) != 'None' + #if $method.plot.color_map color_map='$method.plot.color_map', #end if - #if str($method.plot.palette) != '' + #if $method.plot.palette palette='$method.plot.palette', #end if frameon=$method.plot.frameon, @@ -1052,18 +1066,18 @@ </xml> <token name="@CMD_params_pl_paga@"><![CDATA[ threshold=$method.threshold, -#if str($method.groups) != '' +#if $method.groups #set $groups=([x.strip() for x in str($method.groups).split(',')]) groups=$groups, #end if -#if str($method.color) != '' +#if $method.color #set $color=([x.strip() for x in str($method.color).split(',')]) color=$color, #end if #if $method.pos pos=np.fromfile($method.pos, dtype=dt), #end if -#if str($method.labels) != '' +#if $method.labels #set $labels=([x.strip() for x in str($method.labels).split(',')]) labels=$labels, #end if @@ -1072,7 +1086,7 @@ init_pos=np.fromfile($method.init_pos, dtype=dt), #end if random_state=$method.random_state, -#if str($method.root) != '' +#if $method.root #set $root=([int(x.strip()) for x in str($method.root).split(',')]) root=$root, #end if @@ -1088,15 +1102,17 @@ node_size_scale=$method.node_size_scale, node_size_power=$method.node_size_power, edge_width_scale=$method.edge_width_scale, -#if $method.min_edge_width +#if str($method.min_edge_width) != '' min_edge_width=$method.min_edge_width, #end if -#if $method.max_edge_width +#if str($method.max_edge_width) != '' max_edge_width=$method.max_edge_width, #end if arrowsize=$method.arrowsize, normalize_to_color=$method.normalize_to_color, + #if $method.cmap cmap='$method.cmap', + #end if #if $method.title title='$method.title', #end if @@ -1112,10 +1128,10 @@ </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" label="Color palette"> + <param argument="color_map" type="select" optional="true" label="Color palette"> <expand macro="matplotlib_pyplot_colormap"/> </param> <param argument="dot_max" type="float" value="" min="0" max="1" optional="true" label="Maximum dot size" help="If none, the maximum dot size is set to the maximum fraction value found (e.g. 0.6). If given, the value should be a number between 0 and 1. All fractions larger than dot_max are clipped to this value."/> @@ -1123,7 +1139,9 @@ <expand macro="section_matplotlib_pyplot_scatter"/> </xml> <token name="@CMD_pl_dotplot@"><![CDATA[ + #if $method.color_map color_map='$method.color_map', + #end if #if str($method.dot_max) != '' dot_max=$method.dot_max, #end if @@ -1174,17 +1192,19 @@ <token name="@CMD_pl_heatmap@"><![CDATA[ swap_axes=$method.swap_axes, show_gene_labels=$method.show_gene_labels, + #if $method.matplotlib_pyplot_imshow.cmap cmap='$method.matplotlib_pyplot_imshow.cmap', + #end if #if str($method.matplotlib_pyplot_imshow.interpolation) != 'None' interpolation='$method.matplotlib_pyplot_imshow.interpolation', #end if - #if $method.matplotlib_pyplot_imshow.alpha + #if str($method.matplotlib_pyplot_imshow.alpha) != '' alpha=$method.matplotlib_pyplot_imshow.alpha, #end if - #if $method.matplotlib_pyplot_imshow.vmin + #if str($method.matplotlib_pyplot_imshow.vmin) != '' vmin=$method.matplotlib_pyplot_imshow.vmin, #end if - #if $method.matplotlib_pyplot_imshow.vmax + #if str($method.matplotlib_pyplot_imshow.vmax) != '' vmax=$method.matplotlib_pyplot_imshow.vmax, #end if origin='$method.matplotlib_pyplot_imshow.origin' @@ -1197,10 +1217,8 @@ </xml> <token name="@CMD_pl_rank_genes_groups_ext@"><![CDATA[ @CMD_params_groups@ - #if str($method.n_genes) != '' n_genes=$method.n_genes, - #end if - #if str($method.key) != '' + #if $method.key key='$method.key', #end if ]]> @@ -1208,7 +1226,7 @@ <xml name="pl_matrixplot"> <expand macro="param_swap_axes"/> <section name="matplotlib_pyplot_pcolor" title="Parameters for matplotlib.pyplot.pcolor"> - <param argument="cmap" type="select" label="Color palette"> + <param argument="cmap" type="select" optional="true" label="Color palette"> <expand macro="seaborn_color_palette_options"/> </param> <param argument="vmin" type="float" value="" optional="true" label="Minimum value to anchor the colormap" help=""/> @@ -1220,15 +1238,19 @@ </xml> <token name="@CMD_pl_matrixplot@"><