comparison dimension_reduction_clustering.xml @ 0:af821711b356 draft

planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/snapatac2 commit be132b56781bede5dc6e020aa80ca315546666cd
author iuc
date Thu, 16 May 2024 13:15:57 +0000
parents
children 8f8bef61fd0b
comparison
equal deleted inserted replaced
-1:000000000000 0:af821711b356
1 <tool id="snapatac2_clustering" name="SnapATAC2 Clustering" version="@TOOL_VERSION@+galaxy@VERSION_SUFFIX@" profile="@PROFILE@">
2 <description>and dimension reduction</description>
3 <macros>
4 <import>macros.xml</import>
5 </macros>
6 <requirements>
7 <expand macro="requirements"/>
8 </requirements>
9 <command detect_errors="exit_code"><![CDATA[
10 export NUMBA_CACHE_DIR="\${TEMP:-/tmp}";
11 @PREP_ADATA@
12 @CMD@
13 ]]></command>
14 <configfiles>
15 <configfile name="script_file"><![CDATA[
16
17 @CMD_imports@
18 @CMD_read_inputs@
19
20 #if $method.method == 'tl.spectral'
21 #if $method.features
22 with open('$method.features') as f:
23 features_mask = [x.lower().capitalize() == "True" for x in f.read().splitlines()]
24 #end if
25 sa.tl.spectral(
26 adata,
27 n_comps = $method.n_comps,
28 #if $method.features
29 features = features_mask,
30 #end if
31 random_state = $method.random_state,
32 #if $method.sample_size
33 sample_size = $method.sample_size,
34 #end if
35 chunk_size = $method.chunk_size,
36 distance_metric = '$method.distance_metric',
37 weighted_by_sd = $method.weighted_by_sd,
38 inplace = True
39 )
40
41 #else if $method.method == 'tl.umap'
42 sa.tl.umap(
43 adata,
44 n_comps = $method.n_comps,
45 #if $method.use_dims != ''
46 #set $dims = ([x.strip() for x in str($method.use_dims).split(',')])
47 use_dims=$dims,
48 #end if
49 use_rep = '$method.use_rep',
50 key_added = '$method.key_added',
51 random_state = $method.random_state,
52 inplace = True
53 )
54
55 #else if $method.method == 'pp.knn'
56 sa.pp.knn(
57 adata,
58 n_neighbors = $method.n_neighbors,
59 #if $method.use_dims != ''
60 #set $dims = ([x.strip() for x in str($method.use_dims).split(',')])
61 use_dims=$dims,
62 #end if
63 use_rep = '$method.use_rep',
64 method = '$method.algorithm',
65 inplace = True,
66 random_state = $method.random_state
67 )
68
69 #else if $method.method == 'tl.dbscan'
70 sa.tl.dbscan(
71 adata,
72 eps = $method.eps,
73 min_samples = $method.min_samples,
74 leaf_size = $method.leaf_size,
75 use_rep = '$method.use_rep',
76 key_added = '$method.key_added'
77 )
78
79 #else if $method.method == 'tl.hdbscan'
80 sa.tl.hdbscan(
81 adata,
82 min_cluster_size = $method.min_cluster_size,
83 #if $method.min_samples
84 min_samples = $method.min_samples,
85 #end if
86 cluster_selection_epsilon = $method.cluster_selection_epsilon,
87 alpha = $method.alpha,
88 cluster_selection_method = '$method.cluster_selection_method',
89 random_state = $method.random_state,
90 use_rep = '$method.use_rep',
91 key_added = '$method.key_added'
92 )
93
94 #else if $method.method == 'tl.leiden'
95 sa.tl.leiden(
96 adata,
97 resolution = $method.resolution,
98 objective_function = '$method.objective_function',
99 min_cluster_size = $method.min_cluster_size,
100 n_iterations = $method.n_iterations,
101 random_state = $method.random_state,
102 key_added = '$method.key_added',
103 weighted = $method.weighted,
104 inplace = True
105 )
106
107 #else if $method.method == 'tl.kmeans'
108 sa.tl.kmeans(
109 adata,
110 n_clusters = $method.n_clusters,
111 n_iterations = $method.n_iterations,
112 random_state = $method.random_state,
113 use_rep = '$method.use_rep',
114 key_added = '$method.key_added'
115 )
116
117 #else if $method.method == 'tl.aggregate_X'
118 sa.tl.aggregate_X(
119 adata,
120 #if $method.groupby != ''
121 groupby = '$method.groupby',
122 #end if
123 normalize = '$method.normalize'
124 )
125
126 #else if $method.method == 'tl.aggregate_cells'
127 sa.tl.aggregate_cells(
128 adata,
129 use_rep = '$method.use_rep',
130 #if $method.target_num_cells
131 target_num_cells = $method.target_num_cells,
132 #end if
133 min_cluster_size = $method.min_cluster_size,
134 random_state = $method.random_state,
135 key_added = '$method.key_added',
136 inplace = True
137 )
138 #end if
139
140 @CMD_anndata_write_outputs@
141 ]]></configfile>
142 </configfiles>
143 <inputs>
144 <conditional name="method">
145 <param name="method" type="select" label="Dimension reduction and Clustering">
146 <option value="tl.spectral">Perform dimension reduction using Laplacian Eigenmap, using 'tl.spectral'</option>
147 <option value="tl.umap">Compute Umap, using 'tl.umap'</option>
148 <option value="pp.knn">Compute a neighborhood graph of observations, using 'pp.knn'</option>
149 <option value="tl.leiden">Cluster cells into subgroups, using 'tl.leiden'</option>
150 <option value="tl.kmeans">Cluster cells into subgroups using the K-means algorithm, using 'tl.kmeans'</option>
151 <option value="tl.dbscan">Cluster cells into subgroups using the DBSCAN algorithm, using 'tl.dbscan'</option>
152 <option value="tl.hdbscan">Cluster cells into subgroups using the HDBSCAN algorithm, using 'tl.hdbscan'</option>
153 <option value="tl.aggregate_X">Aggregate values in adata.X in a row-wise fashion, using 'tl.aggregate_X'</option>
154 <option value="tl.aggregate_cells">Aggregate cells into pseudo-cells, using 'tl.aggregate_cells'</option>
155 </param>
156 <when value="tl.spectral">
157 <expand macro="inputs_anndata"/>
158 <expand macro="param_n_comps"/>
159 <param argument="features" type="data" format="txt" optional="true" label="Text file indicating features to keep. Each line contains only word (True/False)." help="True means that the feature is kept. False means the feature is removed"/>
160 <expand macro="param_random_state"/>
161 <param argument="sample_size" type="float" min="0" max="1" optional="true" label="Approximate the embedding using the Nystrom algorithm by selecting a subset of cells" help="Using this only when the number of cells is too large, e.g. &gt; 10,000,000, or the `distance_metric` is “jaccard”"/>
162 <param argument="chunk_size" type="integer" value="20000" label="chunk size"/>
163 <param argument="distance_metric" type="select" label="distance metric: “jaccard”, “cosine“">
164 <option value="jaccard">jaccard</option>
165 <option value="cosine">cosine</option>
166 </param>
167 <param argument="weighted_by_sd" type="boolean" truevalue="True" falsevalue="False" checked="true" label="Whether to weight the result eigenvectors by the square root of eigenvalues"/>
168 </when>
169 <when value="tl.umap">
170 <expand macro="inputs_anndata"/>
171 <param argument="n_comps" type="integer" value="2" label="Number of dimensions of embedding"/>
172 <param argument="use_dims" type="text" optional="true" label="Use these dimensions in `use_rep`" help="comma separated list of dimensions">
173 <expand macro="sanitize_query"/>
174 </param>
175 <expand macro="param_use_rep"/>
176 <expand macro="param_key_added" key_added="umap"/>
177 <expand macro="param_random_state"/>
178 </when>
179 <when value="pp.knn">
180 <expand macro="inputs_anndata"/>
181 <param argument="n_neighbors" type="integer" value="50" label="The number of nearest neighbors to be searched"/>
182 <param argument="use_dims" type="text" value="" optional="true" label="The dimensions used for computation">
183 <expand macro="sanitize_query"/>
184 </param>
185 <param argument="use_rep" type="text" value="X_spectral" label="The key for the matrix"/>
186 <param argument="algorithm" type="select" label="Choose method">
187 <option value="kdtree" selected="true">'kdtree': use the kdtree algorithm to find the nearest neighbors</option>
188 <option value="hora">'hora': use the HNSW algorithm to find the approximate nearest neighbors</option>
189 <option value="pynndescent">'pynndescent': use the pynndescent algorithm to find the approximate nearest neighbors</option>
190 </param>
191 <param argument="random_state" type="integer" value="0" label="Random seed for approximate nearest neighbor search"/>
192 </when>
193 <when value="tl.leiden">
194 <expand macro="inputs_anndata"/>
195 <param argument="resolution" type="float" value="1" label="Parameter value controlling the coarseness of the clustering" help="Higher values lead to more clusters"/>
196 <param argument="objective_function" type="select" label="Whether to use the Constant Potts Model (CPM) or modularity">
197 <option value="CPM">CPM</option>
198 <option value="modularity">modularity</option>
199 <option value="RBConfiguration">RBConfiguration</option>
200 </param>
201 <param argument="min_cluster_size" type="integer" value="5" label="The minimum size of clusters"/>
202 <expand macro="param_n_iterations"/>
203 <expand macro="param_random_state"/>
204 <expand macro="param_key_added" key_added="leiden"/>
205 <param argument="weighted" type="boolean" truevalue="True" falsevalue="False" label="Whether to use the edge weights in the graph"/>
206 </when>
207 <when value="tl.kmeans">
208 <expand macro="inputs_anndata"/>
209 <param argument="n_clusters" type="integer" value="5" label="Number of clusters to return"/>
210 <expand macro="param_n_iterations"/>
211 <expand macro="param_random_state"/>
212 <expand macro="param_use_rep"/>
213 <expand macro="param_key_added" key_added="kmeans"/>
214 </when>
215 <when value="tl.dbscan">
216 <expand macro="inputs_anndata"/>
217 <param argument="eps" type="float" value="0.5" label=" The maximum distance between two samples for one to be considered as in the neighborhood of the other" help="This is not a maximum bound on the distances of points within a cluster. This is the most important DBSCAN parameter to choose appropriately for your data set and distance function."/>
218 <param argument="min_samples" type="integer" value="5" label="The number of samples (or total weight) in a neighborhood for a point to be considered as a core point."/>
219 <param argument="leaf_size" type="integer" value="30" label="Leaf size passed to BallTree or cKDTree" help="This can affect the speed of the construction and query, as well as the memory required to store the tree."/>
220 <expand macro="param_use_rep"/>
221 <expand macro="param_key_added" key_added="dbscan"/>
222 </when>
223 <when value="tl.hdbscan">
224 <expand macro="inputs_anndata"/>
225 <param argument="min_cluster_size" type="integer" value="5" label="The minimum size of clusters"/>
226 <param argument="min_samples" type="integer" value="" optional="true" label="The number of samples in a neighbourhood for a point to be considered a core point"/>
227 <param argument="cluster_selection_epsilon" type="float" value="0.0" label="A distance threshold. Clusters below this value will be merged"/>
228 <param argument="alpha" type="float" value="1.0" label="A distance scaling parameter as used in robust single linkage"/>
229 <param argument="cluster_selection_method" type="select" label="The method used to select clusters from the condensed tree">
230 <option value="eom">Excess of Mass algorithm to find the most persistent clusters</option>
231 <option value="leaf">Select the clusters at the leaves of the tree - this provides the most fine grained and homogeneous clusters</option>
232 </param>
233 <expand macro="param_random_state"/>
234 <expand macro="param_use_rep"/>
235 <expand macro="param_key_added" key_added="hdbscan"/>
236 </when>
237 <when value="tl.aggregate_X">
238 <expand macro="inputs_anndata"/>
239 <expand macro="param_groupby"/>
240 <param argument="normalize" type="select" optional="true" label="normalization method">
241 <option value="RPM">RPM</option>
242 <option value="RPKM">RPKM</option>
243 </param>
244 </when>
245 <when value="tl.aggregate_cells">
246 <expand macro="inputs_anndata"/>
247 <expand macro="param_use_rep"/>
248 <param argument="target_num_cells" type="integer" value="" optional="true" label="target_num_cells" help="If None, `target_num_cells = num_cells / min_cluster_size`"/>
249 <param argument="min_cluster_size" type="integer" value="50" label="The minimum size of clusters"/>
250 <expand macro="param_random_state"/>
251 <expand macro="param_key_added" key_added="pseudo_cell"/>
252 </when>
253 </conditional>
254 <expand macro="inputs_common_advanced"/>
255 </inputs>
256 <outputs>
257 <data name="anndata_out" format="h5ad" from_work_dir="anndata.h5ad" label="${tool.name} (${method.method}) on ${on_string}: Annotated data matrix"/>
258 <data name="hidden_output" format="txt" label="Log file">
259 <filter>advanced_common['show_log']</filter>
260 </data>
261 <data name="diff_peaks" format="tabular" from_work_dir="differential_peaks.tsv" label="${tool.name} on ${on_string}: Differential peaks">
262 <filter>method['method'] and 'tl.diff_test' in method['method']</filter>
263 </data>
264 </outputs>
265 <tests>
266 <test expect_num_outputs="2">
267 <!-- tl.spectral -->
268 <conditional name="method">
269 <param name="method" value="tl.spectral"/>
270 <param name="adata" location="https://zenodo.org/records/11199963/files/pp.select_features.pbmc_500_chr21.h5ad"/>
271 <param name="n_comps" value="30"/>
272 <param name="random_state" value="0"/>
273 <param name="chunk_size" value="20000"/>
274 <param name="distance_metric" value="jaccard"/>
275 <param name="weighted_by_sd" value="True"/>
276 </conditional>
277 <section name="advanced_common">
278 <param name="show_log" value="true"/>
279 </section>
280 <output name="hidden_output">
281 <assert_contents>
282 <has_text_matching expression="sa.tl.spectral"/>
283 <has_text_matching expression="random_state = 0"/>
284 <has_text_matching expression="n_comps = 30"/>
285 <has_text_matching expression="chunk_size = 20000"/>
286 <has_text_matching expression="distance_metric = 'jaccard'"/>
287 <has_text_matching expression="weighted_by_sd = True"/>
288 </assert_contents>
289 </output>
290 <output name="anndata_out" ftype="h5ad" compare="sim_size" delta_frac="0.1" location="https://zenodo.org/records/11199963/files/tl.spectral.pbmc_500_chr21.h5ad"/>
291 </test>
292 <test expect_num_outputs="2">
293 <!-- tl.umap -->
294 <conditional name="method">
295 <param name="method" value="tl.umap"/>
296 <param name="adata" location="https://zenodo.org/records/11199963/files/tl.spectral.pbmc_500_chr21.h5ad"/>
297 <param name="n_comps" value="2"/>
298 <param name="use_rep" value="X_spectral"/>
299 <param name="key_added" value="umap"/>
300 <param name="random_state" value="0"/>
301 </conditional>
302 <section name="advanced_common">
303 <param name="show_log" value="true"/>
304 </section>
305 <output name="hidden_output">
306 <assert_contents>
307 <has_text_matching expression="sa.tl.umap"/>
308 <has_text_matching expression="n_comps = 2"/>
309 <has_text_matching expression="use_rep = 'X_spectral'"/>
310 <has_text_matching expression="key_added = 'umap'"/>
311 <has_text_matching expression="random_state = 0"/>
312 </assert_contents>
313 </output>
314 <output name="anndata_out" ftype="h5ad" compare="sim_size" delta_frac="0.1" location="https://zenodo.org/records/11199963/files/tl.umap.pbmc_500_chr21.h5ad"/>
315 </test>
316 <test expect_num_outputs="2">
317 <!-- pp.knn -->
318 <conditional name="method">
319 <param name="method" value="pp.knn"/>
320 <param name="adata" location="https://zenodo.org/records/11199963/files/tl.umap.pbmc_500_chr21.h5ad"/>
321 <param name="n_neighbors" value="50"/>
322 <param name="use_rep" value="X_spectral"/>
323 <param name="method_" value="kdtree"/>
324 <param name="inplace" value="True"/>
325 <param name="random_state" value="0"/>
326 </conditional>
327 <section name="advanced_common">
328 <param name="show_log" value="true"/>
329 </section>
330 <output name="hidden_output">
331 <assert_contents>
332 <has_text_matching expression="sa.pp.knn"/>
333 <has_text_matching expression="n_neighbors = 50"/>
334 <has_text_matching expression="use_rep = 'X_spectral'"/>
335 <has_text_matching expression="method = 'kdtree'"/>
336 <has_text_matching expression="inplace = True"/>
337 <has_text_matching expression="random_state = 0"/>
338 </assert_contents>
339 </output>
340 <output name="anndata_out" ftype="h5ad" compare="sim_size" delta_frac="0.1" location="https://zenodo.org/records/11199963/files/pp.knn.pbmc_500_chr21.h5ad"/>
341 </test>
342 <test expect_num_outputs="2">
343 <!-- tl.leiden -->
344 <conditional name="method">
345 <param name="method" value="tl.leiden"/>
346 <param name="adata" location="https://zenodo.org/records/11199963/files/pp.knn.pbmc_500_chr21.h5ad"/>
347 <param name="resolution" value="2"/>
348 <param name="objective_function" value="modularity"/>
349 <param name="min_cluster_size" value="3"/>
350 <param name="n_iterations" value="-1"/>
351 <param name="random_state" value="0"/>
352 <param name="key_added" value="leiden"/>
353 <param name="weighted" value="False"/>
354 </conditional>
355 <section name="advanced_common">
356 <param name="show_log" value="true"/>
357 </section>
358 <output name="hidden_output">
359 <assert_contents>
360 <has_text_matching expression="sa.tl.leiden"/>
361 <has_text_matching expression="resolution = 2"/>
362 <has_text_matching expression="objective_function = 'modularity'"/>
363 <has_text_matching expression="min_cluster_size = 3"/>
364 <has_text_matching expression="n_iterations = -1"/>
365 <has_text_matching expression="random_state = 0"/>
366 <has_text_matching expression="key_added = 'leiden'"/>
367 <has_text_matching expression="weighted = False"/>
368 </assert_contents>
369 </output>
370 <output name="anndata_out" ftype="h5ad" compare="sim_size" delta_frac="0.1" location="https://zenodo.org/records/11199963/files/tl.leiden.pbmc_500_chr21.h5ad"/>
371 </test>
372 <test expect_num_outputs="2">
373 <!-- tl.kmeans -->
374 <conditional name="method">
375 <param name="method" value="tl.kmeans"/>
376 <param name="adata" location="https://zenodo.org/records/11199963/files/tl.spectral.pbmc_500_chr21.h5ad"/>
377 <param name="n_iterations" value="-1"/>
378 <param name="random_state" value="0"/>
379 <param name="use_rep" value="X_spectral"/>
380 <param name="key_added" value="kmeans"/>
381 </conditional>
382 <section name="advanced_common">
383 <param name="show_log" value="true"/>
384 </section>
385 <output name="hidden_output">
386 <assert_contents>
387 <has_text_matching expression="sa.tl.kmeans"/>
388 <has_text_matching expression="n_iterations = -1"/>
389 <has_text_matching expression="random_state = 0"/>
390 <has_text_matching expression="use_rep = 'X_spectral'"/>
391 <has_text_matching expression="key_added = 'kmeans'"/>
392 </assert_contents>
393 </output>
394 <output name="anndata_out" ftype="h5ad" compare="sim_size" delta_frac="0.1" location="https://zenodo.org/records/11199963/files/tl.kmeans.pbmc_500_chr21.h5ad"/>
395 </test>
396 <test expect_num_outputs="2">
397 <!-- tl.dbscan -->
398 <conditional name="method">
399 <param name="method" value="tl.dbscan"/>
400 <param name="adata" location="https://zenodo.org/records/11199963/files/tl.spectral.pbmc_500_chr21.h5ad"/>
401 <param name="eps" value="0.5"/>
402 <param name="min_samples" value="3"/>
403 <param name="leaf_size" value="5"/>
404 <param name="use_rep" value="X_spectral"/>
405 <param name="key_added" value="dbscan"/>
406 </conditional>
407 <section name="advanced_common">
408 <param name="show_log" value="true"/>
409 </section>
410 <output name="hidden_output">
411 <assert_contents>
412 <has_text_matching expression="sa.tl.dbscan"/>
413 <has_text_matching expression="eps = 0.5"/>
414 <has_text_matching expression="min_samples = 3"/>
415 <has_text_matching expression="leaf_size = 5"/>
416 <has_text_matching expression="use_rep = 'X_spectral'"/>
417 <has_text_matching expression="key_added = 'dbscan'"/>
418 </assert_contents>
419 </output>
420 <output name="anndata_out" ftype="h5ad" compare="sim_size" delta_frac="0.1" location="https://zenodo.org/records/11199963/files/tl.dbscan.pbmc_500_chr21.h5ad"/>
421 </test>
422 <test expect_num_outputs="2">
423 <!-- tl.hdbscan -->
424 <conditional name="method">
425 <param name="method" value="tl.hdbscan"/>
426 <param name="adata" location="https://zenodo.org/records/11199963/files/tl.spectral.pbmc_500_chr21.h5ad"/>
427 <param name="min_cluster_size" value="3"/>
428 <param name="min_samples" value="3"/>
429 <param name="cluster_selection_method" value="eom"/>
430 <param name="random_state" value="0"/>
431 <param name="use_rep" value="X_spectral"/>
432 <param name="key_added" value="hdbscan"/>
433 </conditional>
434 <section name="advanced_common">
435 <param name="show_log" value="true"/>
436 </section>
437 <output name="hidden_output">
438 <assert_contents>
439 <has_text_matching expression="sa.tl.hdbscan"/>
440 <has_text_matching expression="min_cluster_size = 3"/>
441 <has_text_matching expression="min_samples = 3"/>
442 <has_text_matching expression="cluster_selection_method = 'eom'"/>
443 <has_text_matching expression="random_state = 0"/>
444 <has_text_matching expression="use_rep = 'X_spectral'"/>
445 <has_text_matching expression="key_added = 'hdbscan'"/>
446 </assert_contents>
447 </output>
448 <output name="anndata_out" ftype="h5ad" compare="sim_size" delta_frac="0.1" location="https://zenodo.org/records/11199963/files/tl.hdbscan.pbmc_500_chr21.h5ad"/>
449 </test>
450 <test expect_num_outputs="2">
451 <!-- tl.aggregate_X -->
452 <conditional name="method">
453 <param name="method" value="tl.aggregate_X"/>
454 <param name="adata" location="https://zenodo.org/records/11199963/files/tl.spectral.pbmc_500_chr21.h5ad"/>
455 <param name="normalize" value="RPKM"/>
456 </conditional>
457 <section name="advanced_common">
458 <param name="show_log" value="true"/>
459 </section>
460 <output name="hidden_output">
461 <assert_contents>
462 <has_text_matching expression="sa.tl.aggregate_X"/>
463 <has_text_matching expression="normalize = 'RPKM'"/>
464 </assert_contents>
465 </output>
466 <output name="anndata_out" ftype="h5ad" compare="sim_size" delta_frac="0.1" location="https://zenodo.org/records/11199963/files/tl.aggregate_X.pbmc_500_chr21.h5ad"/>
467 </test>
468 <test expect_num_outputs="2">
469 <!-- tl.aggregate_cells -->
470 <conditional name="method">
471 <param name="method" value="tl.aggregate_cells"/>
472 <param name="adata" location="https://zenodo.org/records/11199963/files/tl.spectral.pbmc_500_chr21.h5ad"/>
473 <param name="use_rep" value="X_spectral"/>
474 <param name="target_num_cells" value="5"/>
475 <param name="min_cluster_size" value="3"/>
476 <param name="random_state" value="0"/>
477 <param name="key_added" value="pseudo_cell"/>
478 </conditional>
479 <section name="advanced_common">
480 <param name="show_log" value="true"/>
481 </section>
482 <output name="hidden_output">
483 <assert_contents>
484 <has_text_matching expression="sa.tl.aggregate_cells"/>
485 <has_text_matching expression="use_rep = 'X_spectral'"/>
486 <has_text_matching expression="target_num_cells = 5"/>
487 <has_text_matching expression="min_cluster_size = 3"/>
488 <has_text_matching expression="random_state = 0"/>
489 <has_text_matching expression="key_added = 'pseudo_cell'"/>
490 </assert_contents>
491 </output>
492 <output name="anndata_out" ftype="h5ad" compare="sim_size" delta_frac="0.1" location="https://zenodo.org/records/11199963/files/tl.aggregate_cells.pbmc_500_chr21.h5ad"/>
493 </test>
494 </tests>
495 <help><![CDATA[
496 Perform dimension reduction using Laplacian Eigenmap, using `tl.spectral`
497 =========================================================================
498
499 Perform dimension reduction using Laplacian Eigenmaps.
500
501 Convert the cell-by-feature count matrix into lower dimensional representations using the spectrum of the normalized graph Laplacian defined by pairwise similarity between cells. This function utilizes the matrix-free spectral embedding algorithm to compute the embedding when `distance_metric` is “cosine”, which scales linearly with the number of cells. For other types of similarity metrics, the time and space complexity scale quadratically with the number of cells.
502
503 More details on the `SnapATAC2 documentation
504 <https://kzhang.org/SnapATAC2/api/_autosummary/snapatac2.tl.spectral.html>`__
505
506 Compute Umap, using `tl.umap`
507 =============================
508
509 Compute Umap
510
511 More details on the `SnapATAC2 documentation
512 <https://kzhang.org/SnapATAC2/api/_autosummary/snapatac2.tl.umap.html>`__
513
514 Compute a neighborhood graph of observations, using `pp.knn`
515 ============================================================
516
517 Compute a neighborhood graph of observations.
518
519 Computes a neighborhood graph of observations stored in adata using the method specified by method. The distance metric used is Euclidean.
520
521 More details on the `SnapATAC2 documentation
522 <https://kzhang.org/SnapATAC2/api/_autosummary/snapatac2.pp.knn.html>`__
523
524 Cluster cells into subgroups, using `tl.leiden`
525 ===============================================
526
527 Cluster cells into subgroups.
528
529 Cluster cells using the Leiden algorithm, an improved version of the Louvain algorithm. It has been proposed for single-cell analysis by. This requires having ran `knn`.
530
531 More details on the `SnapATAC2 documentation
532 <https://kzhang.org/SnapATAC2/api/_autosummary/snapatac2.tl.leiden.html>`__
533
534 Cluster cells into subgroups using the K-means algorithm, using `tl.kmeans`
535 ===========================================================================
536
537 Cluster cells into subgroups using the K-means algorithm, a classical algorithm in data mining.
538
539 More details on the `SnapATAC2 documentation
540 <https://kzhang.org/SnapATAC2/api/_autosummary/snapatac2.tl.kmeans.html>`__
541
542 Cluster cells into subgroups using the DBSCAN algorithm, using `tl.dbscan`
543 ==========================================================================
544
545 Cluster cells into subgroups using the DBSCAN algorithm.
546
547 More details on the `SnapATAC2 documentation
548 <https://kzhang.org/SnapATAC2/api/_autosummary/snapatac2.tl.dbscan.html>`__
549
550 Cluster cells into subgroups using the HDBSCAN algorithm, using `tl.hdbscan`
551 ============================================================================
552
553 Cluster cells into subgroups using the HDBSCAN algorithm.
554
555 More details on the `SnapATAC2 documentation
556 <https://kzhang.org/SnapATAC2/api/_autosummary/snapatac2.tl.hdbscan.html>`__
557
558 Aggregate values in adata.X in a row-wise fashion, using `tl.aggregate_X`
559 =========================================================================
560
561 Aggregate values in adata.X in a row-wise fashion.
562
563 Aggregate values in adata.X in a row-wise fashion. This is used to compute RPKM or RPM values stratified by user-provided groupings.
564
565 More details on the `SnapATAC2 documentation
566 <https://kzhang.org/SnapATAC2/api/_autosummary/snapatac2.tl.aggregate_X.html>`__
567
568 Aggregate cells into pseudo-cells, using `tl.aggregate_cells`
569 =============================================================
570
571 Aggregate cells into pseudo-cells.
572
573 Aggregate cells into pseudo-cells by iterative clustering.
574
575 More details on the `SnapATAC2 documentation
576 <https://kzhang.org/SnapATAC2/api/_autosummary/snapatac2.tl.aggregate_cells.html>`__
577 ]]></help>
578 <expand macro="citations"/>
579 </tool>