Mercurial > repos > goeckslab > squidpy_spatial
annotate squidpy_spatial.py @ 0:5b17a47d1ade draft
planemo upload for repository https://github.com/goeckslab/tools-mti/tree/main/tools/squidpy commit 721eaced787aa3b04d96ad91f6b4540f26b23949
author | goeckslab |
---|---|
date | Thu, 11 Jul 2024 22:22:41 +0000 |
parents | |
children |
rev | line source |
---|---|
0
5b17a47d1ade
planemo upload for repository https://github.com/goeckslab/tools-mti/tree/main/tools/squidpy commit 721eaced787aa3b04d96ad91f6b4540f26b23949
goeckslab
parents:
diff
changeset
|
1 import argparse |
5b17a47d1ade
planemo upload for repository https://github.com/goeckslab/tools-mti/tree/main/tools/squidpy commit 721eaced787aa3b04d96ad91f6b4540f26b23949
goeckslab
parents:
diff
changeset
|
2 import ast |
5b17a47d1ade
planemo upload for repository https://github.com/goeckslab/tools-mti/tree/main/tools/squidpy commit 721eaced787aa3b04d96ad91f6b4540f26b23949
goeckslab
parents:
diff
changeset
|
3 import json |
5b17a47d1ade
planemo upload for repository https://github.com/goeckslab/tools-mti/tree/main/tools/squidpy commit 721eaced787aa3b04d96ad91f6b4540f26b23949
goeckslab
parents:
diff
changeset
|
4 import warnings |
5b17a47d1ade
planemo upload for repository https://github.com/goeckslab/tools-mti/tree/main/tools/squidpy commit 721eaced787aa3b04d96ad91f6b4540f26b23949
goeckslab
parents:
diff
changeset
|
5 |
5b17a47d1ade
planemo upload for repository https://github.com/goeckslab/tools-mti/tree/main/tools/squidpy commit 721eaced787aa3b04d96ad91f6b4540f26b23949
goeckslab
parents:
diff
changeset
|
6 import pandas as pd |
5b17a47d1ade
planemo upload for repository https://github.com/goeckslab/tools-mti/tree/main/tools/squidpy commit 721eaced787aa3b04d96ad91f6b4540f26b23949
goeckslab
parents:
diff
changeset
|
7 import squidpy as sq |
5b17a47d1ade
planemo upload for repository https://github.com/goeckslab/tools-mti/tree/main/tools/squidpy commit 721eaced787aa3b04d96ad91f6b4540f26b23949
goeckslab
parents:
diff
changeset
|
8 from anndata import read_h5ad |
5b17a47d1ade
planemo upload for repository https://github.com/goeckslab/tools-mti/tree/main/tools/squidpy commit 721eaced787aa3b04d96ad91f6b4540f26b23949
goeckslab
parents:
diff
changeset
|
9 |
5b17a47d1ade
planemo upload for repository https://github.com/goeckslab/tools-mti/tree/main/tools/squidpy commit 721eaced787aa3b04d96ad91f6b4540f26b23949
goeckslab
parents:
diff
changeset
|
10 |
5b17a47d1ade
planemo upload for repository https://github.com/goeckslab/tools-mti/tree/main/tools/squidpy commit 721eaced787aa3b04d96ad91f6b4540f26b23949
goeckslab
parents:
diff
changeset
|
11 def main(inputs, anndata, output, output_plot): |
5b17a47d1ade
planemo upload for repository https://github.com/goeckslab/tools-mti/tree/main/tools/squidpy commit 721eaced787aa3b04d96ad91f6b4540f26b23949
goeckslab
parents:
diff
changeset
|
12 """ |
5b17a47d1ade
planemo upload for repository https://github.com/goeckslab/tools-mti/tree/main/tools/squidpy commit 721eaced787aa3b04d96ad91f6b4540f26b23949
goeckslab
parents:
diff
changeset
|
13 Parameter |
5b17a47d1ade
planemo upload for repository https://github.com/goeckslab/tools-mti/tree/main/tools/squidpy commit 721eaced787aa3b04d96ad91f6b4540f26b23949
goeckslab
parents:
diff
changeset
|
14 --------- |
5b17a47d1ade
planemo upload for repository https://github.com/goeckslab/tools-mti/tree/main/tools/squidpy commit 721eaced787aa3b04d96ad91f6b4540f26b23949
goeckslab
parents:
diff
changeset
|
15 inputs : str |
5b17a47d1ade
planemo upload for repository https://github.com/goeckslab/tools-mti/tree/main/tools/squidpy commit 721eaced787aa3b04d96ad91f6b4540f26b23949
goeckslab
parents:
diff
changeset
|
16 File path to galaxy tool parameter. |
5b17a47d1ade
planemo upload for repository https://github.com/goeckslab/tools-mti/tree/main/tools/squidpy commit 721eaced787aa3b04d96ad91f6b4540f26b23949
goeckslab
parents:
diff
changeset
|
17 anndata : str |
5b17a47d1ade
planemo upload for repository https://github.com/goeckslab/tools-mti/tree/main/tools/squidpy commit 721eaced787aa3b04d96ad91f6b4540f26b23949
goeckslab
parents:
diff
changeset
|
18 File path to anndata containing phenotyping info. |
5b17a47d1ade
planemo upload for repository https://github.com/goeckslab/tools-mti/tree/main/tools/squidpy commit 721eaced787aa3b04d96ad91f6b4540f26b23949
goeckslab
parents:
diff
changeset
|
19 output : str |
5b17a47d1ade
planemo upload for repository https://github.com/goeckslab/tools-mti/tree/main/tools/squidpy commit 721eaced787aa3b04d96ad91f6b4540f26b23949
goeckslab
parents:
diff
changeset
|
20 File path to output. |
5b17a47d1ade
planemo upload for repository https://github.com/goeckslab/tools-mti/tree/main/tools/squidpy commit 721eaced787aa3b04d96ad91f6b4540f26b23949
goeckslab
parents:
diff
changeset
|
21 output_plot: str or None |
5b17a47d1ade
planemo upload for repository https://github.com/goeckslab/tools-mti/tree/main/tools/squidpy commit 721eaced787aa3b04d96ad91f6b4540f26b23949
goeckslab
parents:
diff
changeset
|
22 File path to save the plotting image. |
5b17a47d1ade
planemo upload for repository https://github.com/goeckslab/tools-mti/tree/main/tools/squidpy commit 721eaced787aa3b04d96ad91f6b4540f26b23949
goeckslab
parents:
diff
changeset
|
23 """ |
5b17a47d1ade
planemo upload for repository https://github.com/goeckslab/tools-mti/tree/main/tools/squidpy commit 721eaced787aa3b04d96ad91f6b4540f26b23949
goeckslab
parents:
diff
changeset
|
24 warnings.simplefilter('ignore') |
5b17a47d1ade
planemo upload for repository https://github.com/goeckslab/tools-mti/tree/main/tools/squidpy commit 721eaced787aa3b04d96ad91f6b4540f26b23949
goeckslab
parents:
diff
changeset
|
25 |
5b17a47d1ade
planemo upload for repository https://github.com/goeckslab/tools-mti/tree/main/tools/squidpy commit 721eaced787aa3b04d96ad91f6b4540f26b23949
goeckslab
parents:
diff
changeset
|
26 with open(inputs, 'r') as param_handler: |
5b17a47d1ade
planemo upload for repository https://github.com/goeckslab/tools-mti/tree/main/tools/squidpy commit 721eaced787aa3b04d96ad91f6b4540f26b23949
goeckslab
parents:
diff
changeset
|
27 params = json.load(param_handler) |
5b17a47d1ade
planemo upload for repository https://github.com/goeckslab/tools-mti/tree/main/tools/squidpy commit 721eaced787aa3b04d96ad91f6b4540f26b23949
goeckslab
parents:
diff
changeset
|
28 |
5b17a47d1ade
planemo upload for repository https://github.com/goeckslab/tools-mti/tree/main/tools/squidpy commit 721eaced787aa3b04d96ad91f6b4540f26b23949
goeckslab
parents:
diff
changeset
|
29 adata = read_h5ad(anndata) |
5b17a47d1ade
planemo upload for repository https://github.com/goeckslab/tools-mti/tree/main/tools/squidpy commit 721eaced787aa3b04d96ad91f6b4540f26b23949
goeckslab
parents:
diff
changeset
|
30 |
5b17a47d1ade
planemo upload for repository https://github.com/goeckslab/tools-mti/tree/main/tools/squidpy commit 721eaced787aa3b04d96ad91f6b4540f26b23949
goeckslab
parents:
diff
changeset
|
31 if 'spatial' not in adata.obsm: |
5b17a47d1ade
planemo upload for repository https://github.com/goeckslab/tools-mti/tree/main/tools/squidpy commit 721eaced787aa3b04d96ad91f6b4540f26b23949
goeckslab
parents:
diff
changeset
|
32 try: |
5b17a47d1ade
planemo upload for repository https://github.com/goeckslab/tools-mti/tree/main/tools/squidpy commit 721eaced787aa3b04d96ad91f6b4540f26b23949
goeckslab
parents:
diff
changeset
|
33 adata.obsm['spatial'] = adata.obs[['X_centroid', 'Y_centroid']].values |
5b17a47d1ade
planemo upload for repository https://github.com/goeckslab/tools-mti/tree/main/tools/squidpy commit 721eaced787aa3b04d96ad91f6b4540f26b23949
goeckslab
parents:
diff
changeset
|
34 except Exception as e: |
5b17a47d1ade
planemo upload for repository https://github.com/goeckslab/tools-mti/tree/main/tools/squidpy commit 721eaced787aa3b04d96ad91f6b4540f26b23949
goeckslab
parents:
diff
changeset
|
35 print(e) |
5b17a47d1ade
planemo upload for repository https://github.com/goeckslab/tools-mti/tree/main/tools/squidpy commit 721eaced787aa3b04d96ad91f6b4540f26b23949
goeckslab
parents:
diff
changeset
|
36 |
5b17a47d1ade
planemo upload for repository https://github.com/goeckslab/tools-mti/tree/main/tools/squidpy commit 721eaced787aa3b04d96ad91f6b4540f26b23949
goeckslab
parents:
diff
changeset
|
37 tool = params['analyses']['selected_tool'] |
5b17a47d1ade
planemo upload for repository https://github.com/goeckslab/tools-mti/tree/main/tools/squidpy commit 721eaced787aa3b04d96ad91f6b4540f26b23949
goeckslab
parents:
diff
changeset
|
38 tool_func = getattr(sq.gr, tool) |
5b17a47d1ade
planemo upload for repository https://github.com/goeckslab/tools-mti/tree/main/tools/squidpy commit 721eaced787aa3b04d96ad91f6b4540f26b23949
goeckslab
parents:
diff
changeset
|
39 |
5b17a47d1ade
planemo upload for repository https://github.com/goeckslab/tools-mti/tree/main/tools/squidpy commit 721eaced787aa3b04d96ad91f6b4540f26b23949
goeckslab
parents:
diff
changeset
|
40 options = params['analyses']['options'] |
5b17a47d1ade
planemo upload for repository https://github.com/goeckslab/tools-mti/tree/main/tools/squidpy commit 721eaced787aa3b04d96ad91f6b4540f26b23949
goeckslab
parents:
diff
changeset
|
41 |
5b17a47d1ade
planemo upload for repository https://github.com/goeckslab/tools-mti/tree/main/tools/squidpy commit 721eaced787aa3b04d96ad91f6b4540f26b23949
goeckslab
parents:
diff
changeset
|
42 for k, v in options.items(): |
5b17a47d1ade
planemo upload for repository https://github.com/goeckslab/tools-mti/tree/main/tools/squidpy commit 721eaced787aa3b04d96ad91f6b4540f26b23949
goeckslab
parents:
diff
changeset
|
43 if not isinstance(v, str): |
5b17a47d1ade
planemo upload for repository https://github.com/goeckslab/tools-mti/tree/main/tools/squidpy commit 721eaced787aa3b04d96ad91f6b4540f26b23949
goeckslab
parents:
diff
changeset
|
44 continue |
5b17a47d1ade
planemo upload for repository https://github.com/goeckslab/tools-mti/tree/main/tools/squidpy commit 721eaced787aa3b04d96ad91f6b4540f26b23949
goeckslab
parents:
diff
changeset
|
45 |
5b17a47d1ade
planemo upload for repository https://github.com/goeckslab/tools-mti/tree/main/tools/squidpy commit 721eaced787aa3b04d96ad91f6b4540f26b23949
goeckslab
parents:
diff
changeset
|
46 if v in ('', 'none'): |
5b17a47d1ade
planemo upload for repository https://github.com/goeckslab/tools-mti/tree/main/tools/squidpy commit 721eaced787aa3b04d96ad91f6b4540f26b23949
goeckslab
parents:
diff
changeset
|
47 options[k] = None |
5b17a47d1ade
planemo upload for repository https://github.com/goeckslab/tools-mti/tree/main/tools/squidpy commit 721eaced787aa3b04d96ad91f6b4540f26b23949
goeckslab
parents:
diff
changeset
|
48 continue |
5b17a47d1ade
planemo upload for repository https://github.com/goeckslab/tools-mti/tree/main/tools/squidpy commit 721eaced787aa3b04d96ad91f6b4540f26b23949
goeckslab
parents:
diff
changeset
|
49 |
5b17a47d1ade
planemo upload for repository https://github.com/goeckslab/tools-mti/tree/main/tools/squidpy commit 721eaced787aa3b04d96ad91f6b4540f26b23949
goeckslab
parents:
diff
changeset
|
50 if k == 'genes': # for spatial_autocorr and sepal |
5b17a47d1ade
planemo upload for repository https://github.com/goeckslab/tools-mti/tree/main/tools/squidpy commit 721eaced787aa3b04d96ad91f6b4540f26b23949
goeckslab
parents:
diff
changeset
|
51 options[k] = [e.strip() for e in v.split(',')] |
5b17a47d1ade
planemo upload for repository https://github.com/goeckslab/tools-mti/tree/main/tools/squidpy commit 721eaced787aa3b04d96ad91f6b4540f26b23949
goeckslab
parents:
diff
changeset
|
52 elif k == 'radius': # for spatial_neighbors |
5b17a47d1ade
planemo upload for repository https://github.com/goeckslab/tools-mti/tree/main/tools/squidpy commit 721eaced787aa3b04d96ad91f6b4540f26b23949
goeckslab
parents:
diff
changeset
|
53 options[k] = ast.literal_eval(v) |
5b17a47d1ade
planemo upload for repository https://github.com/goeckslab/tools-mti/tree/main/tools/squidpy commit 721eaced787aa3b04d96ad91f6b4540f26b23949
goeckslab
parents:
diff
changeset
|
54 elif k == 'interactions': # for ligrec |
5b17a47d1ade
planemo upload for repository https://github.com/goeckslab/tools-mti/tree/main/tools/squidpy commit 721eaced787aa3b04d96ad91f6b4540f26b23949
goeckslab
parents:
diff
changeset
|
55 options[k] = pd.read_csv(v, sep="\t") |
5b17a47d1ade
planemo upload for repository https://github.com/goeckslab/tools-mti/tree/main/tools/squidpy commit 721eaced787aa3b04d96ad91f6b4540f26b23949
goeckslab
parents:
diff
changeset
|
56 elif k == 'max_neighs': |
5b17a47d1ade
planemo upload for repository https://github.com/goeckslab/tools-mti/tree/main/tools/squidpy commit 721eaced787aa3b04d96ad91f6b4540f26b23949
goeckslab
parents:
diff
changeset
|
57 options[k] = int(v) # for sepal |
5b17a47d1ade
planemo upload for repository https://github.com/goeckslab/tools-mti/tree/main/tools/squidpy commit 721eaced787aa3b04d96ad91f6b4540f26b23949
goeckslab
parents:
diff
changeset
|
58 |
5b17a47d1ade
planemo upload for repository https://github.com/goeckslab/tools-mti/tree/main/tools/squidpy commit 721eaced787aa3b04d96ad91f6b4540f26b23949
goeckslab
parents:
diff
changeset
|
59 cluster_key = params['analyses'].get('cluster_key') |
5b17a47d1ade
planemo upload for repository https://github.com/goeckslab/tools-mti/tree/main/tools/squidpy commit 721eaced787aa3b04d96ad91f6b4540f26b23949
goeckslab
parents:
diff
changeset
|
60 if cluster_key: |
5b17a47d1ade
planemo upload for repository https://github.com/goeckslab/tools-mti/tree/main/tools/squidpy commit 721eaced787aa3b04d96ad91f6b4540f26b23949
goeckslab
parents:
diff
changeset
|
61 tool_func(adata, cluster_key, **options) |
5b17a47d1ade
planemo upload for repository https://github.com/goeckslab/tools-mti/tree/main/tools/squidpy commit 721eaced787aa3b04d96ad91f6b4540f26b23949
goeckslab
parents:
diff
changeset
|
62 else: |
5b17a47d1ade
planemo upload for repository https://github.com/goeckslab/tools-mti/tree/main/tools/squidpy commit 721eaced787aa3b04d96ad91f6b4540f26b23949
goeckslab
parents:
diff
changeset
|
63 tool_func(adata, **options) |
5b17a47d1ade
planemo upload for repository https://github.com/goeckslab/tools-mti/tree/main/tools/squidpy commit 721eaced787aa3b04d96ad91f6b4540f26b23949
goeckslab
parents:
diff
changeset
|
64 |
5b17a47d1ade
planemo upload for repository https://github.com/goeckslab/tools-mti/tree/main/tools/squidpy commit 721eaced787aa3b04d96ad91f6b4540f26b23949
goeckslab
parents:
diff
changeset
|
65 if output_plot: |
5b17a47d1ade
planemo upload for repository https://github.com/goeckslab/tools-mti/tree/main/tools/squidpy commit 721eaced787aa3b04d96ad91f6b4540f26b23949
goeckslab
parents:
diff
changeset
|
66 plotting_options = params['analyses']['plotting_options'] |
5b17a47d1ade
planemo upload for repository https://github.com/goeckslab/tools-mti/tree/main/tools/squidpy commit 721eaced787aa3b04d96ad91f6b4540f26b23949
goeckslab
parents:
diff
changeset
|
67 for k, v in plotting_options.items(): |
5b17a47d1ade
planemo upload for repository https://github.com/goeckslab/tools-mti/tree/main/tools/squidpy commit 721eaced787aa3b04d96ad91f6b4540f26b23949
goeckslab
parents:
diff
changeset
|
68 if not isinstance(v, str): |
5b17a47d1ade
planemo upload for repository https://github.com/goeckslab/tools-mti/tree/main/tools/squidpy commit 721eaced787aa3b04d96ad91f6b4540f26b23949
goeckslab
parents:
diff
changeset
|
69 continue |
5b17a47d1ade
planemo upload for repository https://github.com/goeckslab/tools-mti/tree/main/tools/squidpy commit 721eaced787aa3b04d96ad91f6b4540f26b23949
goeckslab
parents:
diff
changeset
|
70 |
5b17a47d1ade
planemo upload for repository https://github.com/goeckslab/tools-mti/tree/main/tools/squidpy commit 721eaced787aa3b04d96ad91f6b4540f26b23949
goeckslab
parents:
diff
changeset
|
71 if v in ('', 'none'): |
5b17a47d1ade
planemo upload for repository https://github.com/goeckslab/tools-mti/tree/main/tools/squidpy commit 721eaced787aa3b04d96ad91f6b4540f26b23949
goeckslab
parents:
diff
changeset
|
72 plotting_options[k] = None |
5b17a47d1ade
planemo upload for repository https://github.com/goeckslab/tools-mti/tree/main/tools/squidpy commit 721eaced787aa3b04d96ad91f6b4540f26b23949
goeckslab
parents:
diff
changeset
|
73 continue |
5b17a47d1ade
planemo upload for repository https://github.com/goeckslab/tools-mti/tree/main/tools/squidpy commit 721eaced787aa3b04d96ad91f6b4540f26b23949
goeckslab
parents:
diff
changeset
|
74 |
5b17a47d1ade
planemo upload for repository https://github.com/goeckslab/tools-mti/tree/main/tools/squidpy commit 721eaced787aa3b04d96ad91f6b4540f26b23949
goeckslab
parents:
diff
changeset
|
75 if k == 'figsize': |
5b17a47d1ade
planemo upload for repository https://github.com/goeckslab/tools-mti/tree/main/tools/squidpy commit 721eaced787aa3b04d96ad91f6b4540f26b23949
goeckslab
parents:
diff
changeset
|
76 options[k] = ast.literal_eval(v) |
5b17a47d1ade
planemo upload for repository https://github.com/goeckslab/tools-mti/tree/main/tools/squidpy commit 721eaced787aa3b04d96ad91f6b4540f26b23949
goeckslab
parents:
diff
changeset
|
77 elif k in ('palette', 'score', 'source_groups', 'target_groups'): |
5b17a47d1ade
planemo upload for repository https://github.com/goeckslab/tools-mti/tree/main/tools/squidpy commit 721eaced787aa3b04d96ad91f6b4540f26b23949
goeckslab
parents:
diff
changeset
|
78 options[k] = [e.strip() for e in v.split(',')] |
5b17a47d1ade
planemo upload for repository https://github.com/goeckslab/tools-mti/tree/main/tools/squidpy commit 721eaced787aa3b04d96ad91f6b4540f26b23949
goeckslab
parents:
diff
changeset
|
79 elif k == 'means_range': # ligrec |
5b17a47d1ade
planemo upload for repository https://github.com/goeckslab/tools-mti/tree/main/tools/squidpy commit 721eaced787aa3b04d96ad91f6b4540f26b23949
goeckslab
parents:
diff
changeset
|
80 v = v.strip() |
5b17a47d1ade
planemo upload for repository https://github.com/goeckslab/tools-mti/tree/main/tools/squidpy commit 721eaced787aa3b04d96ad91f6b4540f26b23949
goeckslab
parents:
diff
changeset
|
81 if v[0] == '(': |
5b17a47d1ade
planemo upload for repository https://github.com/goeckslab/tools-mti/tree/main/tools/squidpy commit 721eaced787aa3b04d96ad91f6b4540f26b23949
goeckslab
parents:
diff
changeset
|
82 v = v[1:] |
5b17a47d1ade
planemo upload for repository https://github.com/goeckslab/tools-mti/tree/main/tools/squidpy commit 721eaced787aa3b04d96ad91f6b4540f26b23949
goeckslab
parents:
diff
changeset
|
83 if v[-1] == ')': |
5b17a47d1ade
planemo upload for repository https://github.com/goeckslab/tools-mti/tree/main/tools/squidpy commit 721eaced787aa3b04d96ad91f6b4540f26b23949
goeckslab
parents:
diff
changeset
|
84 v = v[:-1] |
5b17a47d1ade
planemo upload for repository https://github.com/goeckslab/tools-mti/tree/main/tools/squidpy commit 721eaced787aa3b04d96ad91f6b4540f26b23949
goeckslab
parents:
diff
changeset
|
85 options[k] = tuple([float(e.strip()) for e in v.split(',', 1)]) |
5b17a47d1ade
planemo upload for repository https://github.com/goeckslab/tools-mti/tree/main/tools/squidpy commit 721eaced787aa3b04d96ad91f6b4540f26b23949
goeckslab
parents:
diff
changeset
|
86 |
5b17a47d1ade
planemo upload for repository https://github.com/goeckslab/tools-mti/tree/main/tools/squidpy commit 721eaced787aa3b04d96ad91f6b4540f26b23949
goeckslab
parents:
diff
changeset
|
87 plotting_func = getattr(sq.pl, tool) |
5b17a47d1ade
planemo upload for repository https://github.com/goeckslab/tools-mti/tree/main/tools/squidpy commit 721eaced787aa3b04d96ad91f6b4540f26b23949
goeckslab
parents:
diff
changeset
|
88 if cluster_key: |
5b17a47d1ade
planemo upload for repository https://github.com/goeckslab/tools-mti/tree/main/tools/squidpy commit 721eaced787aa3b04d96ad91f6b4540f26b23949
goeckslab
parents:
diff
changeset
|
89 plotting_func(adata, cluster_key, save=output_plot, **plotting_options) |
5b17a47d1ade
planemo upload for repository https://github.com/goeckslab/tools-mti/tree/main/tools/squidpy commit 721eaced787aa3b04d96ad91f6b4540f26b23949
goeckslab
parents:
diff
changeset
|
90 else: # TODO Remove this, since all plottings need cluster key |
5b17a47d1ade
planemo upload for repository https://github.com/goeckslab/tools-mti/tree/main/tools/squidpy commit 721eaced787aa3b04d96ad91f6b4540f26b23949
goeckslab
parents:
diff
changeset
|
91 plotting_func(adata, save=output_plot, **plotting_options) |
5b17a47d1ade
planemo upload for repository https://github.com/goeckslab/tools-mti/tree/main/tools/squidpy commit 721eaced787aa3b04d96ad91f6b4540f26b23949
goeckslab
parents:
diff
changeset
|
92 |
5b17a47d1ade
planemo upload for repository https://github.com/goeckslab/tools-mti/tree/main/tools/squidpy commit 721eaced787aa3b04d96ad91f6b4540f26b23949
goeckslab
parents:
diff
changeset
|
93 adata.write(output) |
5b17a47d1ade
planemo upload for repository https://github.com/goeckslab/tools-mti/tree/main/tools/squidpy commit 721eaced787aa3b04d96ad91f6b4540f26b23949
goeckslab
parents:
diff
changeset
|
94 |
5b17a47d1ade
planemo upload for repository https://github.com/goeckslab/tools-mti/tree/main/tools/squidpy commit 721eaced787aa3b04d96ad91f6b4540f26b23949
goeckslab
parents:
diff
changeset
|
95 |
5b17a47d1ade
planemo upload for repository https://github.com/goeckslab/tools-mti/tree/main/tools/squidpy commit 721eaced787aa3b04d96ad91f6b4540f26b23949
goeckslab
parents:
diff
changeset
|
96 if __name__ == '__main__': |
5b17a47d1ade
planemo upload for repository https://github.com/goeckslab/tools-mti/tree/main/tools/squidpy commit 721eaced787aa3b04d96ad91f6b4540f26b23949
goeckslab
parents:
diff
changeset
|
97 aparser = argparse.ArgumentParser() |
5b17a47d1ade
planemo upload for repository https://github.com/goeckslab/tools-mti/tree/main/tools/squidpy commit 721eaced787aa3b04d96ad91f6b4540f26b23949
goeckslab
parents:
diff
changeset
|
98 aparser.add_argument("-i", "--inputs", dest="inputs", required=True) |
5b17a47d1ade
planemo upload for repository https://github.com/goeckslab/tools-mti/tree/main/tools/squidpy commit 721eaced787aa3b04d96ad91f6b4540f26b23949
goeckslab
parents:
diff
changeset
|
99 aparser.add_argument("-e", "--output", dest="output", required=True) |
5b17a47d1ade
planemo upload for repository https://github.com/goeckslab/tools-mti/tree/main/tools/squidpy commit 721eaced787aa3b04d96ad91f6b4540f26b23949
goeckslab
parents:
diff
changeset
|
100 aparser.add_argument("-a", "--anndata", dest="anndata", required=True) |
5b17a47d1ade
planemo upload for repository https://github.com/goeckslab/tools-mti/tree/main/tools/squidpy commit 721eaced787aa3b04d96ad91f6b4540f26b23949
goeckslab
parents:
diff
changeset
|
101 aparser.add_argument("-p", "--output_plot", dest="output_plot", required=False) |
5b17a47d1ade
planemo upload for repository https://github.com/goeckslab/tools-mti/tree/main/tools/squidpy commit 721eaced787aa3b04d96ad91f6b4540f26b23949
goeckslab
parents:
diff
changeset
|
102 |
5b17a47d1ade
planemo upload for repository https://github.com/goeckslab/tools-mti/tree/main/tools/squidpy commit 721eaced787aa3b04d96ad91f6b4540f26b23949
goeckslab
parents:
diff
changeset
|
103 args = aparser.parse_args() |
5b17a47d1ade
planemo upload for repository https://github.com/goeckslab/tools-mti/tree/main/tools/squidpy commit 721eaced787aa3b04d96ad91f6b4540f26b23949
goeckslab
parents:
diff
changeset
|
104 |
5b17a47d1ade
planemo upload for repository https://github.com/goeckslab/tools-mti/tree/main/tools/squidpy commit 721eaced787aa3b04d96ad91f6b4540f26b23949
goeckslab
parents:
diff
changeset
|
105 main(args.inputs, args.anndata, args.output, args.output_plot) |