comparison squidpy_spatial.xml @ 0:be0e7952e229 draft

planemo upload for repository https://github.com/goeckslab/tools-mti/tree/main/tools/squidpy commit ee16860018eba110ff845d62b18396db22abd91e
author goeckslab
date Mon, 29 Aug 2022 23:20:54 +0000
parents
children bad34051dc8a
comparison
equal deleted inserted replaced
-1:000000000000 0:be0e7952e229
1 <tool id="squidpy_spatial" name="Squidpy Graph and Plotting" version="@TOOL_VERSION@+galaxy@VERSION_SUFFIX@" profile="@PROFILE@">
2 <description>for spatial analysis </description>
3 <macros>
4 <import>main_macros.xml</import>
5 </macros>
6 <expand macro="squidpy_requirements"/>
7 <expand macro="macro_stdio" />
8 <version_command>echo "@TOOL_VERSION@"</version_command>
9 <command>
10 <![CDATA[
11 python '$__tool_directory__/squidpy_spatial.py'
12 --inputs '$inputs'
13 --anndata '$anndata'
14 --output '$output'
15 #if $analyses.selected_tool in ['nhood_enrichment', 'centrality_scores', 'interaction_matrix', 'ligrec', 'ripley', 'co_occurrence']:
16 --output_plot "`pwd`/image.png"
17 #end if
18
19 ]]>
20 </command>
21 <configfiles>
22 <inputs name="inputs" data_style="paths"/>
23 </configfiles>
24 <inputs>
25 <param name="anndata" type="data" format="h5ad" label="Select the input anndata" />
26 <conditional name="analyses">
27 <param name="selected_tool" type="select" label="Select an analysis">
28 <option value="spatial_neighbors" selected="true">Spatial neighbors -- Create a graph from spatial coordinates</option>
29 <option value="nhood_enrichment">nhood_enrichment -- Compute neighborhood enrichment by permutation test.</option>
30 <option value="co_occurrence" >co_occurrence -- Compute co-occurrence probability of clusters</option>
31 <option value="centrality_scores">centrality_scores -- Compute centrality scores per cluster or cell type</option>
32 <option value="interaction_matrix">interaction_matrix -- Compute interaction matrix for clusters</option>
33 <option value="ripley">ripley -- Calculate various Ripley’s statistics for point processes</option>
34 <option value="ligrec">ligrec -- Perform the permutation test as described in [Efremova et al., 2020]</option>
35 <option value="spatial_autocorr">spatial_autocorr -- Calculate Global Autocorrelation Statistic (Moran’s I or Geary’s C)</option>
36 <option value="sepal">sepal -- Identify spatially variable genes with Sepal</option>
37 </param>
38 <when value="spatial_neighbors">
39 <expand macro="squidpy_spatial_options">
40 <param argument="spatial_key" type="text" value="spatial" optional="false" label="The Key where spatial coordinates are stored" help="Key in `anndata.AnnData.obsm`." />
41 <param argument="coord_type" type="select" label="Type of coordinate system">
42 <option value="grid" selected="true">grid</option>
43 <option value="generic">generic</option>
44 <option value="none">None - use `grid` when `spatial_key` is in `anndata.AnnData.uns with `n_neighs` = 6 (Visium), otherwise `generic`</option>
45 </param>
46 <param argument="n_neighs" type="integer" value="6" label="Number of neighboring tiles" help="When the `coord_type` is generic, this's number of neighborhoods for non-grid data and only used when `delaunay` is False." />
47 <param argument="radius" type="text" value="" optional="true" label="Radius" help="Only available when coord_type = 'generic'. If float, this is the neighborhood radius to compute the graph; if tuple, this is edge range [min(radius), max(radius)] used prune the final graph." />
48 <param argument="delaunay" type="boolean" checked="false" optional="true" label="Whether to compute the graph from Delaunay triangulation" help="Only used when coord_type = 'generic'." />
49 <param argument="n_rings" type="integer" value="1" label="Number of rings of neighbors for grid data" help="Only used when coord_type = 'grid'." />
50 <param argument="transform" type="select" label="Type of adjacency matrix transform">
51 <option value="none" selected="true">None</option>
52 <option value="spectral">spectral</option>
53 <option value="cosine">cosine</option>
54 </param>
55 <param argument="set_diag" type="boolean" checked="false" label="Whether to set the diagonal of the spatial connectivities to 1.0" />
56 <param argument="key_added" type="text" value="spatial" label="The column name used in anndata to store the returned data" />
57 </expand>
58 </when>
59 <when value="nhood_enrichment">
60 <param argument="cluster_key" type="text" value="" optional="false" label="Key in anndata.AnnData.obs where clustering is stored" />
61 <expand macro="squidpy_spatial_options">
62 <param argument="connectivity_key" type="text" value="" optional="true" label="Key in anndata.AnnData.obsp where spatial connectivities are stored" />
63 <param argument="n_perms" type="integer" value="1000" label="Number of permutations for the permutation test" />
64 <param argument="numba_parallel" type="select" label="Whether to use numba.prange or not">
65 <option value="false" selected="true">No -- Recommended for small datasets or small number of interactions</option>
66 <option value="true">Yes</option>
67 <option value="none">Auto</option>
68 </param>
69 <param argument="seed" type="integer" value="" optional="true" label="Randomness seed" />
70 </expand>
71 <expand macro="squidpy_plotting_options_more">
72 <param argument="mode" type="select" label="Choose one result from gr.nhood_enrichment to plot">
73 <option value="zscore" selected="true">zscore</option>
74 <option value="count">count</option>
75 </param>
76 </expand>
77 </when>
78 <when value="co_occurrence">
79 <param argument="cluster_key" type="text" value="" optional="false" label="Key in anndata.AnnData.obs where clustering is stored" />
80 <expand macro="squidpy_spatial_options">
81 <param argument="spatial_key" type="text" value="spatial" optional="false" label="The Key where spatial coordinates are stored" help="Key in `anndata.AnnData.obsm`." />
82 <param argument="n_steps" type="integer" value="50" label="Number of distance thresholds at which co-occurrence is computed" />
83 <param argument="n_splits" type="integer" value="" optional="true" label="Number of splits in which to divide the spatial coordinates" help="In anndata.AnnData.obsm ['{spatial_key}']." />
84 </expand>
85 <expand macro="squidpy_plotting_options">
86 <expand macro="squidpy_plotting_option_palette" />
87 </expand>
88 </when>
89 <when value="centrality_scores">
90 <param argument="cluster_key" type="text" value="" optional="false" label="Key in anndata.AnnData.obs where clustering is stored" />
91 <expand macro="squidpy_spatial_options">
92 <param argument="score" type="select" label="Centrality measures as described in networkx.algorithms.centrality" help="Refer to [Hagberg et al., 2008]." >
93 <option value="none" selected="true">None</option>
94 <option value="closeness_centrality">closeness_centrality -- measure of how close the group is to other nodes</option>
95 <option value="average_clustering">average_clustering -- measure of the degree to which nodes cluster together</option>
96 <option value="degree_centrality">degree_centrality -- fraction of non-group members connected to group members</option>
97 </param>
98 <param argument="connectivity_key" type="text" value="" optional="true" label="Key in anndata.AnnData.obsp where spatial connectivities are stored" />
99 </expand>
100 <expand macro="squidpy_plotting_options">
101 <param argument="score" type="text" value="" optional="true" label="The scores to plot" help="Comma delimited for multiple. If None, plot all scores." />
102 <expand macro="squidpy_plotting_option_palette" />
103 </expand>
104 </when>
105 <when value="interaction_matrix">
106 <param argument="cluster_key" type="text" value="" optional="false" label="Key in anndata.AnnData.obs where clustering is stored" />
107 <expand macro="squidpy_spatial_options">
108 <param argument="connectivity_key" type="text" value="" optional="true" label="Key in anndata.AnnData.obsp where spatial connectivities are stored" />
109 <param argument="normalized" type="boolean" checked="false" label="Whether to normalize the sum of each row to 1" />
110 <param argument="weights" type="boolean" checked="false" label="Whether to use edge weights or binarize" />
111 </expand>
112 <expand macro="squidpy_plotting_options_more"/>
113 </when>
114 <when value="ripley">
115 <param argument="cluster_key" type="text" value="" optional="false" label="Key in anndata.AnnData.obs where clustering is stored" />
116 <expand macro="squidpy_spatial_options">
117 <param argument="mode" type="select" label="Which Ripley’s statistic to compute">
118 <option value="F" selected="true">F</option>
119 <option value="G">G</option>
120 <option value="L">L</option>
121 </param>
122 <param argument="spatial_key" type="text" value="spatial" optional="false" label="The Key where spatial coordinates are stored" help="Key in `anndata.AnnData.obsm`." />
123 <param argument="metric" type="select" label="Which metric to use for computing distances" help="Refer to `sklearn.neighbors.DistanceMetric`." >
124 <option value="euclidean" selected="true">euclidean</option>
125 <option value="manhattan">manhattan</option>
126 <option value="chebyshev">chebyshev</option>
127 <option value="minkowski">minkowski</option>
128 <option value="wminkowski">wminkowski</option>
129 <option value="seuclidean">seuclidean</option>
130 <option value="mahalanobis">mahalanobis</option>
131 <option value="haversine">haversine</option>
132 <option value="hamming">hamming</option>
133 <option value="canberra">canberra</option>
134 <option value="braycurtis">braycurtis</option>
135 </param>
136 <param argument="n_neigh" type="integer" value="2" label="Number of neighbors to consider for the KNN graph" />
137 <param argument="n_simulations" type="integer" value="100" label="Number of simulations to run for computing p-values" />
138 <param argument="n_observations" type="integer" value="1000" label="Number of observations to generate for the Spatial Poisson Point Process" />
139 <param argument="max_dist" type="float" value="" optional="true" label="Maximum distances for the support" help="If None, max_dist is the square root of area/2."/>
140 <param argument="n_steps" type="integer" value="50" label="Number of steps for the support" />
141 <param argument="seed" type="integer" value="" optional="true" label="Randomness seed" />
142 </expand>
143 <expand macro="squidpy_plotting_options">
144 <param argument="mode" type="select" label="Ripley’s statistics to be plotted">
145 <option value="F" selected="true">F</option>
146 <option value="G">G</option>
147 <option value="L">L</option>
148 </param>
149 <param argument="plot_sims" type="boolean" checked="true" label="Whether to overlay simulations in the plot" />
150 <expand macro="squidpy_plotting_option_palette" />
151 </expand>
152 </when>
153 <when value="ligrec">
154 <param argument="cluster_key" type="text" value="" optional="false" label="Key in anndata.AnnData.obs where clustering is stored" />
155 <expand macro="squidpy_spatial_options">
156 <param argument="use_raw" type="boolean" checked="true" label="Whether to access anndata.AnnData.raw" />
157 <param argument="interactions" type="data" format="tabular" optional="true" label="Select the dataset containing interaction to test" help="Must contain at least 2 columns named ‘source’ and ‘target’. Can be null, a condition under which the interactions are extracted from omnipath." />
158 <param argument="complex_policy" type="select" label="Policy on how to handle complexes">
159 <option value="min" selected="true">min -- select gene with the minimum average expression</option>
160 <option value="all">all -- select all possible combinations between ‘source’ and ‘target’ complexes</option>
161 </param>
162 <param argument="n_perms" type="integer" value="" optional="true" label="Number of permutations for the permutation test." />
163 <param argument="threshold" type="float" value="0.01" label="Do not perform permutation test if any of the interacting components is being expressed in less than threshold percent of cells within a given cluster" />
164 <param argument="corr_method" type="select" label="Correction method for multiple testing">
165 <option value="none" selected="true">None</option>
166 <option value="bonferroni">bonferroni</option>
167 <option value="sidak">sidak</option>
168 <option value="holm-sidak">holm-sidak</option>
169 <option value="holm">holm</option>
170 <option value="simes-hochberg">simes-hochberg</option>
171 <option value="hommel">hommel</option>
172 <option value="fdr_bh">fdr_bh</option>
173 <option value="fdr_by">fdr_by</option>
174 <option value="fdr_tsbh">fdr_tsbh</option>
175 <option value="fdr_tsbky">fdr_tsbky</option>
176 </param>
177 <param argument="corr_axis" type="select" label="Axis over which to perform the FDR correction" help="Only used when corr_method != None.">
178 <option value="clusters" selected="true">clusters -- correct clusters by performing FDR correction across the interactions</option>
179 <option value="interactions">interactions -- correct interactions by performing FDR correction across the clusters</option>
180 </param>
181 <param argument="numba_parallel" type="select" label="Whether to use numba.prange or not">
182 <option value="false" selected="true">No -- Recommended for small datasets or small number of interactions</option>
183 <option value="true">Yes</option>
184 <option value="none">Auto</option>
185 </param>
186 <param argument="key_added" type="text" value="" optional="true" label="Key in anndata to store the result" help="In `anndata.AnnData.uns`. If None, '{cluster_key}_ligrec' will be used." />
187 <param argument="gene_symbols" type="text" value="" optional="true" label="Key in anndata.AnnData.var to use instead of anndata.AnnData.var_names" help="Optional." />
188 <param argument="seed" type="integer" value="" label="Randomness seed" />
189 </expand>
190 <expand macro="squidpy_plotting_options">
191 <param argument="source_groups" type="text" value="" optional="true" label="Source interaction clusters" help="Comma delimited. If None, select all clusters." />
192 <param argument="target_groups" type="text" value="" optional="true" label="Target interaction clusters" help="Comma delimited. If None, select all clusters." />
193 <param argument="means_range" type="text" value="(-inf, inf)" label="Only show interactions whose means are within this closed interval" help="Tuple of floats. e.g.: (-10, 10)." />
194 <param argument="pvalue_threshold" type="float" value="1.0" label="Only show interactions with p-value less than this threshold" />
195 <param argument="remove_empty_interactions" type="boolean" checked="true" label="Whether to remove rows and columns that only contain interactions with NaN values?" />
196 <param argument="remove_nonsig_interactions" type="boolean" checked="false" label="Whether to remove rows and columns that only contain interactions that are larger than `alpha`? " />
197 <param argument="dendrogram" type="select" label="How to cluster based on the p-values?">
198 <option value="none" selected="true">None</option>
199 <option value="interacting_molecules">interacting_molecules</option>
200 <option value="interacting_clusters">interacting_clusters</option>
201 <option value="both">both</option>
202 </param>
203 <param argument="alpha" type="float" value="0.001" label="Significance threshold" help="All elements with p-values less than alpha will be marked by tori instead of dots." />
204 <param argument="swap_axes" type="boolean" checked="false" label="Whether to show the cluster combinations as rows and the interacting pairs as columns" />
205 </expand>
206 </when>
207 <when value="spatial_autocorr">
208 <expand macro="squidpy_spatial_options">
209 <param argument="connectivity_key" type="text" value="spatial_connectivities" label="Key in anndata.AnnData.obsp where spatial connectivities are stored" />
210 <param argument="genes" type="text" value="" optional="true" label="List of gene names, as stored in anndata.AnnData.var_names" help="Comma delitimited. Used to compute global spatial autocorrelation statistic. If None, it’s computed anndata.AnnData.var ['highly_variable']." />
211 <param argument="mode" type="select">
212 <option value="moran" selected="true">moran</option>
213 <option value="geary">geary</option>
214 </param>
215 <param argument="transformation" type="boolean" checked="true" label="Whether to perform row-normalization on weights in anndata.AnnData.obsp ['spatial_connectivities']" />
216 <param argument="n_perms" type="integer" value="" optional="true" label="Number of permutations for the permutation test." help="If None, only p-values under normality assumption are computed"/>
217 <param argument="two_tailed" type="boolean" checked="false" label="Are the p-values two-tailed?" help="One-tailed, if False." />
218 <param argument="corr_method" type="select" label="Correction method for multiple testing">
219 <option value="none" selected="true">None</option>
220 <option value="bonferroni">bonferroni</option>
221 <option value="sidak">sidak</option>
222 <option value="holm-sidak">holm-sidak</option>
223 <option value="holm">holm</option>
224 <option value="simes-hochberg">simes-hochberg</option>
225 <option value="hommel">hommel</option>
226 <option value="fdr_bh">fdr_bh</option>
227 <option value="fdr_by">fdr_by</option>
228 <option value="fdr_tsbh">fdr_tsbh</option>
229 <option value="fdr_tsbky">fdr_tsbky</option>
230 </param>
231 <param argument="layer" type="text" value="" optional="true" label="Layer in anndata.AnnData.layers to use" help="If None, use anndata.AnnData.X." />
232 <param argument="seed" type="integer" value="" optional="true" label="Randomness seed" />
233 </expand>
234 </when>
235 <when value="sepal">
236 <expand macro="squidpy_spatial_options">
237 <param argument="max_neighs" type="select" label="Maximum number of neighbors of a node in the graph">
238 <option value="4" selected="true">4 -- for a square-grid (ST, Dbit-seq)</option>
239 <option value="6">6 -- for a hexagonal-grid (Visium)</option>
240 </param>
241 <param argument="genes" type="text" value="" optional="true" label="List of gene names, as stored in anndata.AnnData.var_names" help="Comma delitimited. Used to compute global spatial autocorrelation statistic. If None, it’s computed anndata.AnnData.var ['highly_variable']." />
242 <param argument="n_iter" type="integer" value="30000" optional="true" label="Maximum number of iterations for the diffusion simulation" />
243 <param argument="dt" type="float" value="0.001" label="Time step in diffusion simulation" />
244 <param argument="thresh" type="float" value="1e-8" label="Entropy threshold for convergence of diffusion simulation" />
245 <param argument="spatial_key" type="text" value="spatial" optional="false" label="The Key where spatial coordinates are stored" help="Key in `anndata.AnnData.obsm`." />
246 <param argument="connectivity_key" type="text" value="spatial_connectivities" label="Key in anndata.AnnData.obsp where spatial connectivities are stored" />
247 <param argument="layer" type="text" value="" optional="true" label="Layer in anndata.AnnData.layers to use" help="If None, use anndata.AnnData.X." />
248 <param argument="use_raw" type="boolean" checked="true" label="Whether to access anndata.AnnData.raw" />
249 </expand>
250 </when>
251 </conditional>
252 </inputs>
253 <outputs>
254 <data format="h5ad" name="output" label="Squidpy.gr.${analyses.selected_tool} on ${on_string}" />
255 <data from_work_dir="image.png" format="png" name="output_plot" label="Squidpy.pl.${analyses.selected_tool} on ${on_string}" >
256 <filter>analyses['selected_tool'] in ['nhood_enrichment', 'centrality_scores', 'interaction_matrix', 'ligrec', 'ripley', 'co_occurrence']</filter>
257 </data>
258 </outputs>
259 <tests>
260 <test>
261 <param name="anndata" value="imc.h5ad" ftype="h5ad" />
262 <param name="selected_tool" value="spatial_neighbors" />
263 <output name="output">
264 <assert_contents>
265 <has_h5_keys keys="uns/spatial_neighbors" />
266 </assert_contents>
267 </output>
268 </test>
269 <test>
270 <param name="anndata" value="imc_sn.h5ad" ftype="h5ad" />
271 <param name="selected_tool" value="nhood_enrichment" />
272 <param name="cluster_key" value="cell type" />
273 <output name="output">
274 <assert_contents>
275 <has_h5_keys keys="uns/cell type_nhood_enrichment" />
276 </assert_contents>
277 </output>
278 <output name="output_plot" file="imc_nhood_enrichment.png" compare="sim_size" delta="2000" />
279 </test>
280 <test>
281 <param name="anndata" value="imc_sn.h5ad" ftype="h5ad" />
282 <param name="selected_tool" value="co_occurrence" />
283 <param name="cluster_key" value="cell type" />
284 <output name="output">
285 <assert_contents>
286 <has_h5_keys keys="uns/cell type_co_occurrence" />
287 </assert_contents>
288 </output>
289 <output name="output_plot" file="imc_co_occurrence.png" compare="sim_size" delta="2000" />
290 </test>
291 <test>
292 <param name="anndata" value="imc_sn.h5ad" ftype="h5ad" />
293 <param name="selected_tool" value="centrality_scores" />
294 <param name="cluster_key" value="cell type" />
295 <output name="output">
296 <assert_contents>
297 <has_h5_keys keys="uns/cell type_centrality_scores" />
298 </assert_contents>
299 </output>
300 <output name="output_plot" file="imc_centrality_scores.png" compare="sim_size" delta="2000" />
301 </test>
302 <test>
303 <param name="anndata" value="imc_sn.h5ad" ftype="h5ad" />
304 <param name="selected_tool" value="interaction_matrix" />
305 <param name="cluster_key" value="cell type" />
306 <output name="output">
307 <assert_contents>
308 <has_h5_keys keys="uns/cell type_interactions" />
309 </assert_contents>
310 </output>
311 <output name="output_plot" file="imc_interaction_matrix.png" compare="sim_size" delta="2000" />
312 </test>
313 <test>
314 <param name="anndata" value="imc_sn.h5ad" ftype="h5ad" />
315 <param name="selected_tool" value="ripley" />
316 <param name="cluster_key" value="cell type" />
317 <output name="output">
318 <assert_contents>
319 <has_h5_keys keys="uns/cell type_ripley_F" />
320 </assert_contents>
321 </output>
322 <output name="output_plot" file="imc_ripley.png" compare="sim_size" delta="2000" />
323 </test>
324 </tests>
325 <help>
326 <![CDATA[
327 **What it does**
328
329 This tool includes various of single cell spatial analysis utils provided by Squidpy.
330
331 **Input**
332
333 *AnnData*
334
335 **Output**
336
337 *Anndata*
338
339 *Plotting (PNG) if applicable*
340
341
342 ]]>
343 </help>
344 <citations>
345 </citations>
346 </tool>