Mercurial > repos > recetox > ipapy2_ms1_annotation
comparison ipapy2_compute_all_adducts.py @ 0:7f84a8a5edde draft default tip
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
author | recetox |
---|---|
date | Fri, 16 May 2025 08:00:41 +0000 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:7f84a8a5edde |
---|---|
1 from ipaPy2 import ipa | |
2 from utils import CustomArgumentParser | |
3 | |
4 | |
5 def main( | |
6 input_dataset_adducts, input_dataset_database, ionisation, output_dataset, ncores | |
7 ): | |
8 write_func, file_path = output_dataset | |
9 adducts_df = ipa.compute_all_adducts( | |
10 input_dataset_adducts, input_dataset_database, ionisation, ncores | |
11 ) | |
12 | |
13 write_func(adducts_df, file_path) | |
14 | |
15 | |
16 if __name__ == "__main__": | |
17 parser = CustomArgumentParser( | |
18 description=" Clustering MS1 features based on correlation across samples." | |
19 ) | |
20 parser.add_argument( | |
21 "--input_dataset_adducts", | |
22 nargs=2, | |
23 action="load_data", | |
24 required=True, | |
25 help="A dataset containing information on all possible adducts.", | |
26 ) | |
27 parser.add_argument( | |
28 "--input_dataset_database", | |
29 nargs=2, | |
30 action="load_data", | |
31 required=True, | |
32 help="The MS1 database.", | |
33 ) | |
34 parser.add_argument( | |
35 "--ionisation", | |
36 type=int, | |
37 default=1, | |
38 choices=[1, -1], | |
39 help="Default value 1. positive = 1, negative = -1", | |
40 ) | |
41 parser.add_argument( | |
42 "--ncores", | |
43 type=int, | |
44 default=1, | |
45 help="Number of cores to use for parallel processing.", | |
46 ) | |
47 args = parser.parse_args() | |
48 main( | |
49 args.input_dataset_adducts, | |
50 args.input_dataset_database, | |
51 args.ionisation, | |
52 args.output_dataset, | |
53 args.ncores, | |
54 ) |