tooluniverse 1.0.0__py3-none-any.whl → 1.0.2__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 +71 -57
- tooluniverse/alphafold_tool.py +51 -20
- tooluniverse/compose_scripts/tool_graph_generation.py +249 -0
- tooluniverse/compose_scripts/tool_metadata_generator.py +369 -0
- tooluniverse/data/agentic_tools.json +143 -28
- tooluniverse/data/alphafold_tools.json +203 -61
- tooluniverse/data/compose_tools.json +63 -0
- tooluniverse/data/special_tools.json +2 -0
- tooluniverse/test/test_alphafold_tool.py +66 -29
- {tooluniverse-1.0.0.dist-info → tooluniverse-1.0.2.dist-info}/METADATA +115 -173
- {tooluniverse-1.0.0.dist-info → tooluniverse-1.0.2.dist-info}/RECORD +16 -18
- tooluniverse/data/packages/software_tools.json +0 -4954
- tooluniverse/remote/expert_feedback_mcp/human_expert_mcp_server.py +0 -1611
- tooluniverse/remote/expert_feedback_mcp/simple_test.py +0 -34
- tooluniverse/remote/expert_feedback_mcp/start_web_interface.py +0 -91
- /tooluniverse/data/{clait_tools.json → adverse_event_tools.json} +0 -0
- {tooluniverse-1.0.0.dist-info → tooluniverse-1.0.2.dist-info}/WHEEL +0 -0
- {tooluniverse-1.0.0.dist-info → tooluniverse-1.0.2.dist-info}/entry_points.txt +0 -0
- {tooluniverse-1.0.0.dist-info → tooluniverse-1.0.2.dist-info}/licenses/LICENSE +0 -0
- {tooluniverse-1.0.0.dist-info → tooluniverse-1.0.2.dist-info}/top_level.txt +0 -0
|
@@ -1,85 +1,227 @@
|
|
|
1
1
|
[
|
|
2
2
|
{
|
|
3
|
-
"name": "
|
|
4
|
-
"description": "Retrieve AlphaFold
|
|
3
|
+
"name": "alphafold_get_prediction",
|
|
4
|
+
"description": "Retrieve full AlphaFold 3D structure predictions for a given protein. Input must be a UniProt accession (e.g., 'P69905'), UniProt entry name (e.g., 'HBA_HUMAN'), or CRC64 checksum. Returns residue-level metadata including sequence, per-residue confidence scores (pLDDT), and structure download links (PDB, CIF, PAE). If you do not know the accession, first call `uniprot_search` to resolve it from a protein/gene name, or `UniProt_get_entry_by_accession` if you already have the accession and want UniProt details. For a quick overview, use `alphafold_get_summary`. For mutation/variant impact, see `alphafold_get_annotations.",
|
|
5
5
|
"type": "AlphaFoldRESTTool",
|
|
6
6
|
"parameter": {
|
|
7
7
|
"type": "object",
|
|
8
8
|
"properties": {
|
|
9
|
-
"
|
|
9
|
+
"qualifier": {
|
|
10
10
|
"type": "string",
|
|
11
|
-
"description": "UniProt accession
|
|
11
|
+
"description": "Protein identifier: UniProt accession (e.g., 'P69905'), entry name (e.g., 'HBA_HUMAN'), or CRC64 checksum."
|
|
12
|
+
},
|
|
13
|
+
"sequence_checksum": {
|
|
14
|
+
"type": "string",
|
|
15
|
+
"description": "Optional CRC64 checksum of the UniProt sequence."
|
|
12
16
|
}
|
|
13
17
|
},
|
|
14
|
-
"required": ["
|
|
18
|
+
"required": ["qualifier"]
|
|
15
19
|
},
|
|
16
20
|
"fields": {
|
|
17
|
-
"endpoint": "/prediction/{
|
|
21
|
+
"endpoint": "/prediction/{qualifier}",
|
|
18
22
|
"return_format": "JSON"
|
|
19
23
|
},
|
|
20
24
|
"return_schema": {
|
|
25
|
+
"type": "array",
|
|
26
|
+
"items": {
|
|
27
|
+
"type": "object",
|
|
28
|
+
"properties": {
|
|
29
|
+
"toolUsed": { "type": "string" },
|
|
30
|
+
"providerId": { "type": "string" },
|
|
31
|
+
"entityType": { "type": "string" },
|
|
32
|
+
"isUniProt": { "type": "boolean" },
|
|
33
|
+
"modelEntityId": { "type": "string" },
|
|
34
|
+
"modelCreatedDate": { "type": "string" },
|
|
35
|
+
"sequenceVersionDate": { "type": "string" },
|
|
36
|
+
"globalMetricValue": { "type": "number" },
|
|
37
|
+
"fractionPlddtVeryLow": { "type": "number" },
|
|
38
|
+
"fractionPlddtLow": { "type": "number" },
|
|
39
|
+
"fractionPlddtConfident": { "type": "number" },
|
|
40
|
+
"fractionPlddtVeryHigh": { "type": "number" },
|
|
41
|
+
"latestVersion": { "type": "integer" },
|
|
42
|
+
"allVersions": { "type": "array", "items": { "type": "integer" } },
|
|
43
|
+
"sequence": { "type": "string" },
|
|
44
|
+
"sequenceStart": { "type": "integer" },
|
|
45
|
+
"sequenceEnd": { "type": "integer" },
|
|
46
|
+
"sequenceChecksum": { "type": "string" },
|
|
47
|
+
"isUniProtReviewed": { "type": "boolean" },
|
|
48
|
+
"gene": { "type": "string" },
|
|
49
|
+
"uniprotAccession": { "type": "string" },
|
|
50
|
+
"uniprotId": { "type": "string" },
|
|
51
|
+
"uniprotDescription": { "type": "string" },
|
|
52
|
+
"taxId": { "type": "integer" },
|
|
53
|
+
"organismScientificName": { "type": "string" },
|
|
54
|
+
"isUniProtReferenceProteome": { "type": "boolean" },
|
|
55
|
+
"organismCommonNames": { "type": "array", "items": { "type": "string" } },
|
|
56
|
+
"organismSynonyms": { "type": "array", "items": { "type": "string" } },
|
|
57
|
+
"geneSynonyms": { "type": "array", "items": { "type": "string" } },
|
|
58
|
+
"proteinFullNames": { "type": "array", "items": { "type": "string" } },
|
|
59
|
+
"proteinShortNames": { "type": "array", "items": { "type": "string" } },
|
|
60
|
+
"complexName": { "type": "string" },
|
|
61
|
+
"stoichiometry": { "type": "number" },
|
|
62
|
+
"ipTM": { "type": "number" },
|
|
63
|
+
"ipSAE": { "type": "number" },
|
|
64
|
+
"keywords": { "type": "array", "items": { "type": "string" } },
|
|
65
|
+
"taxonomyLineage": { "type": "array", "items": { "type": "string" } },
|
|
66
|
+
"functions": { "type": "array", "items": { "type": "string" } },
|
|
67
|
+
"alternativeNames": { "type": "array", "items": { "type": "string" } },
|
|
68
|
+
"catalyticActivities": { "type": "array", "items": { "type": "string" } },
|
|
69
|
+
"bcifUrl": { "type": "string" },
|
|
70
|
+
"cifUrl": { "type": "string" },
|
|
71
|
+
"pdbUrl": { "type": "string" },
|
|
72
|
+
"paeImageUrl": { "type": "string" },
|
|
73
|
+
"paeDocUrl": { "type": "string" },
|
|
74
|
+
"amAnnotationsUrl": { "type": "string" },
|
|
75
|
+
"amAnnotationsHg19Url": { "type": "string" },
|
|
76
|
+
"amAnnotationsHg38Url": { "type": "string" },
|
|
77
|
+
"entryId": { "type": "string" },
|
|
78
|
+
"isReviewed": { "type": "boolean" },
|
|
79
|
+
"isReferenceProteome": { "type": "boolean" },
|
|
80
|
+
"uniprotStart": { "type": "integer" },
|
|
81
|
+
"uniprotEnd": { "type": "integer" },
|
|
82
|
+
"uniprotSequence": { "type": "string" }
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
"name": "alphafold_get_summary",
|
|
89
|
+
"description": "Retrieve summary details of AlphaFold 3D models for a given protein. Input must be a UniProt accession, entry name, or CRC64 checksum. Returns lightweight information such as sequence length, coverage, confidence scores, experimental method, resolution, oligomeric state, and structural entities. If you only know the protein/gene name, first use `uniprot_search` to find the accession. For full residue-level 3D predictions with downloadable coordinates, call `alphafold_get_prediction`. For curated variants, see `UniProt_get_disease_variants_by_accession`; for predicted mutation effects, use `alphafold_get_annotations`.",
|
|
90
|
+
"type": "AlphaFoldRESTTool",
|
|
91
|
+
"parameter": {
|
|
21
92
|
"type": "object",
|
|
22
|
-
"description": "AlphaFold predicted protein structure metadata.",
|
|
23
93
|
"properties": {
|
|
24
|
-
"
|
|
25
|
-
"type": "string",
|
|
26
|
-
"description": "UniProt accession ID"
|
|
27
|
-
},
|
|
28
|
-
"uniprotDescription": {
|
|
29
|
-
"type": "string",
|
|
30
|
-
"description": "Protein description"
|
|
31
|
-
},
|
|
32
|
-
"organismScientificName": {
|
|
33
|
-
"type": "string",
|
|
34
|
-
"description": "Scientific name of the source organism"
|
|
35
|
-
},
|
|
36
|
-
"gene": {
|
|
37
|
-
"type": "string",
|
|
38
|
-
"description": "Gene name if available"
|
|
39
|
-
},
|
|
40
|
-
"modelCreatedDate": {
|
|
41
|
-
"type": "string",
|
|
42
|
-
"description": "Date this AlphaFold model was created"
|
|
43
|
-
},
|
|
44
|
-
"globalMetricValue": {
|
|
45
|
-
"type": "number",
|
|
46
|
-
"description": "Global pLDDT confidence score"
|
|
47
|
-
},
|
|
48
|
-
"fractionPlddtVeryLow": {
|
|
49
|
-
"type": "number",
|
|
50
|
-
"description": "Fraction of residues with very low pLDDT (<50)"
|
|
51
|
-
},
|
|
52
|
-
"fractionPlddtLow": {
|
|
53
|
-
"type": "number",
|
|
54
|
-
"description": "Fraction of residues with low pLDDT (50–70)"
|
|
55
|
-
},
|
|
56
|
-
"fractionPlddtConfident": {
|
|
57
|
-
"type": "number",
|
|
58
|
-
"description": "Fraction of residues with confident pLDDT (70–90)"
|
|
59
|
-
},
|
|
60
|
-
"fractionPlddtVeryHigh": {
|
|
61
|
-
"type": "number",
|
|
62
|
-
"description": "Fraction of residues with very high pLDDT (>90)"
|
|
63
|
-
},
|
|
64
|
-
"pdbUrl": {
|
|
65
|
-
"type": "string",
|
|
66
|
-
"description": "Download link for PDB file"
|
|
67
|
-
},
|
|
68
|
-
"cifUrl": {
|
|
69
|
-
"type": "string",
|
|
70
|
-
"description": "Download link for CIF file"
|
|
71
|
-
},
|
|
72
|
-
"bcifUrl": {
|
|
94
|
+
"qualifier": {
|
|
73
95
|
"type": "string",
|
|
74
|
-
"description": "
|
|
96
|
+
"description": "Protein identifier: UniProt accession, entry name, or CRC64 checksum."
|
|
97
|
+
}
|
|
98
|
+
},
|
|
99
|
+
"required": ["qualifier"]
|
|
100
|
+
},
|
|
101
|
+
"fields": {
|
|
102
|
+
"endpoint": "/uniprot/summary/{qualifier}.json",
|
|
103
|
+
"return_format": "JSON"
|
|
104
|
+
},
|
|
105
|
+
"return_schema": {
|
|
106
|
+
"type": "object",
|
|
107
|
+
"properties": {
|
|
108
|
+
"uniprot_entry": {
|
|
109
|
+
"type": "object",
|
|
110
|
+
"properties": {
|
|
111
|
+
"ac": { "type": "string" },
|
|
112
|
+
"id": { "type": "string" },
|
|
113
|
+
"uniprot_checksum": { "type": "string" },
|
|
114
|
+
"sequence_length": { "type": "integer" },
|
|
115
|
+
"segment_start": { "type": "integer" },
|
|
116
|
+
"segment_end": { "type": "integer" }
|
|
117
|
+
}
|
|
75
118
|
},
|
|
76
|
-
"
|
|
119
|
+
"structures": {
|
|
120
|
+
"type": "array",
|
|
121
|
+
"items": {
|
|
122
|
+
"type": "object",
|
|
123
|
+
"properties": {
|
|
124
|
+
"summary": {
|
|
125
|
+
"type": "object",
|
|
126
|
+
"properties": {
|
|
127
|
+
"model_identifier": { "type": "string" },
|
|
128
|
+
"model_category": { "type": "string" },
|
|
129
|
+
"model_url": { "type": "string" },
|
|
130
|
+
"model_format": { "type": "string" },
|
|
131
|
+
"model_type": { "type": "string" },
|
|
132
|
+
"model_page_url": { "type": "string" },
|
|
133
|
+
"provider": { "type": "string" },
|
|
134
|
+
"number_of_conformers": { "type": "integer" },
|
|
135
|
+
"ensemble_sample_url": { "type": "string" },
|
|
136
|
+
"ensemble_sample_format": { "type": "string" },
|
|
137
|
+
"created": { "type": "string" },
|
|
138
|
+
"sequence_identity": { "type": "number" },
|
|
139
|
+
"uniprot_start": { "type": "integer" },
|
|
140
|
+
"uniprot_end": { "type": "integer" },
|
|
141
|
+
"coverage": { "type": "number" },
|
|
142
|
+
"experimental_method": { "type": "string" },
|
|
143
|
+
"resolution": { "type": "number" },
|
|
144
|
+
"confidence_type": { "type": "string" },
|
|
145
|
+
"confidence_version": { "type": "string" },
|
|
146
|
+
"confidence_avg_local_score": { "type": "number" },
|
|
147
|
+
"oligomeric_state": { "type": "string" },
|
|
148
|
+
"preferred_assembly_id": { "type": "string" },
|
|
149
|
+
"entities": {
|
|
150
|
+
"type": "array",
|
|
151
|
+
"items": {
|
|
152
|
+
"type": "object",
|
|
153
|
+
"properties": {
|
|
154
|
+
"entity_type": { "type": "string" },
|
|
155
|
+
"entity_poly_type": { "type": "string" },
|
|
156
|
+
"identifier": { "type": "string" },
|
|
157
|
+
"identifier_category": { "type": "string" },
|
|
158
|
+
"description": { "type": "string" },
|
|
159
|
+
"chain_ids": { "type": "array", "items": { "type": "string" } }
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
},
|
|
171
|
+
{
|
|
172
|
+
"name": "alphafold_get_annotations",
|
|
173
|
+
"description": "Retrieve AlphaFold variant annotations (e.g., missense mutations) for a given UniProt accession (e.g., 'P69905'). Input must be a UniProt accession, entry name, or CRC64 checksum, along with an annotation type (currently only 'MUTAGEN'). Use this tool to explore predicted pathogenicity or functional effects of substitutions. If you only have a protein/gene name, resolve it with `uniprot_search`. For experimentally curated variants, use `UniProt_get_disease_variants_by_accession`. To view the full 3D structure, call `alphafold_get_prediction`; for overall model metadata, use `alphafold_get_summary`.",
|
|
174
|
+
"type": "AlphaFoldRESTTool",
|
|
175
|
+
"parameter": {
|
|
176
|
+
"type": "object",
|
|
177
|
+
"properties": {
|
|
178
|
+
"qualifier": {
|
|
77
179
|
"type": "string",
|
|
78
|
-
"description": "
|
|
180
|
+
"description": "Protein identifier: UniProt accession, entry name, or CRC64 checksum."
|
|
79
181
|
},
|
|
80
|
-
"
|
|
182
|
+
"type": {
|
|
81
183
|
"type": "string",
|
|
82
|
-
"description": "
|
|
184
|
+
"description": "Annotation type (currently only 'MUTAGEN' is supported).",
|
|
185
|
+
"enum": ["MUTAGEN"]
|
|
186
|
+
}
|
|
187
|
+
},
|
|
188
|
+
"required": ["qualifier", "type"]
|
|
189
|
+
},
|
|
190
|
+
"fields": {
|
|
191
|
+
"endpoint": "/annotations/{qualifier}.json",
|
|
192
|
+
"return_format": "JSON"
|
|
193
|
+
},
|
|
194
|
+
"return_schema": {
|
|
195
|
+
"type": "object",
|
|
196
|
+
"properties": {
|
|
197
|
+
"accession": { "type": "string" },
|
|
198
|
+
"id": { "type": "string" },
|
|
199
|
+
"sequence": { "type": "string" },
|
|
200
|
+
"annotation": {
|
|
201
|
+
"type": "array",
|
|
202
|
+
"items": {
|
|
203
|
+
"type": "object",
|
|
204
|
+
"properties": {
|
|
205
|
+
"type": { "type": "string" },
|
|
206
|
+
"description": { "type": "string" },
|
|
207
|
+
"source_name": { "type": "string" },
|
|
208
|
+
"source_url": { "type": "string" },
|
|
209
|
+
"evidence": { "type": "string" },
|
|
210
|
+
"residues": { "type": "array", "items": { "type": "integer" } },
|
|
211
|
+
"regions": {
|
|
212
|
+
"type": "array",
|
|
213
|
+
"items": {
|
|
214
|
+
"type": "object",
|
|
215
|
+
"properties": {
|
|
216
|
+
"start": { "type": "integer" },
|
|
217
|
+
"end": { "type": "integer" },
|
|
218
|
+
"annotation_value": { "type": "string" },
|
|
219
|
+
"unit": { "type": "string" }
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
}
|
|
83
225
|
}
|
|
84
226
|
}
|
|
85
227
|
}
|
|
@@ -199,4 +199,67 @@
|
|
|
199
199
|
"composition_file": "biomarker_discovery.py",
|
|
200
200
|
"composition_function": "compose"
|
|
201
201
|
}
|
|
202
|
+
,
|
|
203
|
+
{
|
|
204
|
+
"type": "ComposeTool",
|
|
205
|
+
"name": "ToolMetadataGenerationPipeline",
|
|
206
|
+
"description": "Generates standardized metadata for a batch of ToolUniverse tool configurations by calling ToolMetadataGenerator, LabelGenerator, and ToolMetadataStandardizer for sources and tags.",
|
|
207
|
+
"parameter": {
|
|
208
|
+
"type": "object",
|
|
209
|
+
"properties": {
|
|
210
|
+
"tool_configs": {
|
|
211
|
+
"type": "array",
|
|
212
|
+
"description": "List of raw tool configuration JSON objects to extract and standardize metadata for",
|
|
213
|
+
"items": {"type": "object"}
|
|
214
|
+
},
|
|
215
|
+
"tool_type_mappings": {
|
|
216
|
+
"type": "object",
|
|
217
|
+
"description": "Mapping of simplified toolType (keys) to lists of tool 'type' values belonging to each simplified category (e.g., {'Databases': ['XMLTool']})",
|
|
218
|
+
"default": {}
|
|
219
|
+
},
|
|
220
|
+
"add_existing_tooluniverse_labels": {
|
|
221
|
+
"type": "boolean",
|
|
222
|
+
"description": "Whether to include labels from existing ToolUniverse tools when labeling the metadata configs of the new tools. It is strongly recommended that this is set to true to minimize the number of new labels created and the possibility of redundant labels.",
|
|
223
|
+
"default": true
|
|
224
|
+
},
|
|
225
|
+
"max_new_tooluniverse_labels": {
|
|
226
|
+
"type": "integer",
|
|
227
|
+
"description": "The maximum number of new ToolUniverse labels to use in the metadata configs of the new tools. The existing ToolUniverse labels will be used first, and then new labels will be created as needed up to this limit. If the limit is reached, the least relevant new labels will be discarded. Please try to use as few new labels as possible to avoid excessive labels.",
|
|
228
|
+
"default": 0
|
|
229
|
+
}
|
|
230
|
+
},
|
|
231
|
+
"required": ["tool_configs"]
|
|
232
|
+
},
|
|
233
|
+
"auto_load_dependencies": true,
|
|
234
|
+
"fail_on_missing_tools": false,
|
|
235
|
+
"required_tools": [
|
|
236
|
+
"ToolMetadataGenerator",
|
|
237
|
+
"LabelGenerator",
|
|
238
|
+
"ToolMetadataStandardizer"
|
|
239
|
+
],
|
|
240
|
+
"composition_file": "tool_metadata_generator.py",
|
|
241
|
+
"composition_function": "compose"
|
|
242
|
+
},
|
|
243
|
+
{
|
|
244
|
+
"type": "ComposeTool",
|
|
245
|
+
"name": "ToolGraphGenerationPipeline",
|
|
246
|
+
"description": "Generates a directed tool relationship graph among provided tool configs using ToolRelationshipDetector to infer data-flow compatibility.",
|
|
247
|
+
"parameter": {
|
|
248
|
+
"type": "object",
|
|
249
|
+
"properties": {
|
|
250
|
+
"tool_configs": {"type": "array", "description": "List of tool configuration objects", "items": {"type": "object"}},
|
|
251
|
+
"max_tools": {"type": "integer", "description": "Optional max number of tools to process (debug)"},
|
|
252
|
+
"output_path": {"type": "string", "description": "Path for output graph JSON", "default": "./tool_relationship_graph.json"},
|
|
253
|
+
"save_intermediate_every": {"type": "integer", "description": "Checkpoint every N processed pairs", "default": 5000}
|
|
254
|
+
},
|
|
255
|
+
"required": ["tool_configs"]
|
|
256
|
+
},
|
|
257
|
+
"auto_load_dependencies": true,
|
|
258
|
+
"fail_on_missing_tools": false,
|
|
259
|
+
"required_tools": [
|
|
260
|
+
"ToolRelationshipDetector"
|
|
261
|
+
],
|
|
262
|
+
"composition_file": "tool_graph_generation.py",
|
|
263
|
+
"composition_function": "compose"
|
|
264
|
+
}
|
|
202
265
|
]
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
[
|
|
2
2
|
{
|
|
3
|
+
"type": "SpecialTool",
|
|
3
4
|
"name": "Finish",
|
|
4
5
|
"description": "Indicate the end of multi-step reasoning.",
|
|
5
6
|
"parameter": {
|
|
@@ -8,6 +9,7 @@
|
|
|
8
9
|
}
|
|
9
10
|
},
|
|
10
11
|
{
|
|
12
|
+
"type": "SpecialTool",
|
|
11
13
|
"name": "CallAgent",
|
|
12
14
|
"description": "Give a solution plan to the agent and let it solve the problem. Solution plan should reflect a distinct method, approach, or viewpoint to solve the given question. Call these function multiple times, and each solution plan should start with different aspects of the question, for example, genes, phenotypes, diseases, or drugs, etc. The CallAgent will achieve the task based on the plan, so only give the plan instead of unverified information.",
|
|
13
15
|
"parameter": {
|
|
@@ -1,46 +1,54 @@
|
|
|
1
1
|
import json
|
|
2
|
-
from typing import Any, Dict, List
|
|
3
2
|
import os
|
|
3
|
+
from typing import Any, Dict, List
|
|
4
4
|
from tooluniverse import ToolUniverse
|
|
5
5
|
|
|
6
|
-
# Load
|
|
6
|
+
# Load all tool schemas from JSON
|
|
7
7
|
schema_path = os.path.join(
|
|
8
8
|
os.path.dirname(__file__), "..", "data", "alphafold_tools.json"
|
|
9
9
|
)
|
|
10
10
|
with open(schema_path) as f:
|
|
11
|
-
|
|
11
|
+
tools_json = json.load(f)
|
|
12
|
+
|
|
13
|
+
schemas = {tool["name"]: tool["return_schema"] for tool in tools_json}
|
|
12
14
|
|
|
13
15
|
tooluni = ToolUniverse()
|
|
14
16
|
tooluni.load_tools()
|
|
15
17
|
|
|
16
|
-
# Test cases: 3 valid, 1 invalid UniProt ID, and 1 missing parameter
|
|
17
18
|
test_queries: List[Dict[str, Any]] = [
|
|
19
|
+
# Hemoglobin subunit alpha (valid)
|
|
18
20
|
{
|
|
19
|
-
"name": "
|
|
20
|
-
"arguments": {"
|
|
21
|
+
"name": "alphafold_get_prediction",
|
|
22
|
+
"arguments": {"qualifier": "P69905"},
|
|
21
23
|
},
|
|
24
|
+
# Invalid
|
|
22
25
|
{
|
|
23
|
-
"name": "
|
|
24
|
-
"arguments": {"
|
|
26
|
+
"name": "alphafold_get_prediction",
|
|
27
|
+
"arguments": {"qualifier": "XXX123"},
|
|
25
28
|
},
|
|
29
|
+
# Missing param
|
|
26
30
|
{
|
|
27
|
-
"name": "
|
|
28
|
-
"arguments": {
|
|
31
|
+
"name": "alphafold_get_prediction",
|
|
32
|
+
"arguments": {},
|
|
29
33
|
},
|
|
34
|
+
# Summary: valid
|
|
30
35
|
{
|
|
31
|
-
"name": "
|
|
32
|
-
"arguments": {"
|
|
33
|
-
},
|
|
36
|
+
"name": "alphafold_get_summary",
|
|
37
|
+
"arguments": {"qualifier": "P69905"},
|
|
38
|
+
},
|
|
39
|
+
# Annotations (valid + invalid type)
|
|
34
40
|
{
|
|
35
|
-
"name": "
|
|
36
|
-
"arguments": {},
|
|
37
|
-
},
|
|
41
|
+
"name": "alphafold_get_annotations",
|
|
42
|
+
"arguments": {"qualifier": "P69905", "type": "MUTAGEN"},
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
"name": "alphafold_get_annotations",
|
|
46
|
+
"arguments": {"qualifier": "P69905", "type": "INVALID"},
|
|
47
|
+
},
|
|
38
48
|
]
|
|
39
49
|
|
|
40
50
|
for idx, query in enumerate(test_queries, 1):
|
|
41
|
-
|
|
42
|
-
label = f"UniProt ID: {uid}" if uid else "No UniProt ID"
|
|
43
|
-
print(f"\n[{idx}] Running {query['name']} with {label}")
|
|
51
|
+
print(f"\n[{idx}] Running {query['name']} with {query['arguments']}")
|
|
44
52
|
result = tooluni.run(query)
|
|
45
53
|
|
|
46
54
|
# Handle errors
|
|
@@ -51,21 +59,50 @@ for idx, query in enumerate(test_queries, 1):
|
|
|
51
59
|
continue
|
|
52
60
|
|
|
53
61
|
# Handle success
|
|
54
|
-
data = result.get("data"
|
|
62
|
+
data = result.get("data")
|
|
55
63
|
if not data:
|
|
56
64
|
print("No data returned.")
|
|
57
65
|
continue
|
|
58
66
|
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
67
|
+
# Schema validation (check only top-level keys)
|
|
68
|
+
schema = schemas[query["name"]]
|
|
69
|
+
expected_keys = schema.get("properties", {}).keys()
|
|
70
|
+
|
|
71
|
+
# Handle list vs dict results
|
|
72
|
+
if isinstance(data, list) and data:
|
|
73
|
+
record = data[0]
|
|
74
|
+
elif isinstance(data, dict):
|
|
75
|
+
record = data
|
|
76
|
+
else:
|
|
77
|
+
record = {}
|
|
65
78
|
|
|
66
|
-
|
|
67
|
-
missing = [k for k in schema.keys() if k not in first]
|
|
79
|
+
missing = [k for k in expected_keys if k not in record]
|
|
68
80
|
if missing:
|
|
69
81
|
print(f" INVALID Missing expected fields: {missing}")
|
|
70
82
|
else:
|
|
71
|
-
print(" All expected schema fields present")
|
|
83
|
+
print(" SUCCESS All expected schema fields present")
|
|
84
|
+
|
|
85
|
+
# Show highlights depending on tool
|
|
86
|
+
if query["name"] == "alphafold_get_prediction":
|
|
87
|
+
if "uniprotDescription" in record:
|
|
88
|
+
print(
|
|
89
|
+
f" {record.get('uniprotDescription')} ({record.get('uniprotAccession')})"
|
|
90
|
+
)
|
|
91
|
+
print(f" Organism: {record.get('organismScientificName')}")
|
|
92
|
+
print(f" Avg pLDDT: {record.get('globalMetricValue')}")
|
|
93
|
+
|
|
94
|
+
elif query["name"] == "alphafold_get_summary":
|
|
95
|
+
entry = record.get("uniprot_entry", {})
|
|
96
|
+
structures = record.get("structures", [])
|
|
97
|
+
print(f" UniProt AC: {entry.get('ac')}, ID: {entry.get('id')}")
|
|
98
|
+
print(f" Sequence length: {entry.get('sequence_length')}")
|
|
99
|
+
print(f" Structures returned: {len(structures)}")
|
|
100
|
+
|
|
101
|
+
elif query["name"] == "alphafold_get_annotations":
|
|
102
|
+
annotations = record.get("annotation", [])
|
|
103
|
+
print(f" Accession: {record.get('accession')}")
|
|
104
|
+
print(f" Total annotations: {len(annotations)}")
|
|
105
|
+
if annotations:
|
|
106
|
+
first_ann = annotations[0]
|
|
107
|
+
print(f" First annotation type: {first_ann.get('type')}")
|
|
108
|
+
print(f" First annotation description: {first_ann.get('description')}")
|