Mercurial > repos > recetox > ipapy2_clustering
annotate utils.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 | 
| 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 import argparse | 
| 
cb18b8fcb441
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
 recetox parents: diff
changeset | 2 from typing import Tuple | 
| 
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 import pandas as pd | 
| 
cb18b8fcb441
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
 recetox parents: diff
changeset | 5 | 
| 
cb18b8fcb441
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
 recetox parents: diff
changeset | 6 | 
| 
cb18b8fcb441
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
 recetox parents: diff
changeset | 7 class LoadDataAction(argparse.Action): | 
| 
cb18b8fcb441
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
 recetox parents: diff
changeset | 8 """ | 
| 
cb18b8fcb441
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. | 
| 
cb18b8fcb441
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. | 
| 
cb18b8fcb441
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
 recetox parents: diff
changeset | 11 | 
| 
cb18b8fcb441
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
 recetox parents: diff
changeset | 12 """ | 
| 
cb18b8fcb441
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
 recetox parents: diff
changeset | 13 | 
| 
cb18b8fcb441
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): | 
| 
cb18b8fcb441
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
 recetox parents: diff
changeset | 15 """ | 
| 
cb18b8fcb441
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. | 
| 
cb18b8fcb441
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
 recetox parents: diff
changeset | 17 :param namespace: Namespace object | 
| 
cb18b8fcb441
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 | 
| 
cb18b8fcb441
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 | 
| 
cb18b8fcb441
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
 recetox parents: diff
changeset | 20 :return: None | 
| 
cb18b8fcb441
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
 recetox parents: diff
changeset | 21 """ | 
| 
cb18b8fcb441
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
 recetox parents: diff
changeset | 22 | 
| 
cb18b8fcb441
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 | 
| 
cb18b8fcb441
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() | 
| 
cb18b8fcb441
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
 recetox parents: diff
changeset | 25 if file_extension == "csv": | 
| 
cb18b8fcb441
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) | 
| 
cb18b8fcb441
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"]: | 
| 
cb18b8fcb441
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( | 
| 
cb18b8fcb441
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
 recetox parents: diff
changeset | 29 "", None | 
| 
cb18b8fcb441
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
 recetox parents: diff
changeset | 30 ) | 
| 
cb18b8fcb441
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
 recetox parents: diff
changeset | 31 elif file_extension == "parquet": | 
| 
cb18b8fcb441
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) | 
| 
cb18b8fcb441
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
 recetox parents: diff
changeset | 33 else: | 
| 
cb18b8fcb441
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}") | 
| 
cb18b8fcb441
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) | 
| 
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 | 
| 
cb18b8fcb441
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
 recetox parents: diff
changeset | 38 class LoadTextAction(argparse.Action): | 
| 
cb18b8fcb441
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
 recetox parents: diff
changeset | 39 """ | 
| 
cb18b8fcb441
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. | 
| 
cb18b8fcb441
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
 recetox parents: diff
changeset | 41 """ | 
| 
cb18b8fcb441
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
 recetox parents: diff
changeset | 42 | 
| 
cb18b8fcb441
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): | 
| 
cb18b8fcb441
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
 recetox parents: diff
changeset | 44 """ | 
| 
cb18b8fcb441
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. | 
| 
cb18b8fcb441
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
 recetox parents: diff
changeset | 46 :param namespace: Namespace object | 
| 
cb18b8fcb441
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 | 
| 
cb18b8fcb441
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 | 
| 
cb18b8fcb441
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
 recetox parents: diff
changeset | 49 :return: None | 
| 
cb18b8fcb441
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
 recetox parents: diff
changeset | 50 """ | 
| 
cb18b8fcb441
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
 recetox parents: diff
changeset | 51 file_path, _ = values | 
| 
cb18b8fcb441
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
 recetox parents: diff
changeset | 52 data = [] | 
| 
cb18b8fcb441
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
 recetox parents: diff
changeset | 53 if file_path: | 
| 
cb18b8fcb441
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: | 
| 
cb18b8fcb441
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
 recetox parents: diff
