comparison export.xml @ 3:8623710d083c draft

"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/anndata/ commit dc9d19d1f902f3ed54009cd0e68c8518c284b856"
author iuc
date Mon, 06 Jan 2020 13:44:46 -0500
parents fcb7370e827f
children 707023fa62fe
comparison
equal deleted inserted replaced
2:e0395cca2c57 3:8623710d083c
1 <tool id="anndata_export" name="Export AnnData" version="@VERSION@+@GALAXY_VERSION@"> 1 <tool id="anndata_export" name="Export AnnData and loom files" version="@VERSION@+@GALAXY_VERSION@">
2 <description>to different formats</description> 2 <description>Interconvert AnnData and Loom formats</description>
3 <macros> 3 <macros>
4 <import>macros.xml</import> 4 <import>macros.xml</import>
5 </macros> 5 </macros>
6 <expand macro="requirements"/> 6 <expand macro="requirements"/>
7 <expand macro="version_command"/> 7 <expand macro="version_command"/>
8 <command detect_errors="exit_code"><![CDATA[ 8 <command detect_errors="exit_code"><![CDATA[
9 @CMD@ 9 #if $hd5_format.filetype == 'anndata':
10 @CMD@
11 #else:
12 @LOOMCMD@
13 #end if
10 ]]></command> 14 ]]></command>
11 <configfiles> 15 <configfiles>
12 <configfile name="script_file"><![CDATA[ 16 <configfile name="script_file"><![CDATA[
13 @CMD_imports@ 17 @CMD_imports@
14 18 #if $hd5_format.filetype == 'anndata':
15 adata = ad.read('$input') 19 adata = ad.read('$hd5_format.input')
16 #if $output_format == 'loom' 20 #if $hd5_format.output_format == 'loom':
17 adata.write_loom('anndata.loom') 21 adata.write_loom('anndata.loom')
18 #else if $output_format == 'tabular' 22 #else if $hd5_format.output_format == 'tabular':
19 adata.write_csvs('.', sep="\t", skip_data = False) 23 adata.write_csvs('.', sep="\t", skip_data = False)
24 #end if
20 #end if 25 #end if
21 ]]></configfile> 26 ]]></configfile>
22 </configfiles> 27 </configfiles>
23 <inputs> 28 <inputs>
24 <param name="input" type="data" format="h5ad" label="Annotated data matrix"/> 29 <conditional name="hd5_format">
25 <param name="output_format" type="select" label="Format to write the annotated data matrix"> 30 <param name="filetype" type="select" label="hd5 format">
26 <option value="loom">loom</option> 31 <option value="anndata" selected="true">Anndata file</option>
27 <option value="tabular">Tabular</option> 32 <option value="loom">Loom file</option>
28 </param> 33 </param>
34 <when value="anndata">
35 <param name="input" type="data" format="h5ad" label="Annotated data matrix"/>
36 <param name="output_format" type="select" label="Format to write the annotated data matrix">
37 <option value="loom">loom</option>
38 <option value="tabular">Tabular</option>
39 </param>
40 </when>
41 <when value="loom">
42 <param name="input" type="data" format="loom" label="Loom file to be exported to a series of tabular files."/>
43 </when>
44 </conditional>
29 </inputs> 45 </inputs>
30 <outputs> 46 <outputs>
31 <data name="loom_output" format="loom" from_work_dir="anndata.loom" label="${tool.name} on ${on_string}: Annotated data matrix"> 47 <data name="loom_output" format="loom" from_work_dir="anndata.loom" label="${tool.name} on ${on_string}: Annotated data matrix">
32 <filter>output_format == 'loom'</filter> 48 <filter>hd5_format['filetype'] == 'anndata' and hd5_format['output_format'] == 'loom'</filter>
33 </data> 49 </data>
34 <data name="tabular_x" format="tabular" from_work_dir="X.csv" label="${tool.name} on ${on_string}: Matrix table (X)"> 50 <data name="tabular_x" format="tabular" from_work_dir="X.csv" label="${tool.name} on ${on_string}: Matrix table (X)">
35 <filter>output_format == 'tabular'</filter> 51 <filter>hd5_format['filetype'] == 'anndata' and hd5_format['output_format'] == 'tabular'</filter>
36 </data> 52 </data>
37 <data name="tabular_obs" format="tabular" from_work_dir="obs.csv" label="${tool.name} on ${on_string}: Key-indexed one-dimensional observations annotation (obs)"> 53 <data name="tabular_obs" format="tabular" from_work_dir="obs.csv" label="${tool.name} on ${on_string}: Key-indexed one-dimensional observations annotation (obs)">
38 <filter>output_format == 'tabular'</filter> 54 <filter>hd5_format['filetype'] == 'anndata' and hd5_format['output_format'] == 'tabular'</filter>
39 </data> 55 </data>
40 <data name="tabular_obsm" format="tabular" from_work_dir="obsm.csv" label="${tool.name} on ${on_string}: Key-indexed multi-dimensional observations annotation (obsm)"> 56 <data name="tabular_obsm" format="tabular" from_work_dir="obsm.csv" label="${tool.name} on ${on_string}: Key-indexed multi-dimensional observations annotation (obsm)">
41 <filter>output_format == 'tabular'</filter> 57 <filter>hd5_format['filetype'] == 'anndata' and hd5_format['output_format'] == 'tabular'</filter>
42 </data> 58 </data>
43 <data name="tabular_var" format="tabular" from_work_dir="var.csv" label="${tool.name} on ${on_string}: Key-indexed one-dimensional variables annotation (var)"> 59 <data name="tabular_var" format="tabular" from_work_dir="var.csv" label="${tool.name} on ${on_string}: Key-indexed one-dimensional variables annotation (var)">
44 <filter>output_format == 'tabular'</filter> 60 <filter>hd5_format['filetype'] == 'anndata' and hd5_format['output_format'] == 'tabular'</filter>
45 </data> 61 </data>
46 <data name="tabular_varm" format="tabular" from_work_dir="varm.csv" label="${tool.name} on ${on_string}: Key-indexed multi-dimensional variables annotation (varm)"> 62 <data name="tabular_varm" format="tabular" from_work_dir="varm.csv" label="${tool.name} on ${on_string}: Key-indexed multi-dimensional variables annotation (varm)">
47 <filter>output_format == 'tabular'</filter> 63 <filter>hd5_format['filetype'] == 'anndata' and hd5_format['output_format'] == 'tabular'</filter>
48 </data> 64 </data>
65 <collection name="layer_tsvs" type="list" label="Layer matrices" >
66 <filter>hd5_format['filetype'] == 'loom'</filter>
67 <discover_datasets pattern="__designation__" format="tabular" directory="output" visible="false" />
68 </collection>
69 <collection name="attribute_tsvs" type="list" label="Attribute matrices" >
70 <filter>hd5_format['filetype'] == 'loom'</filter>
71 <discover_datasets pattern="__designation__" format="tabular" directory="attributes" visible="false" />
72 </collection>
49 </outputs> 73 </outputs>
50 <tests> 74 <tests>
51 <test> 75 <test expect_num_outputs="1">
76 <param name="filetype" value="anndata"/>
52 <param name="input" value="krumsiek11.h5ad"/> 77 <param name="input" value="krumsiek11.h5ad"/>
53 <param name="output_format" value="loom"/> 78 <param name="output_format" value="loom"/>
54 <assert_stdout> 79 <assert_stdout>
55 <has_text_matching expression="adata.write_loom"/> 80 <has_text_matching expression="adata.write_loom"/>
56 </assert_stdout> 81 </assert_stdout>
57 <output name="loom_output" value="export.krumsiek11.loom" ftype="loom" compare="sim_size"/> 82 <output name="loom_output" value="export.krumsiek11.loom" ftype="loom" compare="sim_size"/>
58 </test> 83 </test>
59 <test> 84 <test expect_num_outputs="5">
85 <param name="filetype" value="anndata"/>
60 <param name="input" value="krumsiek11.h5ad"/> 86 <param name="input" value="krumsiek11.h5ad"/>
61 <param name="output_format" value="tabular"/> 87 <param name="output_format" value="tabular"/>
62 <assert_stdout> 88 <assert_stdout>
63 <has_text_matching expression="adata.write_csvs"/> 89 <has_text_matching expression="adata.write_csvs"/>
64 </assert_stdout> 90 </assert_stdout>
66 <output name="tabular_obs" value="export.krumsiek11.obs.tabular" ftype="tabular"/> 92 <output name="tabular_obs" value="export.krumsiek11.obs.tabular" ftype="tabular"/>
67 <output name="tabular_obsm" value="export.krumsiek11.obsm.tabular" ftype="tabular"/> 93 <output name="tabular_obsm" value="export.krumsiek11.obsm.tabular" ftype="tabular"/>
68 <output name="tabular_var" value="export.krumsiek11.var.tabular" ftype="tabular"/> 94 <output name="tabular_var" value="export.krumsiek11.var.tabular" ftype="tabular"/>
69 <output name="tabular_varm" value="export.krumsiek11.varm.tabular" ftype="tabular"/> 95 <output name="tabular_varm" value="export.krumsiek11.varm.tabular" ftype="tabular"/>
70 </test> 96 </test>
97 <test expect_num_outputs="2">
98 <param name="filetype" value="loom"/>
99 <param name="input" value="loomtest.loom"/>
100 <output_collection name="layer_tsvs" type="list">
101 <element name="mainmatrix.tsv" value="firstlayer.tsv" ftype="tabular"/>
102 <element name="extralayer.tsv" value="secondlayer.tsv" ftype="tabular"/>
103 <element name="thirdlayer.tsv" value="finallayer.tsv" ftype="tabular"/>
104 </output_collection>
105 <output_collection name="attribute_tsvs" type="list">
106 <element name="row_attr.tsv" value="rows.tsv" ftype="tabular"/>
107 <element name="col_attr.tsv" value="cols.tsv" ftype="tabular"/>
108 </output_collection>
109 </test>
71 </tests> 110 </tests>
72 <help><![CDATA[ 111 <help><![CDATA[
73 **What it does** 112 This tool exports an AnnData dataset to a Loom file
113 (`write_loom method <https://anndata.readthedocs.io/en/latest/anndata.AnnData.write_loom.html>`__)
114 or a Tabular file (`write_csvs method <https://anndata.readthedocs.io/en/latest/anndata.AnnData.write_csvs.html>`__)
74 115
75 This tool exports a AnnData dataset to a Loom file 116 It can also create a series of tabular files from an input loom dataset.
76 (`write_loom method <https://anndata.readthedocs.io/en/latest/anndata.AnnData.write_loom.html>`__)
77 or a Tabular file (`write_csvs method <https://anndata.readthedocs.io/en/latest/anndata.AnnData.write_csvs.html>`__)
78 117
79 @HELP@ 118 @HELP@
80 ]]></help> 119 ]]></help>
81 <expand macro="citations"/> 120 <expand macro="citations"/>
82 </tool> 121 </tool>