Mercurial > repos > goeckslab > scimap_phenotyping
comparison mcmicro_to_anndata.py @ 0:7ed4b55b11f7 draft
planemo upload for repository https://github.com/goeckslab/tools-mti/tree/main/tools/scimap commit b19cb55dfb751cccc857b95a432890299bfeebb5
author | goeckslab |
---|---|
date | Tue, 19 Jul 2022 20:29:22 +0000 |
parents | |
children | ce22e846c5e4 |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:7ed4b55b11f7 |
---|---|
1 import argparse | |
2 import json | |
3 import warnings | |
4 | |
5 import scimap as sm | |
6 | |
7 | |
8 def main(inputs, outfile): | |
9 """ | |
10 Parameter | |
11 --------- | |
12 inputs : str | |
13 File path to galaxy tool parameter. | |
14 | |
15 outfile : str | |
16 File path to estimator. | |
17 """ | |
18 warnings.simplefilter('ignore') | |
19 | |
20 with open(inputs, 'r') as param_handler: | |
21 params = json.load(param_handler) | |
22 | |
23 image_path = params['image_path'] | |
24 drop_markers = params['drop_markers'] | |
25 if not drop_markers: | |
26 drop_markers = None | |
27 else: | |
28 drop_markers = [x.strip() for x in drop_markers.split(',')] | |
29 options = params['options'] | |
30 for k, v in options.items(): | |
31 if v == '': | |
32 options[k] = None | |
33 | |
34 adata = sm.pp.mcmicro_to_scimap(image_path, drop_markers=drop_markers, **options) | |
35 | |
36 adata.write(outfile) | |
37 | |
38 | |
39 if __name__ == '__main__': | |
40 aparser = argparse.ArgumentParser() | |
41 aparser.add_argument("-i", "--inputs", dest="inputs", required=True) | |
42 aparser.add_argument("-e", "--outfile", dest="outfile", required=True) | |
43 args = aparser.parse_args() | |
44 | |
45 main(args.inputs, args.outfile) |