changeset | 55 for line in f: | 
| 
cb18b8fcb441
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())) | 
| 
cb18b8fcb441
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) | 
| 
cb18b8fcb441
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
 recetox parents: diff
changeset | 58 | 
| 
cb18b8fcb441
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
 recetox parents: diff
changeset | 59 | 
| 
cb18b8fcb441
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: | 
| 
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 Write the dataframe to a CSV file. | 
| 
cb18b8fcb441
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
 recetox parents: diff
changeset | 63 | 
| 
cb18b8fcb441
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
 recetox parents: diff
changeset | 64 Parameters: | 
| 
cb18b8fcb441
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. | 
| 
cb18b8fcb441
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. | 
| 
cb18b8fcb441
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
 recetox parents: diff
changeset | 67 """ | 
| 
cb18b8fcb441
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) | 
| 
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 def write_tsv(df: pd.DataFrame, file_path: str) -> None: | 
| 
cb18b8fcb441
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
 recetox parents: diff
changeset | 72 """ | 
| 
cb18b8fcb441
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. | 
| 
cb18b8fcb441
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
 recetox parents: diff
changeset | 74 | 
| 
cb18b8fcb441
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
 recetox parents: diff
changeset | 75 Parameters: | 
| 
cb18b8fcb441
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. | 
| 
cb18b8fcb441
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. | 
| 
cb18b8fcb441
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
 recetox parents: diff
changeset | 78 """ | 
| 
cb18b8fcb441
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) | 
| 
cb18b8fcb441
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
 recetox parents: diff
changeset | 80 | 
| 
cb18b8fcb441
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
 recetox parents: diff
changeset | 81 | 
| 
cb18b8fcb441
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: | 
| 
cb18b8fcb441
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
 recetox parents: diff
changeset | 83 """ | 
| 
cb18b8fcb441
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. | 
| 
cb18b8fcb441
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
 recetox parents: diff
changeset | 85 | 
| 
cb18b8fcb441
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
 recetox parents: diff
changeset | 86 Parameters: | 
| 
cb18b8fcb441
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. | 
| 
cb18b8fcb441
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. | 
| 
cb18b8fcb441
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
 recetox parents: diff
changeset | 89 """ | 
| 
cb18b8fcb441
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) | 
| 
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 | 
| 
cb18b8fcb441
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: | 
| 
cb18b8fcb441
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
 recetox parents: diff
changeset | 94 """ | 
| 
cb18b8fcb441
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. | 
| 
cb18b8fcb441
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
 recetox parents: diff
changeset | 96 | 
| 
cb18b8fcb441
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
 recetox parents: diff
changeset | 97 Parameters: | 
| 
cb18b8fcb441
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. | 
| 
cb18b8fcb441
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. | 
| 
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 if file_path: | 
| 
cb18b8fcb441
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: | 
| 
cb18b8fcb441
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
 recetox parents: diff
changeset | 103 for s in data: | 
| 
cb18b8fcb441
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") | 
| 
cb18b8fcb441
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
 recetox parents: diff
changeset | 105 | 
| 
cb18b8fcb441
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
 recetox parents: diff
changeset | 106 | 
| 
cb18b8fcb441
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
 recetox parents: diff
changeset | 107 class StoreOutputAction(argparse.Action): | 
| 
cb18b8fcb441
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
 recetox parents: diff
changeset | 108 def __call__( | 
| 
cb18b8fcb441
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
 recetox parents: diff
changeset | 109 self, | 
| 
cb18b8fcb441
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
 recetox parents: diff
changeset | 110 parser: argparse.ArgumentParser, | 
| 
cb18b8fcb441
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
 recetox parents: diff
changeset | 111 namespace: argparse.Namespace, | 
| 
cb18b8fcb441
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
 recetox parents: diff
changeset | 112 values: Tuple[str, str], | 
| 
cb18b8fcb441
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
 recetox parents: diff
changeset | 113 option_string: str = None, | 
| 
cb18b8fcb441
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
 recetox parents: diff
changeset | 114 ) -> None: | 
| 
cb18b8fcb441
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
 recetox parents: diff
