Mercurial > repos > iuc > scanpy_inspect
changeset 12:03ed427eb5e7 draft
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/scanpy/ commit c21958f44b81d740191999fb6015d5ae69538ee0
line wrap: on
line diff
--- a/inspect.xml Wed Sep 22 21:08:23 2021 +0000 +++ b/inspect.xml Wed Jul 31 18:07:55 2024 +0000 @@ -1,6 +1,5 @@ -<tool id="scanpy_inspect" name="Inspect and manipulate" version="@galaxy_version@" profile="@profile@"> +<tool id="scanpy_inspect" name="Inspect and manipulate" version="@TOOL_VERSION@+galaxy@VERSION_SUFFIX@" profile="@profile@"> <description> with scanpy</description> - <expand macro="bio_tools"/> <macros> <import>macros.xml</import> <xml name="score_genes_params"> @@ -51,6 +50,7 @@ label="The seed of the pseudo random number generator to use when shuffling the data" help=""/> </xml> </macros> + <expand macro="bio_tools"/> <expand macro="requirements"/> <expand macro="version_command"/> <command detect_errors="exit_code"><![CDATA[ @@ -66,13 +66,13 @@ adata=adata, expr_type='$method.expr_type', var_type='$method.var_type', - #if str($method.qc_vars) != '' + #if $method.qc_vars #set $qc_vars = [str(x.strip()) for x in str($method.qc_vars).split(',')] qc_vars=$qc_vars, #end if - #if str($method.percent_top) != '' + #if $method.percent_top #set $percent_top = [int(x.strip()) for x in str($method.percent_top).split(',')] - percent_top=$method.percent_top, + percent_top=$percent_top, #end if inplace=True) @@ -125,7 +125,7 @@ #if str($method.n_pcs) != '' n_pcs=$method.n_pcs, #end if - #if str($method.use_rep) != '' + #if $method.use_rep use_rep='$method.use_rep', #end if knn=$method.knn, @@ -138,7 +138,7 @@ sc.tl.rank_genes_groups( adata=adata, groupby='$method.groupby', - #if str($method.groups) != '' + #if $method.groups #set $group=[x.strip() for x in str($method.groups).split(',')] groups=$group, #end if @@ -176,13 +176,13 @@ #if $method.tl_rank_genes_groups_method.solver.intercept_scaling.fit_intercept == 'True' intercept_scaling=$method.tl_rank_genes_groups_method.solver.intercept_scaling.intercept_scaling, #end if - #if $method.tl_rank_genes_groups_method.solver.random_state + #if str($method.tl_rank_genes_groups_method.solver.random_state) != '' random_state=$method.tl_rank_genes_groups_method.solver.random_state, #end if #else if $method.tl_rank_genes_groups_method.solver.solver == 'sag' penalty='l2', fit_intercept=$method.tl_rank_genes_groups_method.solver.fit_intercept, - #if $method.tl_rank_genes_groups_method.solver.random_state + #if str($method.tl_rank_genes_groups_method.solver.random_state) != '' random_state=$method.tl_rank_genes_groups_method.solver.random_state, #end if max_iter=$method.tl_rank_genes_groups_method.solver.max_iter, @@ -213,7 +213,7 @@ sc.tl.marker_gene_overlap( adata, reference_markers, - #if str($method.key) != '' + #if $method.key key='$method.key', #end if method='$method.overlap.method', @@ -226,7 +226,7 @@ #if str($method.adj_pval_threshold) != '' adj_pval_threshold=$method.adj_pval_threshold, #end if - #if str($method.key_added) != '' + #if $method.key_added key_added='$method.key_added', #end if inplace=True) @@ -240,7 +240,7 @@ sc.pp.scale( adata, zero_center=$method.zero_center, - #if $method.max_value + #if str($method.max_value) != '' max_value=$method.max_value, #end if copy=False) @@ -368,9 +368,9 @@ <param argument="n_genes" type="integer" min="0" value="100" label="The number of genes that appear in the returned tables" help=""/> <conditional name="tl_rank_genes_groups_method"> <param argument="method" type="select" label="Method"> - <option value="t-test">t-test</option> + <option value="t-test" selected="true">t-test</option> <option value="wilcoxon">Wilcoxon-Rank-Sum</option> - <option value="t-test_overestim_var" selected="true">t-test with overestimate of variance of each group</option> + <option value="t-test_overestim_var">t-test with overestimate of variance of each group</option> <option value="logreg">Logistic regression</option> </param> <when value="t-test"> @@ -453,7 +453,8 @@ </when> </conditional> </when> - <!--<when value="tl.marker_gene_overlap"> + <!-- With inplace=True, NotImplementedError: Writing Pandas dataframes to h5ad is currently under development. Please use `inplace=False`. --> + <!-- <when value="tl.marker_gene_overlap"> <repeat name="reference_markers" title="Marker genes"> <param name="key" type="text" value="" label="Cell identity name" help=""/> <param name="values" type="text" value="" label="List of genes" help="Comma-separated names from 'var'"/> @@ -477,7 +478,7 @@ </conditional> <param argument="top_n_markers" type="integer" optional="true" label="Number of top data-derived marker genes to use" help="By default all calculated marker genes are used. If adj_pval_threshold is set along with top_n_markers, then adj_pval_threshold is ignored."/> <param argument="adj_pval_threshold" type="float" optional="true" label="Significance threshold on the adjusted p-values to select marker genes" help=" This can only be used when adjusted p-values are calculated by 'tl.rank_genes_groups'. If adj_pval_threshold is set along with top_n_markers, then adj_pval_threshold is ignored."/> - <param argument="key_added" type="text" value="" optional="true" label="Key that will contain the marker overlap scores in 'uns'"/> + <param argument="key_added" type="text" value="marker_gene_overlap" optional="true" label="Key that will contain the marker overlap scores in 'uns'"/> </when>--> <when value="pp.log1p"/> <when value="pp.scale"> @@ -494,8 +495,8 @@ <expand macro="anndata_outputs"/> </outputs> <tests> - <test> - <!-- test 0 --> + <test expect_num_outputs="2"> + <!-- test 1 --> <param name="adata" value="sparce_csr_matrix.h5ad" /> <conditional name="method"> <param name="method" value="pp.calculate_qc_metrics"/> @@ -517,8 +518,8 @@ </output> <output name="anndata_out" file="pp.calculate_qc_metrics.sparce_csr_matrix.h5ad" ftype="h5ad" compare="sim_size"/> </test> - <test> - <!-- test 1 --> + <test expect_num_outputs="2"> + <!-- test 2 --> <param name="adata" value="pp.recipe_weinreb17.paul15_subsample.h5ad" /> <conditional name="method"> <param name="method" value="pp.neighbors"/> @@ -547,8 +548,8 @@ </assert_contents> </output> </test> - <test> - <!-- test 2 --> + <test expect_num_outputs="2"> + <!-- test 3 --> <param name="adata" value="pp.recipe_weinreb17.paul15_subsample.h5ad" /> <conditional name="method"> <param name="method" value="pp.neighbors"/> @@ -572,8 +573,8 @@ </output> <output name="anndata_out" file="pp.neighbors_gauss_braycurtis.recipe_weinreb17.paul15_subsample.h5ad" ftype="h5ad" compare="sim_size"/> </test> - <test> - <!-- test 3 --> + <test expect_num_outputs="2"> + <!-- test 4 --> <param name="adata" value="krumsiek11.h5ad" /> <conditional name="method"> <param name="method" value="tl.score_genes"/> @@ -601,8 +602,8 @@ </output> <output name="anndata_out" file="tl.score_genes.krumsiek11.h5ad" ftype="h5ad" compare="sim_size"/> </test> - <test> - <!-- test 4 --> + <test expect_num_outputs="2"> + <!-- test 5 --> <param name="adata" value="krumsiek11.h5ad" /> <conditional name="method"> <param name="method" value="tl.score_genes_cell_cycle"/> @@ -633,13 +634,13 @@ </output> <output name="anndata_out" file="tl.score_genes_cell_cycle.krumsiek11.h5ad" ftype="h5ad" compare="sim_size"/> </test> - <test> - <!-- test 5 --> + <test expect_num_outputs="2"> + <!-- test 6 --> <param name="adata" value="krumsiek11.h5ad" /> <conditional name="method"> <param name="method" value="tl.rank_genes_groups"/> <param name="groupby" value="cell_type"/> - <param name="use_raw" value="True"/> + <param name="use_raw" value="False"/> <conditional name="ref"> <param name="rest" value="rest"/> </conditional> @@ -656,7 +657,7 @@ <assert_contents> <has_text_matching expression="sc.tl.rank_genes_groups"/> <has_text_matching expression="groupby='cell_type'"/> - <has_text_matching expression="use_raw=True"/> + <has_text_matching expression="use_raw=False"/> <has_text_matching expression="reference='rest'"/> <has_text_matching expression="n_genes=100"/> <has_text_matching expression="method='t-test_overestim_var'"/> @@ -665,8 +666,8 @@ </output> <output name="anndata_out" file="tl.rank_genes_groups.krumsiek11.h5ad" ftype="h5ad" compare="sim_size"/> </test> - <test> - <!-- test 6 --> + <test expect_num_outputs="2"> + <!-- test 7 --> <param name="adata" value="pbmc68k_reduced.h5ad" /> <conditional name="method"> <param name="method" value="tl.rank_genes_groups"/> @@ -714,8 +715,8 @@ </assert_contents> </output> </test> - <test> - <!-- test 7 --> + <test expect_num_outputs="2"> + <!-- test 8 --> <param name="adata" value="pbmc68k_reduced.h5ad" /> <conditional name="method"> <param name="method" value="tl.rank_genes_groups"/> @@ -769,9 +770,9 @@ </assert_contents> </output> </test> - <!--<test> - < test 9 > - <param name="adata" value="tl.rank_genes_groups.louvain.neighbors.pca.pbmc68k_reduced.h5ad" /> + <!-- test expect_num_outputs="2"> + < test 9 tl.marker_gene_overlap function was commented because inpace=True does not work> + <param name="adata" value="tl.rank_genes_groups.newton-cg.pbmc68k_reduced.h5ad" /> <conditional name="method"> <param name="method" value="tl.marker_gene_overlap"/> <repeat name="reference_markers"> @@ -787,8 +788,8 @@ <param name="value" value="MS4A1"/> </repeat> <conditional name="overlap"> - <param argument="method" value="overlap_count"/> - <param argument="normalize" value="None"/> + <param name="method" value="overlap_count"/> + <param name="normalize" value="None"/> </conditional> </conditional> <assert_stdout> @@ -796,10 +797,10 @@ <has_text_matching expression="key='rank_genes_groups'"/> <has_text_matching expression="method='overlap_count'"/> </assert_stdout> - <output name="anndata_out" file="pp.log1p.krumsiek11.h5ad" ftype="h5ad" compare="sim_size"/> - </test>--> - <test> - <!-- test 8 --> + <output name="anndata_out" file="tl.marker_gene_overlap.pbmc68k_reduced.h5ad" ftype="h5ad" compare="sim_size"/> + </test> --> + <test expect_num_outputs="2"> + <!-- test 10 --> <param name="adata" value="krumsiek11.h5ad" /> <conditional name="method"> <param name="method" value="pp.log1p"/> @@ -814,8 +815,8 @@ </output> <output name="anndata_out" file="pp.log1p.krumsiek11.h5ad" ftype="h5ad" compare="sim_size"/> </test> - <test> - <!-- test 9 --> + <test expect_num_outputs="2"> + <!-- test 11 --> <param name="adata" value="krumsiek11.h5ad" /> <conditional name="method"> <param name="method" value="pp.scale"/> @@ -832,8 +833,8 @@ </output> <output name="anndata_out" file="pp.scale.krumsiek11.h5ad" ftype="h5ad" compare="sim_size"/> </test> - <test> - <!-- test 10 --> + <test expect_num_outputs="2"> + <!-- test 12 --> <param name="adata" value="krumsiek11.h5ad" /> <conditional name="method"> <param name="method" value="pp.scale"/> @@ -852,8 +853,8 @@ </output> <output name="anndata_out" file="pp.scale_max_value.krumsiek11.h5ad" ftype="h5ad" compare="sim_size"/> </test> - <test> - <!-- test 11 --> + <test expect_num_outputs="2"> + <!-- test 13 --> <param name="adata" value="krumsiek11.h5ad" /> <conditional name="method"> <param name="method" value="pp.sqrt"/> @@ -868,6 +869,30 @@ </output> <output name="anndata_out" file="pp.sqrt.krumsiek11.h5ad" ftype="h5ad" compare="sim_size"/> </test> + <test expect_num_outputs="2"> + <!-- test 13 --> + <param name="adata" value="sparce_csr_matrix.h5ad" /> + <conditional name="method"> + <param name="method" value="pp.calculate_qc_metrics"/> + <param name="expr_type" value="counts"/> + <param name="var_type" value="genes"/> + <param name="qc_vars" value="mito,negative"/> + <param name="percent_top" value="50,100,200,300"/> + </conditional> + <section name="advanced_common"> + <param name="show_log" value="true" /> + </section> + <output name="hidden_output"> + <assert_contents> + <has_text_matching expression="sc.pp.calculate_qc_metrics" /> + <has_text_matching expression="expr_type='counts'" /> + <has_text_matching expression="var_type='genes'" /> + <has_text_matching expression="qc_vars=\['mito', 'negative'\]" /> + <has_text_matching expression="percent_top=\[50, 100, 200, 300\]" /> + </assert_contents> + </output> + <output name="anndata_out" file="pp.calculate_qc_metrics.sparce_csr_matrix.h5ad" ftype="h5ad" compare="sim_size"/> + </test> </tests> <help><![CDATA[ Calculate quality control metrics., using `pp.calculate_qc_metrics` @@ -892,7 +917,7 @@ - pct_dropout_by_{expr_type} (e.g. "pct_dropout_by_counts", percentage of cells this feature does not appear in) More details on the `scanpy documentation -<https://icb-scanpy.readthedocs-hosted.com/en/@version@/api/scanpy.pp.calculate_qc_metrics.html>`__ +<https://scanpy.readthedocs.io/en/stable/api/scanpy.pp.calculate_qc_metrics.html>`__ Compute a neighborhood graph of observations, using `pp.neighbors` ================================================================== @@ -911,7 +936,7 @@ This data are stored in the unstructured annotation (uns) and can be accessed using the inspect tool for AnnData objects More details on the `scanpy documentation -<https://icb-scanpy.readthedocs-hosted.com/en/@version@/api/scanpy.pp.neighbors.html>`__ +<https://scanpy.readthedocs.io/en/stable/api/generated/scanpy.pp.neighbors.html>`__ Score a set of genes, using `tl.score_genes` ============================================ @@ -924,7 +949,7 @@ for Scanpy by Davide Cittaro. More details on the `scanpy documentation -<https://icb-scanpy.readthedocs-hosted.com/en/@version@/api/scanpy.tl.score_genes.html>`__ +<https://scanpy.readthedocs.io/en/stable/api/scanpy.tl.score_genes.html>`__ Score cell cycle genes, using `tl.score_genes_cell_cycle` ========================================================= @@ -934,7 +959,7 @@ `score_genes` for more explanation. More details on the `scanpy documentation -<https://icb-scanpy.readthedocs-hosted.com/en/@version@/api/scanpy.tl.score_genes_cell_cycle.html>`__ +<https://scanpy.readthedocs.io/en/stable/api/scanpy.tl.score_genes_cell_cycle.html>`__ Rank genes for characterizing groups, using `tl.rank_genes_groups` ================================================================== @@ -950,7 +975,7 @@ This data are stored in the unstructured annotation (uns) and can be accessed using the inspect tool for AnnData objects More details on the `scanpy documentation -<https://icb-scanpy.readthedocs-hosted.com/en/@version@/api/scanpy.tl.rank_genes_groups.html>`__ +<https://scanpy.readthedocs.io/en/stable/api/scanpy.tl.rank_genes_groups.html>`__ Calculate an overlap score between data-deriven marker genes and provided markers (`tl.marker_gene_overlap`) @@ -963,13 +988,13 @@ ========================================= More details on the `scanpy documentation -<https://icb-scanpy.readthedocs-hosted.com/en/@version@/api/scanpy.pp.log1p.html>`__ +<https://scanpy.readthedocs.io/en/stable/api/scanpy.pp.log1p.html>`__ Scale data to unit variance and zero mean (`pp.scale`) ====================================================== More details on the `scanpy documentation -<https://icb-scanpy.readthedocs-hosted.com/en/@version@/api/scanpy.pp.scale.html>`__ +<https://scanpy.readthedocs.io/en/stable/api/scanpy.pp.scale.html>`__ Computes the square root the data matrix (`pp.sqrt`) ====================================================
--- a/macros.xml Wed Sep 22 21:08:23 2021 +0000 +++ b/macros.xml Wed Jul 31 18:07:55 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@"><