Repository 'scanpy_plot'
hg clone https://toolshed.g2.bx.psu.edu/repos/iuc/scanpy_plot

Changeset 6:dbbe1ea8ecb1 (2020-02-20)
Previous changeset 5:8599fd07d140 (2020-02-10) Next changeset 7:7647e5cd1b8b (2020-05-20)
Commit message:
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/scanpy/ commit 5a90fd345b43ca12366f4475f4cfd88ef197e452"
modified:
macros.xml
plot.xml
b
diff -r 8599fd07d140 -r dbbe1ea8ecb1 macros.xml
--- a/macros.xml Mon Feb 10 05:25:58 2020 -0500
+++ b/macros.xml Thu Feb 20 08:22:46 2020 -0500
[
@@ -21,12 +21,17 @@
     </xml>
     <token name="@CMD@"><![CDATA[
 cp '$adata' 'anndata.h5ad' &&
-cat '$script_file' &&
-python '$script_file' &&
-ls .
+cat '$script_file' > '$hidden_output' &&
+python '$script_file' >> '$hidden_output' &&
+ls . >> '$hidden_output' &&
+touch 'anndata_info.txt' &&
+cat 'anndata_info.txt' @CMD_prettify_stdout@
     ]]>
     </token>
     <token name="@CMD_imports@"><![CDATA[
+import sys
+sys.stderr = open('$hidden_output', 'a')
+
 import scanpy as sc
 import pandas as pd
 import numpy as np
@@ -39,13 +44,25 @@
 adata = sc.read('anndata.h5ad')
 ]]>
     </token>
+    <xml name="inputs_common_advanced">
+        <section name="advanced_common" title="Advanced Options" expanded="false">
+            <param name="show_log" type="boolean" checked="false" label="Output Log?" />
+        </section>
+    </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" >
+            <filter>advanced_common['show_log']</filter>
+        </data>
     </xml>
     <token name="@CMD_anndata_write_outputs@"><![CDATA[
 adata.write('anndata.h5ad')
+with open('anndata_info.txt','w', encoding='utf-8') as ainfo:
+    print(adata, file=ainfo)
 ]]>
     </token>
+    <token name="@CMD_prettify_stdout@"><![CDATA[ | sed -r '1 s|AnnData object with (.+) = (.*)\s*|\1: \2|g' | sed "s|'||g"  | sed -r 's|^\s*(.*):\s(.*)|[\1]\n-    \2|g' | sed 's|, |\n-    |g'
+    ]]></token>
     <xml name="svd_solver">
         <param name="svd_solver" type="select" label="SVD solver to use" help="">
             <option value="auto">Automatically chosen depending on the size of the problem</option>
b
diff -r 8599fd07d140 -r dbbe1ea8ecb1 plot.xml
--- a/plot.xml Mon Feb 10 05:25:58 2020 -0500
+++ b/plot.xml Thu Feb 20 08:22:46 2020 -0500
[
b'@@ -82,7 +82,7 @@\n     log=$method.log,\n     use_raw=$method.use_raw,\n     @CMD_conditional_stripplot@\n-    multi_panel=$method.violin_plot.multi_panel.multi_panel, \n+    multi_panel=$method.violin_plot.multi_panel.multi_panel,\n     #if $method.violin_plot.multi_panel.multi_panel == "True" and str($method.violin_plot.multi_panel.width) != \'\' and str($method.violin_plot.multi_panel.height) != \'\'\n     figsize=($method.violin_plot.multi_panel.width, $method.violin_plot.multi_panel.height),\n     #end if\n@@ -551,7 +551,7 @@\n                     <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.">\n                         <expand macro="seaborn_color_palette_options"/>\n                     </param>\n-                    <param argument="saturation" type="float" value="1" label="Proportion of the original saturation to draw colors at" help="Large patches often look better with slightly desaturated colors, but set this to 1 if you want the plot colors to perfectly match the input color spec."/>            \n+                    <param argument="saturation" type="float" value="1" label="Proportion of the original saturation to draw colors at" help="Large patches often look better with slightly desaturated colors, but set this to 1 if you want the plot colors to perfectly match the input color spec."/>\n                 </section>\n             </when>\n             <when value="pl.pca">\n@@ -641,7 +641,7 @@\n                 <expand macro="inputs_paga"/>\n             </when>\n             <when value="pl.paga_path">\n-                <param argument="nodes" type="text" value="" label="A path through nodes of the abstracted graph" \n+                <param argument="nodes" type="text" value="" label="A path through nodes of the abstracted graph"\n                     help="Each node is represented by its indice (within .categories) for the groups that have been used to run PAGA. Comma-separated"/>\n                 <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\'"/>\n                 <expand macro="param_use_raw"/>\n@@ -706,6 +706,7 @@\n                 <expand macro="pl_stacked_violin"/>\n             </when>\n         </conditional>\n+        <expand macro="inputs_common_advanced"/>\n     </inputs>\n     <outputs>\n         <data name="out_png" format="png" from_work_dir="*.png" label="${tool.name} (${method.method}) on ${on_string}">\n@@ -729,10 +730,13 @@\n             <discover_datasets pattern="rank_genes_groups_(?P&lt;designation&gt;.*).svg" format="svg"/>\n             <filter>format == \'svg\' and method[\'method\'] == \'pl.rank_genes_groups_violin\'</filter>\n         </collection>\n+        <data name="hidden_output" format="txt" label="Log file" hidden="true" >\n+            <filter>advanced_common[\'show_log\']</filter>\n+        </data>\n     </outputs>\n     <tests>\n         <test>\n-            <!-- test 1: pl.scatter !-->\n+            <!-- test 0: pl.scatter !-->\n             <param name="adata" value="pbmc68k_reduced.h5ad" />\n             <param name="format" value="png"/>\n             <conditional name="method">\n@@ -755,25 +759,30 @@\n                     <param name="size" value="1"/>\n                 </section>\n             </conditional>\n-            <assert_stdout>\n-                <has_text_matching expression="sc.pl.scatter"/>\n-                <has_text_matching expression="basis=\'umap\'" />\n-                <has_text_matching expression="color=\\[\'HES4\'\\]"/>\n-                <has_text_matching expression="use_raw=True"/>\n-                <has_text_matching expression="sort_order=True"/>\n-                <has_text_matching expression="projection=\'2d\'"/>\n-                <has_text_matching expression="legend_loc=\'right margin\'"/>\n-                <has_text_matching expression="leg'..b'                   <has_text_matching expression="cmap=\'viridis\'"/>\n+                    <has_text_matching expression="edgecolors=\'face\'"/>\n+                    <has_text_matching expression="snap=False"/>\n+                </assert_contents>\n+            </output>\n             <output name="out_png" file="pl.rank_genes_groups_matrixplot.rank_genes_groups.krumsiek11.png" ftype="png" compare="sim_size"/>\n         </test>\n         <test>\n-            <!-- test 25: pl.rank_genes_groups_stacked_violin !-->\n+            <!-- test 24: pl.rank_genes_groups_stacked_violin !-->\n             <param name="adata" value="tl.rank_genes_groups.krumsiek11.h5ad" />\n             <param name="format" value="png"/>\n             <conditional name="method">\n@@ -1692,24 +1816,29 @@\n                     <param name="saturation" value="0.75"/>\n                 </section>\n             </conditional>\n-            <assert_stdout>\n-                <has_text_matching expression="sc.pl.rank_genes_groups_stacked_violin"/>\n-                <has_text_matching expression="n_genes=10"/>\n-                <has_text_matching expression="log=False"/>\n-                <has_text_matching expression="use_raw=False"/>\n-                <has_text_matching expression="dendrogram=True"/>\n-                <has_text_matching expression="swap_axes=True"/>\n-                <has_text_matching expression="stripplot=True"/>\n-                <has_text_matching expression="jitter=True"/>\n-                <has_text_matching expression="size=1"/>\n-                <has_text_matching expression="scale=\'width\'"/>\n-                <has_text_matching expression="bw=\'scott\'"/>\n-                <has_text_matching expression="scale=\'width\'"/>\n-                <has_text_matching expression="linewidth=0.0"/>\n-                <has_text_matching expression="color=\'AliceBlue\'"/>\n-                <has_text_matching expression="palette=\'viridis\'"/>\n-                <has_text_matching expression="saturation=0.75"/>\n-            </assert_stdout>\n+            <section name="advanced_common">\n+                <param name="show_log" value="true" />\n+            </section>\n+            <output name="hidden_output">\n+                <assert_contents>\n+                    <has_text_matching expression="sc.pl.rank_genes_groups_stacked_violin"/>\n+                    <has_text_matching expression="n_genes=10"/>\n+                    <has_text_matching expression="log=False"/>\n+                    <has_text_matching expression="use_raw=False"/>\n+                    <has_text_matching expression="dendrogram=True"/>\n+                    <has_text_matching expression="swap_axes=True"/>\n+                    <has_text_matching expression="stripplot=True"/>\n+                    <has_text_matching expression="jitter=True"/>\n+                    <has_text_matching expression="size=1"/>\n+                    <has_text_matching expression="scale=\'width\'"/>\n+                    <has_text_matching expression="bw=\'scott\'"/>\n+                    <has_text_matching expression="scale=\'width\'"/>\n+                    <has_text_matching expression="linewidth=0.0"/>\n+                    <has_text_matching expression="color=\'AliceBlue\'"/>\n+                    <has_text_matching expression="palette=\'viridis\'"/>\n+                    <has_text_matching expression="saturation=0.75"/>\n+                </assert_contents>\n+            </output>\n             <output name="out_png" file="pl.rank_genes_groups_stacked_violin.rank_genes_groups.krumsiek11.png" ftype="png" compare="sim_size"/>\n         </test>\n     </tests>\n@@ -1763,7 +1892,7 @@\n Generic: Stacked violin plots (`pl.stacked_violin`)\n ===================================================\n \n-Makes a compact image composed of individual violin plots (from `seaborn.violinplot`) \n+Makes a compact image composed of individual violin plots (from `seaborn.violinplot`)\n stacked on top of each other. Useful to visualize gene expression per cluster.\n \n More details on the `scanpy documentation\n'