changeset | 115 """ | 
| 
cb18b8fcb441
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. | 
| 
cb18b8fcb441
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
 recetox parents: diff
changeset | 117 | 
| 
cb18b8fcb441
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
 recetox parents: diff
changeset | 118 Parameters: | 
| 
cb18b8fcb441
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. | 
| 
cb18b8fcb441
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. | 
| 
cb18b8fcb441
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. | 
| 
cb18b8fcb441
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. | 
| 
cb18b8fcb441
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
 recetox parents: diff
changeset | 123 """ | 
| 
cb18b8fcb441
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 | 
| 
cb18b8fcb441
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() | 
| 
cb18b8fcb441
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
 recetox parents: diff
changeset | 126 if file_extension == "csv": | 
| 
cb18b8fcb441
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
 recetox parents: diff
changeset | 127 write_func = write_csv | 
| 
cb18b8fcb441
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"]: | 
| 
cb18b8fcb441
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
 recetox parents: diff
changeset | 129 write_func = write_tsv | 
| 
cb18b8fcb441
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
 recetox parents: diff
changeset | 130 elif file_extension == "parquet": | 
| 
cb18b8fcb441
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
 recetox parents: diff
changeset | 131 write_func = write_parquet | 
| 
cb18b8fcb441
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
 recetox parents: diff
changeset | 132 elif file_extension == "txt": | 
| 
cb18b8fcb441
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
 recetox parents: diff
changeset | 133 write_func = write_text | 
| 
cb18b8fcb441
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
 recetox parents: diff
changeset | 134 else: | 
| 
cb18b8fcb441
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}") | 
| 
cb18b8fcb441
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)) | 
| 
cb18b8fcb441
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
 recetox parents: diff
changeset | 137 | 
| 
cb18b8fcb441
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
 recetox parents: diff
changeset | 138 | 
| 
cb18b8fcb441
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: | 
| 
cb18b8fcb441
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
 recetox parents: diff
changeset | 140 """ | 
| 
cb18b8fcb441
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. | 
| 
cb18b8fcb441
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
 recetox parents: diff
changeset | 142 | 
| 
cb18b8fcb441
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
 recetox parents: diff
changeset | 143 Parameters: | 
| 
cb18b8fcb441
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. | 
| 
cb18b8fcb441
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
 recetox parents: diff
changeset | 145 | 
| 
cb18b8fcb441
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
 recetox parents: diff
changeset | 146 Returns: | 
| 
cb18b8fcb441
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. | 
| 
cb18b8fcb441
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
 recetox parents: diff
changeset | 148 """ | 
| 
cb18b8fcb441
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
 recetox parents: diff
changeset | 149 annotations_flat = pd.DataFrame() | 
| 
cb18b8fcb441
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: | 
| 
cb18b8fcb441
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
 recetox parents: diff
changeset | 151 annotation = annotations[peak_id] | 
| 
cb18b8fcb441
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 | 
| 
cb18b8fcb441
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]) | 
| 
cb18b8fcb441
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
 recetox parents: diff
changeset | 154 return annotations_flat | 
| 
cb18b8fcb441
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
 recetox parents: diff
changeset | 155 | 
| 
cb18b8fcb441
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
 recetox parents: diff
changeset | 156 | 
| 
cb18b8fcb441
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: | 
| 
cb18b8fcb441
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
 recetox parents: diff
changeset | 158 """ | 
| 
cb18b8fcb441
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' | 
| 
cb18b8fcb441
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'. | 
| 
cb18b8fcb441
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
 recetox parents: diff
changeset | 161 | 
| 
cb18b8fcb441
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
 recetox parents: diff
changeset | 162 Parameters: | 
| 
cb18b8fcb441
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. | 
| 
cb18b8fcb441
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
 recetox parents: diff
changeset | 164 | 
| 
cb18b8fcb441
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
 recetox parents: diff
changeset | 165 Returns: | 
| 
cb18b8fcb441
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. | 
| 
cb18b8fcb441
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
 recetox parents: diff
changeset | 167 """ | 
| 
cb18b8fcb441
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
 recetox parents: diff
