tooluniverse 1.0.9.1__py3-none-any.whl → 1.0.11__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 +57 -1
- tooluniverse/admetai_tool.py +1 -1
- tooluniverse/agentic_tool.py +65 -17
- tooluniverse/base_tool.py +19 -8
- tooluniverse/blast_tool.py +132 -0
- tooluniverse/boltz_tool.py +3 -3
- tooluniverse/cache/result_cache_manager.py +167 -12
- tooluniverse/cbioportal_tool.py +42 -0
- tooluniverse/clinvar_tool.py +268 -74
- tooluniverse/compose_scripts/drug_safety_analyzer.py +1 -1
- tooluniverse/compose_scripts/multi_agent_literature_search.py +1 -1
- tooluniverse/compose_scripts/output_summarizer.py +4 -4
- tooluniverse/compose_scripts/tool_discover.py +1941 -443
- tooluniverse/compose_scripts/tool_graph_composer.py +1 -1
- tooluniverse/compose_scripts/tool_metadata_generator.py +1 -1
- tooluniverse/compose_tool.py +9 -9
- tooluniverse/core_tool.py +2 -2
- tooluniverse/ctg_tool.py +4 -4
- tooluniverse/custom_tool.py +1 -1
- tooluniverse/data/agentic_tools.json +0 -370
- tooluniverse/data/alphafold_tools.json +6 -6
- tooluniverse/data/blast_tools.json +112 -0
- tooluniverse/data/cbioportal_tools.json +87 -0
- tooluniverse/data/clinvar_tools.json +235 -0
- tooluniverse/data/compose_tools.json +0 -89
- tooluniverse/data/dbsnp_tools.json +275 -0
- tooluniverse/data/emdb_tools.json +61 -0
- tooluniverse/data/ensembl_tools.json +259 -0
- tooluniverse/data/file_download_tools.json +275 -0
- tooluniverse/data/geo_tools.json +200 -48
- tooluniverse/data/gnomad_tools.json +109 -0
- tooluniverse/data/gtopdb_tools.json +68 -0
- tooluniverse/data/gwas_tools.json +32 -0
- tooluniverse/data/interpro_tools.json +199 -0
- tooluniverse/data/jaspar_tools.json +70 -0
- tooluniverse/data/kegg_tools.json +356 -0
- tooluniverse/data/mpd_tools.json +87 -0
- tooluniverse/data/ols_tools.json +314 -0
- tooluniverse/data/package_discovery_tools.json +64 -0
- tooluniverse/data/packages/categorized_tools.txt +0 -1
- tooluniverse/data/packages/machine_learning_tools.json +0 -47
- tooluniverse/data/paleobiology_tools.json +91 -0
- tooluniverse/data/pride_tools.json +62 -0
- tooluniverse/data/pypi_package_inspector_tools.json +158 -0
- tooluniverse/data/python_executor_tools.json +341 -0
- tooluniverse/data/regulomedb_tools.json +50 -0
- tooluniverse/data/remap_tools.json +89 -0
- tooluniverse/data/screen_tools.json +89 -0
- tooluniverse/data/tool_discovery_agents.json +428 -0
- tooluniverse/data/tool_discovery_agents.json.backup +1343 -0
- tooluniverse/data/uniprot_tools.json +77 -0
- tooluniverse/data/web_search_tools.json +250 -0
- tooluniverse/data/worms_tools.json +55 -0
- tooluniverse/dataset_tool.py +2 -2
- tooluniverse/dbsnp_tool.py +196 -58
- tooluniverse/default_config.py +36 -3
- tooluniverse/emdb_tool.py +30 -0
- tooluniverse/enrichr_tool.py +14 -14
- tooluniverse/ensembl_tool.py +140 -47
- tooluniverse/execute_function.py +594 -29
- tooluniverse/extended_hooks.py +4 -4
- tooluniverse/file_download_tool.py +269 -0
- tooluniverse/gene_ontology_tool.py +1 -1
- tooluniverse/generate_tools.py +3 -3
- tooluniverse/geo_tool.py +81 -28
- tooluniverse/gnomad_tool.py +100 -52
- tooluniverse/gtopdb_tool.py +41 -0
- tooluniverse/humanbase_tool.py +10 -10
- tooluniverse/interpro_tool.py +72 -0
- tooluniverse/jaspar_tool.py +30 -0
- tooluniverse/kegg_tool.py +230 -0
- tooluniverse/logging_config.py +2 -2
- tooluniverse/mcp_client_tool.py +57 -129
- tooluniverse/mcp_integration.py +52 -49
- tooluniverse/mcp_tool_registry.py +147 -528
- tooluniverse/mpd_tool.py +42 -0
- tooluniverse/ncbi_eutils_tool.py +96 -0
- tooluniverse/ols_tool.py +435 -0
- tooluniverse/openalex_tool.py +8 -8
- tooluniverse/openfda_tool.py +2 -2
- tooluniverse/output_hook.py +15 -15
- tooluniverse/package_discovery_tool.py +217 -0
- tooluniverse/package_tool.py +1 -1
- tooluniverse/paleobiology_tool.py +30 -0
- tooluniverse/pmc_tool.py +2 -2
- tooluniverse/pride_tool.py +30 -0
- tooluniverse/pypi_package_inspector_tool.py +593 -0
- tooluniverse/python_executor_tool.py +711 -0
- tooluniverse/regulomedb_tool.py +30 -0
- tooluniverse/remap_tool.py +44 -0
- tooluniverse/remote/boltz/boltz_mcp_server.py +1 -1
- tooluniverse/remote/depmap_24q2/depmap_24q2_mcp_tool.py +3 -3
- tooluniverse/remote/immune_compass/compass_tool.py +3 -3
- tooluniverse/remote/pinnacle/pinnacle_tool.py +2 -2
- tooluniverse/remote/transcriptformer/transcriptformer_tool.py +3 -3
- tooluniverse/remote/uspto_downloader/uspto_downloader_mcp_server.py +3 -3
- tooluniverse/remote_tool.py +4 -4
- tooluniverse/screen_tool.py +44 -0
- tooluniverse/scripts/filter_tool_files.py +2 -2
- tooluniverse/smcp.py +93 -12
- tooluniverse/smcp_server.py +100 -21
- tooluniverse/space/__init__.py +46 -0
- tooluniverse/space/loader.py +133 -0
- tooluniverse/space/validator.py +353 -0
- tooluniverse/tool_finder_embedding.py +5 -3
- tooluniverse/tool_finder_keyword.py +12 -10
- tooluniverse/tool_finder_llm.py +12 -8
- tooluniverse/tools/{UCSC_get_genes_by_region.py → BLAST_nucleotide_search.py} +22 -26
- tooluniverse/tools/BLAST_protein_search.py +63 -0
- tooluniverse/tools/ClinVar_search_variants.py +26 -15
- tooluniverse/tools/CodeQualityAnalyzer.py +3 -3
- tooluniverse/tools/EMDB_get_structure.py +46 -0
- tooluniverse/tools/GtoPdb_get_targets.py +52 -0
- tooluniverse/tools/InterPro_get_domain_details.py +46 -0
- tooluniverse/tools/InterPro_get_protein_domains.py +49 -0
- tooluniverse/tools/InterPro_search_domains.py +52 -0
- tooluniverse/tools/JASPAR_get_transcription_factors.py +52 -0
- tooluniverse/tools/MPD_get_phenotype_data.py +59 -0
- tooluniverse/tools/PRIDE_search_proteomics.py +52 -0
- tooluniverse/tools/PackageAnalyzer.py +55 -0
- tooluniverse/tools/Paleobiology_get_fossils.py +52 -0
- tooluniverse/tools/PyPIPackageInspector.py +59 -0
- tooluniverse/tools/ReMap_get_transcription_factor_binding.py +59 -0
- tooluniverse/tools/ReferenceInfoAnalyzer.py +55 -0
- tooluniverse/tools/RegulomeDB_query_variant.py +46 -0
- tooluniverse/tools/SCREEN_get_regulatory_elements.py +59 -0
- tooluniverse/tools/{ArgumentDescriptionOptimizer.py → TestResultsAnalyzer.py} +13 -13
- tooluniverse/tools/ToolDiscover.py +11 -11
- tooluniverse/tools/UniProt_id_mapping.py +63 -0
- tooluniverse/tools/UniProt_search.py +63 -0
- tooluniverse/tools/UnifiedToolGenerator.py +59 -0
- tooluniverse/tools/WoRMS_search_species.py +49 -0
- tooluniverse/tools/XMLToolOptimizer.py +55 -0
- tooluniverse/tools/__init__.py +119 -29
- tooluniverse/tools/_shared_client.py +3 -3
- tooluniverse/tools/alphafold_get_annotations.py +3 -3
- tooluniverse/tools/alphafold_get_prediction.py +3 -3
- tooluniverse/tools/alphafold_get_summary.py +3 -3
- tooluniverse/tools/cBioPortal_get_cancer_studies.py +46 -0
- tooluniverse/tools/cBioPortal_get_mutations.py +52 -0
- tooluniverse/tools/{gnomAD_query_variant.py → clinvar_get_clinical_significance.py} +8 -11
- tooluniverse/tools/clinvar_get_variant_details.py +49 -0
- tooluniverse/tools/dbSNP_get_variant_by_rsid.py +7 -7
- tooluniverse/tools/dbsnp_get_frequencies.py +46 -0
- tooluniverse/tools/dbsnp_search_by_gene.py +52 -0
- tooluniverse/tools/download_binary_file.py +66 -0
- tooluniverse/tools/download_file.py +71 -0
- tooluniverse/tools/download_text_content.py +55 -0
- tooluniverse/tools/dynamic_package_discovery.py +59 -0
- tooluniverse/tools/ensembl_get_sequence.py +52 -0
- tooluniverse/tools/{Ensembl_lookup_gene_by_symbol.py → ensembl_get_variants.py} +11 -11
- tooluniverse/tools/ensembl_lookup_gene.py +46 -0
- tooluniverse/tools/geo_get_dataset_info.py +46 -0
- tooluniverse/tools/geo_get_sample_info.py +46 -0
- tooluniverse/tools/geo_search_datasets.py +67 -0
- tooluniverse/tools/gnomad_get_gene_constraints.py +49 -0
- tooluniverse/tools/kegg_find_genes.py +52 -0
- tooluniverse/tools/kegg_get_gene_info.py +46 -0
- tooluniverse/tools/kegg_get_pathway_info.py +46 -0
- tooluniverse/tools/kegg_list_organisms.py +44 -0
- tooluniverse/tools/kegg_search_pathway.py +46 -0
- tooluniverse/tools/ols_find_similar_terms.py +63 -0
- tooluniverse/tools/{get_hyperopt_info.py → ols_get_ontology_info.py} +13 -10
- tooluniverse/tools/ols_get_term_ancestors.py +67 -0
- tooluniverse/tools/ols_get_term_children.py +67 -0
- tooluniverse/tools/{TestCaseGenerator.py → ols_get_term_info.py} +12 -9
- tooluniverse/tools/{CodeOptimizer.py → ols_search_ontologies.py} +22 -14
- tooluniverse/tools/ols_search_terms.py +71 -0
- tooluniverse/tools/python_code_executor.py +79 -0
- tooluniverse/tools/python_script_runner.py +79 -0
- tooluniverse/tools/web_api_documentation_search.py +63 -0
- tooluniverse/tools/web_search.py +71 -0
- tooluniverse/uniprot_tool.py +219 -16
- tooluniverse/url_tool.py +19 -1
- tooluniverse/uspto_tool.py +1 -1
- tooluniverse/utils.py +12 -12
- tooluniverse/web_search_tool.py +229 -0
- tooluniverse/worms_tool.py +64 -0
- {tooluniverse-1.0.9.1.dist-info → tooluniverse-1.0.11.dist-info}/METADATA +8 -3
- {tooluniverse-1.0.9.1.dist-info → tooluniverse-1.0.11.dist-info}/RECORD +184 -92
- tooluniverse/data/genomics_tools.json +0 -174
- tooluniverse/tools/ToolDescriptionOptimizer.py +0 -67
- tooluniverse/tools/ToolImplementationGenerator.py +0 -67
- tooluniverse/tools/ToolOptimizer.py +0 -59
- tooluniverse/tools/ToolSpecificationGenerator.py +0 -67
- tooluniverse/tools/ToolSpecificationOptimizer.py +0 -63
- tooluniverse/ucsc_tool.py +0 -60
- {tooluniverse-1.0.9.1.dist-info → tooluniverse-1.0.11.dist-info}/WHEEL +0 -0
- {tooluniverse-1.0.9.1.dist-info → tooluniverse-1.0.11.dist-info}/entry_points.txt +0 -0
- {tooluniverse-1.0.9.1.dist-info → tooluniverse-1.0.11.dist-info}/licenses/LICENSE +0 -0
- {tooluniverse-1.0.9.1.dist-info → tooluniverse-1.0.11.dist-info}/top_level.txt +0 -0
tooluniverse/dbsnp_tool.py
CHANGED
|
@@ -1,71 +1,209 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
"""
|
|
2
|
+
dbSNP REST API Tool
|
|
3
|
+
|
|
4
|
+
This tool provides access to the dbSNP (Single Nucleotide Polymorphism) database
|
|
5
|
+
for variant information, allele frequencies, and genomic coordinates.
|
|
6
|
+
"""
|
|
7
|
+
|
|
8
|
+
from typing import Dict, Any
|
|
9
|
+
from .ncbi_eutils_tool import NCBIEUtilsTool
|
|
3
10
|
from .tool_registry import register_tool
|
|
4
11
|
|
|
5
12
|
|
|
6
|
-
|
|
7
|
-
class
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
13
|
+
class dbSNPRESTTool(NCBIEUtilsTool):
|
|
14
|
+
"""Base class for dbSNP REST API tools with rate limiting."""
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
@register_tool("dbSNPGetVariantByRsID")
|
|
18
|
+
class dbSNPGetVariantByRsID(dbSNPRESTTool):
|
|
19
|
+
"""Get variant information by rsID."""
|
|
12
20
|
|
|
13
21
|
def __init__(self, tool_config):
|
|
14
22
|
super().__init__(tool_config)
|
|
15
|
-
self.
|
|
16
|
-
self.session = requests.Session()
|
|
23
|
+
self.endpoint = "/esummary.fcgi"
|
|
17
24
|
|
|
18
|
-
def run(self, arguments):
|
|
19
|
-
|
|
25
|
+
def run(self, arguments: Dict[str, Any]) -> Dict[str, Any]:
|
|
26
|
+
"""Get variant by rsID using E-utilities."""
|
|
27
|
+
rsid = arguments.get("rsid", "")
|
|
20
28
|
if not rsid:
|
|
21
|
-
return {"
|
|
29
|
+
return {"status": "error", "error": "rsid is required"}
|
|
22
30
|
|
|
23
|
-
#
|
|
31
|
+
# Remove 'rs' prefix if present
|
|
24
32
|
if rsid.startswith("rs"):
|
|
25
33
|
rsid = rsid[2:]
|
|
26
34
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
35
|
+
params = {"db": "snp", "id": rsid, "retmode": "json"}
|
|
36
|
+
|
|
37
|
+
result = self._make_request(self.endpoint, params)
|
|
38
|
+
|
|
39
|
+
# Parse and extract useful data from NCBI response
|
|
40
|
+
if result.get("status") == "success":
|
|
41
|
+
data = result.get("data", {})
|
|
42
|
+
if isinstance(data, dict) and "result" in data:
|
|
43
|
+
result_data = data["result"]
|
|
44
|
+
if rsid in result_data:
|
|
45
|
+
variant_data = result_data[rsid]
|
|
46
|
+
|
|
47
|
+
# Extract key information
|
|
48
|
+
parsed_data = {
|
|
49
|
+
"refsnp_id": f"rs{rsid}",
|
|
50
|
+
"snp_id": variant_data.get("snp_id"),
|
|
51
|
+
"chromosome": variant_data.get("chr"),
|
|
52
|
+
"position": variant_data.get("chrpos"),
|
|
53
|
+
"allele": variant_data.get("allele"),
|
|
54
|
+
"snp_class": variant_data.get("snp_class"),
|
|
55
|
+
"clinical_significance": variant_data.get(
|
|
56
|
+
"clinical_significance", ""
|
|
57
|
+
).split(","),
|
|
58
|
+
"genes": [
|
|
59
|
+
gene.get("name") for gene in variant_data.get("genes", [])
|
|
60
|
+
],
|
|
61
|
+
"allele_frequencies": variant_data.get("global_mafs", []),
|
|
62
|
+
"hgvs_notation": variant_data.get("docsum", ""),
|
|
63
|
+
"spdi_notation": variant_data.get("spdi", ""),
|
|
64
|
+
"function_class": variant_data.get("fxn_class", "").split(","),
|
|
65
|
+
"validated": variant_data.get("validated", "").split(","),
|
|
66
|
+
"created_date": variant_data.get("createdate"),
|
|
67
|
+
"updated_date": variant_data.get("updatedate"),
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
result["data"] = parsed_data
|
|
71
|
+
result["rsid"] = f"rs{rsid}"
|
|
72
|
+
else:
|
|
73
|
+
result["status"] = "error"
|
|
74
|
+
result["error"] = f"Variant rs{rsid} not found in dbSNP"
|
|
75
|
+
else:
|
|
76
|
+
result["status"] = "error"
|
|
77
|
+
result["error"] = "Invalid response format from NCBI E-utilities"
|
|
78
|
+
|
|
79
|
+
return result
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
@register_tool("dbSNPSearchByGene")
|
|
83
|
+
class dbSNPSearchByGene(dbSNPRESTTool):
|
|
84
|
+
"""Search variants by gene symbol."""
|
|
85
|
+
|
|
86
|
+
def __init__(self, tool_config):
|
|
87
|
+
super().__init__(tool_config)
|
|
88
|
+
self.endpoint = "/esearch.fcgi"
|
|
89
|
+
|
|
90
|
+
def run(self, arguments: Dict[str, Any]) -> Dict[str, Any]:
|
|
91
|
+
"""Search variants by gene using E-utilities."""
|
|
92
|
+
gene_symbol = arguments.get("gene_symbol", "")
|
|
93
|
+
if not gene_symbol:
|
|
94
|
+
return {"status": "error", "error": "gene_symbol is required"}
|
|
95
|
+
|
|
96
|
+
params = {
|
|
97
|
+
"db": "snp",
|
|
98
|
+
"term": f"{gene_symbol}[gene]",
|
|
99
|
+
"retmode": "json",
|
|
100
|
+
"retmax": arguments.get("limit", 20),
|
|
71
101
|
}
|
|
102
|
+
|
|
103
|
+
result = self._make_request(self.endpoint, params)
|
|
104
|
+
|
|
105
|
+
# Parse and extract useful data from NCBI response
|
|
106
|
+
if result.get("status") == "success":
|
|
107
|
+
data = result.get("data", {})
|
|
108
|
+
if isinstance(data, dict) and "esearchresult" in data:
|
|
109
|
+
esearch_data = data["esearchresult"]
|
|
110
|
+
|
|
111
|
+
# Extract variant IDs
|
|
112
|
+
variant_ids = esearch_data.get("idlist", [])
|
|
113
|
+
count = int(esearch_data.get("count", 0))
|
|
114
|
+
|
|
115
|
+
# Create variant list with basic info
|
|
116
|
+
variants = []
|
|
117
|
+
for variant_id in variant_ids:
|
|
118
|
+
variants.append(
|
|
119
|
+
{"refsnp_id": f"rs{variant_id}", "snp_id": int(variant_id)}
|
|
120
|
+
)
|
|
121
|
+
|
|
122
|
+
parsed_data = {
|
|
123
|
+
"variants": variants,
|
|
124
|
+
"total_count": count,
|
|
125
|
+
"returned_count": len(variants),
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
result["data"] = parsed_data
|
|
129
|
+
result["gene_symbol"] = gene_symbol
|
|
130
|
+
else:
|
|
131
|
+
result["status"] = "error"
|
|
132
|
+
result["error"] = "Invalid response format from NCBI E-utilities"
|
|
133
|
+
|
|
134
|
+
return result
|
|
135
|
+
|
|
136
|
+
|
|
137
|
+
@register_tool("dbSNPGetFrequencies")
|
|
138
|
+
class dbSNPGetFrequencies(dbSNPRESTTool):
|
|
139
|
+
"""Get allele frequencies for a variant."""
|
|
140
|
+
|
|
141
|
+
def __init__(self, tool_config):
|
|
142
|
+
super().__init__(tool_config)
|
|
143
|
+
self.endpoint = "/esummary.fcgi"
|
|
144
|
+
|
|
145
|
+
def run(self, arguments: Dict[str, Any]) -> Dict[str, Any]:
|
|
146
|
+
"""Get allele frequencies by rsID using E-utilities."""
|
|
147
|
+
rsid = arguments.get("rsid", "")
|
|
148
|
+
if not rsid:
|
|
149
|
+
return {"status": "error", "error": "rsid is required"}
|
|
150
|
+
|
|
151
|
+
# Remove 'rs' prefix if present
|
|
152
|
+
if rsid.startswith("rs"):
|
|
153
|
+
rsid = rsid[2:]
|
|
154
|
+
|
|
155
|
+
params = {"db": "snp", "id": rsid, "retmode": "json"}
|
|
156
|
+
|
|
157
|
+
result = self._make_request(self.endpoint, params)
|
|
158
|
+
|
|
159
|
+
# Parse and extract frequency data from NCBI response
|
|
160
|
+
if result.get("status") == "success":
|
|
161
|
+
data = result.get("data", {})
|
|
162
|
+
if isinstance(data, dict) and "result" in data:
|
|
163
|
+
result_data = data["result"]
|
|
164
|
+
if rsid in result_data:
|
|
165
|
+
variant_data = result_data[rsid]
|
|
166
|
+
|
|
167
|
+
# Extract allele frequency data
|
|
168
|
+
frequencies = []
|
|
169
|
+
global_mafs = variant_data.get("global_mafs", [])
|
|
170
|
+
|
|
171
|
+
for maf in global_mafs:
|
|
172
|
+
study = maf.get("study", "Unknown")
|
|
173
|
+
freq_str = maf.get("freq", "")
|
|
174
|
+
|
|
175
|
+
# Parse frequency string (e.g., "C=0.1505591/754")
|
|
176
|
+
if "=" in freq_str and "/" in freq_str:
|
|
177
|
+
try:
|
|
178
|
+
allele_part, count_part = freq_str.split("/")
|
|
179
|
+
allele = allele_part.split("=")[0]
|
|
180
|
+
frequency = float(allele_part.split("=")[1])
|
|
181
|
+
sample_count = int(count_part)
|
|
182
|
+
|
|
183
|
+
frequencies.append(
|
|
184
|
+
{
|
|
185
|
+
"study": study,
|
|
186
|
+
"allele": allele,
|
|
187
|
+
"frequency": frequency,
|
|
188
|
+
"sample_count": sample_count,
|
|
189
|
+
}
|
|
190
|
+
)
|
|
191
|
+
except (ValueError, IndexError):
|
|
192
|
+
# Skip malformed frequency entries
|
|
193
|
+
continue
|
|
194
|
+
|
|
195
|
+
parsed_data = {
|
|
196
|
+
"frequencies": frequencies,
|
|
197
|
+
"total_studies": len(frequencies),
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
result["data"] = parsed_data
|
|
201
|
+
result["rsid"] = f"rs{rsid}"
|
|
202
|
+
else:
|
|
203
|
+
result["status"] = "error"
|
|
204
|
+
result["error"] = f"Variant rs{rsid} not found in dbSNP"
|
|
205
|
+
else:
|
|
206
|
+
result["status"] = "error"
|
|
207
|
+
result["error"] = "Invalid response format from NCBI E-utilities"
|
|
208
|
+
|
|
209
|
+
return result
|
tooluniverse/default_config.py
CHANGED
|
@@ -51,6 +51,16 @@ default_tool_files = {
|
|
|
51
51
|
"fatcat": os.path.join(current_dir, "data", "fatcat_tools.json"),
|
|
52
52
|
"wikidata_sparql": os.path.join(current_dir, "data", "wikidata_sparql_tools.json"),
|
|
53
53
|
"agents": os.path.join(current_dir, "data", "agentic_tools.json"),
|
|
54
|
+
"tool_discovery_agents": os.path.join(
|
|
55
|
+
current_dir, "data", "tool_discovery_agents.json"
|
|
56
|
+
),
|
|
57
|
+
"web_search_tools": os.path.join(current_dir, "data", "web_search_tools.json"),
|
|
58
|
+
"package_discovery_tools": os.path.join(
|
|
59
|
+
current_dir, "data", "package_discovery_tools.json"
|
|
60
|
+
),
|
|
61
|
+
"pypi_package_inspector_tools": os.path.join(
|
|
62
|
+
current_dir, "data", "pypi_package_inspector_tools.json"
|
|
63
|
+
),
|
|
54
64
|
"drug_discovery_agents": os.path.join(
|
|
55
65
|
current_dir, "data", "drug_discovery_agents.json"
|
|
56
66
|
),
|
|
@@ -100,6 +110,20 @@ default_tool_files = {
|
|
|
100
110
|
"visualization_molecule_2d": os.path.join(
|
|
101
111
|
current_dir, "data", "molecule_2d_tools.json"
|
|
102
112
|
),
|
|
113
|
+
# New database tools
|
|
114
|
+
"interpro": os.path.join(current_dir, "data", "interpro_tools.json"),
|
|
115
|
+
"blast": os.path.join(current_dir, "data", "blast_tools.json"),
|
|
116
|
+
"cbioportal": os.path.join(current_dir, "data", "cbioportal_tools.json"),
|
|
117
|
+
"regulomedb": os.path.join(current_dir, "data", "regulomedb_tools.json"),
|
|
118
|
+
"jaspar": os.path.join(current_dir, "data", "jaspar_tools.json"),
|
|
119
|
+
"remap": os.path.join(current_dir, "data", "remap_tools.json"),
|
|
120
|
+
"screen": os.path.join(current_dir, "data", "screen_tools.json"),
|
|
121
|
+
"pride": os.path.join(current_dir, "data", "pride_tools.json"),
|
|
122
|
+
"emdb": os.path.join(current_dir, "data", "emdb_tools.json"),
|
|
123
|
+
"gtopdb": os.path.join(current_dir, "data", "gtopdb_tools.json"),
|
|
124
|
+
"mpd": os.path.join(current_dir, "data", "mpd_tools.json"),
|
|
125
|
+
"worms": os.path.join(current_dir, "data", "worms_tools.json"),
|
|
126
|
+
"paleobiology": os.path.join(current_dir, "data", "paleobiology_tools.json"),
|
|
103
127
|
"visualization_molecule_3d": os.path.join(
|
|
104
128
|
current_dir, "data", "molecule_3d_tools.json"
|
|
105
129
|
),
|
|
@@ -120,6 +144,7 @@ default_tool_files = {
|
|
|
120
144
|
),
|
|
121
145
|
"go": os.path.join(current_dir, "data", "gene_ontology_tools.json"),
|
|
122
146
|
"compose": os.path.join(current_dir, "data", "compose_tools.json"),
|
|
147
|
+
"python_executor": os.path.join(current_dir, "data", "python_executor_tools.json"),
|
|
123
148
|
"idmap": os.path.join(current_dir, "data", "idmap_tools.json"),
|
|
124
149
|
"disease_target_score": os.path.join(
|
|
125
150
|
current_dir, "data", "disease_target_score_tools.json"
|
|
@@ -131,6 +156,7 @@ default_tool_files = {
|
|
|
131
156
|
"xml": os.path.join(current_dir, "data", "xml_tools.json"),
|
|
132
157
|
"mcp_auto_loader_boltz": os.path.join(current_dir, "data", "boltz_tools.json"),
|
|
133
158
|
"url": os.path.join(current_dir, "data", "url_fetch_tools.json"),
|
|
159
|
+
"file_download": os.path.join(current_dir, "data", "file_download_tools.json"),
|
|
134
160
|
# 'langchain': os.path.join(current_dir, 'data', 'langchain_tools.json'),
|
|
135
161
|
"rcsb_pdb": os.path.join(current_dir, "data", "rcsb_pdb_tools.json"),
|
|
136
162
|
"tool_composition": os.path.join(
|
|
@@ -146,10 +172,17 @@ default_tool_files = {
|
|
|
146
172
|
),
|
|
147
173
|
"odphp": os.path.join(current_dir, "data", "odphp_tools.json"),
|
|
148
174
|
"markitdown": os.path.join(current_dir, "data", "markitdown_tools.json"),
|
|
149
|
-
# Genomics tools
|
|
150
|
-
"genomics": os.path.join(current_dir, "data", "genomics_tools.json"),
|
|
151
175
|
# Guideline and health policy tools
|
|
152
176
|
"guidelines": os.path.join(current_dir, "data", "unified_guideline_tools.json"),
|
|
177
|
+
# Database tools
|
|
178
|
+
"kegg": os.path.join(current_dir, "data", "kegg_tools.json"),
|
|
179
|
+
"ensembl": os.path.join(current_dir, "data", "ensembl_tools.json"),
|
|
180
|
+
"clinvar": os.path.join(current_dir, "data", "clinvar_tools.json"),
|
|
181
|
+
"geo": os.path.join(current_dir, "data", "geo_tools.json"),
|
|
182
|
+
"dbsnp": os.path.join(current_dir, "data", "dbsnp_tools.json"),
|
|
183
|
+
"gnomad": os.path.join(current_dir, "data", "gnomad_tools.json"),
|
|
184
|
+
# Ontology tools
|
|
185
|
+
"ols": os.path.join(current_dir, "data", "ols_tools.json"),
|
|
153
186
|
}
|
|
154
187
|
|
|
155
188
|
|
|
@@ -157,7 +190,7 @@ def get_default_hook_config():
|
|
|
157
190
|
"""
|
|
158
191
|
Get default hook configuration.
|
|
159
192
|
|
|
160
|
-
Returns
|
|
193
|
+
Returns
|
|
161
194
|
dict: Default hook configuration with basic settings
|
|
162
195
|
"""
|
|
163
196
|
return {
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import requests
|
|
2
|
+
from typing import Any, Dict
|
|
3
|
+
from .base_tool import BaseTool
|
|
4
|
+
from .tool_registry import register_tool
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
@register_tool("EMDBRESTTool")
|
|
8
|
+
class EMDBRESTTool(BaseTool):
|
|
9
|
+
def __init__(self, tool_config: Dict):
|
|
10
|
+
super().__init__(tool_config)
|
|
11
|
+
self.base_url = "https://www.ebi.ac.uk/emdb/api"
|
|
12
|
+
self.session = requests.Session()
|
|
13
|
+
self.session.headers.update({"Accept": "application/json"})
|
|
14
|
+
self.timeout = 30
|
|
15
|
+
|
|
16
|
+
def _build_url(self, args: Dict[str, Any]) -> str:
|
|
17
|
+
url = self.tool_config["fields"]["endpoint"]
|
|
18
|
+
for k, v in args.items():
|
|
19
|
+
url = url.replace(f"{{{k}}}", str(v))
|
|
20
|
+
return url
|
|
21
|
+
|
|
22
|
+
def run(self, arguments: Dict[str, Any]) -> Dict[str, Any]:
|
|
23
|
+
try:
|
|
24
|
+
url = self._build_url(arguments)
|
|
25
|
+
response = self.session.get(url, timeout=self.timeout)
|
|
26
|
+
response.raise_for_status()
|
|
27
|
+
data = response.json()
|
|
28
|
+
return {"status": "success", "data": data, "url": url}
|
|
29
|
+
except Exception as e:
|
|
30
|
+
return {"status": "error", "error": f"EMDB API error: {str(e)}"}
|
tooluniverse/enrichr_tool.py
CHANGED
|
@@ -37,10 +37,10 @@ class EnrichrTool(BaseTool):
|
|
|
37
37
|
"""
|
|
38
38
|
Retrieve the official gene symbol for a given gene name or synonym using the MyGene.info API.
|
|
39
39
|
|
|
40
|
-
Parameters
|
|
40
|
+
Parameters
|
|
41
41
|
gene_name (str): The gene name or synonym to query.
|
|
42
42
|
|
|
43
|
-
Returns
|
|
43
|
+
Returns
|
|
44
44
|
str: The official gene symbol if found; otherwise, raises an Exception.
|
|
45
45
|
"""
|
|
46
46
|
# URL-encode the gene_name to handle special characters
|
|
@@ -89,10 +89,10 @@ class EnrichrTool(BaseTool):
|
|
|
89
89
|
"""
|
|
90
90
|
Submit the gene list to Enrichr and return the user list ID.
|
|
91
91
|
|
|
92
|
-
Parameters
|
|
92
|
+
Parameters
|
|
93
93
|
gene_list (str): Newline-separated string of gene names.
|
|
94
94
|
|
|
95
|
-
Returns
|
|
95
|
+
Returns
|
|
96
96
|
str: The user list ID from Enrichr.
|
|
97
97
|
"""
|
|
98
98
|
payload = {
|
|
@@ -110,11 +110,11 @@ class EnrichrTool(BaseTool):
|
|
|
110
110
|
"""
|
|
111
111
|
Fetch enrichment results for a specific library.
|
|
112
112
|
|
|
113
|
-
Parameters
|
|
113
|
+
Parameters
|
|
114
114
|
user_list_id (str): The user list ID from Enrichr.
|
|
115
115
|
library (str): The name of the enrichment library.
|
|
116
116
|
|
|
117
|
-
Returns
|
|
117
|
+
Returns
|
|
118
118
|
dict: The enrichment results.
|
|
119
119
|
"""
|
|
120
120
|
query_string = f"?userListId={user_list_id}&backgroundType={library}"
|
|
@@ -129,11 +129,11 @@ class EnrichrTool(BaseTool):
|
|
|
129
129
|
"""
|
|
130
130
|
Initialize and build the graph with gene nodes and enriched terms.
|
|
131
131
|
|
|
132
|
-
Parameters
|
|
132
|
+
Parameters
|
|
133
133
|
genes (list): List of gene names.
|
|
134
134
|
enrichment_results (dict): Dictionary of enrichment results by library.
|
|
135
135
|
|
|
136
|
-
Returns
|
|
136
|
+
Returns
|
|
137
137
|
networkx.Graph: The constructed graph.
|
|
138
138
|
"""
|
|
139
139
|
G = nx.Graph()
|
|
@@ -159,12 +159,12 @@ class EnrichrTool(BaseTool):
|
|
|
159
159
|
"""
|
|
160
160
|
Find and rank paths between source and target based on total edge weight.
|
|
161
161
|
|
|
162
|
-
Parameters
|
|
162
|
+
Parameters
|
|
163
163
|
G (networkx.Graph): The graph to search.
|
|
164
164
|
source (str): The source node.
|
|
165
165
|
target (str): The target node.
|
|
166
166
|
|
|
167
|
-
Returns
|
|
167
|
+
Returns
|
|
168
168
|
list: List of tuples (path, weight) sorted by weight descending.
|
|
169
169
|
"""
|
|
170
170
|
all_paths = list(nx.all_simple_paths(G, source=source, target=target))
|
|
@@ -182,12 +182,12 @@ class EnrichrTool(BaseTool):
|
|
|
182
182
|
"""
|
|
183
183
|
Find and rank paths from each gene to a specified term based on total edge weight.
|
|
184
184
|
|
|
185
|
-
Parameters
|
|
185
|
+
Parameters
|
|
186
186
|
G (networkx.Graph): The graph to search.
|
|
187
187
|
gene (str): The source gene.
|
|
188
188
|
term (str): The target term.
|
|
189
189
|
|
|
190
|
-
Returns
|
|
190
|
+
Returns
|
|
191
191
|
list or None: List of tuples (path, weight) sorted by weight descending, or None if no paths.
|
|
192
192
|
"""
|
|
193
193
|
all_paths = list(nx.all_simple_paths(G, source=gene, target=term))
|
|
@@ -207,11 +207,11 @@ class EnrichrTool(BaseTool):
|
|
|
207
207
|
"""
|
|
208
208
|
Main API function to perform gene enrichment analysis.
|
|
209
209
|
|
|
210
|
-
Parameters
|
|
210
|
+
Parameters
|
|
211
211
|
genes (list): List of gene names.
|
|
212
212
|
libs (list): List of enrichment libraries to use.
|
|
213
213
|
|
|
214
|
-
Returns
|
|
214
|
+
Returns
|
|
215
215
|
tuple: (connected_path, connections) dictionaries.
|
|
216
216
|
"""
|
|
217
217
|
# Convert each gene to its official name and log the result
|