comparison import.xml @ 7:cfc3f5a57dc6 draft

"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/anndata/ commit 6497f5415b57bedd849b876883574b3f0050741a"
author iuc
date Thu, 07 Jan 2021 23:28:53 +0000
parents 32e547223c9e
children ae1e5d9d8972
comparison
equal deleted inserted replaced
6:00712416fdaa 7:cfc3f5a57dc6
1 <tool id="anndata_import" name="Import Anndata and loom" version="@VERSION@+@GALAXY_VERSION@" profile="18.01"> 1 <tool id="anndata_import" name="Import Anndata and loom" version="@VERSION@+@GALAXY_VERSION@" profile="20.09">
2 <description>from different format</description> 2 <description>from different format</description>
3 <macros> 3 <macros>
4 <import>macros.xml</import> 4 <import>macros.xml</import>
5 <xml name="params_10x"> 5 <xml name="params_10x">
6 <param name="barcodes" type="data" format="tabular,txt" label="Barcodes"/> 6 <param name="barcodes" type="data" format="tabular,txt" label="Barcodes"/>
56 ]]></command> 56 ]]></command>
57 <configfiles> 57 <configfiles>
58 <configfile name="script_file"><![CDATA[ 58 <configfile name="script_file"><![CDATA[
59 @CMD_imports@ 59 @CMD_imports@
60 #if $hd5_format.filetype == 'anndata' 60 #if $hd5_format.filetype == 'anndata'
61 #if $hd5_format.in.adata_format == 'loom' 61 #if $hd5_format.in.adata_format == 'loom'
62 adata = ad.read_loom( 62 adata = ad.read_loom(
63 '$hd5_format.in.input', 63 '$hd5_format.in.input',
64 sparse=$hd5_format.in.sparse, 64 sparse=$hd5_format.in.sparse,
65 cleanup=$hd5_format.in.cleanup, 65 cleanup=$hd5_format.in.cleanup,
66 X_name='$hd5_format.in.x_name', 66 X_name='$hd5_format.in.x_name',
67 obs_names='$hd5_format.in.obs_names', 67 obs_names='$hd5_format.in.obs_names',
68 var_names='$hd5_format.in.var_names') 68 var_names='$hd5_format.in.var_names')
69 69
70 #else if $hd5_format.in.adata_format == 'tabular' 70 #else if $hd5_format.in.adata_format == 'tabular'
71 #set delimiter=$hd5_format.in.input.metadata.delimiter 71 #set delimiter=$hd5_format.in.input.metadata.delimiter
72 #if $delimiter != ',' 72 #if $delimiter != ','
73 #set delimiter='\\t' 73 #set delimiter='\\t'
74 #end if 74 #end if
75 adata = ad.read_csv( 75 adata = ad.read_csv(
76 '$hd5_format.in.input', 76 '$hd5_format.in.input',
77 delimiter='$delimiter', 77 delimiter='$delimiter',
78 first_column_names=$hd5_format.in.first_column_names) 78 first_column_names=$hd5_format.in.first_column_names)
79 79
80 #else if $hd5_format.in.adata_format == '10x_h5' 80 #else if $hd5_format.in.adata_format == '10x_h5'
81 import scanpy as sc 81 import scanpy as sc
82 adata = sc.read_10x_h5('$hd5_format.in.input') 82 adata = sc.read_10x_h5('$hd5_format.in.input')
83 83
84 #else if $hd5_format.in.adata_format == 'mtx' 84 #else if $hd5_format.in.adata_format == 'mtx'
85 #if $hd5_format.in.tenx.use == 'no' 85 #if $hd5_format.in.tenx.use == 'no'
86 adata = ad.read_mtx(filename='$hd5_format.in.matrix') 86 adata = ad.read_mtx(filename='$hd5_format.in.matrix')
87 #else 87 #else
88 import scanpy as sc 88 import scanpy as sc
89 adata = sc.read_10x_mtx( 89 adata = sc.read_10x_mtx(
90 'mtx', 90 'mtx',
91 var_names='$hd5_format.in.tenx.var_names', 91 var_names='$hd5_format.in.tenx.var_names',
92 make_unique=$hd5_format.in.tenx.make_unique, 92 make_unique=$hd5_format.in.tenx.make_unique,
93 cache=False, 93 cache=False,
94 gex_only=$hd5_format.in.tenx.gex_only) 94 gex_only=$hd5_format.in.tenx.gex_only)
95 #end if
96
97 #else if $hd5_format.in.adata_format == 'umi_tools'
98 adata = ad.read_umi_tools('${hd5_format.in.input}.gz')
95 #end if 99 #end if
96
97 #else if $hd5_format.in.adata_format == 'umi_tools'
98 adata = ad.read_umi_tools('${hd5_format.in.input}.gz')
99
100 #end if
101 adata.write('anndata.h5ad') 100 adata.write('anndata.h5ad')
102 #end if 101 #end if
103 ]]></configfile> 102 ]]></configfile>
104 </configfiles> 103 </configfiles>
105 <inputs> 104 <inputs>
174 </outputs> 173 </outputs>
175 <tests> 174 <tests>
176 <test expect_num_outputs="1"> 175 <test expect_num_outputs="1">
177 <conditional name="in"> 176 <conditional name="in">
178 <param name="adata_format" value="loom"/> 177 <param name="adata_format" value="loom"/>
179 <param name="input" value="krumsiek11.loom" /> 178 <param name="input" ftype="loom" value="krumsiek11.loom" />
180 <param name="sparse" value="True"/> 179 <param name="sparse" value="True"/>
181 <param name="cleanup" value="False"/> 180 <param name="cleanup" value="False"/>
182 <param name="x_name" value="spliced"/> 181 <param name="x_name" value="spliced"/>
183 <param name="obs_names" value="CellID" /> 182 <param name="obs_names" value="CellID" />
184 <param name="var_names" value="Gene"/> 183 <param name="var_names" value="Gene"/>
217 <has_text_matching expression="delimiter='\\t'"/> 216 <has_text_matching expression="delimiter='\\t'"/>
218 <has_text_matching expression="first_column_names=True"/> 217 <has_text_matching expression="first_column_names=True"/>
219 </assert_stdout> 218 </assert_stdout>
220 <output name="anndata" value="import.tsv.h5ad" ftype="h5ad" compare="sim_size"/> 219 <output name="anndata" value="import.tsv.h5ad" ftype="h5ad" compare="sim_size"/>
221 </test> 220 </test>
222 <!--<test expect_num_outputs="1"> 221 <test expect_num_outputs="1">
223 <conditional name="in"> 222 <conditional name="in">
224 <param name="adata_format" value="mtx"/> 223 <param name="adata_format" value="mtx"/>
225 <param name="matrix" value="matrix_10x_v1.2.0.mtx"/> 224 <param name="matrix" value="matrix_10x_v1.2.0.mtx"/>
226 <conditional name="tenx"> 225 <conditional name="tenx">
227 <param name="use" value="no"/> 226 <param name="use" value="no"/>
228 </conditional> 227 </conditional>
229 </conditional> 228 </conditional>
230 <output name="anndata" value="import.mtx.no_10x.h5ad" ftype="h5ad" compare="sim_size"/> 229 <output name="anndata" value="import.mtx.no_10x.h5ad" ftype="h5ad" compare="sim_size"/>
231 </test> 230 </test>
232 <test> 231 <!--<test>
233 <conditional name="in"> 232 <conditional name="in">
234 <param name="adata_format" value="mtx"/> 233 <param name="adata_format" value="mtx"/>
235 <param name="matrix" value="matrix_10x_v1.2.0.mtx"/> 234 <param name="matrix" value="matrix_10x_v1.2.0.mtx"/>
236 <conditional name="tenx"> 235 <conditional name="tenx">
237 <param name="use" value="legacy_10x"/> 236 <param name="use" value="legacy_10x"/>
291 </assert_contents> 290 </assert_contents>
292 </output> 291 </output>
293 </test> 292 </test>
294 </tests> 293 </tests>
295 <help><![CDATA[ 294 <help><![CDATA[
295
296 **What it does** 296 **What it does**
297 297
298 This tool creates an AnnData or loom dataset from several input types: 298 This tool creates an AnnData or loom dataset from several input types:
299 299
300 - Loom (`read_loom method <https://anndata.readthedocs.io/en/latest/anndata.read_loom.html>`__) 300 - Loom (`read_loom method <https://anndata.readthedocs.io/en/latest/anndata.read_loom.html>`__)