changeset | 168 annotations = {} | 
| 
cb18b8fcb441
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"]) | 
| 
cb18b8fcb441
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
 recetox parents: diff
changeset | 170 for i in keys: | 
| 
cb18b8fcb441
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) | 
| 
cb18b8fcb441
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
 recetox parents: diff
changeset | 172 return annotations | 
| 
cb18b8fcb441
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
 recetox parents: diff
changeset | 173 | 
| 
cb18b8fcb441
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
 recetox parents: diff
changeset | 174 | 
| 
cb18b8fcb441
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
 recetox parents: diff
changeset | 175 class CustomArgumentParser(argparse.ArgumentParser): | 
| 
cb18b8fcb441
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): | 
| 
cb18b8fcb441
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
 recetox parents: diff
changeset | 177 super().__init__(*args, **kwargs) | 
| 
cb18b8fcb441
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) | 
| 
cb18b8fcb441
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) | 
| 
cb18b8fcb441
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) | 
| 
cb18b8fcb441
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
 recetox parents: diff
changeset | 181 self.add_argument( | 
| 
cb18b8fcb441
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
 recetox parents: diff
changeset | 182 "--output_dataset", | 
| 
cb18b8fcb441
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
 recetox parents: diff
changeset | 183 nargs=2, | 
| 
cb18b8fcb441
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
 recetox parents: diff
changeset | 184 action="store_output", | 
| 
cb18b8fcb441
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
 recetox parents: diff
changeset | 185 required=True, | 
| 
cb18b8fcb441
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.", | 
| 
cb18b8fcb441
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
 recetox parents: diff
changeset | 187 ) | 
| 
cb18b8fcb441
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
 recetox parents: diff
changeset | 188 | 
| 
cb18b8fcb441
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
 recetox parents: diff
changeset | 189 | 
| 
cb18b8fcb441
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
 recetox parents: diff
changeset | 190 class MSArgumentParser(CustomArgumentParser): | 
| 
cb18b8fcb441
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): | 
| 
cb18b8fcb441
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
 recetox parents: diff
changeset | 192 super().__init__(*args, **kwargs) | 
| 
cb18b8fcb441
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
 recetox parents: diff
changeset | 193 self.add_argument( | 
| 
cb18b8fcb441
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
 recetox parents: diff
changeset | 194 "--ncores", | 
| 
cb18b8fcb441
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
 recetox parents: diff
changeset | 195 type=int, | 
| 
cb18b8fcb441
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
 recetox parents: diff
changeset | 196 default=1, | 
| 
cb18b8fcb441
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.", | 
| 
cb18b8fcb441
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
 recetox parents: diff
changeset | 198 ) | 
| 
cb18b8fcb441
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
 recetox parents: diff
changeset | 199 self.add_argument( | 
| 
cb18b8fcb441
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
 recetox parents: diff
changeset | 200 "--pRTout", | 
| 
cb18b8fcb441
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
 recetox parents: diff
changeset | 201 type=float, | 
| 
cb18b8fcb441
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
 recetox parents: diff
changeset | 202 default=0.4, | 
| 
cb18b8fcb441
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
 recetox parents: diff
changeset | 203 help=( | 
| 
cb18b8fcb441
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" | 
| 
cb18b8fcb441
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
 recetox parents: diff
changeset | 205 " present in the database." | 
| 
cb18b8fcb441
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
 recetox parents: diff
changeset | 206 ), | 
| 
cb18b8fcb441
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
 recetox parents: diff
changeset | 207 ) | 
| 
cb18b8fcb441
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
 recetox parents: diff
