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

Changeset 6:5e9171dc8244 (2020-02-20)
Previous changeset 5:08192eebb47d (2020-02-10) Next changeset 7:6c145a6868cc (2020-05-20)
Commit message:
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/scanpy/ commit 5a90fd345b43ca12366f4475f4cfd88ef197e452"
modified:
inspect.xml
macros.xml
b
diff -r 08192eebb47d -r 5e9171dc8244 inspect.xml
--- a/inspect.xml Mon Feb 10 05:29:16 2020 -0500
+++ b/inspect.xml Thu Feb 20 08:25:37 2020 -0500
[
b'@@ -461,13 +461,14 @@\n             </when>\n             <when value="pp.sqrt"/>\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="sparce_csr_matrix.h5ad" />\n             <conditional name="method">\n                 <param name="method" value="pp.calculate_qc_metrics"/>\n@@ -476,16 +477,21 @@\n                 <param name="qc_vars" value="mito,negative"/>\n                 <param name="percent_top" value=""/>\n             </conditional>\n-            <assert_stdout>\n-                <has_text_matching expression="sc.pp.calculate_qc_metrics" />\n-                <has_text_matching expression="expr_type=\'counts\'" />\n-                <has_text_matching expression="var_type=\'genes\'" />\n-                <has_text_matching expression="qc_vars=\\[\'mito\', \'negative\'\\]" />\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.pp.calculate_qc_metrics" />\n+                    <has_text_matching expression="expr_type=\'counts\'" />\n+                    <has_text_matching expression="var_type=\'genes\'" />\n+                    <has_text_matching expression="qc_vars=\\[\'mito\', \'negative\'\\]" />\n+                </assert_contents>\n+            </output>\n             <output name="anndata_out" file="pp.calculate_qc_metrics.sparce_csr_matrix.h5ad" ftype="h5ad" compare="sim_size"/>\n         </test>\n         <test>\n-            <!-- test 2 -->\n+            <!-- test 1 -->\n             <param name="adata" value="pp.recipe_weinreb17.paul15_subsample.h5ad" />\n             <conditional name="method">\n                 <param name="method" value="pp.neighbors"/>\n@@ -495,14 +501,19 @@\n                 <param name="pp_neighbors_method" value="umap"/>\n                 <param name="metric" value="euclidean"/>\n             </conditional>\n-            <assert_stdout>\n-                <has_text_matching expression="sc.pp.neighbors"/>\n-                <has_text_matching expression="n_neighbors=15"/>\n-                <has_text_matching expression="knn=True"/>\n-                <has_text_matching expression="random_state=0"/>\n-                <has_text_matching expression="method=\'umap\'"/>\n-                <has_text_matching expression="metric=\'euclidean\'"/>\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.pp.neighbors"/>\n+                    <has_text_matching expression="n_neighbors=15"/>\n+                    <has_text_matching expression="knn=True"/>\n+                    <has_text_matching expression="random_state=0"/>\n+                    <has_text_matching expression="method=\'umap\'"/>\n+                    <has_text_matching expression="metric=\'euclidean\'"/>\n+                </assert_contents>\n+            </output>\n             <output name="anndata_out" file="pp.neighbors_umap_euclidean.recipe_weinreb17.paul15_subsample.h5ad" ftype="h5ad" compare="sim_size">\n                 <assert_contents>\n                     <has_h5_keys keys="X, obs, obsm, uns, var" />\n@@ -510,7 +521,7 @@\n             </output>\n         </test>\n         <test>\n-            <!-- test 3 -->\n+            <!-- test 2 -->\n             <param name="adata" value="pp.recipe_weinreb17.paul15_subsample.h5ad" />\n             <conditional name="method">\n                 <param name="method" value="pp.neighbors"/>\n@@ -519,18 +530,23 @@\n                 <param name="pp_neighbors_method" value="gauss"/>\n     '..b'_contents>\n+                    <has_text_matching expression="sc.pp.log1p"/>\n+                </assert_contents>\n+            </output>\n             <output name="anndata_out" file="pp.log1p.krumsiek11.h5ad" ftype="h5ad" compare="sim_size"/>\n         </test>\n         <test>\n+            <!-- test 9 -->\n+            <param name="adata" value="krumsiek11.h5ad" />\n+            <conditional name="method">\n+                <param name="method" value="pp.scale"/>\n+                <param name="zero_center" value="true"/>\n+            </conditional>\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.pp.scale"/>\n+                    <has_text_matching expression="zero_center=True"/>\n+                </assert_contents>\n+            </output>\n+            <output name="anndata_out" file="pp.scale.krumsiek11.h5ad" ftype="h5ad" compare="sim_size"/>\n+        </test>\n+        <test>\n             <!-- test 10 -->\n             <param name="adata" value="krumsiek11.h5ad" />\n             <conditional name="method">\n                 <param name="method" value="pp.scale"/>\n                 <param name="zero_center" value="true"/>\n+                <param name="max_value" value="10"/>\n             </conditional>\n-            <assert_stdout>\n-                <has_text_matching expression="sc.pp.scale"/>\n-                <has_text_matching expression="zero_center=True"/>\n-            </assert_stdout>\n-            <output name="anndata_out" file="pp.scale.krumsiek11.h5ad" ftype="h5ad" compare="sim_size"/>\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.pp.scale"/>\n+                    <has_text_matching expression="zero_center=True"/>\n+                    <has_text_matching expression="max_value=10.0"/>\n+                </assert_contents>\n+            </output>\n+            <output name="anndata_out" file="pp.scale_max_value.krumsiek11.h5ad" ftype="h5ad" compare="sim_size"/>\n         </test>\n         <test>\n             <!-- test 11 -->\n             <param name="adata" value="krumsiek11.h5ad" />\n             <conditional name="method">\n-                <param name="method" value="pp.scale"/>\n-                <param name="zero_center" value="true"/>\n-                <param name="max_value" value="10"/>\n-            </conditional>\n-            <assert_stdout>\n-                <has_text_matching expression="sc.pp.scale"/>\n-                <has_text_matching expression="zero_center=True"/>\n-                <has_text_matching expression="max_value=10.0"/>\n-            </assert_stdout>\n-            <output name="anndata_out" file="pp.scale_max_value.krumsiek11.h5ad" ftype="h5ad" compare="sim_size"/>\n-        </test>\n-        <test>\n-            <!-- test 12 -->\n-            <param name="adata" value="krumsiek11.h5ad" />\n-            <conditional name="method">\n                 <param name="method" value="pp.sqrt"/>\n             </conditional>\n-            <assert_stdout>\n-                <has_text_matching expression="sc.pp.sqrt"/>\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.pp.sqrt"/>\n+                </assert_contents>\n+            </output>\n             <output name="anndata_out" file="pp.sqrt.krumsiek11.h5ad" ftype="h5ad" compare="sim_size"/>\n         </test>\n     </tests>\n@@ -889,4 +950,4 @@\n `X = sqrt(X)`\n     ]]></help>\n     <expand macro="citations"/>\n-</tool>\n\\ No newline at end of file\n+</tool>\n'
b
diff -r 08192eebb47d -r 5e9171dc8244 macros.xml
--- a/macros.xml Mon Feb 10 05:29:16 2020 -0500
+++ b/macros.xml Thu Feb 20 08:25:37 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>