annotate utils.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
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
7f84a8a5edde planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
1 import argparse
7f84a8a5edde planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
2 from typing import Tuple
7f84a8a5edde planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
3
7f84a8a5edde planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
4 import pandas as pd
7f84a8a5edde planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
5
7f84a8a5edde planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
6
7f84a8a5edde planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
7 class LoadDataAction(argparse.Action):
7f84a8a5edde planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
8 """
7f84a8a5edde planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
9 Custom argparse action to load data from a file.
7f84a8a5edde planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
10 Supported file formats: CSV, TSV, Tabular and Parquet.
7f84a8a5edde planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
11
7f84a8a5edde planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
12 """
7f84a8a5edde planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
13
7f84a8a5edde planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
14 def __call__(self, parser, namespace, values, option_string=None):
7f84a8a5edde planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
15 """
7f84a8a5edde planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
16 Load data from a file and store it in the namespace.
7f84a8a5edde planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
17 :param namespace: Namespace object
7f84a8a5edde planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
18 :param values: Tuple containing the file path and file extension
7f84a8a5edde planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
19 :param option_string: Option string
7f84a8a5edde planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
20 :return: None
7f84a8a5edde planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
21 """
7f84a8a5edde planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
22
7f84a8a5edde planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
23 file_path, file_extension = values
7f84a8a5edde planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
24 file_extension = file_extension.lower()
7f84a8a5edde planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
25 if file_extension == "csv":
7f84a8a5edde planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
26 df = pd.read_csv(file_path, keep_default_na=False).replace("", None)
7f84a8a5edde planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
27 elif file_extension in ["tsv", "tabular"]:
7f84a8a5edde planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
28 df = pd.read_csv(file_path, sep="\t", keep_default_na=False).replace(
7f84a8a5edde planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
29 "", None
7f84a8a5edde planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
30 )
7f84a8a5edde planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
31 elif file_extension == "parquet":
7f84a8a5edde planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
32 df = pd.read_parquet(file_path).replace("", None)
7f84a8a5edde planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
33 else:
7f84a8a5edde planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
34 raise ValueError(f"Unsupported file format: {file_extension}")
7f84a8a5edde planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
35 setattr(namespace, self.dest, df)
7f84a8a5edde planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
36
7f84a8a5edde planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
37
7f84a8a5edde planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
38 class LoadTextAction(argparse.Action):
7f84a8a5edde planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
39 """
7f84a8a5edde planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
40 Custom argparse action to load data from a text file.
7f84a8a5edde planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
41 """
7f84a8a5edde planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
42
7f84a8a5edde planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
43 def __call__(self, parser, namespace, values, option_string=None):
7f84a8a5edde planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
44 """
7f84a8a5edde planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
45 Load data from a text file and store it in the namespace.
7f84a8a5edde planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
46 :param namespace: Namespace object
7f84a8a5edde planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
47 :param values: Tuple containing the file path and file extension
7f84a8a5edde planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
48 :param option_string: Option string
7f84a8a5edde planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
49 :return: None
7f84a8a5edde planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
50 """
7f84a8a5edde planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
51 file_path, _ = values
7f84a8a5edde planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
52 data = []
7f84a8a5edde planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
53 if file_path:
7f84a8a5edde planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
54 with open(file_path, "r") as f:
7f84a8a5edde planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
55 for line in f:
7f84a8a5edde planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
56 data.append(int(line.strip()))
7f84a8a5edde planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
57 setattr(namespace, self.dest, data)
7f84a8a5edde planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
58
7f84a8a5edde planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
59
7f84a8a5edde planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
60 def write_csv(df: pd.DataFrame, file_path: str) -> None:
7f84a8a5edde planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
61 """
7f84a8a5edde planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
62 Write the dataframe to a CSV file.
7f84a8a5edde planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
63
7f84a8a5edde planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
64 Parameters:
7f84a8a5edde planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
65 df (pd.DataFrame): The dataframe to write.
7f84a8a5edde planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
66 file_path (str): The path to the output CSV file.
7f84a8a5edde planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
67 """
7f84a8a5edde planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
68 df.to_csv(file_path, index=False)
7f84a8a5edde planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
69
7f84a8a5edde planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
70
7f84a8a5edde planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
71 def write_tsv(df: pd.DataFrame, file_path: str) -> None:
7f84a8a5edde planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
72 """
7f84a8a5edde planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
73 Write the dataframe to a TSV file.
7f84a8a5edde planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
74
7f84a8a5edde planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
75 Parameters:
7f84a8a5edde planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
76 df (pd.DataFrame): The dataframe to write.
7f84a8a5edde planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
77 file_path (str): The path to the output TSV file.
7f84a8a5edde planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
78 """
7f84a8a5edde planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
79 df.to_csv(file_path, sep="\t", index=False)
7f84a8a5edde planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
80
7f84a8a5edde planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
81
7f84a8a5edde planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
82 def write_parquet(df: pd.DataFrame, file_path: str) -> None:
7f84a8a5edde planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
83 """
7f84a8a5edde planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
84 Write the dataframe to a Parquet file.
7f84a8a5edde planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
85
7f84a8a5edde planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
86 Parameters:
7f84a8a5edde planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
87 df (pd.DataFrame): The dataframe to write.
7f84a8a5edde planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
88 file_path (str): The path to the output Parquet file.
7f84a8a5edde planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
89 """
7f84a8a5edde planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
90 df.to_parquet(file_path, index=False)
7f84a8a5edde planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
91
7f84a8a5edde planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
92
7f84a8a5edde planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
93 def write_text(data: list, file_path: str) -> None:
7f84a8a5edde planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
94 """
7f84a8a5edde planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
95 Write the data to a text file.
7f84a8a5edde planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
96
7f84a8a5edde planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
97 Parameters:
7f84a8a5edde planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
98 data (list): The data to write.
7f84a8a5edde planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
99 file_path (str): The path to the output text file.
7f84a8a5edde planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
100 """
7f84a8a5edde planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
101 if file_path:
7f84a8a5edde planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
102 with open(file_path, "w") as f:
7f84a8a5edde planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
103 for s in data:
7f84a8a5edde planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
104 f.write(str(s) + "\n")
7f84a8a5edde planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
105
7f84a8a5edde planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
106
7f84a8a5edde planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
107 class StoreOutputAction(argparse.Action):
7f84a8a5edde planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
108 def __call__(
7f84a8a5edde planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
109 self,
7f84a8a5edde planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
110 parser: argparse.ArgumentParser,
7f84a8a5edde planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
111 namespace: argparse.Namespace,
7f84a8a5edde planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
112 values: Tuple[str, str],
7f84a8a5edde planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
113 option_string: str = None,
7f84a8a5edde planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
114 ) -> None:
7f84a8a5edde planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
115 """
7f84a8a5edde planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
116 Custom argparse action to store the output function and file path based on file extension.
7f84a8a5edde planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
117
7f84a8a5edde planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
118 Parameters:
7f84a8a5edde planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
119 parser (argparse.ArgumentParser): The argument parser instance.
7f84a8a5edde planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
120 namespace (argparse.Namespace): The namespace to hold the parsed values.
7f84a8a5edde planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
121 values (Tuple[str, str]): The file path and file extension.
7f84a8a5edde planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
122 option_string (str): The option string.
7f84a8a5edde planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
123 """
7f84a8a5edde planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
124 file_path, file_extension = values
7f84a8a5edde planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
125 file_extension = file_extension.lower()
7f84a8a5edde planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
126 if file_extension == "csv":
7f84a8a5edde planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
127 write_func = write_csv
7f84a8a5edde planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
128 elif file_extension in ["tsv", "tabular"]:
7f84a8a5edde planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
129 write_func = write_tsv
7f84a8a5edde planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
130 elif file_extension == "parquet":
7f84a8a5edde planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
131 write_func = write_parquet
7f84a8a5edde planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
132 elif file_extension == "txt":
7f84a8a5edde planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
133 write_func = write_text
7f84a8a5edde planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
134 else:
7f84a8a5edde planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
135 raise ValueError(f"Unsupported file format: {file_extension}")
7f84a8a5edde planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
136 setattr(namespace, self.dest, (write_func, file_path))
7f84a8a5edde planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
137
7f84a8a5edde planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
138
7f84a8a5edde planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
139 def flattern_annotations(annotations: dict) -> pd.DataFrame:
7f84a8a5edde planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
140 """
7f84a8a5edde planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
141 Flatten the annotations dictionary and convert it to a dataframe.
7f84a8a5edde planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
142
7f84a8a5edde planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
143 Parameters:
7f84a8a5edde planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
144 annotations (dict): The annotations dictionary.
7f84a8a5edde planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
145
7f84a8a5edde planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
146 Returns:
7f84a8a5edde planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
147 pd.DataFrame: The flattened annotations dataframe.
7f84a8a5edde planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
148 """
7f84a8a5edde planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
149 annotations_flat = pd.DataFrame()
7f84a8a5edde planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
150 for peak_id in annotations:
7f84a8a5edde planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
151 annotation = annotations[peak_id]
7f84a8a5edde planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
152 annotation["peak_id"] = peak_id
7f84a8a5edde planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
153 annotations_flat = pd.concat([annotations_flat, annotation])
7f84a8a5edde planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
154 return annotations_flat
7f84a8a5edde planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
155
7f84a8a5edde planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
156
7f84a8a5edde planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
157 def group_by_peak_id(df: pd.DataFrame) -> dict:
7f84a8a5edde planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
158 """
7f84a8a5edde planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
159 Convert a pandas dataframe to a dictionary where each key is a unique 'peak_id'
7f84a8a5edde planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
160 and each value is a dataframe subset corresponding to that 'peak_id'.
7f84a8a5edde planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
161
7f84a8a5edde planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
162 Parameters:
7f84a8a5edde planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
163 df (pd.DataFrame): The input dataframe.
7f84a8a5edde planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
164
7f84a8a5edde planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
165 Returns:
7f84a8a5edde planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
166 dict: The dictionary representation of the dataframe.
7f84a8a5edde planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
167 """
7f84a8a5edde planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
168 annotations = {}
7f84a8a5edde planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
169 keys = set(df["peak_id"])
7f84a8a5edde planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
170 for i in keys:
7f84a8a5edde planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
171 annotations[i] = df[df["peak_id"] == i].drop("peak_id", axis=1)
7f84a8a5edde planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
172 return annotations
7f84a8a5edde planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
173
7f84a8a5edde planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
174
7f84a8a5edde planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
175 class CustomArgumentParser(argparse.ArgumentParser):
7f84a8a5edde planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
176 def __init__(self, *args, **kwargs):
7f84a8a5edde planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
177 super().__init__(*args, **kwargs)
7f84a8a5edde planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
178 self.register("action", "load_data", LoadDataAction)
7f84a8a5edde planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
179 self.register("action", "store_output", StoreOutputAction)
7f84a8a5edde planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
180 self.register("action", "load_text", LoadTextAction)
7f84a8a5edde planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
181 self.add_argument(
7f84a8a5edde planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
182 "--output_dataset",
7f84a8a5edde planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
183 nargs=2,
7f84a8a5edde planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
184 action="store_output",
7f84a8a5edde planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
185 required=True,
7f84a8a5edde planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
186 help="A file path for the output results.",
7f84a8a5edde planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
187 )
7f84a8a5edde planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
188
7f84a8a5edde planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
189
7f84a8a5edde planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
190 class MSArgumentParser(CustomArgumentParser):
7f84a8a5edde planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
191 def __init__(self, *args, **kwargs):
7f84a8a5edde planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
192 super().__init__(*args, **kwargs)
7f84a8a5edde planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
193 self.add_argument(
7f84a8a5edde planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
194 "--ncores",
7f84a8a5edde planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
195 type=int,
7f84a8a5edde planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
196 default=1,
7f84a8a5edde planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
197 help="The number of cores to use for parallel processing.",
7f84a8a5edde planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
198 )
7f84a8a5edde planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
199 self.add_argument(
7f84a8a5edde planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
200 "--pRTout",
7f84a8a5edde planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
201 type=float,
7f84a8a5edde planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
202 default=0.4,
7f84a8a5edde planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
203 help=(
7f84a8a5edde planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
204 "multiplicative factor for the RT if measured RT is outside the RTrange"
7f84a8a5edde planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
205 " present in the database."
7f84a8a5edde planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
206 ),
7f84a8a5edde planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
207 )
7f84a8a5edde planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
208 self.add_argument(
7f84a8a5edde planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
209 "--pRTNone",
7f84a8a5edde planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
210 type=float,
7f84a8a5edde planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
211 default=0.8,
7f84a8a5edde planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
212 help=(
7f84a8a5edde planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
213 "multiplicative factor for the RT if no RTrange present in the"
7f84a8a5edde planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
214 " database."
7f84a8a5edde planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
215 ),
7f84a8a5edde planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
216 )
7f84a8a5edde planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
217 self.add_argument(
7f84a8a5edde planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
218 "--ppmthr",
7f84a8a5edde planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
219 type=float,
7f84a8a5edde planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
220 help=(
7f84a8a5edde planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
221 "maximum ppm possible for the annotations. if not provided equal to"
7f84a8a5edde planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
222 " 2*ppm."
7f84a8a5edde planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
223 ),
7f84a8a5edde planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
224 )
7f84a8a5edde planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
225 self.add_argument(
7f84a8a5edde planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
226 "--ppm",
7f84a8a5edde planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
227 type=float,
7f84a8a5edde planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
228 required=True,
7f84a8a5edde planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
229 default=100,
7f84a8a5edde planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
230 help="accuracy of the MS instrument used.",
7f84a8a5edde planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
231 )
7f84a8a5edde planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
232 self.add_argument(
7f84a8a5edde planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
233 "--ratiosd",
7f84a8a5edde planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
234 type=float,
7f84a8a5edde planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
235 default=0.9,
7f84a8a5edde planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
236 help=(
7f84a8a5edde planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
237 "acceptable ratio between predicted intensity and observed intensity of"
7f84a8a5edde planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
238 " isotopes."
7f84a8a5edde planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
239 ),
7f84a8a5edde planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
240 )
7f84a8a5edde planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
241 self.add_argument(
7f84a8a5edde planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
242 "--ppmunk",
7f84a8a5edde planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
243 type=float,
7f84a8a5edde planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
244 help=(
7f84a8a5edde planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
245 "pm associated to the 'unknown' annotation. If not provided equal to"
7f84a8a5edde planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
246 " ppm."
7f84a8a5edde planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
247 ),
7f84a8a5edde planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
248 )
7f84a8a5edde planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
249 self.add_argument(
7f84a8a5edde planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
250 "--ratiounk",
7f84a8a5edde planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
251 type=float,
7f84a8a5edde planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
252 default=0.5,
7f84a8a5edde planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
253 help="isotope ratio associated to the 'unknown' annotation.",
7f84a8a5edde planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
254 )
7f84a8a5edde planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
255
7f84a8a5edde planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
256
7f84a8a5edde planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
257 class GibbsArgumentParser(CustomArgumentParser):
7f84a8a5edde planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
258 def __init__(self, *args, **kwargs):
7f84a8a5edde planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
259 super().__init__(*args, **kwargs)
7f84a8a5edde planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
260 self.add_argument(
7f84a8a5edde planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
261 "--noits",
7f84a8a5edde planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
262 type=int,
7f84a8a5edde planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
263 help="number of iterations if the Gibbs sampler to be run",
7f84a8a5edde planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
264 )
7f84a8a5edde planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
265 self.add_argument(
7f84a8a5edde planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
266 "--burn",
7f84a8a5edde planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
267 type=int,
7f84a8a5edde planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
268 help="""number of iterations to be ignored when computing posterior
7f84a8a5edde planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
269 probabilities. If None, is set to 10% of total iterations""",
7f84a8a5edde planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
270 )
7f84a8a5edde planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
271 self.add_argument(
7f84a8a5edde planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
272 "--delta_add",
7f84a8a5edde planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
273 type=float,
7f84a8a5edde planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
274 default=1,
7f84a8a5edde planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
275 help="""parameter used when computing the conditional priors. The
7f84a8a5edde planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
276 parameter must be positive. The smaller the parameter the more
7f84a8a5edde planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
277 weight the adducts connections have on the posterior
7f84a8a5edde planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
278 probabilities. Default 1.""",
7f84a8a5edde planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
279 )
7f84a8a5edde planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
280 self.add_argument(
7f84a8a5edde planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
281 "--all_out",
7f84a8a5edde planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
282 type=bool,
7f84a8a5edde planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
283 help="Output all the Gibbs sampler results.",
7f84a8a5edde planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
284 )
7f84a8a5edde planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
285 self.add_argument(
7f84a8a5edde planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
286 "--zs_out",
7f84a8a5edde planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
287 nargs=2,
7f84a8a5edde planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
288 action="store_output",
7f84a8a5edde planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
289 help="A file path for the output results of the Gibbs sampler.",
7f84a8a5edde planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
290 )
7f84a8a5edde planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
291 self.add_argument(
7f84a8a5edde planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
292 "--zs",
7f84a8a5edde planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
293 nargs=2,
7f84a8a5edde planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
294 action="load_text",
7f84a8a5edde planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
295 help="""a txt file containing the list of assignments computed in a previous run of the Gibbs sampler.
7f84a8a5edde planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
296 Optional, default None.""",
7f84a8a5edde planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
recetox
parents:
diff changeset
297 )