tooluniverse 0.2.0__py3-none-any.whl ā 1.0.1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of tooluniverse might be problematic. Click here for more details.
- tooluniverse/__init__.py +340 -4
- tooluniverse/admetai_tool.py +84 -0
- tooluniverse/agentic_tool.py +563 -0
- tooluniverse/alphafold_tool.py +96 -0
- tooluniverse/base_tool.py +129 -6
- tooluniverse/boltz_tool.py +207 -0
- tooluniverse/chem_tool.py +192 -0
- tooluniverse/compose_scripts/__init__.py +1 -0
- tooluniverse/compose_scripts/biomarker_discovery.py +293 -0
- tooluniverse/compose_scripts/comprehensive_drug_discovery.py +186 -0
- tooluniverse/compose_scripts/drug_safety_analyzer.py +89 -0
- tooluniverse/compose_scripts/literature_tool.py +34 -0
- tooluniverse/compose_scripts/output_summarizer.py +279 -0
- tooluniverse/compose_scripts/tool_description_optimizer.py +681 -0
- tooluniverse/compose_scripts/tool_discover.py +705 -0
- tooluniverse/compose_scripts/tool_graph_composer.py +448 -0
- tooluniverse/compose_tool.py +371 -0
- tooluniverse/ctg_tool.py +1002 -0
- tooluniverse/custom_tool.py +81 -0
- tooluniverse/dailymed_tool.py +108 -0
- tooluniverse/data/admetai_tools.json +155 -0
- tooluniverse/data/adverse_event_tools.json +108 -0
- tooluniverse/data/agentic_tools.json +1156 -0
- tooluniverse/data/alphafold_tools.json +87 -0
- tooluniverse/data/boltz_tools.json +9 -0
- tooluniverse/data/chembl_tools.json +16 -0
- tooluniverse/data/clinicaltrials_gov_tools.json +326 -0
- tooluniverse/data/compose_tools.json +202 -0
- tooluniverse/data/dailymed_tools.json +70 -0
- tooluniverse/data/dataset_tools.json +646 -0
- tooluniverse/data/disease_target_score_tools.json +712 -0
- tooluniverse/data/efo_tools.json +17 -0
- tooluniverse/data/embedding_tools.json +319 -0
- tooluniverse/data/enrichr_tools.json +31 -0
- tooluniverse/data/europe_pmc_tools.json +22 -0
- tooluniverse/data/expert_feedback_tools.json +10 -0
- tooluniverse/data/fda_drug_adverse_event_tools.json +491 -0
- tooluniverse/data/fda_drug_labeling_tools.json +1 -1
- tooluniverse/data/fda_drugs_with_brand_generic_names_for_tool.py +76929 -148860
- tooluniverse/data/finder_tools.json +209 -0
- tooluniverse/data/gene_ontology_tools.json +113 -0
- tooluniverse/data/gwas_tools.json +1082 -0
- tooluniverse/data/hpa_tools.json +333 -0
- tooluniverse/data/humanbase_tools.json +47 -0
- tooluniverse/data/idmap_tools.json +74 -0
- tooluniverse/data/mcp_client_tools_example.json +113 -0
- tooluniverse/data/mcpautoloadertool_defaults.json +28 -0
- tooluniverse/data/medlineplus_tools.json +141 -0
- tooluniverse/data/monarch_tools.json +1 -1
- tooluniverse/data/openalex_tools.json +36 -0
- tooluniverse/data/opentarget_tools.json +1 -1
- tooluniverse/data/output_summarization_tools.json +101 -0
- tooluniverse/data/packages/bioinformatics_core_tools.json +1756 -0
- tooluniverse/data/packages/categorized_tools.txt +206 -0
- tooluniverse/data/packages/cheminformatics_tools.json +347 -0
- tooluniverse/data/packages/earth_sciences_tools.json +74 -0
- tooluniverse/data/packages/genomics_tools.json +776 -0
- tooluniverse/data/packages/image_processing_tools.json +38 -0
- tooluniverse/data/packages/machine_learning_tools.json +789 -0
- tooluniverse/data/packages/neuroscience_tools.json +62 -0
- tooluniverse/data/packages/original_tools.txt +0 -0
- tooluniverse/data/packages/physics_astronomy_tools.json +62 -0
- tooluniverse/data/packages/scientific_computing_tools.json +560 -0
- tooluniverse/data/packages/single_cell_tools.json +453 -0
- tooluniverse/data/packages/structural_biology_tools.json +396 -0
- tooluniverse/data/packages/visualization_tools.json +399 -0
- tooluniverse/data/pubchem_tools.json +215 -0
- tooluniverse/data/pubtator_tools.json +68 -0
- tooluniverse/data/rcsb_pdb_tools.json +1332 -0
- tooluniverse/data/reactome_tools.json +19 -0
- tooluniverse/data/semantic_scholar_tools.json +26 -0
- tooluniverse/data/special_tools.json +2 -25
- tooluniverse/data/tool_composition_tools.json +88 -0
- tooluniverse/data/toolfinderkeyword_defaults.json +34 -0
- tooluniverse/data/txagent_client_tools.json +9 -0
- tooluniverse/data/uniprot_tools.json +211 -0
- tooluniverse/data/url_fetch_tools.json +94 -0
- tooluniverse/data/uspto_downloader_tools.json +9 -0
- tooluniverse/data/uspto_tools.json +811 -0
- tooluniverse/data/xml_tools.json +3275 -0
- tooluniverse/dataset_tool.py +296 -0
- tooluniverse/default_config.py +165 -0
- tooluniverse/efo_tool.py +42 -0
- tooluniverse/embedding_database.py +630 -0
- tooluniverse/embedding_sync.py +396 -0
- tooluniverse/enrichr_tool.py +266 -0
- tooluniverse/europe_pmc_tool.py +52 -0
- tooluniverse/execute_function.py +1775 -95
- tooluniverse/extended_hooks.py +444 -0
- tooluniverse/gene_ontology_tool.py +194 -0
- tooluniverse/graphql_tool.py +158 -36
- tooluniverse/gwas_tool.py +358 -0
- tooluniverse/hpa_tool.py +1645 -0
- tooluniverse/humanbase_tool.py +389 -0
- tooluniverse/logging_config.py +254 -0
- tooluniverse/mcp_client_tool.py +764 -0
- tooluniverse/mcp_integration.py +413 -0
- tooluniverse/mcp_tool_registry.py +925 -0
- tooluniverse/medlineplus_tool.py +337 -0
- tooluniverse/openalex_tool.py +228 -0
- tooluniverse/openfda_adv_tool.py +283 -0
- tooluniverse/openfda_tool.py +393 -160
- tooluniverse/output_hook.py +1122 -0
- tooluniverse/package_tool.py +195 -0
- tooluniverse/pubchem_tool.py +158 -0
- tooluniverse/pubtator_tool.py +168 -0
- tooluniverse/rcsb_pdb_tool.py +38 -0
- tooluniverse/reactome_tool.py +108 -0
- tooluniverse/remote/boltz/boltz_mcp_server.py +50 -0
- tooluniverse/remote/depmap_24q2/depmap_24q2_mcp_tool.py +442 -0
- tooluniverse/remote/expert_feedback/human_expert_mcp_tools.py +2013 -0
- tooluniverse/remote/expert_feedback/simple_test.py +23 -0
- tooluniverse/remote/expert_feedback/start_web_interface.py +188 -0
- tooluniverse/remote/expert_feedback/web_only_interface.py +0 -0
- tooluniverse/remote/immune_compass/compass_tool.py +327 -0
- tooluniverse/remote/pinnacle/pinnacle_tool.py +328 -0
- tooluniverse/remote/transcriptformer/transcriptformer_tool.py +586 -0
- tooluniverse/remote/uspto_downloader/uspto_downloader_mcp_server.py +61 -0
- tooluniverse/remote/uspto_downloader/uspto_downloader_tool.py +120 -0
- tooluniverse/remote_tool.py +99 -0
- tooluniverse/restful_tool.py +53 -30
- tooluniverse/scripts/generate_tool_graph.py +408 -0
- tooluniverse/scripts/visualize_tool_graph.py +829 -0
- tooluniverse/semantic_scholar_tool.py +62 -0
- tooluniverse/smcp.py +2452 -0
- tooluniverse/smcp_server.py +975 -0
- tooluniverse/test/mcp_server_test.py +0 -0
- tooluniverse/test/test_admetai_tool.py +370 -0
- tooluniverse/test/test_agentic_tool.py +129 -0
- tooluniverse/test/test_alphafold_tool.py +71 -0
- tooluniverse/test/test_chem_tool.py +37 -0
- tooluniverse/test/test_compose_lieraturereview.py +63 -0
- tooluniverse/test/test_compose_tool.py +448 -0
- tooluniverse/test/test_dailymed.py +69 -0
- tooluniverse/test/test_dataset_tool.py +200 -0
- tooluniverse/test/test_disease_target_score.py +56 -0
- tooluniverse/test/test_drugbank_filter_examples.py +179 -0
- tooluniverse/test/test_efo.py +31 -0
- tooluniverse/test/test_enrichr_tool.py +21 -0
- tooluniverse/test/test_europe_pmc_tool.py +20 -0
- tooluniverse/test/test_fda_adv.py +95 -0
- tooluniverse/test/test_fda_drug_labeling.py +91 -0
- tooluniverse/test/test_gene_ontology_tools.py +66 -0
- tooluniverse/test/test_gwas_tool.py +139 -0
- tooluniverse/test/test_hpa.py +625 -0
- tooluniverse/test/test_humanbase_tool.py +20 -0
- tooluniverse/test/test_idmap_tools.py +61 -0
- tooluniverse/test/test_mcp_server.py +211 -0
- tooluniverse/test/test_mcp_tool.py +247 -0
- tooluniverse/test/test_medlineplus.py +220 -0
- tooluniverse/test/test_openalex_tool.py +32 -0
- tooluniverse/test/test_opentargets.py +28 -0
- tooluniverse/test/test_pubchem_tool.py +116 -0
- tooluniverse/test/test_pubtator_tool.py +37 -0
- tooluniverse/test/test_rcsb_pdb_tool.py +86 -0
- tooluniverse/test/test_reactome.py +54 -0
- tooluniverse/test/test_semantic_scholar_tool.py +24 -0
- tooluniverse/test/test_software_tools.py +147 -0
- tooluniverse/test/test_tool_description_optimizer.py +49 -0
- tooluniverse/test/test_tool_finder.py +26 -0
- tooluniverse/test/test_tool_finder_llm.py +252 -0
- tooluniverse/test/test_tools_find.py +195 -0
- tooluniverse/test/test_uniprot_tools.py +74 -0
- tooluniverse/test/test_uspto_tool.py +72 -0
- tooluniverse/test/test_xml_tool.py +113 -0
- tooluniverse/tool_finder_embedding.py +267 -0
- tooluniverse/tool_finder_keyword.py +693 -0
- tooluniverse/tool_finder_llm.py +699 -0
- tooluniverse/tool_graph_web_ui.py +955 -0
- tooluniverse/tool_registry.py +416 -0
- tooluniverse/uniprot_tool.py +155 -0
- tooluniverse/url_tool.py +253 -0
- tooluniverse/uspto_tool.py +240 -0
- tooluniverse/utils.py +369 -41
- tooluniverse/xml_tool.py +369 -0
- tooluniverse-1.0.1.dist-info/METADATA +387 -0
- tooluniverse-1.0.1.dist-info/RECORD +182 -0
- tooluniverse-1.0.1.dist-info/entry_points.txt +9 -0
- tooluniverse/generate_mcp_tools.py +0 -113
- tooluniverse/mcp_server.py +0 -3340
- tooluniverse-0.2.0.dist-info/METADATA +0 -139
- tooluniverse-0.2.0.dist-info/RECORD +0 -21
- tooluniverse-0.2.0.dist-info/entry_points.txt +0 -4
- {tooluniverse-0.2.0.dist-info ā tooluniverse-1.0.1.dist-info}/WHEEL +0 -0
- {tooluniverse-0.2.0.dist-info ā tooluniverse-1.0.1.dist-info}/licenses/LICENSE +0 -0
- {tooluniverse-0.2.0.dist-info ā tooluniverse-1.0.1.dist-info}/top_level.txt +0 -0
|
@@ -0,0 +1,625 @@
|
|
|
1
|
+
# test_hpa.py
|
|
2
|
+
# Comprehensive test file for all HPA tools including enhanced optimized tools
|
|
3
|
+
|
|
4
|
+
from tooluniverse import ToolUniverse
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
# Helper function to format dictionary values
|
|
8
|
+
def format_value(value, max_length=800):
|
|
9
|
+
"""Format output values, showing more detail for agent reasoning"""
|
|
10
|
+
if isinstance(value, dict):
|
|
11
|
+
formatted = str(value)
|
|
12
|
+
if len(formatted) > max_length:
|
|
13
|
+
return formatted[:max_length] + "... (truncated)"
|
|
14
|
+
return formatted
|
|
15
|
+
elif isinstance(value, list):
|
|
16
|
+
if len(value) > 15: # Show more list items for better context
|
|
17
|
+
return f"{value[:15]}... (total {len(value)} items)"
|
|
18
|
+
return value
|
|
19
|
+
elif isinstance(value, str) and len(value) > max_length:
|
|
20
|
+
return value[:max_length] + "..."
|
|
21
|
+
return value
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
# Initialize ToolUniverse and load all tools
|
|
25
|
+
print("š§Ŗ Comprehensive HPA Tools Testing")
|
|
26
|
+
print("=" * 80)
|
|
27
|
+
print("Testing all HPA tools with complete input/output display for agent reasoning")
|
|
28
|
+
print("=" * 80)
|
|
29
|
+
|
|
30
|
+
tooluni = ToolUniverse()
|
|
31
|
+
tooluni.load_tools()
|
|
32
|
+
|
|
33
|
+
# Define test genes and parameters with biological context
|
|
34
|
+
VALID_GENE = "TP53" # Tumor suppressor gene - nuclear protein
|
|
35
|
+
VALID_GENE_2 = "BRCA1" # Breast cancer susceptibility gene
|
|
36
|
+
VALID_GENE_3 = "EGFR" # Epidermal growth factor receptor
|
|
37
|
+
VALID_GENE_4 = "ACTB" # Beta-actin - housekeeping gene
|
|
38
|
+
VALID_GENE_5 = "GFAP" # Glial fibrillary acidic protein
|
|
39
|
+
VALID_GENE_6 = "INS" # Insulin - pancreas-specific
|
|
40
|
+
VALID_GENE_7 = "CD3E" # T-cell surface glycoprotein
|
|
41
|
+
VALID_CELL_LINE = "hela" # HeLa cervical cancer cell line
|
|
42
|
+
VALID_DISEASE = "breast_cancer" # Breast cancer
|
|
43
|
+
VALID_ENSEMBL_ID = "ENSG00000134057" # CCNB1 gene's Ensembl ID
|
|
44
|
+
VALID_ENSEMBL_ID_2 = "ENSG00000141510" # TP53 gene's Ensembl ID
|
|
45
|
+
VALID_ENSEMBL_ID_3 = "ENSG00000012048" # BRCA1 gene's Ensembl ID
|
|
46
|
+
VALID_ENSEMBL_ID_4 = "ENSG00000075624" # ACTB gene's Ensembl ID
|
|
47
|
+
VALID_ENSEMBL_ID_5 = "ENSG00000146648" # EGFR gene's Ensembl ID
|
|
48
|
+
|
|
49
|
+
# Comprehensive test cases covering all HPA tools
|
|
50
|
+
comprehensive_test_queries = [
|
|
51
|
+
# === GENE SEARCH AND BASIC INFO TOOLS ===
|
|
52
|
+
{
|
|
53
|
+
"name": "HPA_search_genes_by_query",
|
|
54
|
+
"arguments": {"search_query": VALID_GENE},
|
|
55
|
+
"description": "Search for TP53 gene to get Ensembl ID and synonyms",
|
|
56
|
+
"biological_context": "TP53 is a crucial tumor suppressor gene, mutations cause cancer",
|
|
57
|
+
"expected_output": "Should return gene name, Ensembl ID, and known synonyms",
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
"name": "HPA_search_genes_by_query",
|
|
61
|
+
"arguments": {"search_query": "BCAS1"},
|
|
62
|
+
"description": "Search for BCAS1 gene (breast carcinoma amplified sequence 1)",
|
|
63
|
+
"biological_context": "BCAS1 is involved in breast cancer progression",
|
|
64
|
+
"expected_output": "Should return ENSG00000064787 as Ensembl ID",
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
"name": "HPA_get_gene_basic_info_by_ensembl_id",
|
|
68
|
+
"arguments": {"ensembl_id": VALID_ENSEMBL_ID_2},
|
|
69
|
+
"description": "Get basic gene information for TP53 using JSON API",
|
|
70
|
+
"biological_context": "TP53 basic info should include transcription regulation functions",
|
|
71
|
+
"expected_output": "Gene name, synonyms, Uniprot ID, biological processes",
|
|
72
|
+
},
|
|
73
|
+
# === EXPRESSION ANALYSIS TOOLS ===
|
|
74
|
+
{
|
|
75
|
+
"name": "HPA_get_comparative_expression_by_gene_and_cellline",
|
|
76
|
+
"arguments": {"gene_name": VALID_GENE, "cell_line": VALID_CELL_LINE},
|
|
77
|
+
"description": "Compare TP53 expression between HeLa cells and healthy tissues",
|
|
78
|
+
"biological_context": "TP53 is often mutated/dysregulated in cancer cell lines like HeLa",
|
|
79
|
+
"expected_output": "Cell line expression vs healthy tissue expression with comparison",
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
"name": "HPA_get_disease_expression_by_gene_tissue_disease",
|
|
83
|
+
"arguments": {"gene_name": VALID_GENE_2, "disease_name": VALID_DISEASE},
|
|
84
|
+
"description": "Compare BRCA1 expression in breast cancer vs healthy breast tissue",
|
|
85
|
+
"biological_context": "BRCA1 mutations are major risk factor for breast cancer",
|
|
86
|
+
"expected_output": "Disease vs healthy expression with fold change analysis",
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
"name": "HPA_get_rna_expression_in_specific_tissues",
|
|
90
|
+
"arguments": {
|
|
91
|
+
"ensembl_id": VALID_ENSEMBL_ID_2,
|
|
92
|
+
"tissue_names": ["brain", "liver", "heart"],
|
|
93
|
+
},
|
|
94
|
+
"description": "Get TP53 RNA expression levels in brain, liver, and heart tissues",
|
|
95
|
+
"biological_context": "TP53 should be expressed in all tissues as tumor suppressor",
|
|
96
|
+
"expected_output": "nTPM values for each tissue with expression level categories",
|
|
97
|
+
},
|
|
98
|
+
# === NEW OPTIMIZED EXPRESSION TOOLS ===
|
|
99
|
+
{
|
|
100
|
+
"name": "HPA_get_rna_expression_by_source",
|
|
101
|
+
"arguments": {
|
|
102
|
+
"gene_name": VALID_GENE_4,
|
|
103
|
+
"source_type": "tissue",
|
|
104
|
+
"source_name": "brain",
|
|
105
|
+
},
|
|
106
|
+
"description": "Get ACTB expression in brain using optimized column-based query",
|
|
107
|
+
"biological_context": "ACTB is housekeeping gene, should have high expression everywhere",
|
|
108
|
+
"expected_output": "High nTPM value with 'Very high' or 'High' expression level",
|
|
109
|
+
},
|
|
110
|
+
{
|
|
111
|
+
"name": "HPA_get_rna_expression_by_source",
|
|
112
|
+
"arguments": {
|
|
113
|
+
"gene_name": VALID_GENE_6,
|
|
114
|
+
"source_type": "tissue",
|
|
115
|
+
"source_name": "pancreas",
|
|
116
|
+
},
|
|
117
|
+
"description": "Get insulin expression in pancreas using tissue-specific column",
|
|
118
|
+
"biological_context": "Insulin is exclusively produced by pancreatic beta cells",
|
|
119
|
+
"expected_output": "Very high nTPM value showing tissue specificity",
|
|
120
|
+
},
|
|
121
|
+
{
|
|
122
|
+
"name": "HPA_get_rna_expression_by_source",
|
|
123
|
+
"arguments": {
|
|
124
|
+
"gene_name": VALID_GENE_5,
|
|
125
|
+
"source_type": "brain",
|
|
126
|
+
"source_name": "cerebellum",
|
|
127
|
+
},
|
|
128
|
+
"description": "Get GFAP expression in cerebellum using brain region-specific column",
|
|
129
|
+
"biological_context": "GFAP is astrocyte marker, should be high in brain regions",
|
|
130
|
+
"expected_output": "High expression indicating glial cell presence",
|
|
131
|
+
},
|
|
132
|
+
{
|
|
133
|
+
"name": "HPA_get_rna_expression_by_source",
|
|
134
|
+
"arguments": {
|
|
135
|
+
"gene_name": VALID_GENE_7,
|
|
136
|
+
"source_type": "blood",
|
|
137
|
+
"source_name": "t_cell",
|
|
138
|
+
},
|
|
139
|
+
"description": "Get CD3E expression in T cells using blood cell-specific column",
|
|
140
|
+
"biological_context": "CD3E is T cell receptor component, T cell-specific marker",
|
|
141
|
+
"expected_output": "Very high expression showing T cell specificity",
|
|
142
|
+
},
|
|
143
|
+
# === FUNCTIONAL ANALYSIS TOOLS ===
|
|
144
|
+
{
|
|
145
|
+
"name": "HPA_get_biological_processes_by_gene",
|
|
146
|
+
"arguments": {"gene_name": VALID_GENE},
|
|
147
|
+
"description": "Get biological processes for TP53 with focus on key processes",
|
|
148
|
+
"biological_context": "TP53 involved in apoptosis, cell cycle, transcription regulation",
|
|
149
|
+
"expected_output": "List of processes highlighting apoptosis and cell cycle control",
|
|
150
|
+
},
|
|
151
|
+
{
|
|
152
|
+
"name": "HPA_get_contextual_biological_process_analysis",
|
|
153
|
+
"arguments": {"gene_name": VALID_GENE, "context_name": "brain"},
|
|
154
|
+
"description": "Analyze TP53 biological functions in brain tissue context",
|
|
155
|
+
"biological_context": "TP53 protects brain cells from DNA damage and cancer",
|
|
156
|
+
"expected_output": "Functional relevance assessment based on brain expression",
|
|
157
|
+
},
|
|
158
|
+
{
|
|
159
|
+
"name": "HPA_get_contextual_biological_process_analysis",
|
|
160
|
+
"arguments": {"gene_name": VALID_GENE_3, "context_name": "hela"},
|
|
161
|
+
"description": "Analyze EGFR functions in HeLa cell line context",
|
|
162
|
+
"biological_context": "EGFR drives cell proliferation, often overexpressed in cancer",
|
|
163
|
+
"expected_output": "High expression with growth/proliferation process relevance",
|
|
164
|
+
},
|
|
165
|
+
# === SUBCELLULAR LOCALIZATION TOOLS ===
|
|
166
|
+
{
|
|
167
|
+
"name": "HPA_get_subcellular_location",
|
|
168
|
+
"arguments": {"gene_name": VALID_GENE},
|
|
169
|
+
"description": "Get TP53 subcellular localization using optimized scml/scal columns",
|
|
170
|
+
"biological_context": "TP53 is nuclear transcription factor",
|
|
171
|
+
"expected_output": "Nuclear localization as main location",
|
|
172
|
+
},
|
|
173
|
+
{
|
|
174
|
+
"name": "HPA_get_subcellular_location",
|
|
175
|
+
"arguments": {"gene_name": VALID_GENE_4},
|
|
176
|
+
"description": "Get ACTB subcellular localization - cytoskeletal protein",
|
|
177
|
+
"biological_context": "Actin forms cytoskeletal filaments throughout cytoplasm",
|
|
178
|
+
"expected_output": "Cytoplasmic/cytoskeletal localization",
|
|
179
|
+
},
|
|
180
|
+
{
|
|
181
|
+
"name": "HPA_get_subcellular_location",
|
|
182
|
+
"arguments": {"gene_name": VALID_GENE_5},
|
|
183
|
+
"description": "Get GFAP subcellular localization - intermediate filament protein",
|
|
184
|
+
"biological_context": "GFAP forms intermediate filaments in astrocyte cytoplasm",
|
|
185
|
+
"expected_output": "Cytoplasmic intermediate filaments",
|
|
186
|
+
},
|
|
187
|
+
# === CANCER AND PROGNOSTICS TOOLS ===
|
|
188
|
+
{
|
|
189
|
+
"name": "HPA_get_cancer_prognostics_by_gene",
|
|
190
|
+
"arguments": {"ensembl_id": VALID_ENSEMBL_ID_2},
|
|
191
|
+
"description": "Get TP53 prognostic value across cancer types",
|
|
192
|
+
"biological_context": "TP53 mutations are prognostic markers in many cancers",
|
|
193
|
+
"expected_output": "Multiple cancer types with prognostic significance",
|
|
194
|
+
},
|
|
195
|
+
{
|
|
196
|
+
"name": "HPA_get_cancer_prognostics_by_gene",
|
|
197
|
+
"arguments": {"ensembl_id": VALID_ENSEMBL_ID_3},
|
|
198
|
+
"description": "Get BRCA1 prognostic value in cancers",
|
|
199
|
+
"biological_context": "BRCA1 mutations affect treatment response and survival",
|
|
200
|
+
"expected_output": "Breast/ovarian cancer prognostic associations",
|
|
201
|
+
},
|
|
202
|
+
# === PROTEIN INTERACTION TOOLS ===
|
|
203
|
+
{
|
|
204
|
+
"name": "HPA_get_protein_interactions_by_gene",
|
|
205
|
+
"arguments": {"gene_name": VALID_GENE_3},
|
|
206
|
+
"description": "Get EGFR protein-protein interactions",
|
|
207
|
+
"biological_context": "EGFR interacts with many signaling proteins",
|
|
208
|
+
"expected_output": "List of interaction partners involved in growth signaling",
|
|
209
|
+
},
|
|
210
|
+
{
|
|
211
|
+
"name": "HPA_get_protein_interactions_by_gene",
|
|
212
|
+
"arguments": {"gene_name": VALID_GENE},
|
|
213
|
+
"description": "Get TP53 protein-protein interactions",
|
|
214
|
+
"biological_context": "TP53 interacts with MDM2, p21, and other cell cycle proteins",
|
|
215
|
+
"expected_output": "Interaction partners in DNA damage response pathway",
|
|
216
|
+
},
|
|
217
|
+
# === COMPREHENSIVE GENE DETAILS (IMAGES) ===
|
|
218
|
+
{
|
|
219
|
+
"name": "HPA_get_comprehensive_gene_details_by_ensembl_id",
|
|
220
|
+
"arguments": {"ensembl_id": "ENSG00000064787"},
|
|
221
|
+
"description": "Get comprehensive BCAS1 gene details with enhanced XML parsing",
|
|
222
|
+
"biological_context": "Should include tissue IHC images and subcellular IF images",
|
|
223
|
+
"expected_output": "Gene info, IHC images, IF images, antibody data, expression summary",
|
|
224
|
+
},
|
|
225
|
+
{
|
|
226
|
+
"name": "HPA_get_comprehensive_gene_details_by_ensembl_id",
|
|
227
|
+
"arguments": {
|
|
228
|
+
"ensembl_id": VALID_ENSEMBL_ID_2,
|
|
229
|
+
"include_images": True,
|
|
230
|
+
"include_antibodies": True,
|
|
231
|
+
},
|
|
232
|
+
"description": "Get comprehensive TP53 details with all data types",
|
|
233
|
+
"biological_context": "TP53 should have extensive antibody validation and tissue images",
|
|
234
|
+
"expected_output": "Complete gene profile with images, antibodies, expression data",
|
|
235
|
+
},
|
|
236
|
+
# === ERROR HANDLING TESTS ===
|
|
237
|
+
{
|
|
238
|
+
"name": "HPA_get_rna_expression_by_source",
|
|
239
|
+
"arguments": {
|
|
240
|
+
"gene_name": VALID_GENE,
|
|
241
|
+
"source_type": "invalid_type",
|
|
242
|
+
"source_name": "brain",
|
|
243
|
+
},
|
|
244
|
+
"description": "Error test: invalid source_type parameter",
|
|
245
|
+
"biological_context": "Should demonstrate proper error handling",
|
|
246
|
+
"expected_output": "Error message with available source types listed",
|
|
247
|
+
},
|
|
248
|
+
{
|
|
249
|
+
"name": "HPA_get_subcellular_location",
|
|
250
|
+
"arguments": {},
|
|
251
|
+
"description": "Error test: missing required gene_name parameter",
|
|
252
|
+
"biological_context": "Should demonstrate parameter validation",
|
|
253
|
+
"expected_output": "Error message indicating gene_name is required",
|
|
254
|
+
},
|
|
255
|
+
{
|
|
256
|
+
"name": "HPA_get_cancer_prognostics_by_gene",
|
|
257
|
+
"arguments": {"ensembl_id": "INVALID_ENSEMBL_ID"},
|
|
258
|
+
"description": "Error test: invalid Ensembl ID",
|
|
259
|
+
"biological_context": "Should handle non-existent gene IDs gracefully",
|
|
260
|
+
"expected_output": "404 error or no data found message",
|
|
261
|
+
},
|
|
262
|
+
# === INTELLIGENT RECOMMENDATION TESTS ===
|
|
263
|
+
{
|
|
264
|
+
"name": "HPA_get_rna_expression_by_source",
|
|
265
|
+
"arguments": {
|
|
266
|
+
"gene_name": "ACTB",
|
|
267
|
+
"source_type": "blood",
|
|
268
|
+
"source_name": "tcell",
|
|
269
|
+
},
|
|
270
|
+
"description": "Smart recommendation test: typo in source_name (tcell ā t_cell)",
|
|
271
|
+
"biological_context": "Should provide intelligent suggestions for misspelled parameters",
|
|
272
|
+
"expected_output": "Error with similar options: ['t_cell'] and complete available list",
|
|
273
|
+
},
|
|
274
|
+
{
|
|
275
|
+
"name": "HPA_get_rna_expression_by_source",
|
|
276
|
+
"arguments": {
|
|
277
|
+
"gene_name": "GFAP",
|
|
278
|
+
"source_type": "brain",
|
|
279
|
+
"source_name": "cortex",
|
|
280
|
+
},
|
|
281
|
+
"description": "Smart recommendation test: partial match (cortex ā cerebral_cortex)",
|
|
282
|
+
"biological_context": "Should find partial matches for brain region names",
|
|
283
|
+
"expected_output": "Error with similar options suggesting cerebral_cortex",
|
|
284
|
+
},
|
|
285
|
+
{
|
|
286
|
+
"name": "HPA_get_contextual_biological_process_analysis",
|
|
287
|
+
"arguments": {"gene_name": "TP53", "context_name": "foot"},
|
|
288
|
+
"description": "Smart recommendation test: invalid tissue name",
|
|
289
|
+
"biological_context": "Should provide comprehensive tissue and cell line options",
|
|
290
|
+
"expected_output": "Error with available tissues and cell lines listed",
|
|
291
|
+
},
|
|
292
|
+
{
|
|
293
|
+
"name": "HPA_get_contextual_biological_process_analysis",
|
|
294
|
+
"arguments": {"gene_name": "EGFR", "context_name": "muscle"},
|
|
295
|
+
"description": "Smart recommendation test: ambiguous tissue name (muscle ā skeletal_muscle)",
|
|
296
|
+
"biological_context": "Should suggest specific muscle types available",
|
|
297
|
+
"expected_output": "Error with similar options for muscle-related tissues",
|
|
298
|
+
},
|
|
299
|
+
{
|
|
300
|
+
"name": "HPA_get_comparative_expression_by_gene_and_cellline",
|
|
301
|
+
"arguments": {"gene_name": "BRCA1", "cell_line": "heLa"},
|
|
302
|
+
"description": "Smart recommendation test: case sensitivity (heLa ā hela)",
|
|
303
|
+
"biological_context": "Should handle case variations in cell line names",
|
|
304
|
+
"expected_output": "Error with similar options suggesting hela",
|
|
305
|
+
},
|
|
306
|
+
{
|
|
307
|
+
"name": "HPA_get_comparative_expression_by_gene_and_cellline",
|
|
308
|
+
"arguments": {"gene_name": "EGFR", "cell_line": "mcf"},
|
|
309
|
+
"description": "Smart recommendation test: partial cell line name (mcf ā mcf7)",
|
|
310
|
+
"biological_context": "Should suggest complete cell line names",
|
|
311
|
+
"expected_output": "Error with similar options suggesting mcf7",
|
|
312
|
+
},
|
|
313
|
+
{
|
|
314
|
+
"name": "HPA_get_disease_expression_by_gene_tissue_disease",
|
|
315
|
+
"arguments": {"gene_name": "BRCA1", "disease_name": "cancer"},
|
|
316
|
+
"description": "Smart recommendation test: generic disease name",
|
|
317
|
+
"biological_context": "Should provide specific cancer type options",
|
|
318
|
+
"expected_output": "Error with specific cancer types like breast_cancer, lung_cancer",
|
|
319
|
+
},
|
|
320
|
+
{
|
|
321
|
+
"name": "HPA_get_disease_expression_by_gene_tissue_disease",
|
|
322
|
+
"arguments": {"gene_name": "TP53", "disease_name": "colon"},
|
|
323
|
+
"description": "Smart recommendation test: tissue name as disease (colon ā colon_cancer)",
|
|
324
|
+
"biological_context": "Should suggest adding '_cancer' suffix",
|
|
325
|
+
"expected_output": "Error with similar options suggesting colon_cancer",
|
|
326
|
+
},
|
|
327
|
+
{
|
|
328
|
+
"name": "HPA_get_rna_expression_by_source",
|
|
329
|
+
"arguments": {
|
|
330
|
+
"gene_name": "INS",
|
|
331
|
+
"source_type": "tissue",
|
|
332
|
+
"source_name": "islet",
|
|
333
|
+
},
|
|
334
|
+
"description": "Smart recommendation test: related but different term (islet ā pancreas)",
|
|
335
|
+
"biological_context": "Should suggest pancreas for insulin-related queries",
|
|
336
|
+
"expected_output": "Error with pancreas in similar options",
|
|
337
|
+
},
|
|
338
|
+
{
|
|
339
|
+
"name": "HPA_get_rna_expression_by_source",
|
|
340
|
+
"arguments": {
|
|
341
|
+
"gene_name": "CD3E",
|
|
342
|
+
"source_type": "blood",
|
|
343
|
+
"source_name": "lymphocyte",
|
|
344
|
+
},
|
|
345
|
+
"description": "Smart recommendation test: general term (lymphocyte ā t_cell, b_cell)",
|
|
346
|
+
"biological_context": "Should suggest specific lymphocyte subtypes",
|
|
347
|
+
"expected_output": "Error with t_cell and b_cell in similar options",
|
|
348
|
+
},
|
|
349
|
+
# === EDGE CASE RECOMMENDATION TESTS ===
|
|
350
|
+
{
|
|
351
|
+
"name": "HPA_get_contextual_biological_process_analysis",
|
|
352
|
+
"arguments": {"gene_name": "ACTB", "context_name": ""},
|
|
353
|
+
"description": "Edge case test: empty context_name",
|
|
354
|
+
"biological_context": "Should require context_name parameter",
|
|
355
|
+
"expected_output": "Error indicating context_name is required",
|
|
356
|
+
},
|
|
357
|
+
{
|
|
358
|
+
"name": "HPA_get_rna_expression_by_source",
|
|
359
|
+
"arguments": {
|
|
360
|
+
"gene_name": "GFAP",
|
|
361
|
+
"source_type": "tissue",
|
|
362
|
+
"source_name": "xyz123",
|
|
363
|
+
},
|
|
364
|
+
"description": "Edge case test: completely invalid source_name",
|
|
365
|
+
"biological_context": "Should show no similar options but list all available",
|
|
366
|
+
"expected_output": "Error with complete tissue list but no similar options",
|
|
367
|
+
},
|
|
368
|
+
{
|
|
369
|
+
"name": "HPA_get_rna_expression_in_specific_tissues",
|
|
370
|
+
"arguments": {"ensembl_id": VALID_ENSEMBL_ID_2, "tissue_names": "not_a_list"},
|
|
371
|
+
"description": "Edge case test: wrong parameter type",
|
|
372
|
+
"biological_context": "Should provide example of correct format",
|
|
373
|
+
"expected_output": "Error with tissue name examples",
|
|
374
|
+
},
|
|
375
|
+
]
|
|
376
|
+
|
|
377
|
+
# Execute all test cases with detailed output
|
|
378
|
+
for idx, query_info in enumerate(comprehensive_test_queries, 1):
|
|
379
|
+
print(f"\n[{idx}] TOOL: {query_info['name']}")
|
|
380
|
+
print(f"INPUT ARGUMENTS: {query_info['arguments']}")
|
|
381
|
+
print(f"DESCRIPTION: {query_info['description']}")
|
|
382
|
+
print(f"BIOLOGICAL CONTEXT: {query_info['biological_context']}")
|
|
383
|
+
print(f"EXPECTED OUTPUT: {query_info['expected_output']}")
|
|
384
|
+
print("-" * 80)
|
|
385
|
+
|
|
386
|
+
# Execute the query
|
|
387
|
+
result = tooluni.run(
|
|
388
|
+
{"name": query_info["name"], "arguments": query_info["arguments"]}
|
|
389
|
+
)
|
|
390
|
+
|
|
391
|
+
# Display results with complete formatting for agent reasoning
|
|
392
|
+
if isinstance(result, dict) and "error" in result:
|
|
393
|
+
print("ā ERROR RESULT:")
|
|
394
|
+
print(f" Error: {result['error']}")
|
|
395
|
+
if "detail" in result:
|
|
396
|
+
print(f" Detail: {result['detail']}")
|
|
397
|
+
|
|
398
|
+
# Enhanced interpretation for intelligent recommendation tests
|
|
399
|
+
error_msg = result["error"]
|
|
400
|
+
if "Similar options:" in error_msg:
|
|
401
|
+
print(" š§ SMART RECOMMENDATION: Tool provided intelligent suggestions!")
|
|
402
|
+
print(" š” FUZZY MATCHING: Successfully identified similar valid options")
|
|
403
|
+
print(" ⨠USER EXPERIENCE: Error message is helpful and actionable")
|
|
404
|
+
elif "Available" in error_msg and (
|
|
405
|
+
"tissues:" in error_msg
|
|
406
|
+
or "cell lines:" in error_msg
|
|
407
|
+
or "sources:" in error_msg
|
|
408
|
+
):
|
|
409
|
+
print(" š COMPREHENSIVE GUIDANCE: Tool provided complete option lists")
|
|
410
|
+
print(" šÆ PARAMETER VALIDATION: Clear indication of valid inputs")
|
|
411
|
+
elif "required" in error_msg:
|
|
412
|
+
print(" ā
PARAMETER VALIDATION: Proper required field checking")
|
|
413
|
+
else:
|
|
414
|
+
print(
|
|
415
|
+
" INTERPRETATION: Tool properly handled invalid input with informative error"
|
|
416
|
+
)
|
|
417
|
+
else:
|
|
418
|
+
print("ā
SUCCESS RESULT:")
|
|
419
|
+
|
|
420
|
+
if isinstance(result, dict):
|
|
421
|
+
# Display complete result data
|
|
422
|
+
print(" COMPLETE OUTPUT DATA:")
|
|
423
|
+
for key, value in result.items():
|
|
424
|
+
formatted_value = format_value(value)
|
|
425
|
+
print(f" {key}: {formatted_value}")
|
|
426
|
+
|
|
427
|
+
# Add biological interpretation
|
|
428
|
+
print(" BIOLOGICAL INTERPRETATION:")
|
|
429
|
+
|
|
430
|
+
# Expression data interpretation
|
|
431
|
+
if "expression_value" in result:
|
|
432
|
+
expr_val = result.get("expression_value", "N/A")
|
|
433
|
+
expr_level = result.get("expression_level", "Unknown")
|
|
434
|
+
source_type = result.get("source_type", "Unknown")
|
|
435
|
+
source_name = result.get("source_name", "Unknown")
|
|
436
|
+
column = result.get("column_queried", "Unknown")
|
|
437
|
+
gene = result.get("gene_name", "Unknown")
|
|
438
|
+
|
|
439
|
+
print(
|
|
440
|
+
f" Gene {gene} shows {expr_level} expression ({expr_val} nTPM)"
|
|
441
|
+
)
|
|
442
|
+
print(f" in {source_name} ({source_type}) via column '{column}'")
|
|
443
|
+
|
|
444
|
+
# Biological significance
|
|
445
|
+
if expr_val != "N/A":
|
|
446
|
+
try:
|
|
447
|
+
val = float(expr_val)
|
|
448
|
+
if val > 50:
|
|
449
|
+
print(
|
|
450
|
+
" SIGNIFICANCE: Very high expression suggests major functional role"
|
|
451
|
+
)
|
|
452
|
+
elif val > 10:
|
|
453
|
+
print(
|
|
454
|
+
" SIGNIFICANCE: High expression indicates important function"
|
|
455
|
+
)
|
|
456
|
+
elif val > 1:
|
|
457
|
+
print(
|
|
458
|
+
" SIGNIFICANCE: Moderate expression shows functional presence"
|
|
459
|
+
)
|
|
460
|
+
else:
|
|
461
|
+
print(
|
|
462
|
+
" SIGNIFICANCE: Low expression may indicate limited role"
|
|
463
|
+
)
|
|
464
|
+
except Exception:
|
|
465
|
+
print(" SIGNIFICANCE: Expression level unclear from data")
|
|
466
|
+
|
|
467
|
+
# Subcellular location interpretation
|
|
468
|
+
if "main_locations" in result:
|
|
469
|
+
main_locs = result.get("main_locations", [])
|
|
470
|
+
add_locs = result.get("additional_locations", [])
|
|
471
|
+
total = result.get("total_locations", 0)
|
|
472
|
+
gene = result.get("gene_name", "Unknown")
|
|
473
|
+
|
|
474
|
+
print(f" Gene {gene} localizes to {total} subcellular compartments")
|
|
475
|
+
if main_locs:
|
|
476
|
+
print(f" PRIMARY LOCATIONS: {', '.join(main_locs)}")
|
|
477
|
+
if add_locs:
|
|
478
|
+
print(f" ADDITIONAL LOCATIONS: {', '.join(add_locs)}")
|
|
479
|
+
|
|
480
|
+
# Functional implications
|
|
481
|
+
if any("nuclear" in loc.lower() for loc in main_locs):
|
|
482
|
+
print(
|
|
483
|
+
" FUNCTIONAL IMPLICATION: Nuclear localization suggests transcriptional role"
|
|
484
|
+
)
|
|
485
|
+
if any("cytoplasm" in loc.lower() for loc in main_locs):
|
|
486
|
+
print(
|
|
487
|
+
" FUNCTIONAL IMPLICATION: Cytoplasmic localization suggests metabolic/structural role"
|
|
488
|
+
)
|
|
489
|
+
if any("membrane" in loc.lower() for loc in main_locs):
|
|
490
|
+
print(
|
|
491
|
+
" FUNCTIONAL IMPLICATION: Membrane localization suggests signaling role"
|
|
492
|
+
)
|
|
493
|
+
|
|
494
|
+
# Cancer prognostics interpretation
|
|
495
|
+
if "prognostic_cancers_count" in result:
|
|
496
|
+
count = result.get("prognostic_cancers_count", 0)
|
|
497
|
+
gene = result.get("gene", "Unknown")
|
|
498
|
+
prognostics = result.get("prognostic_summary", [])
|
|
499
|
+
|
|
500
|
+
print(f" Gene {gene} has prognostic value in {count} cancer types")
|
|
501
|
+
if isinstance(prognostics, list) and prognostics:
|
|
502
|
+
for prog in prognostics[:3]: # Show first 3
|
|
503
|
+
cancer_type = prog.get("cancer_type", "Unknown")
|
|
504
|
+
prog_type = prog.get("prognostic_type", "Unknown")
|
|
505
|
+
print(f" {cancer_type}: {prog_type} prognostic marker")
|
|
506
|
+
print(
|
|
507
|
+
" CLINICAL SIGNIFICANCE: Can guide treatment decisions and prognosis"
|
|
508
|
+
)
|
|
509
|
+
|
|
510
|
+
# Protein interactions interpretation
|
|
511
|
+
if "interactor_count" in result:
|
|
512
|
+
count = result.get("interactor_count", 0)
|
|
513
|
+
gene = result.get("gene", "Unknown")
|
|
514
|
+
interactors = result.get("interactors", [])
|
|
515
|
+
|
|
516
|
+
print(f" Gene {gene} interacts with {count} proteins")
|
|
517
|
+
if interactors and count > 0:
|
|
518
|
+
print(
|
|
519
|
+
f" KEY INTERACTORS: {', '.join(interactors[:5])}"
|
|
520
|
+
) # Show first 5
|
|
521
|
+
print(
|
|
522
|
+
" NETWORK SIGNIFICANCE: High connectivity suggests central role in pathways"
|
|
523
|
+
)
|
|
524
|
+
else:
|
|
525
|
+
print(
|
|
526
|
+
" NETWORK SIGNIFICANCE: Limited interactions or data not available"
|
|
527
|
+
)
|
|
528
|
+
|
|
529
|
+
# Biological processes interpretation
|
|
530
|
+
if "total_biological_processes" in result:
|
|
531
|
+
total_processes = result.get("total_biological_processes", 0)
|
|
532
|
+
target_processes = result.get("target_process_names", [])
|
|
533
|
+
gene = result.get("gene_symbol", result.get("gene", "Unknown"))
|
|
534
|
+
|
|
535
|
+
print(
|
|
536
|
+
f" Gene {gene} participates in {total_processes} biological processes"
|
|
537
|
+
)
|
|
538
|
+
if target_processes:
|
|
539
|
+
print(f" KEY PROCESSES: {', '.join(target_processes)}")
|
|
540
|
+
print(
|
|
541
|
+
" FUNCTIONAL SIGNIFICANCE: Involvement in critical cellular processes"
|
|
542
|
+
)
|
|
543
|
+
|
|
544
|
+
# Comprehensive gene details interpretation
|
|
545
|
+
if "summary" in result and isinstance(result["summary"], dict):
|
|
546
|
+
summary = result["summary"]
|
|
547
|
+
gene = result.get("gene_name", "Unknown")
|
|
548
|
+
|
|
549
|
+
print(f" Gene {gene} comprehensive analysis:")
|
|
550
|
+
for sum_key, sum_val in summary.items():
|
|
551
|
+
print(f" {sum_key}: {sum_val}")
|
|
552
|
+
|
|
553
|
+
ihc_images = summary.get("total_ihc_images", 0)
|
|
554
|
+
if_images = summary.get("total_if_images", 0)
|
|
555
|
+
antibodies = summary.get("total_antibodies", 0)
|
|
556
|
+
|
|
557
|
+
print(
|
|
558
|
+
f" EXPERIMENTAL EVIDENCE: {ihc_images} tissue images, {if_images} subcellular images, {antibodies} antibodies"
|
|
559
|
+
)
|
|
560
|
+
print(" DATA QUALITY: Extensive experimental validation available")
|
|
561
|
+
|
|
562
|
+
# Contextual analysis interpretation
|
|
563
|
+
if "contextual_conclusion" in result:
|
|
564
|
+
conclusion = result.get("contextual_conclusion", "")
|
|
565
|
+
context = result.get("context", "Unknown")
|
|
566
|
+
gene = result.get("gene", "Unknown")
|
|
567
|
+
|
|
568
|
+
print(f" CONTEXTUAL ANALYSIS for {gene} in {context}:")
|
|
569
|
+
print(f" {conclusion}")
|
|
570
|
+
|
|
571
|
+
relevance = result.get("functional_relevance", "")
|
|
572
|
+
if relevance:
|
|
573
|
+
print(f" FUNCTIONAL RELEVANCE: {relevance}")
|
|
574
|
+
|
|
575
|
+
elif isinstance(result, list):
|
|
576
|
+
print(f" LIST RESULT: {len(result)} items")
|
|
577
|
+
if result:
|
|
578
|
+
print(f" FIRST ITEM: {format_value(result[0])}")
|
|
579
|
+
print(" INTERPRETATION: Multiple data points returned for analysis")
|
|
580
|
+
|
|
581
|
+
else:
|
|
582
|
+
print(f" RAW RESULT: {format_value(result)}")
|
|
583
|
+
print(" INTERPRETATION: Direct data output for further processing")
|
|
584
|
+
|
|
585
|
+
print("=" * 80)
|
|
586
|
+
|
|
587
|
+
print("\nšÆ COMPREHENSIVE HPA TOOLS TESTING COMPLETE!")
|
|
588
|
+
print("\nš TESTING SUMMARY:")
|
|
589
|
+
print(f"ā
Tested {len(comprehensive_test_queries)} different HPA tools and scenarios")
|
|
590
|
+
print(
|
|
591
|
+
"ā
Covered all tool categories: search, expression, function, localization, interactions, prognostics"
|
|
592
|
+
)
|
|
593
|
+
print("ā
Included both original and optimized enhanced tools")
|
|
594
|
+
print("ā
Demonstrated error handling and parameter validation")
|
|
595
|
+
print("ā
Added comprehensive intelligent recommendation testing")
|
|
596
|
+
print("ā
Provided complete input/output data for agent reasoning")
|
|
597
|
+
print("ā
Added biological context and functional interpretation")
|
|
598
|
+
|
|
599
|
+
print("\nš¬ ENHANCED FEATURES DEMONSTRATED:")
|
|
600
|
+
print("⨠Column-based optimized queries for direct data access")
|
|
601
|
+
print("⨠Comprehensive source type mappings (tissue/blood/brain/single_cell)")
|
|
602
|
+
print("⨠Enhanced XML parsing with improved image extraction")
|
|
603
|
+
print("⨠Intelligent error handling with informative messages")
|
|
604
|
+
print("⨠Smart parameter recommendations with fuzzy matching")
|
|
605
|
+
print("⨠Context-aware suggestions for biological terms")
|
|
606
|
+
print("⨠Biological interpretation of results for agent reasoning")
|
|
607
|
+
print("⨠Complete data transparency for downstream analysis")
|
|
608
|
+
|
|
609
|
+
print("\nš§ INTELLIGENT RECOMMENDATION FEATURES:")
|
|
610
|
+
print("š” Typo correction: 'tcell' ā suggests 't_cell'")
|
|
611
|
+
print("š” Partial matching: 'cortex' ā suggests 'cerebral_cortex'")
|
|
612
|
+
print("š” Case handling: 'heLa' ā suggests 'hela'")
|
|
613
|
+
print("š” Context awareness: 'muscle' ā suggests 'skeletal_muscle'")
|
|
614
|
+
print("š” Domain knowledge: 'islet' ā suggests 'pancreas' for insulin")
|
|
615
|
+
print("š” Hierarchical suggestions: 'lymphocyte' ā suggests 't_cell', 'b_cell'")
|
|
616
|
+
print("š” Comprehensive fallback: Shows all available options when no match")
|
|
617
|
+
print("š” Edge case handling: Empty parameters, wrong types, invalid inputs")
|
|
618
|
+
|
|
619
|
+
print("\nš” FOR AGENT USAGE:")
|
|
620
|
+
print("š All inputs and outputs are fully displayed")
|
|
621
|
+
print("š§ Biological context provided for each test")
|
|
622
|
+
print("š Results include functional interpretation")
|
|
623
|
+
print("ā” Both original and optimized tools available")
|
|
624
|
+
print("š”ļø Error handling demonstrates robustness")
|
|
625
|
+
print("\n" + "=" * 80)
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
from tooluniverse import ToolUniverse
|
|
2
|
+
|
|
3
|
+
# Step 1: Initialize tool universe
|
|
4
|
+
tooluni = ToolUniverse()
|
|
5
|
+
tooluni.load_tools()
|
|
6
|
+
|
|
7
|
+
test_queries = [
|
|
8
|
+
{
|
|
9
|
+
"name": "humanbase_ppi_analysis",
|
|
10
|
+
"arguments": {"gene_list": ["TP53", "USP7"], "tissue": "brain"},
|
|
11
|
+
},
|
|
12
|
+
]
|
|
13
|
+
|
|
14
|
+
for idx, query in enumerate(test_queries):
|
|
15
|
+
print(
|
|
16
|
+
f"\n[{idx+1}] Running tool: {query['name']} with arguments: {query['arguments']}"
|
|
17
|
+
)
|
|
18
|
+
result = tooluni.run(query)
|
|
19
|
+
print("ā
Success. Example output snippet:")
|
|
20
|
+
print(result if isinstance(result, dict) else str(result))
|