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

Changeset 6:77b91b9bdf52 (2020-02-20)
Previous changeset 5:6f2d2c7f77ee (2020-02-10) Next changeset 7:b2df381a6004 (2020-05-20)
Commit message:
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/scanpy/ commit 5a90fd345b43ca12366f4475f4cfd88ef197e452"
modified:
cluster_reduce_dimension.xml
macros.xml
b
diff -r 6f2d2c7f77ee -r 77b91b9bdf52 cluster_reduce_dimension.xml
--- a/cluster_reduce_dimension.xml Mon Feb 10 05:27:02 2020 -0500
+++ b/cluster_reduce_dimension.xml Thu Feb 20 08:23:29 2020 -0500
b
b'@@ -276,13 +276,14 @@\n                 </param>\n             </when>\n         </conditional>            \n+        <expand macro="inputs_common_advanced"/>\n     </inputs>\n     <outputs>\n         <expand macro="anndata_outputs"/>\n     </outputs>\n     <tests>\n         <test>\n-            <!-- test 1 -->\n+            <!-- test 0 -->\n             <param name="adata" value="pp.neighbors_gauss_braycurtis.recipe_weinreb17.paul15_subsample.h5ad" />\n             <conditional name="method">\n                 <param name="method" value="tl.louvain"/>\n@@ -295,20 +296,25 @@\n                 <param name="directed" value="true"/>\n                 <param name="use_weights" value="false"/>\n             </conditional>\n-            <assert_stdout>\n-                <has_text_matching expression="sc.tl.louvain"/>\n-                <has_text_matching expression="adata=adata"/>\n-                <has_text_matching expression="flavor = \'vtraag\'"/>\n-                <has_text_matching expression="resolution=1.0"/>\n-                <has_text_matching expression="random_state=10"/>\n-                <has_text_matching expression="key_added=\'louvain\'"/>\n-                <has_text_matching expression="directed=True"/>\n-                <has_text_matching expression="use_weights=False"/>\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.tl.louvain"/>\n+                    <has_text_matching expression="adata=adata"/>\n+                    <has_text_matching expression="flavor = \'vtraag\'"/>\n+                    <has_text_matching expression="resolution=1.0"/>\n+                    <has_text_matching expression="random_state=10"/>\n+                    <has_text_matching expression="key_added=\'louvain\'"/>\n+                    <has_text_matching expression="directed=True"/>\n+                    <has_text_matching expression="use_weights=False"/>\n+                </assert_contents>\n+            </output>\n             <output name="anndata_out" file="tl.louvain.neighbors_gauss_braycurtis.recipe_weinreb17.paul15_subsample.h5ad" ftype="h5ad" compare="sim_size"/>\n         </test>\n         <test>\n-            <!-- test 2 -->\n+            <!-- test 1 -->\n             <param name="adata" value="pp.neighbors_gauss_braycurtis.recipe_weinreb17.paul15_subsample.h5ad" />\n             <conditional name="method">\n                 <param name="method" value="tl.leiden"/>\n@@ -318,18 +324,23 @@\n                 <param name="use_weights" value="false"/>\n                 <param name="n_iterations" value="-1"/>\n             </conditional>\n-            <assert_stdout>\n-                <has_text_matching expression="sc.tl.leiden"/>\n-                <has_text_matching expression="resolution=1"/>\n-                <has_text_matching expression="random_state=10"/>\n-                <has_text_matching expression="key_added=\'leiden\'"/>\n-                <has_text_matching expression="use_weights=False"/>\n-                <has_text_matching expression="n_iterations=-1"/>\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.tl.leiden"/>\n+                    <has_text_matching expression="resolution=1"/>\n+                    <has_text_matching expression="random_state=10"/>\n+                    <has_text_matching expression="key_added=\'leiden\'"/>\n+                    <has_text_matching expression="use_weights=False"/>\n+                    <has_text_matching expression="n_iterations=-1"/>\n+                </assert_contents>\n+            </output>\n             <output name="anndata_out" file="tl.leiden.neighbors_gauss_braycurtis.recipe_we'..b'            <has_text_matching expression="layout=\'fa\'"/>\n-                <has_text_matching expression="random_state=0"/>\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.tl.draw_graph"/>\n+                    <has_text_matching expression="layout=\'fa\'"/>\n+                    <has_text_matching expression="random_state=0"/>\n+                </assert_contents>\n+            </output>\n             <output name="anndata_out" file="tl.draw_graph.pp.neighbors_umap_euclidean.recipe_weinreb17.paul15_subsample.h5ad" ftype="h5ad" compare="sim_size"/>\n         </test>\n         <test>\n-            <!-- test 8 -->\n+            <!-- test 7 -->\n             <param name="adata" value="pp.neighbors_gauss_braycurtis.recipe_weinreb17.paul15_subsample.h5ad"/>\n             <conditional name="method">\n                 <param name="method" value="tl.paga"/>\n@@ -502,16 +543,21 @@\n                 <param name="use_rna_velocity" value="False"/>\n                 <param name="model" value="v1.2"/>\n             </conditional>\n-            <assert_stdout>\n-                <has_text_matching expression="sc.tl.paga"/>\n-                <has_text_matching expression="groups=\'paul15_clusters\'"/>\n-                <has_text_matching expression="use_rna_velocity=False"/>\n-                <has_text_matching expression="model=\'v1.2\'"/>\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.tl.paga"/>\n+                    <has_text_matching expression="groups=\'paul15_clusters\'"/>\n+                    <has_text_matching expression="use_rna_velocity=False"/>\n+                    <has_text_matching expression="model=\'v1.2\'"/>\n+                </assert_contents>\n+            </output>\n             <output name="anndata_out" file="tl.paga.neighbors_gauss_braycurtis.recipe_weinreb17.paul15_subsample.h5ad" ftype="h5ad" compare="sim_size"/>\n         </test>\n         <test>\n-            <!-- test 9 -->\n+            <!-- test 8 -->\n             <param name="adata" value="tl.diffmap.neighbors_gauss_braycurtis.recipe_weinreb17.paul15_subsample.h5ad" />\n             <conditional name="method">\n                 <param name="method" value="tl.dpt"/>\n@@ -520,13 +566,18 @@\n                 <param name="min_group_size" value="0.01"/>\n                 <param name="allow_kendall_tau_shift" value="True"/>\n             </conditional>\n-            <assert_stdout>\n-                <has_text_matching expression="sc.tl.dpt"/>\n-                <has_text_matching expression="n_dcs=15"/>\n-                <has_text_matching expression="n_branchings=1"/>\n-                <has_text_matching expression="min_group_size=0.01"/>\n-                <has_text_matching expression="allow_kendall_tau_shift=True"/>\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.tl.dpt"/>\n+                    <has_text_matching expression="n_dcs=15"/>\n+                    <has_text_matching expression="n_branchings=1"/>\n+                    <has_text_matching expression="min_group_size=0.01"/>\n+                    <has_text_matching expression="allow_kendall_tau_shift=True"/>\n+                </assert_contents>\n+            </output>\n             <output name="anndata_out" file="tl.dpt.diffmap.neighbors_gauss_braycurtis.recipe_weinreb17.paul15_subsample.h5ad" ftype="h5ad" compare="sim_size"/>\n         </test>\n     </tests>\n'
b
diff -r 6f2d2c7f77ee -r 77b91b9bdf52 macros.xml
--- a/macros.xml Mon Feb 10 05:27:02 2020 -0500
+++ b/macros.xml Thu Feb 20 08:23:29 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>