# HG changeset patch # User tduigou # Date 1759415251 0 # Node ID 815748762646f925cf2db58ec0211b5743857211 # Parent 95b4196b4dedc9e8a39e8b69bdd72d42d45c9263 planemo upload for repository https://github.com/brsynth/galaxytools commit d7030c1af6fe06a1d45af115756ee775721e39b5 diff -r 95b4196b4ded -r 815748762646 generate_test.py --- a/generate_test.py Mon Sep 15 12:59:58 2025 +0000 +++ b/generate_test.py Thu Oct 02 14:27:31 2025 +0000 @@ -49,7 +49,7 @@ cmd = ["--input-template-id-str", template_id] value = run_cmd(subcommand="templates-summary", sub_cmd=cmd) print("Test:", " ".join(cmd), "md5:", value) - + print("=" * 50) print("templates-sources") @@ -57,9 +57,9 @@ cmd = ["--input-template-id-str", template_id] value = run_cmd(subcommand="templates-sources", sub_cmd=cmd) print("Test:", " ".join(cmd), "md5:", value) - + print("=" * 50) - + print("templates-count") smarts_str = "[O]-[C](=[O])" cmd = ["--input-smarts-str", smarts_str] @@ -73,4 +73,4 @@ cmd = ["--input-smarts-str", smarts_str] value = run_cmd(subcommand="templates-export", sub_cmd=cmd) print("Test:", " ".join(cmd), "md5:", value) - """ \ No newline at end of file + """ diff -r 95b4196b4ded -r 815748762646 query.py --- a/query.py Mon Sep 15 12:59:58 2025 +0000 +++ b/query.py Thu Oct 02 14:27:31 2025 +0000 @@ -17,11 +17,11 @@ chemical_domain_str: str, ec_number_str: str, min_radius_int: int, - valid_str: str, + valid_str: str, dedup_str: str, limit_int: int, offset_int: int, - ) -> Tuple: +) -> Tuple: url = f"{BASE_URL}/templates" params = [] if smarts_str: @@ -48,16 +48,19 @@ params.append(("offset", str(offset_int))) return url, params + def from_templates_summary(template_id_str: str) -> Tuple: url = f"{BASE_URL}/templates/{template_id_str}/summary" params = {} return url, params + def from_templates_sources(template_id_str: str) -> Tuple: url = f"{BASE_URL}/templates/{template_id_str}/sources" params = {} return url, params + def from_templates_count( smarts_str: str, template_ids_str: str, @@ -66,9 +69,9 @@ chemical_domain_str: str, ec_number_str: str, min_radius_int: int, - valid_str: str, + valid_str: str, dedup_str: str, - ) -> Tuple: +) -> Tuple: url = f"{BASE_URL}/templates_count" params = [] if smarts_str: @@ -91,6 +94,7 @@ params.append(("dedup", dedup_str)) return url, params + def from_templates_export( generation_token_str: str, smarts_str: str, @@ -100,9 +104,9 @@ chemical_domain_str: str, ec_number_str: str, min_radius_int: int, - valid_str: str, + valid_str: str, dedup_str: str, - ) -> Tuple: +) -> Tuple: url = f"{BASE_URL}/templates_export" params = [] if generation_token_str: @@ -127,19 +131,23 @@ params.append(("dedup", dedup_str)) return url, params + def query(url: str, params: Dict): response = requests.get(url, params=params) response.raise_for_status() return response + def write_json(path: str, data: Dict): with open(path, "w") as fd: json.dump(data, fd, indent=4) + def write_tab(path: str, data: str): with open(path, "w") as fd: fd.write(data) + def main(): parser = argparse.ArgumentParser( description="Query RetroRules API via command-line endpoints." @@ -215,7 +223,7 @@ required=True, help="Path to output JSON file", ) - + # Subcommand: templates-sources parser_tem_sou = subparsers.add_parser("templates-sources", help="From templates-sources") parser_tem_sou.add_argument("--input-template-id-str", required=True, help="Template ID") diff -r 95b4196b4ded -r 815748762646 retrorules.xml --- a/retrorules.xml Mon Sep 15 12:59:58 2025 +0000 +++ b/retrorules.xml Thu Oct 02 14:27:31 2025 +0000 @@ -1,4 +1,4 @@ - + Querying the RetroRules REST API requests @@ -166,7 +166,7 @@ - + @@ -174,7 +174,7 @@ - + @@ -182,7 +182,7 @@ - +