changeset | 208 self.add_argument( | 
| 
cb18b8fcb441
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
 recetox parents: diff
changeset | 209 "--pRTNone", | 
| 
cb18b8fcb441
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
 recetox parents: diff
changeset | 210 type=float, | 
| 
cb18b8fcb441
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
 recetox parents: diff
changeset | 211 default=0.8, | 
| 
cb18b8fcb441
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
 recetox parents: diff
changeset | 212 help=( | 
| 
cb18b8fcb441
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" | 
| 
cb18b8fcb441
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
 recetox parents: diff
changeset | 214 " database." | 
| 
cb18b8fcb441
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
 recetox parents: diff
changeset | 215 ), | 
| 
cb18b8fcb441
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
 recetox parents: diff
changeset | 216 ) | 
| 
cb18b8fcb441
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
 recetox parents: diff
changeset | 217 self.add_argument( | 
| 
cb18b8fcb441
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
 recetox parents: diff
changeset | 218 "--ppmthr", | 
| 
cb18b8fcb441
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
 recetox parents: diff
changeset | 219 type=float, | 
| 
cb18b8fcb441
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
 recetox parents: diff
changeset | 220 help=( | 
| 
cb18b8fcb441
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" | 
| 
cb18b8fcb441
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
 recetox parents: diff
changeset | 222 " 2*ppm." | 
| 
cb18b8fcb441
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
 recetox parents: diff
changeset | 223 ), | 
| 
cb18b8fcb441
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
 recetox parents: diff
changeset | 224 ) | 
| 
cb18b8fcb441
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
 recetox parents: diff
changeset | 225 self.add_argument( | 
| 
cb18b8fcb441
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
 recetox parents: diff
changeset | 226 "--ppm", | 
| 
cb18b8fcb441
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
 recetox parents: diff
changeset | 227 type=float, | 
| 
cb18b8fcb441
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
 recetox parents: diff
changeset | 228 required=True, | 
| 
cb18b8fcb441
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
 recetox parents: diff
changeset | 229 default=100, | 
| 
cb18b8fcb441
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.", | 
| 
cb18b8fcb441
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
 recetox parents: diff
changeset | 231 ) | 
| 
cb18b8fcb441
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
 recetox parents: diff
changeset | 232 self.add_argument( | 
| 
cb18b8fcb441
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
 recetox parents: diff
changeset | 233 "--ratiosd", | 
| 
cb18b8fcb441
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
 recetox parents: diff
changeset | 234 type=float, | 
| 
cb18b8fcb441
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
 recetox parents: diff
changeset | 235 default=0.9, | 
| 
cb18b8fcb441
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
 recetox parents: diff
changeset | 236 help=( | 
| 
cb18b8fcb441
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" | 
| 
cb18b8fcb441
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
 recetox parents: diff
changeset | 238 " isotopes." | 
| 
cb18b8fcb441
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
 recetox parents: diff
changeset | 239 ), | 
| 
cb18b8fcb441
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
 recetox parents: diff
changeset | 240 ) | 
| 
cb18b8fcb441
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
 recetox parents: diff
changeset | 241 self.add_argument( | 
| 
cb18b8fcb441
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
 recetox parents: diff
changeset | 242 "--ppmunk", | 
| 
cb18b8fcb441
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
 recetox parents: diff
changeset | 243 type=float, | 
| 
cb18b8fcb441
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
 recetox parents: diff
changeset | 244 help=( | 
| 
cb18b8fcb441
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" | 
| 
cb18b8fcb441
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
 recetox parents: diff
changeset | 246 " ppm." | 
| 
cb18b8fcb441
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
 recetox parents: diff
changeset | 247 ), | 
| 
cb18b8fcb441
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
 recetox parents: diff
changeset | 248 ) | 
| 
cb18b8fcb441
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
 recetox parents: diff
changeset | 249 self.add_argument( | 
| 
cb18b8fcb441
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
 recetox parents: diff
changeset | 250 "--ratiounk", | 
| 
cb18b8fcb441
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
 recetox parents: diff
changeset | 251 type=float, | 
| 
cb18b8fcb441
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
 recetox parents: diff
changeset | 252 default=0.5, | 
| 
cb18b8fcb441
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.", | 
| 
cb18b8fcb441
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
 recetox parents: diff
changeset | 254 ) | 
| 
cb18b8fcb441
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
 recetox parents: diff
