Mercurial > repos > iuc > anndata_import
comparison import.xml @ 0:69e2275406fd draft
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/anndata/ commit 2e16aca90c4fc6f13bd024eed43bc4adbf5967da
author | iuc |
---|---|
date | Wed, 10 Apr 2019 03:23:36 -0400 |
parents | |
children | e175d4067b00 |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:69e2275406fd |
---|---|
1 <tool id="anndata_import" name="Import AnnData" version="@VERSION@+@GALAXY_VERSION@"> | |
2 <description>from different format</description> | |
3 <macros> | |
4 <import>macros.xml</import> | |
5 <xml name="params_10x"> | |
6 <param name="barcodes" type="data" format="tabular,txt" label="Barcodes"/> | |
7 <param name="var_names" type="select" label="Variables index"> | |
8 <option value="gene_symbols">gene_symbols</option> | |
9 <option value="gene_ids">gene_ids</option> | |
10 </param> | |
11 <param name="make_unique" type="boolean" truevalue="True" falsevalue="False" checked="true" label="Make the variable index unique by appending '-1', '-2'?"/> | |
12 <param name="gex_only" type="boolean" truevalue="True" falsevalue="False" checked="true" label="Keep only 'Gene Expression' data and ignore other feature types?"/> | |
13 </xml> | |
14 </macros> | |
15 <expand macro="requirements"> | |
16 | |
17 </expand> | |
18 <expand macro="version_command"/> | |
19 <command detect_errors="exit_code"><![CDATA[ | |
20 #if $in.adata_format == 'mtx' | |
21 mkdir mtx | |
22 #if $in.tenx.use == 'legacy_10x' | |
23 && cp '$in.matrix' 'mtx/matrix.mtx' | |
24 && cp '$in.tenx.genes' 'mtx/genes.tsv' | |
25 && cp '$in.tenx.barcodes' 'mtx/barcodes.tsv' | |
26 #else if $in.tenx.use == 'v3_10x' | |
27 && cp '$in.matrix' 'mtx/matrix.mtx' | |
28 && gzip 'mtx/matrix.mtx' | |
29 && cp '$in.tenx.features' 'mtx/features.tsv' | |
30 && gzip 'mtx/features.tsv' | |
31 && cp '$in.tenx.barcodes' 'mtx/barcodes.tsv' | |
32 && gzip 'mtx/barcodes.tsv' | |
33 #end if | |
34 && | |
35 #else if $in.adata_format == 'umi_tools' | |
36 gzip '$in.input' | |
37 && | |
38 #end if | |
39 | |
40 @CMD@ | |
41 | |
42 #if $in.adata_format == 'mtx' | |
43 && rm -rf mtx | |
44 #end if | |
45 ]]></command> | |
46 <configfiles> | |
47 <configfile name="script_file"><![CDATA[ | |
48 @CMD_imports@ | |
49 #if $in.adata_format == 'loom' | |
50 adata = ad.read_loom( | |
51 '$in.input', | |
52 sparse=$in.sparse, | |
53 cleanup=$in.cleanup, | |
54 X_name='$in.x_name', | |
55 obs_names='$in.obs_names', | |
56 var_names='$in.var_names') | |
57 | |
58 #else if $in.adata_format == 'tabular' | |
59 #set delimiter=$in.input.metadata.delimiter | |
60 #if $delimiter != ',' | |
61 #set delimiter='\\t' | |
62 #end if | |
63 adata = ad.read_csv( | |
64 '$in.input', | |
65 delimiter='$delimiter', | |
66 first_column_names=$in.first_column_names) | |
67 | |
68 #else if $in.adata_format == 'mtx' | |
69 #if $in.tenx.use == 'no' | |
70 adata = ad.read_mtx(filename='$in.matrix') | |
71 #else | |
72 import scanpy as sc | |
73 adata = sc.read_10x_mtx( | |
74 'mtx', | |
75 var_names='$in.tenx.var_names', | |
76 make_unique=$in.tenx.make_unique, | |
77 cache=False, | |
78 gex_only=$in.tenx.gex_only) | |
79 #end if | |
80 | |
81 #else if $in.adata_format == 'umi_tools' | |
82 adata = ad.read_umi_tools('${in.input}.gz') | |
83 | |
84 #end if | |
85 | |
86 adata.write('anndata.h5ad') | |
87 ]]></configfile> | |
88 </configfiles> | |
89 <inputs> | |
90 <conditional name="in"> | |
91 <param name="adata_format" type="select" label="Format for the annotated data matrix"> | |
92 <option value="loom">Loom</option> | |
93 <option value="tabular">Tabular, CSV, TSV</option> | |
94 <option value="mtx">Matrix Market (mtx), from Cell ranger or not</option> | |
95 <option value="umi_tools">UMI tools</option> | |
96 </param> | |
97 <when value="loom"> | |
98 <param name="input" type="data" format="loom" label="Annotated data matrix"/> | |
99 <param name="sparse" type="boolean" truevalue="True" falsevalue="False" checked="true" label="Is the data matrix to read sparse?"/> | |
100 <param name="cleanup" type="boolean" truevalue="True" falsevalue="False" checked="false" label="Cleanup?"/> | |
101 <param name="x_name" type="text" value="spliced" label="X_name"/> | |
102 <param name="obs_names" type="text" value="CellID" label="obs_names"/> | |
103 <param name="var_names" type="text" value="Gene" label="var_names"/> | |
104 </when> | |
105 <when value="tabular"> | |
106 <param name="input" type="data" format="tabular,csv,tsv" label="Annotated data matrix"/> | |
107 <param name="first_column_names" type="boolean" truevalue="True" falsevalue="False" checked="true" label="Does the first column store the row names?"/> | |
108 </when> | |
109 <when value="mtx"> | |
110 <param name="matrix" type="data" format="mtx" label="Matrix"/> | |
111 <conditional name="tenx"> | |
112 <param name="use" type="select" label="Use 10x Genomics formatted mtx"> | |
113 <option value="no">No</option> | |
114 <option value="legacy_10x">Output from Cell Ranger v2 or earlier versions</option> | |
115 <option value="v3_10x">Output from Cell Ranger v3 or later versions</option> | |
116 </param> | |
117 <when value="no"/> | |
118 <when value="legacy_10x"> | |
119 <param name="genes" type="data" format="tabular" label="Genes"/> | |
120 <expand macro="params_10x"/> | |
121 </when> | |
122 <when value="v3_10x"> | |
123 <param name="features" type="data" format="tabular" label="Features"/> | |
124 <expand macro="params_10x"/> | |
125 </when> | |
126 </conditional> | |
127 </when> | |
128 <when value="umi_tools"> | |
129 <param name="input" type="data" format="tabular" label="condensed count matrix from UMI tools"/> | |
130 </when> | |
131 </conditional> | |
132 </inputs> | |
133 <outputs> | |
134 <data name="anndata" format="h5ad" from_work_dir="anndata.h5ad" label="${tool.name} on ${on_string}"/> | |
135 </outputs> | |
136 <tests> | |
137 <test> | |
138 <conditional name="in"> | |
139 <param name="adata_format" value="loom"/> | |
140 <param name="input" value="krumsiek11.loom" /> | |
141 <param name="sparse" value="True"/> | |
142 <param name="cleanup" value="False"/> | |
143 <param name="x_name" value="spliced"/> | |
144 <param name="obs_names" value="CellID" /> | |
145 <param name="var_names" value="Gene"/> | |
146 </conditional> | |
147 <assert_stdout> | |
148 <has_text_matching expression="ad.read_loom"/> | |
149 <has_text_matching expression="sparse=True"/> | |
150 <has_text_matching expression="cleanup=False"/> | |
151 <has_text_matching expression="X_name='spliced'"/> | |
152 <has_text_matching expression="obs_names='CellID'"/> | |
153 <has_text_matching expression="var_names='Gene'"/> | |
154 </assert_stdout> | |
155 <output name="anndata" value="import.loom.krumsiek11.h5ad" ftype="h5ad" compare="sim_size"/> | |
156 </test> | |
157 <test> | |
158 <conditional name="in"> | |
159 <param name="adata_format" value="tabular"/> | |
160 <param name="input" value="adata.csv"/> | |
161 <param name="first_column_names" value="true"/> | |
162 </conditional> | |
163 <assert_stdout> | |
164 <has_text_matching expression="ad.read_csv"/> | |
165 <has_text_matching expression="delimiter=','"/> | |
166 <has_text_matching expression="first_column_names=True"/> | |
167 </assert_stdout> | |
168 <output name="anndata" value="import.csv.h5ad" ftype="h5ad" compare="sim_size"/> | |
169 </test> | |
170 <test> | |
171 <conditional name="in"> | |
172 <param name="adata_format" value="tabular"/> | |
173 <param name="input" value="adata.tsv"/> | |
174 <param name="first_column_names" value="true"/> | |
175 </conditional> | |
176 <assert_stdout> | |
177 <has_text_matching expression="ad.read_csv"/> | |
178 <has_text_matching expression="delimiter='\\t'"/> | |
179 <has_text_matching expression="first_column_names=True"/> | |
180 </assert_stdout> | |
181 <output name="anndata" value="import.tsv.h5ad" ftype="h5ad" compare="sim_size"/> | |
182 </test> | |
183 <!--<test> | |
184 <conditional name="in"> | |
185 <param name="adata_format" value="mtx"/> | |
186 <param name="matrix" value="matrix_10x_v1.2.0.mtx"/> | |
187 <conditional name="tenx"> | |
188 <param name="use" value="no"/> | |
189 </conditional> | |
190 </conditional> | |
191 <output name="anndata" value="import.mtx.no_10x.h5ad" ftype="h5ad" compare="sim_size"/> | |
192 </test> | |
193 <test> | |
194 <conditional name="in"> | |
195 <param name="adata_format" value="mtx"/> | |
196 <param name="matrix" value="matrix_10x_v1.2.0.mtx"/> | |
197 <conditional name="tenx"> | |
198 <param name="use" value="legacy_10x"/> | |
199 <param name="genes" value="genes_10x_v1.2.0.tsv"/> | |
200 <param name="barcodes" value="barcodes_10x_v1.2.0.tsv"/> | |
201 <param name="var_names" value="gene_symbols"/> | |
202 <param name="make_unique" value="true"/> | |
203 <param name="gex_only" value="true"/> | |
204 </conditional> | |
205 </conditional> | |
206 <output name="anndata" value="import.mtx.legacy_10x.h5ad" ftype="h5ad" compare="sim_size"/> | |
207 </test> | |
208 <test> | |
209 <conditional name="in"> | |
210 <param name="adata_format" value="mtx"/> | |
211 <param name="matrix" value="matrix_10x_v3.0.0.mtx"/> | |
212 <conditional name="tenx"> | |
213 <param name="use" value="v3_10x"/> | |
214 <param name="features" value="features_10x_v3.0.0.tsv"/> | |
215 <param name="barcodes" value="barcodes_10x_v3.0.0.tsv"/> | |
216 <param name="var_names" value="gene_symbols"/> | |
217 <param name="make_unique" value="true"/> | |
218 <param name="gex_only" value="true"/> | |
219 </conditional> | |
220 </conditional> | |
221 <output name="anndata" value="import.mtx.v3_10x.h5ad" ftype="h5ad" compare="sim_size"/> | |
222 </test>!--> | |
223 <test> | |
224 <conditional name="in"> | |
225 <param name="adata_format" value="umi_tools"/> | |
226 <param name="input" value="umi_tools.tsv"/> | |
227 </conditional> | |
228 <output name="anndata" value="import.umi_tools.h5ad" ftype="h5ad" compare="sim_size"/> | |
229 </test> | |
230 </tests> | |
231 <help><![CDATA[ | |
232 **What it does** | |
233 | |
234 This tool creates an AnnData dataset from several input types: | |
235 | |
236 - Loom (`read_loom method <https://anndata.readthedocs.io/en/latest/anndata.read_loom.html>`__) | |
237 - Tabular (`read_csv method <https://anndata.readthedocs.io/en/latest/anndata.read_csv.html>`__) | |
238 - Matrix Market (mtx), from Cell ranger or not (`read_mtx method <https://anndata.readthedocs.io/en/latest/anndata.read_mtx.html>`__) | |
239 - UMI tools (`read_umi_tools method <https://anndata.readthedocs.io/en/latest/anndata.read_umi_tools.html>`__) | |
240 | |
241 @HELP@ | |
242 ]]></help> | |
243 <expand macro="citations"/> | |
244 </tool> |