Mercurial > repos > iuc > anndata_export
comparison export.xml @ 12:cfaf5a405371 draft
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/anndata/ commit 67b3808b56df343798263ff0c905df8cb789edfa
author | iuc |
---|---|
date | Sat, 14 Sep 2024 19:57:36 +0000 |
parents | e1c3c2f2a834 |
children | 7a6655aa6eb2 |
comparison
equal
deleted
inserted
replaced
11:e1c3c2f2a834 | 12:cfaf5a405371 |
---|---|
1 <tool id="anndata_export" name="Export AnnData and loom files" version="@TOOL_VERSION@+galaxy@VERSION_SUFFIX@"> | 1 <tool id="anndata_export" name="Export AnnData" version="@TOOL_VERSION@+galaxy@VERSION_SUFFIX@" profile="@PROFILE@"> |
2 <description>Interconvert AnnData and Loom formats</description> | 2 <description>matrix and annotations</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 #if $hd5_format.filetype == 'anndata': | 9 @CMD@ |
10 @CMD@ | |
11 #else: | |
12 @LOOMCMD@ | |
13 #end if | |
14 ]]></command> | 10 ]]></command> |
15 <configfiles> | 11 <configfiles> |
16 <configfile name="script_file"><![CDATA[ | 12 <configfile name="script_file"><![CDATA[ |
17 @CMD_imports@ | 13 @CMD_imports@ |
18 #if $hd5_format.filetype == 'anndata': | 14 adata = ad.read_h5ad('$input') |
19 adata = ad.read_h5ad('$hd5_format.input') | |
20 #if $hd5_format.output_format == 'loom': | |
21 adata.write_loom('anndata.loom') | |
22 #else if $hd5_format.output_format == 'tabular': | |
23 adata.write_csvs('.', sep="\t", skip_data = False) | 15 adata.write_csvs('.', sep="\t", skip_data = False) |
24 #end if | |
25 #end if | |
26 ]]></configfile> | 16 ]]></configfile> |
27 </configfiles> | 17 </configfiles> |
28 <inputs> | 18 <inputs> |
29 <conditional name="hd5_format"> | 19 <param name="input" type="data" format="h5ad" label="Annotated data matrix to export" help="Create individual tabular files for matrix, obs, obsm, var and varm annotations"/> |
30 <param name="filetype" type="select" label="hd5 format"> | |
31 <option value="anndata" selected="true">Anndata file</option> | |
32 <option value="loom">Loom file</option> | |
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> | |
45 </inputs> | 20 </inputs> |
46 <outputs> | 21 <outputs> |
47 <data name="loom_output" format="loom" from_work_dir="anndata.loom" label="${tool.name} on ${on_string}: Annotated data matrix"> | 22 <data name="tabular_x" format="tabular" from_work_dir="X.csv" label="${tool.name} on ${on_string}: Matrix table (X)"/> |
48 <filter>hd5_format['filetype'] == 'anndata' and hd5_format['output_format'] == 'loom'</filter> | 23 <data name="tabular_obs" format="tabular" from_work_dir="obs.csv" label="${tool.name} on ${on_string}: Key-indexed one-dimensional observations annotation (obs)"/> |
49 </data> | 24 <data name="tabular_obsm" format="tabular" from_work_dir="obsm.csv" label="${tool.name} on ${on_string}: Key-indexed multi-dimensional observations annotation (obsm)"/> |
50 <data name="tabular_x" format="tabular" from_work_dir="X.csv" label="${tool.name} on ${on_string}: Matrix table (X)"> | 25 <data name="tabular_var" format="tabular" from_work_dir="var.csv" label="${tool.name} on ${on_string}: Key-indexed one-dimensional variables annotation (var)"/> |
51 <filter>hd5_format['filetype'] == 'anndata' and hd5_format['output_format'] == 'tabular'</filter> | 26 <data name="tabular_varm" format="tabular" from_work_dir="varm.csv" label="${tool.name} on ${on_string}: Key-indexed multi-dimensional variables annotation (varm)"/> |
52 </data> | |
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)"> | |
54 <filter>hd5_format['filetype'] == 'anndata' and hd5_format['output_format'] == 'tabular'</filter> | |
55 </data> | |
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)"> | |
57 <filter>hd5_format['filetype'] == 'anndata' and hd5_format['output_format'] == 'tabular'</filter> | |
58 </data> | |
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)"> | |
60 <filter>hd5_format['filetype'] == 'anndata' and hd5_format['output_format'] == 'tabular'</filter> | |
61 </data> | |
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)"> | |
63 <filter>hd5_format['filetype'] == 'anndata' and hd5_format['output_format'] == 'tabular'</filter> | |
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> | |
73 </outputs> | 27 </outputs> |
74 <tests> | 28 <tests> |
75 <test expect_num_outputs="1"> | 29 <test expect_num_outputs="5"> |
76 <param name="filetype" value="anndata"/> | |
77 <param name="input" value="krumsiek11.h5ad"/> | 30 <param name="input" value="krumsiek11.h5ad"/> |
78 <param name="output_format" value="loom"/> | |
79 <assert_stdout> | |
80 <has_text_matching expression="adata.write_loom"/> | |
81 </assert_stdout> | |
82 <output name="loom_output" value="export.krumsiek11.loom" ftype="loom" compare="sim_size"/> | |
83 </test> | |
84 <test expect_num_outputs="5"> | |
85 <param name="filetype" value="anndata"/> | |
86 <param name="input" value="krumsiek11.h5ad"/> | |
87 <param name="output_format" value="tabular"/> | |
88 <assert_stdout> | 31 <assert_stdout> |
89 <has_text_matching expression="adata.write_csvs"/> | 32 <has_text_matching expression="adata.write_csvs"/> |
90 </assert_stdout> | 33 </assert_stdout> |
91 <output name="tabular_x" value="export.krumsiek11.X.tabular" ftype="tabular"/> | 34 <output name="tabular_x" value="export.krumsiek11.X.tabular" ftype="tabular"/> |
92 <output name="tabular_obs" value="export.krumsiek11.obs.tabular" ftype="tabular"/> | 35 <output name="tabular_obs" value="export.krumsiek11.obs.tabular" ftype="tabular"/> |
93 <output name="tabular_obsm" value="export.krumsiek11.obsm.tabular" ftype="tabular"/> | 36 <output name="tabular_obsm" value="export.krumsiek11.obsm.tabular" ftype="tabular"/> |
94 <output name="tabular_var" value="export.krumsiek11.var.tabular" ftype="tabular"/> | 37 <output name="tabular_var" value="export.krumsiek11.var.tabular" ftype="tabular"/> |
95 <output name="tabular_varm" value="export.krumsiek11.varm.tabular" ftype="tabular"/> | 38 <output name="tabular_varm" value="export.krumsiek11.varm.tabular" ftype="tabular"/> |
96 </test> | 39 </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> | |
110 </tests> | 40 </tests> |
111 <help><![CDATA[ | 41 <help><![CDATA[ |
112 This tool exports an AnnData dataset to a Loom file | 42 This tool exports an AnnData dataset to a tabular files (`write_csvs method <https://anndata.readthedocs.io/en/latest/generated/anndata.AnnData.write_csvs.html>`__) |
113 (`write_loom method <https://anndata.readthedocs.io/en/latest/generated/anndata.AnnData.write_loom.html>`__) | |
114 or a Tabular file (`write_csvs method <https://anndata.readthedocs.io/en/latest/generated/anndata.AnnData.write_csvs.html>`__) | |
115 | |
116 It can also create a series of tabular files from an input loom dataset. | |
117 | 43 |
118 @HELP@ | 44 @HELP@ |
119 ]]></help> | 45 ]]></help> |
120 <expand macro="citations"/> | 46 <expand macro="citations"/> |
121 </tool> | 47 </tool> |