annotate ipapy2_gibbs_sampler.py @ 0:cb18b8fcb441 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:02:15 +0000
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
cb18b8fcb441 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
1 from ipaPy2 import ipa
cb18b8fcb441 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
2 from utils import flattern_annotations, GibbsArgumentParser, group_by_peak_id
cb18b8fcb441 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
3
cb18b8fcb441 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
4
cb18b8fcb441 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
5 def main(
cb18b8fcb441 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
6 input_dataset_mapped_isotope_patterns,
cb18b8fcb441 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
7 input_dataset_annotations,
cb18b8fcb441 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
8 integrating_mode,
cb18b8fcb441 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
9 input_dataset_bio,
cb18b8fcb441 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
10 noits,
cb18b8fcb441 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
11 burn,
cb18b8fcb441 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
12 delta_bio,
cb18b8fcb441 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
13 delta_add,
cb18b8fcb441 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
14 all_out,
cb18b8fcb441 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
15 zs,
cb18b8fcb441 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
16 zs_out,
cb18b8fcb441 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
17 output_dataset,
cb18b8fcb441 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
18 ):
cb18b8fcb441 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
19 annotations_df = input_dataset_annotations
cb18b8fcb441 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
20 annotations_df["post"] = annotations_df["post"].replace("", 0)
cb18b8fcb441 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
21 annotations_df = annotations_df.replace("", None)
cb18b8fcb441 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
22 annotations = group_by_peak_id(annotations_df)
cb18b8fcb441 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
23
cb18b8fcb441 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
24 if not zs:
cb18b8fcb441 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
25 zs = None
cb18b8fcb441 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
26
cb18b8fcb441 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
27 if integrating_mode == "adducts":
cb18b8fcb441 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
28 zs = ipa.Gibbs_sampler_add(
cb18b8fcb441 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
29 input_dataset_mapped_isotope_patterns,
cb18b8fcb441 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
30 annotations,
cb18b8fcb441 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
31 noits=noits,
cb18b8fcb441 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
32 burn=burn,
cb18b8fcb441 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
33 delta_add=delta_add,
cb18b8fcb441 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
34 all_out=all_out,
cb18b8fcb441 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
35 zs=zs,
cb18b8fcb441 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
36 )
cb18b8fcb441 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
37 else:
cb18b8fcb441 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
38 if args.integrating_mode == "biochemical":
cb18b8fcb441 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
39 zs = ipa.Gibbs_sampler_bio(
cb18b8fcb441 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
40 input_dataset_mapped_isotope_patterns,
cb18b8fcb441 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
41 annotations,
cb18b8fcb441 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
42 Bio=input_dataset_bio,
cb18b8fcb441 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
43 noits=noits,
cb18b8fcb441 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
44 burn=burn,
cb18b8fcb441 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
45 delta_bio=delta_bio,
cb18b8fcb441 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
46 all_out=all_out,
cb18b8fcb441 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
47 zs=zs,
cb18b8fcb441 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
48 )
cb18b8fcb441 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
49 else:
cb18b8fcb441 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
50 zs = ipa.Gibbs_sampler_bio_add(
cb18b8fcb441 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
51 input_dataset_mapped_isotope_patterns,
cb18b8fcb441 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
52 annotations,
cb18b8fcb441 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
53 Bio=input_dataset_bio,
cb18b8fcb441 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
54 noits=noits,
cb18b8fcb441 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
55 burn=burn,
cb18b8fcb441 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
56 delta_bio=delta_bio,
cb18b8fcb441 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
57 delta_add=delta_add,
cb18b8fcb441 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
58 all_out=all_out,
cb18b8fcb441 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
59 zs=zs,
cb18b8fcb441 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
60 )
cb18b8fcb441 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
61
cb18b8fcb441 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
62 annotations_flat = flattern_annotations(annotations)
cb18b8fcb441 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
63 write_func, file_path = output_dataset
cb18b8fcb441 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
64 write_func(annotations_flat, file_path)
cb18b8fcb441 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
65
cb18b8fcb441 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
66 if args.all_out:
cb18b8fcb441 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
67 write_func, file_path = zs_out
cb18b8fcb441 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
68 write_func(zs, file_path)
cb18b8fcb441 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
69
cb18b8fcb441 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
70
cb18b8fcb441 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
71 if __name__ == "__main__":
cb18b8fcb441 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
72 parser = GibbsArgumentParser(
cb18b8fcb441 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
73 description="""Gibbs sampler considering both biochemical and adducts connections. The
cb18b8fcb441 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
74 function computes the posterior probabilities of the annotations
cb18b8fcb441 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
75 considering the possible biochemical connections reported in Bio and the
cb18b8fcb441 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
76 possible adducts connection.""",
cb18b8fcb441 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
77 )
cb18b8fcb441 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
78 parser.add_argument(
cb18b8fcb441 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
79 "--input_dataset_mapped_isotope_patterns",
cb18b8fcb441 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
80 nargs=2,
cb18b8fcb441 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
81 action="load_data",
cb18b8fcb441 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
82 required=True,
cb18b8fcb441 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
83 help="a dataframe containing the measured intensities across several samples.",
cb18b8fcb441 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
84 )
cb18b8fcb441 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
85 parser.add_argument(
cb18b8fcb441 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
86 "--input_dataset_annotations",
cb18b8fcb441 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
87 nargs=2,
cb18b8fcb441 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
88 action="load_data",
cb18b8fcb441 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
89 required=True,
cb18b8fcb441 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
90 help="a datset containing the annotations of the features.",
cb18b8fcb441 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
91 )
cb18b8fcb441 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
92 parser.add_argument(
cb18b8fcb441 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
93 "--integrating_mode",
cb18b8fcb441 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
94 type=str,
cb18b8fcb441 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
95 required=True,
cb18b8fcb441 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
96 choices=["adducts", "biochemical", "biochemical_adducts"],
cb18b8fcb441 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
97 help=(
cb18b8fcb441 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
98 "The mode of integration. Options are 'adducts', 'biochemical', or"
cb18b8fcb441 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
99 " 'biochemical_adducts'."
cb18b8fcb441 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
100 ),
cb18b8fcb441 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
101 )
cb18b8fcb441 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
102 parser.add_argument(
cb18b8fcb441 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
103 "--input_dataset_bio",
cb18b8fcb441 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
104 nargs=2,
cb18b8fcb441 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
105 action="load_data",
cb18b8fcb441 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
106 type=str,
cb18b8fcb441 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
107 help="""dataframe (2 columns), reporting all the possible connections between
cb18b8fcb441 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
108 compounds. It uses the unique ids from the database. It could be the
cb18b8fcb441 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
109 output of Compute_Bio() or Compute_Bio_Parallel()""",
cb18b8fcb441 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
110 )
cb18b8fcb441 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
111 parser.add_argument(
cb18b8fcb441 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
112 "--delta_bio",
cb18b8fcb441 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
113 type=float,
cb18b8fcb441 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
114 help="""parameter used when computing the conditional priors. The
cb18b8fcb441 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
115 parameter must be positive. The smaller the parameter the more
cb18b8fcb441 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
116 weight the adducts connections have on the posterior
cb18b8fcb441 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
117 probabilities. Default 1.""",
cb18b8fcb441 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
118 )
cb18b8fcb441 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
119 args = parser.parse_args()
cb18b8fcb441 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
120 main(
cb18b8fcb441 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
121 args.input_dataset_mapped_isotope_patterns,
cb18b8fcb441 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
122 args.input_dataset_annotations,
cb18b8fcb441 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
123 args.integrating_mode,
cb18b8fcb441 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
124 args.input_dataset_bio,
cb18b8fcb441 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
125 args.noits,
cb18b8fcb441 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
126 args.burn,
cb18b8fcb441 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
127 args.delta_bio,
cb18b8fcb441 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
128 args.delta_add,
cb18b8fcb441 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
129 args.all_out,
cb18b8fcb441 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
130 args.zs,
cb18b8fcb441 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
131 args.zs_out,
cb18b8fcb441 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
132 args.output_dataset,
cb18b8fcb441 planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
133 )