changeset | 255 | 
| 
cb18b8fcb441
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
 recetox parents: diff
changeset | 256 | 
| 
cb18b8fcb441
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
 recetox parents: diff
changeset | 257 class GibbsArgumentParser(CustomArgumentParser): | 
| 
cb18b8fcb441
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): | 
| 
cb18b8fcb441
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
 recetox parents: diff
changeset | 259 super().__init__(*args, **kwargs) | 
| 
cb18b8fcb441
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
 recetox parents: diff
changeset | 260 self.add_argument( | 
| 
cb18b8fcb441
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
 recetox parents: diff
changeset | 261 "--noits", | 
| 
cb18b8fcb441
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
 recetox parents: diff
changeset | 262 type=int, | 
| 
cb18b8fcb441
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", | 
| 
cb18b8fcb441
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
 recetox parents: diff
changeset | 264 ) | 
| 
cb18b8fcb441
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
 recetox parents: diff
changeset | 265 self.add_argument( | 
| 
cb18b8fcb441
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
 recetox parents: diff
changeset | 266 "--burn", | 
| 
cb18b8fcb441
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
 recetox parents: diff
changeset | 267 type=int, | 
| 
cb18b8fcb441
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 | 
| 
cb18b8fcb441
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""", | 
| 
cb18b8fcb441
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
 recetox parents: diff
changeset | 270 ) | 
| 
cb18b8fcb441
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
 recetox parents: diff
changeset | 271 self.add_argument( | 
| 
cb18b8fcb441
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
 recetox parents: diff
changeset | 272 "--delta_add", | 
| 
cb18b8fcb441
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
 recetox parents: diff
changeset | 273 type=float, | 
| 
cb18b8fcb441
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
 recetox parents: diff
changeset | 274 default=1, | 
| 
cb18b8fcb441
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 | 
| 
cb18b8fcb441
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 | 
| 
cb18b8fcb441
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 | 
| 
cb18b8fcb441
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
 recetox parents: diff
changeset | 278 probabilities. Default 1.""", | 
| 
cb18b8fcb441
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
 recetox parents: diff
changeset | 279 ) | 
| 
cb18b8fcb441
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
 recetox parents: diff
changeset | 280 self.add_argument( | 
| 
cb18b8fcb441
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
 recetox parents: diff
changeset | 281 "--all_out", | 
| 
cb18b8fcb441
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
 recetox parents: diff
changeset | 282 type=bool, | 
| 
cb18b8fcb441
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.", | 
| 
cb18b8fcb441
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
 recetox parents: diff
changeset | 284 ) | 
| 
cb18b8fcb441
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
 recetox parents: diff
changeset | 285 self.add_argument( | 
| 
cb18b8fcb441
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
 recetox parents: diff
changeset | 286 "--zs_out", | 
| 
cb18b8fcb441
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
 recetox parents: diff
changeset | 287 nargs=2, | 
| 
cb18b8fcb441
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
 recetox parents: diff
changeset | 288 action="store_output", | 
| 
cb18b8fcb441
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.", | 
| 
cb18b8fcb441
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
 recetox parents: diff
changeset | 290 ) | 
| 
cb18b8fcb441
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
 recetox parents: diff
changeset | 291 self.add_argument( | 
| 
cb18b8fcb441
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
 recetox parents: diff
changeset | 292 "--zs", | 
| 
cb18b8fcb441
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
 recetox parents: diff
changeset | 293 nargs=2, | 
| 
cb18b8fcb441
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
 recetox parents: diff
changeset | 294 action="load_text", | 
| 
cb18b8fcb441
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. | 
| 
cb18b8fcb441
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
 recetox parents: diff
changeset | 296 Optional, default None.""", | 
| 
cb18b8fcb441
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/ipapy2 commit 64b61ff2823b4f54868c0ab7a4c0dc49eaf2979a
 recetox parents: diff
changeset | 297 ) | 
