aiagents4pharma 1.9.0__tar.gz → 1.11.0__tar.gz
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.
- {aiagents4pharma-1.9.0 → aiagents4pharma-1.11.0}/PKG-INFO +39 -23
- {aiagents4pharma-1.9.0 → aiagents4pharma-1.11.0}/README.md +37 -21
- aiagents4pharma-1.11.0/aiagents4pharma/__init__.py +11 -0
- {aiagents4pharma-1.9.0 → aiagents4pharma-1.11.0}/aiagents4pharma/talk2biomodels/agents/t2b_agent.py +7 -10
- {aiagents4pharma-1.9.0 → aiagents4pharma-1.11.0}/aiagents4pharma/talk2biomodels/models/basico_model.py +29 -32
- {aiagents4pharma-1.9.0 → aiagents4pharma-1.11.0}/aiagents4pharma/talk2biomodels/models/sys_bio_model.py +9 -6
- {aiagents4pharma-1.9.0 → aiagents4pharma-1.11.0}/aiagents4pharma/talk2biomodels/states/state_talk2biomodels.py +3 -3
- {aiagents4pharma-1.9.0 → aiagents4pharma-1.11.0}/aiagents4pharma/talk2biomodels/tests/test_basico_model.py +7 -8
- {aiagents4pharma-1.9.0 → aiagents4pharma-1.11.0}/aiagents4pharma/talk2biomodels/tests/test_langgraph.py +64 -2
- {aiagents4pharma-1.9.0 → aiagents4pharma-1.11.0}/aiagents4pharma/talk2biomodels/tests/test_sys_bio_model.py +13 -7
- {aiagents4pharma-1.9.0 → aiagents4pharma-1.11.0}/aiagents4pharma/talk2biomodels/tools/__init__.py +1 -0
- {aiagents4pharma-1.9.0 → aiagents4pharma-1.11.0}/aiagents4pharma/talk2biomodels/tools/get_modelinfo.py +5 -3
- aiagents4pharma-1.11.0/aiagents4pharma/talk2biomodels/tools/parameter_scan.py +292 -0
- {aiagents4pharma-1.9.0 → aiagents4pharma-1.11.0}/aiagents4pharma/talk2biomodels/tools/simulate_model.py +9 -11
- aiagents4pharma-1.11.0/aiagents4pharma/talk2competitors/__init__.py +5 -0
- aiagents4pharma-1.11.0/aiagents4pharma/talk2competitors/agents/__init__.py +6 -0
- aiagents4pharma-1.11.0/aiagents4pharma/talk2competitors/agents/main_agent.py +130 -0
- aiagents4pharma-1.11.0/aiagents4pharma/talk2competitors/agents/s2_agent.py +75 -0
- aiagents4pharma-1.11.0/aiagents4pharma/talk2competitors/config/__init__.py +5 -0
- aiagents4pharma-1.11.0/aiagents4pharma/talk2competitors/config/config.py +110 -0
- aiagents4pharma-1.11.0/aiagents4pharma/talk2competitors/state/__init__.py +5 -0
- aiagents4pharma-1.11.0/aiagents4pharma/talk2competitors/state/state_talk2competitors.py +32 -0
- aiagents4pharma-1.11.0/aiagents4pharma/talk2competitors/tests/__init__.py +3 -0
- aiagents4pharma-1.11.0/aiagents4pharma/talk2competitors/tests/test_langgraph.py +274 -0
- aiagents4pharma-1.11.0/aiagents4pharma/talk2competitors/tools/__init__.py +7 -0
- aiagents4pharma-1.11.0/aiagents4pharma/talk2competitors/tools/s2/__init__.py +8 -0
- aiagents4pharma-1.11.0/aiagents4pharma/talk2competitors/tools/s2/display_results.py +25 -0
- aiagents4pharma-1.11.0/aiagents4pharma/talk2competitors/tools/s2/multi_paper_rec.py +132 -0
- aiagents4pharma-1.11.0/aiagents4pharma/talk2competitors/tools/s2/search.py +119 -0
- aiagents4pharma-1.11.0/aiagents4pharma/talk2competitors/tools/s2/single_paper_rec.py +141 -0
- {aiagents4pharma-1.9.0 → aiagents4pharma-1.11.0}/aiagents4pharma.egg-info/PKG-INFO +39 -23
- {aiagents4pharma-1.9.0 → aiagents4pharma-1.11.0}/aiagents4pharma.egg-info/SOURCES.txt +16 -0
- {aiagents4pharma-1.9.0 → aiagents4pharma-1.11.0}/pyproject.toml +1 -1
- aiagents4pharma-1.11.0/release_version.txt +1 -0
- aiagents4pharma-1.9.0/aiagents4pharma/__init__.py +0 -8
- aiagents4pharma-1.9.0/aiagents4pharma/talk2knowledgegraphs/utils/__init__.py +0 -0
- aiagents4pharma-1.9.0/release_version.txt +0 -1
- {aiagents4pharma-1.9.0 → aiagents4pharma-1.11.0}/LICENSE +0 -0
- {aiagents4pharma-1.9.0 → aiagents4pharma-1.11.0}/aiagents4pharma/configs/__init__.py +0 -0
- {aiagents4pharma-1.9.0 → aiagents4pharma-1.11.0}/aiagents4pharma/configs/config.yaml +0 -0
- {aiagents4pharma-1.9.0 → aiagents4pharma-1.11.0}/aiagents4pharma/configs/talk2biomodels/__init__.py +0 -0
- {aiagents4pharma-1.9.0 → aiagents4pharma-1.11.0}/aiagents4pharma/configs/talk2biomodels/agents/__init__.py +0 -0
- {aiagents4pharma-1.9.0 → aiagents4pharma-1.11.0}/aiagents4pharma/configs/talk2biomodels/agents/t2b_agent/__init__.py +0 -0
- {aiagents4pharma-1.9.0 → aiagents4pharma-1.11.0}/aiagents4pharma/configs/talk2biomodels/agents/t2b_agent/default.yaml +0 -0
- {aiagents4pharma-1.9.0 → aiagents4pharma-1.11.0}/aiagents4pharma/talk2biomodels/__init__.py +0 -0
- {aiagents4pharma-1.9.0 → aiagents4pharma-1.11.0}/aiagents4pharma/talk2biomodels/agents/__init__.py +0 -0
- {aiagents4pharma-1.9.0 → aiagents4pharma-1.11.0}/aiagents4pharma/talk2biomodels/models/__init__.py +0 -0
- {aiagents4pharma-1.9.0 → aiagents4pharma-1.11.0}/aiagents4pharma/talk2biomodels/states/__init__.py +0 -0
- {aiagents4pharma-1.9.0 → aiagents4pharma-1.11.0}/aiagents4pharma/talk2biomodels/tests/__init__.py +0 -0
- {aiagents4pharma-1.9.0 → aiagents4pharma-1.11.0}/aiagents4pharma/talk2biomodels/tools/ask_question.py +0 -0
- {aiagents4pharma-1.9.0 → aiagents4pharma-1.11.0}/aiagents4pharma/talk2biomodels/tools/custom_plotter.py +0 -0
- {aiagents4pharma-1.9.0 → aiagents4pharma-1.11.0}/aiagents4pharma/talk2biomodels/tools/load_biomodel.py +0 -0
- {aiagents4pharma-1.9.0 → aiagents4pharma-1.11.0}/aiagents4pharma/talk2biomodels/tools/search_models.py +0 -0
- {aiagents4pharma-1.9.0 → aiagents4pharma-1.11.0}/aiagents4pharma/talk2cells/__init__.py +0 -0
- {aiagents4pharma-1.9.0 → aiagents4pharma-1.11.0}/aiagents4pharma/talk2cells/agents/__init__.py +0 -0
- {aiagents4pharma-1.9.0 → aiagents4pharma-1.11.0}/aiagents4pharma/talk2cells/agents/scp_agent.py +0 -0
- {aiagents4pharma-1.9.0 → aiagents4pharma-1.11.0}/aiagents4pharma/talk2cells/states/__init__.py +0 -0
- {aiagents4pharma-1.9.0 → aiagents4pharma-1.11.0}/aiagents4pharma/talk2cells/states/state_talk2cells.py +0 -0
- {aiagents4pharma-1.9.0 → aiagents4pharma-1.11.0}/aiagents4pharma/talk2cells/tests/scp_agent/test_scp_agent.py +0 -0
- {aiagents4pharma-1.9.0 → aiagents4pharma-1.11.0}/aiagents4pharma/talk2cells/tools/__init__.py +0 -0
- {aiagents4pharma-1.9.0 → aiagents4pharma-1.11.0}/aiagents4pharma/talk2cells/tools/scp_agent/__init__.py +0 -0
- {aiagents4pharma-1.9.0 → aiagents4pharma-1.11.0}/aiagents4pharma/talk2cells/tools/scp_agent/display_studies.py +0 -0
- {aiagents4pharma-1.9.0 → aiagents4pharma-1.11.0}/aiagents4pharma/talk2cells/tools/scp_agent/search_studies.py +0 -0
- {aiagents4pharma-1.9.0 → aiagents4pharma-1.11.0}/aiagents4pharma/talk2knowledgegraphs/__init__.py +0 -0
- {aiagents4pharma-1.9.0 → aiagents4pharma-1.11.0}/aiagents4pharma/talk2knowledgegraphs/datasets/__init__.py +0 -0
- {aiagents4pharma-1.9.0 → aiagents4pharma-1.11.0}/aiagents4pharma/talk2knowledgegraphs/datasets/biobridge_primekg.py +0 -0
- {aiagents4pharma-1.9.0 → aiagents4pharma-1.11.0}/aiagents4pharma/talk2knowledgegraphs/datasets/dataset.py +0 -0
- {aiagents4pharma-1.9.0 → aiagents4pharma-1.11.0}/aiagents4pharma/talk2knowledgegraphs/datasets/primekg.py +0 -0
- {aiagents4pharma-1.9.0 → aiagents4pharma-1.11.0}/aiagents4pharma/talk2knowledgegraphs/datasets/starkqa_primekg.py +0 -0
- {aiagents4pharma-1.9.0/aiagents4pharma/talk2competitors → aiagents4pharma-1.11.0/aiagents4pharma/talk2knowledgegraphs/tests}/__init__.py +0 -0
- {aiagents4pharma-1.9.0 → aiagents4pharma-1.11.0}/aiagents4pharma/talk2knowledgegraphs/tests/test_datasets_biobridge_primekg.py +0 -0
- {aiagents4pharma-1.9.0 → aiagents4pharma-1.11.0}/aiagents4pharma/talk2knowledgegraphs/tests/test_datasets_dataset.py +0 -0
- {aiagents4pharma-1.9.0 → aiagents4pharma-1.11.0}/aiagents4pharma/talk2knowledgegraphs/tests/test_datasets_primekg.py +0 -0
- {aiagents4pharma-1.9.0 → aiagents4pharma-1.11.0}/aiagents4pharma/talk2knowledgegraphs/tests/test_datasets_starkqa_primekg.py +0 -0
- {aiagents4pharma-1.9.0 → aiagents4pharma-1.11.0}/aiagents4pharma/talk2knowledgegraphs/tests/test_utils_embeddings_embeddings.py +0 -0
- {aiagents4pharma-1.9.0 → aiagents4pharma-1.11.0}/aiagents4pharma/talk2knowledgegraphs/tests/test_utils_embeddings_huggingface.py +0 -0
- {aiagents4pharma-1.9.0 → aiagents4pharma-1.11.0}/aiagents4pharma/talk2knowledgegraphs/tests/test_utils_embeddings_sentencetransformer.py +0 -0
- {aiagents4pharma-1.9.0/aiagents4pharma/talk2knowledgegraphs/tests → aiagents4pharma-1.11.0/aiagents4pharma/talk2knowledgegraphs/utils}/__init__.py +0 -0
- {aiagents4pharma-1.9.0 → aiagents4pharma-1.11.0}/aiagents4pharma/talk2knowledgegraphs/utils/embeddings/__init__.py +0 -0
- {aiagents4pharma-1.9.0 → aiagents4pharma-1.11.0}/aiagents4pharma/talk2knowledgegraphs/utils/embeddings/embeddings.py +0 -0
- {aiagents4pharma-1.9.0 → aiagents4pharma-1.11.0}/aiagents4pharma/talk2knowledgegraphs/utils/embeddings/huggingface.py +0 -0
- {aiagents4pharma-1.9.0 → aiagents4pharma-1.11.0}/aiagents4pharma/talk2knowledgegraphs/utils/embeddings/sentence_transformer.py +0 -0
- {aiagents4pharma-1.9.0 → aiagents4pharma-1.11.0}/aiagents4pharma/talk2knowledgegraphs/utils/kg_utils.py +0 -0
- {aiagents4pharma-1.9.0 → aiagents4pharma-1.11.0}/aiagents4pharma.egg-info/dependency_links.txt +0 -0
- {aiagents4pharma-1.9.0 → aiagents4pharma-1.11.0}/aiagents4pharma.egg-info/requires.txt +0 -0
- {aiagents4pharma-1.9.0 → aiagents4pharma-1.11.0}/aiagents4pharma.egg-info/top_level.txt +0 -0
- {aiagents4pharma-1.9.0 → aiagents4pharma-1.11.0}/setup.cfg +0 -0
@@ -1,11 +1,11 @@
|
|
1
1
|
Metadata-Version: 2.2
|
2
2
|
Name: aiagents4pharma
|
3
|
-
Version: 1.
|
3
|
+
Version: 1.11.0
|
4
4
|
Summary: AI Agents for drug discovery, drug development, and other pharmaceutical R&D
|
5
5
|
Classifier: Programming Language :: Python :: 3
|
6
6
|
Classifier: License :: OSI Approved :: MIT License
|
7
7
|
Classifier: Operating System :: OS Independent
|
8
|
-
Requires-Python: >=3.
|
8
|
+
Requires-Python: >=3.12
|
9
9
|
Description-Content-Type: text/markdown
|
10
10
|
License-File: LICENSE
|
11
11
|
Requires-Dist: copasi_basico==0.78
|
@@ -48,6 +48,9 @@ Requires-Dist: streamlit-feedback
|
|
48
48
|
[](https://github.com/VirtualPatientEngine/AIAgents4Pharma/actions/workflows/tests_talk2cells.yml)
|
49
49
|
[](https://github.com/VirtualPatientEngine/AIAgents4Pharma/actions/workflows/tests_talk2knowledgegraphs.yml)
|
50
50
|
[](https://github.com/VirtualPatientEngine/AIAgents4Pharma/actions/workflows/tests_talk2competitors.yml)
|
51
|
+

|
52
|
+

|
53
|
+
|
51
54
|
|
52
55
|
<h1 align="center" style="border-bottom: none;">🤖 AIAgents4Pharma</h1>
|
53
56
|
|
@@ -56,9 +59,9 @@ Welcome to **AIAgents4Pharma** – an open-source project by [Team VPE](https://
|
|
56
59
|
Our toolkit currently consists of three intelligent agents, each designed to simplify and enhance access to specialized data in biology:
|
57
60
|
|
58
61
|
- **Talk2BioModels**: Engage directly with mathematical models in systems biology.
|
59
|
-
- **Talk2Cells**
|
60
|
-
- **Talk2KnowledgeGraphs**
|
61
|
-
- **Talk2Competitors**
|
62
|
+
- **Talk2Cells** _(Work in progress)_: Query and analyze sequencing data with ease.
|
63
|
+
- **Talk2KnowledgeGraphs** _(Work in progress)_: Access and explore complex biological knowledge graphs for insightful data connections.
|
64
|
+
- **Talk2Competitors** _(Coming soon)_: Get recommendations for articles related to your choice. Download, query, and write/retrieve them to your reference manager (currently supporting Zotero).
|
62
65
|
|
63
66
|
---
|
64
67
|
|
@@ -71,68 +74,77 @@ Our toolkit currently consists of three intelligent agents, each designed to sim
|
|
71
74
|
- Forward simulation of both internal and open-source models (BioModels).
|
72
75
|
- Adjust parameters within the model to simulate different conditions.
|
73
76
|
- Query simulation results.
|
77
|
+
- Extract model information such as species, parameters, units and description.
|
74
78
|
|
75
|
-
### 2. Talk2Cells
|
79
|
+
### 2. Talk2Cells _(Work in Progress)_
|
76
80
|
|
77
81
|
**Talk2Cells** is being developed to provide direct access to and analysis of sequencing data, such as RNA-Seq or DNA-Seq, using natural language.
|
78
82
|
|
79
|
-
### 3. Talk2KnowledgeGraphs
|
83
|
+
### 3. Talk2KnowledgeGraphs _(Work in Progress)_
|
80
84
|
|
81
85
|
**Talk2KnowledgeGraphs** is an agent designed to enable interaction with biological knowledge graphs (KGs). KGs integrate vast amounts of structured biological data into a format that highlights relationships between entities, such as proteins, genes, and diseases.
|
82
86
|
|
83
|
-
### 4.
|
87
|
+
### 4. Talk2Competitors _(Coming soon)_
|
84
88
|
|
85
89
|
## Getting Started
|
86
90
|
|
87
|
-
|
88
|
-
|
89
|
-
- **Python 3.10+**
|
90
|
-
- **Git**
|
91
|
-
- Required libraries specified in `requirements.txt`
|
91
|
+

|
92
92
|
|
93
93
|
### Installation
|
94
|
+
|
94
95
|
#### Option 1: PyPI
|
95
|
-
|
96
|
-
|
97
|
-
|
96
|
+
|
97
|
+
```bash
|
98
|
+
pip install aiagents4pharma
|
99
|
+
```
|
98
100
|
|
99
101
|
Check out the tutorials on each agent for detailed instrcutions.
|
100
102
|
|
101
103
|
#### Option 2: git
|
104
|
+
|
102
105
|
1. **Clone the repository:**
|
106
|
+
|
103
107
|
```bash
|
104
108
|
git clone https://github.com/VirtualPatientEngine/AIAgents4Pharma
|
105
109
|
cd AIAgents4Pharma
|
106
110
|
```
|
107
111
|
|
108
112
|
2. **Install dependencies:**
|
113
|
+
|
109
114
|
```bash
|
110
115
|
pip install .
|
111
116
|
```
|
112
117
|
|
113
118
|
3. **Initialize OPENAI_API_KEY**
|
119
|
+
|
114
120
|
```bash
|
115
|
-
export OPENAI_API_KEY
|
121
|
+
export OPENAI_API_KEY=....
|
116
122
|
```
|
117
123
|
|
118
124
|
4. **[Optional] Set up login credentials**
|
125
|
+
|
119
126
|
```bash
|
120
127
|
vi .streamlit/secrets.toml
|
121
128
|
```
|
129
|
+
|
122
130
|
and enter
|
131
|
+
|
123
132
|
```
|
124
133
|
password='XXX'
|
125
134
|
```
|
126
|
-
|
135
|
+
|
136
|
+
Please note that the passoword will be same for all the users.
|
127
137
|
|
128
138
|
5. **[Optional] Initialize LANGSMITH_API_KEY**
|
139
|
+
|
129
140
|
```bash
|
130
141
|
export LANGCHAIN_TRACING_V2=true
|
131
142
|
export LANGCHAIN_API_KEY=<your-api-key>
|
132
143
|
```
|
133
|
-
|
134
|
-
|
135
|
-
|
144
|
+
|
145
|
+
Please note that this will create a new tracing project in your Langsmith
|
146
|
+
account with the name `<user_name>@<uuid>`, where `user_name` is the name
|
147
|
+
you provided in the previous step. If you skip the previous step, it will
|
136
148
|
default to `default`. <uuid> will be the 128 bit unique ID created for the
|
137
149
|
session.
|
138
150
|
|
@@ -164,6 +176,7 @@ We welcome contributions to AIAgents4Pharma! Here’s how you can help:
|
|
164
176
|
5. **Open a pull request**
|
165
177
|
|
166
178
|
### Current Needs
|
179
|
+
|
167
180
|
- **Beta testers** for Talk2BioModels.
|
168
181
|
- **Developers** with experience in natural language processing, bioinformatics, or knowledge graphs for contributions to AIAgents4Pharma.
|
169
182
|
|
@@ -174,19 +187,22 @@ Check out our [CONTRIBUTING.md](CONTRIBUTING.md) for more information.
|
|
174
187
|
## Roadmap
|
175
188
|
|
176
189
|
### Completed
|
190
|
+
|
177
191
|
- **Talk2BioModels**: Initial release with core capabilities for interacting with systems biology models.
|
178
192
|
|
179
193
|
### Planned
|
194
|
+
|
180
195
|
- **User Interface**: Interactive web UI for all agents.
|
181
196
|
- **Talk2Cells**: Integration of sequencing data analysis tools.
|
182
197
|
- **Talk2KnowledgeGraphs**: Interface for biological knowledge graph interaction.
|
183
|
-
- **Talk2Competitors
|
198
|
+
- **Talk2Competitors**: Interface for exploring articles
|
184
199
|
|
185
|
-
We’re excited to bring AIAgents4Pharma to the bioinformatics and pharmaceutical research community. Together, let’s make data-driven biological research more accessible and insightful.
|
200
|
+
We’re excited to bring AIAgents4Pharma to the bioinformatics and pharmaceutical research community. Together, let’s make data-driven biological research more accessible and insightful.
|
186
201
|
|
187
202
|
**Get Started** with AIAgents4Pharma today and transform the way you interact with biological data.
|
188
203
|
|
189
204
|
---
|
190
205
|
|
191
206
|
## Feedback
|
207
|
+
|
192
208
|
Questions/Bug reports/Feature requests/Comments/Suggestions? We welcome all. Please use the `Isssues` tab 😀
|
@@ -2,6 +2,9 @@
|
|
2
2
|
[](https://github.com/VirtualPatientEngine/AIAgents4Pharma/actions/workflows/tests_talk2cells.yml)
|
3
3
|
[](https://github.com/VirtualPatientEngine/AIAgents4Pharma/actions/workflows/tests_talk2knowledgegraphs.yml)
|
4
4
|
[](https://github.com/VirtualPatientEngine/AIAgents4Pharma/actions/workflows/tests_talk2competitors.yml)
|
5
|
+

|
6
|
+

|
7
|
+
|
5
8
|
|
6
9
|
<h1 align="center" style="border-bottom: none;">🤖 AIAgents4Pharma</h1>
|
7
10
|
|
@@ -10,9 +13,9 @@ Welcome to **AIAgents4Pharma** – an open-source project by [Team VPE](https://
|
|
10
13
|
Our toolkit currently consists of three intelligent agents, each designed to simplify and enhance access to specialized data in biology:
|
11
14
|
|
12
15
|
- **Talk2BioModels**: Engage directly with mathematical models in systems biology.
|
13
|
-
- **Talk2Cells**
|
14
|
-
- **Talk2KnowledgeGraphs**
|
15
|
-
- **Talk2Competitors**
|
16
|
+
- **Talk2Cells** _(Work in progress)_: Query and analyze sequencing data with ease.
|
17
|
+
- **Talk2KnowledgeGraphs** _(Work in progress)_: Access and explore complex biological knowledge graphs for insightful data connections.
|
18
|
+
- **Talk2Competitors** _(Coming soon)_: Get recommendations for articles related to your choice. Download, query, and write/retrieve them to your reference manager (currently supporting Zotero).
|
16
19
|
|
17
20
|
---
|
18
21
|
|
@@ -25,68 +28,77 @@ Our toolkit currently consists of three intelligent agents, each designed to sim
|
|
25
28
|
- Forward simulation of both internal and open-source models (BioModels).
|
26
29
|
- Adjust parameters within the model to simulate different conditions.
|
27
30
|
- Query simulation results.
|
31
|
+
- Extract model information such as species, parameters, units and description.
|
28
32
|
|
29
|
-
### 2. Talk2Cells
|
33
|
+
### 2. Talk2Cells _(Work in Progress)_
|
30
34
|
|
31
35
|
**Talk2Cells** is being developed to provide direct access to and analysis of sequencing data, such as RNA-Seq or DNA-Seq, using natural language.
|
32
36
|
|
33
|
-
### 3. Talk2KnowledgeGraphs
|
37
|
+
### 3. Talk2KnowledgeGraphs _(Work in Progress)_
|
34
38
|
|
35
39
|
**Talk2KnowledgeGraphs** is an agent designed to enable interaction with biological knowledge graphs (KGs). KGs integrate vast amounts of structured biological data into a format that highlights relationships between entities, such as proteins, genes, and diseases.
|
36
40
|
|
37
|
-
### 4.
|
41
|
+
### 4. Talk2Competitors _(Coming soon)_
|
38
42
|
|
39
43
|
## Getting Started
|
40
44
|
|
41
|
-
|
42
|
-
|
43
|
-
- **Python 3.10+**
|
44
|
-
- **Git**
|
45
|
-
- Required libraries specified in `requirements.txt`
|
45
|
+

|
46
46
|
|
47
47
|
### Installation
|
48
|
+
|
48
49
|
#### Option 1: PyPI
|
49
|
-
|
50
|
-
|
51
|
-
|
50
|
+
|
51
|
+
```bash
|
52
|
+
pip install aiagents4pharma
|
53
|
+
```
|
52
54
|
|
53
55
|
Check out the tutorials on each agent for detailed instrcutions.
|
54
56
|
|
55
57
|
#### Option 2: git
|
58
|
+
|
56
59
|
1. **Clone the repository:**
|
60
|
+
|
57
61
|
```bash
|
58
62
|
git clone https://github.com/VirtualPatientEngine/AIAgents4Pharma
|
59
63
|
cd AIAgents4Pharma
|
60
64
|
```
|
61
65
|
|
62
66
|
2. **Install dependencies:**
|
67
|
+
|
63
68
|
```bash
|
64
69
|
pip install .
|
65
70
|
```
|
66
71
|
|
67
72
|
3. **Initialize OPENAI_API_KEY**
|
73
|
+
|
68
74
|
```bash
|
69
|
-
export OPENAI_API_KEY
|
75
|
+
export OPENAI_API_KEY=....
|
70
76
|
```
|
71
77
|
|
72
78
|
4. **[Optional] Set up login credentials**
|
79
|
+
|
73
80
|
```bash
|
74
81
|
vi .streamlit/secrets.toml
|
75
82
|
```
|
83
|
+
|
76
84
|
and enter
|
85
|
+
|
77
86
|
```
|
78
87
|
password='XXX'
|
79
88
|
```
|
80
|
-
|
89
|
+
|
90
|
+
Please note that the passoword will be same for all the users.
|
81
91
|
|
82
92
|
5. **[Optional] Initialize LANGSMITH_API_KEY**
|
93
|
+
|
83
94
|
```bash
|
84
95
|
export LANGCHAIN_TRACING_V2=true
|
85
96
|
export LANGCHAIN_API_KEY=<your-api-key>
|
86
97
|
```
|
87
|
-
|
88
|
-
|
89
|
-
|
98
|
+
|
99
|
+
Please note that this will create a new tracing project in your Langsmith
|
100
|
+
account with the name `<user_name>@<uuid>`, where `user_name` is the name
|
101
|
+
you provided in the previous step. If you skip the previous step, it will
|
90
102
|
default to `default`. <uuid> will be the 128 bit unique ID created for the
|
91
103
|
session.
|
92
104
|
|
@@ -118,6 +130,7 @@ We welcome contributions to AIAgents4Pharma! Here’s how you can help:
|
|
118
130
|
5. **Open a pull request**
|
119
131
|
|
120
132
|
### Current Needs
|
133
|
+
|
121
134
|
- **Beta testers** for Talk2BioModels.
|
122
135
|
- **Developers** with experience in natural language processing, bioinformatics, or knowledge graphs for contributions to AIAgents4Pharma.
|
123
136
|
|
@@ -128,19 +141,22 @@ Check out our [CONTRIBUTING.md](CONTRIBUTING.md) for more information.
|
|
128
141
|
## Roadmap
|
129
142
|
|
130
143
|
### Completed
|
144
|
+
|
131
145
|
- **Talk2BioModels**: Initial release with core capabilities for interacting with systems biology models.
|
132
146
|
|
133
147
|
### Planned
|
148
|
+
|
134
149
|
- **User Interface**: Interactive web UI for all agents.
|
135
150
|
- **Talk2Cells**: Integration of sequencing data analysis tools.
|
136
151
|
- **Talk2KnowledgeGraphs**: Interface for biological knowledge graph interaction.
|
137
|
-
- **Talk2Competitors
|
152
|
+
- **Talk2Competitors**: Interface for exploring articles
|
138
153
|
|
139
|
-
We’re excited to bring AIAgents4Pharma to the bioinformatics and pharmaceutical research community. Together, let’s make data-driven biological research more accessible and insightful.
|
154
|
+
We’re excited to bring AIAgents4Pharma to the bioinformatics and pharmaceutical research community. Together, let’s make data-driven biological research more accessible and insightful.
|
140
155
|
|
141
156
|
**Get Started** with AIAgents4Pharma today and transform the way you interact with biological data.
|
142
157
|
|
143
158
|
---
|
144
159
|
|
145
160
|
## Feedback
|
161
|
+
|
146
162
|
Questions/Bug reports/Feature requests/Comments/Suggestions? We welcome all. Please use the `Isssues` tab 😀
|
{aiagents4pharma-1.9.0 → aiagents4pharma-1.11.0}/aiagents4pharma/talk2biomodels/agents/t2b_agent.py
RENAMED
@@ -16,6 +16,7 @@ from ..tools.get_modelinfo import GetModelInfoTool
|
|
16
16
|
from ..tools.simulate_model import SimulateModelTool
|
17
17
|
from ..tools.custom_plotter import CustomPlotterTool
|
18
18
|
from ..tools.ask_question import AskQuestionTool
|
19
|
+
from ..tools.parameter_scan import ParameterScanTool
|
19
20
|
from ..states.state_talk2biomodels import Talk2Biomodels
|
20
21
|
|
21
22
|
# Initialize logger
|
@@ -35,17 +36,13 @@ def get_app(uniq_id, llm_model='gpt-4o-mini'):
|
|
35
36
|
return response
|
36
37
|
|
37
38
|
# Define the tools
|
38
|
-
simulate_model = SimulateModelTool()
|
39
|
-
custom_plotter = CustomPlotterTool()
|
40
|
-
ask_question = AskQuestionTool()
|
41
|
-
search_model = SearchModelsTool()
|
42
|
-
get_modelinfo = GetModelInfoTool()
|
43
39
|
tools = ToolNode([
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
40
|
+
SimulateModelTool(),
|
41
|
+
AskQuestionTool(),
|
42
|
+
CustomPlotterTool(),
|
43
|
+
SearchModelsTool(),
|
44
|
+
GetModelInfoTool(),
|
45
|
+
ParameterScanTool()
|
49
46
|
])
|
50
47
|
|
51
48
|
# Define the model
|
@@ -48,52 +48,49 @@ class BasicoModel(SysBioModel):
|
|
48
48
|
self.name = basico.model_info.get_model_name(model=self.copasi_model)
|
49
49
|
return self
|
50
50
|
|
51
|
-
def
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
51
|
+
def update_parameters(self, parameters: Dict[str, Union[float, int]]) -> None:
|
52
|
+
"""
|
53
|
+
Update model parameters with new values.
|
54
|
+
"""
|
55
|
+
# Update parameters in the model
|
56
|
+
for param_name, param_value in parameters.items():
|
57
|
+
# check if the param_name is not None
|
58
|
+
if param_name is None:
|
59
|
+
continue
|
60
|
+
# if param is a kinetic parameter
|
61
|
+
df_all_params = basico.model_info.get_parameters(model=self.copasi_model)
|
62
|
+
if param_name in df_all_params.index.tolist():
|
63
|
+
basico.model_info.set_parameters(name=param_name,
|
64
|
+
exact=True,
|
65
|
+
initial_value=param_value,
|
66
|
+
model=self.copasi_model)
|
67
|
+
# if param is a species
|
68
|
+
else:
|
69
|
+
basico.model_info.set_species(name=param_name,
|
70
|
+
exact=True,
|
71
|
+
initial_concentration=param_value,
|
72
|
+
model=self.copasi_model)
|
73
|
+
|
74
|
+
def simulate(self, duration: Union[int, float] = 10, interval: int = 10) -> pd.DataFrame:
|
56
75
|
"""
|
57
76
|
Simulate the COPASI model over a specified range of time points.
|
58
77
|
|
59
78
|
Args:
|
60
|
-
parameters: Dictionary of model parameters to update before simulation.
|
61
79
|
duration: Duration of the simulation in time units.
|
62
80
|
interval: Interval between time points in the simulation.
|
63
81
|
|
64
82
|
Returns:
|
65
83
|
Pandas DataFrame with time-course simulation results.
|
66
84
|
"""
|
67
|
-
|
68
|
-
# Update parameters in the model
|
69
|
-
if parameters:
|
70
|
-
for param_name, param_value in parameters.items():
|
71
|
-
# check if the param_name is not None
|
72
|
-
if param_name is None:
|
73
|
-
continue
|
74
|
-
# if param is a kinectic parameter
|
75
|
-
df_all_params = basico.model_info.get_parameters(model=self.copasi_model)
|
76
|
-
if param_name in df_all_params.index.tolist():
|
77
|
-
basico.model_info.set_parameters(name=param_name,
|
78
|
-
exact=True,
|
79
|
-
initial_value=param_value,
|
80
|
-
model=self.copasi_model)
|
81
|
-
# if param is a species
|
82
|
-
else:
|
83
|
-
basico.model_info.set_species(name=param_name,
|
84
|
-
exact=True,
|
85
|
-
initial_concentration=param_value,
|
86
|
-
model=self.copasi_model)
|
87
|
-
|
88
85
|
# Run the simulation and return results
|
89
86
|
df_result = basico.run_time_course(model=self.copasi_model,
|
90
87
|
intervals=interval,
|
91
88
|
duration=duration)
|
92
|
-
# Replace curly braces in column headers with square brackets
|
93
|
-
# Because curly braces in the world of LLMS are used for
|
94
|
-
# structured output
|
95
|
-
df_result.columns = df_result.columns.str.replace('{', '[', regex=False).\
|
96
|
-
|
89
|
+
# # Replace curly braces in column headers with square brackets
|
90
|
+
# # Because curly braces in the world of LLMS are used for
|
91
|
+
# # structured output
|
92
|
+
# df_result.columns = df_result.columns.str.replace('{', '[', regex=False).\
|
93
|
+
# str.replace('}', ']', regex=False)
|
97
94
|
# Reset the index
|
98
95
|
df_result.reset_index(inplace=True)
|
99
96
|
# Store the simulation results
|
@@ -35,18 +35,21 @@ class SysBioModel(ABC, BaseModel):
|
|
35
35
|
Returns:
|
36
36
|
dict: Dictionary with model metadata
|
37
37
|
"""
|
38
|
+
@abstractmethod
|
39
|
+
def update_parameters(self, parameters: Dict[str, Union[float, int]]) -> None:
|
40
|
+
"""
|
41
|
+
Abstract method to update model parameters.
|
42
|
+
|
43
|
+
Args:
|
44
|
+
parameters: Dictionary of parameter values.
|
45
|
+
"""
|
38
46
|
|
39
47
|
@abstractmethod
|
40
|
-
def simulate(self,
|
41
|
-
parameters: Dict[str, Union[float, int]],
|
42
|
-
duration: Union[int, float]) -> List[float]:
|
48
|
+
def simulate(self, duration: Union[int, float]) -> List[float]:
|
43
49
|
"""
|
44
50
|
Abstract method to run a simulation of the model.
|
45
|
-
This method should be implemented to simulate model
|
46
|
-
behavior based on the provided parameters.
|
47
51
|
|
48
52
|
Args:
|
49
|
-
parameters: Dictionary of parameter values.
|
50
53
|
duration: Duration of the simulation.
|
51
54
|
|
52
55
|
Returns:
|
@@ -12,13 +12,13 @@ class Talk2Biomodels(AgentState):
|
|
12
12
|
"""
|
13
13
|
The state for the Talk2BioModels agent.
|
14
14
|
"""
|
15
|
-
|
16
|
-
# sbml_file_path: str
|
15
|
+
llm_model: str
|
17
16
|
# A StateGraph may receive a concurrent updates
|
18
17
|
# which is not supported by the StateGraph.
|
19
18
|
# Therefore, we need to use Annotated to specify
|
20
19
|
# the operator for the sbml_file_path field.
|
21
20
|
# https://langchain-ai.github.io/langgraph/troubleshooting/errors/INVALID_CONCURRENT_GRAPH_UPDATE/
|
21
|
+
model_id: Annotated[list, operator.add]
|
22
22
|
sbml_file_path: Annotated[list, operator.add]
|
23
23
|
dic_simulated_data: Annotated[list[dict], operator.add]
|
24
|
-
|
24
|
+
dic_scanned_data: Annotated[list[dict], operator.add]
|
@@ -19,13 +19,14 @@ def test_with_biomodel_id(model):
|
|
19
19
|
Test initialization of BasicoModel with biomodel_id.
|
20
20
|
"""
|
21
21
|
assert model.biomodel_id == 64
|
22
|
+
model.update_parameters(parameters={'Pyruvate': 0.5, 'KmPFKF6P': 1.5})
|
23
|
+
df_species = basico.model_info.get_species(model=model.copasi_model)
|
24
|
+
assert df_species.loc['Pyruvate', 'initial_concentration'] == 0.5
|
25
|
+
df_parameters = basico.model_info.get_parameters(model=model.copasi_model)
|
26
|
+
assert df_parameters.loc['KmPFKF6P', 'initial_value'] == 1.5
|
22
27
|
# check if the simulation results are a pandas DataFrame object
|
23
|
-
assert isinstance(model.simulate(
|
24
|
-
|
25
|
-
interval=2),
|
26
|
-
pd.DataFrame)
|
27
|
-
assert isinstance(model.simulate(parameters={None: None}, duration=2, interval=2),
|
28
|
-
pd.DataFrame)
|
28
|
+
assert isinstance(model.simulate(duration=2, interval=2), pd.DataFrame)
|
29
|
+
model.update_parameters(parameters={None: None})
|
29
30
|
assert model.description == basico.biomodels.get_model_info(model.biomodel_id)["description"]
|
30
31
|
|
31
32
|
def test_with_sbml_file():
|
@@ -35,8 +36,6 @@ def test_with_sbml_file():
|
|
35
36
|
model_object = BasicoModel(sbml_file_path="./BIOMD0000000064_url.xml")
|
36
37
|
assert model_object.sbml_file_path == "./BIOMD0000000064_url.xml"
|
37
38
|
assert isinstance(model_object.simulate(duration=2, interval=2), pd.DataFrame)
|
38
|
-
assert isinstance(model_object.simulate(parameters={'NADH': 0.5}, duration=2, interval=2),
|
39
|
-
pd.DataFrame)
|
40
39
|
|
41
40
|
def test_check_biomodel_id_or_sbml_file_path():
|
42
41
|
'''
|
@@ -119,6 +119,68 @@ def test_simulate_model_tool():
|
|
119
119
|
# Check if the data of the second model contains
|
120
120
|
assert 'mTORC2' in dic_simulated_data[1]['data']
|
121
121
|
|
122
|
+
def test_param_scan_tool():
|
123
|
+
'''
|
124
|
+
In this test, we will test the parameter_scan tool.
|
125
|
+
We will prompt it to scan the parameter `kIL6RBind`
|
126
|
+
from 1 to 100 in steps of 10, record the changes
|
127
|
+
in the concentration of the species `Ab{serum}` in
|
128
|
+
model 537.
|
129
|
+
|
130
|
+
We will pass the inaccuarate parameter (`KIL6Rbind`)
|
131
|
+
and species names (just `Ab`) to the tool to test
|
132
|
+
if it can deal with it.
|
133
|
+
|
134
|
+
We expect the agent to first invoke the parameter_scan
|
135
|
+
tool and raise an error. It will then invoke another
|
136
|
+
tool get_modelinfo to get the correct parameter
|
137
|
+
and species names. Finally, the agent will reinvoke
|
138
|
+
the parameter_scan tool with the correct parameter
|
139
|
+
and species names.
|
140
|
+
|
141
|
+
'''
|
142
|
+
unique_id = 123
|
143
|
+
app = get_app(unique_id)
|
144
|
+
config = {"configurable": {"thread_id": unique_id}}
|
145
|
+
app.update_state(config, {"llm_model": "gpt-4o-mini"})
|
146
|
+
prompt = """How will the value of Ab in model 537 change
|
147
|
+
if the param kIL6Rbind is varied from 1 to 100 in steps of 10?
|
148
|
+
Set the initial `DoseQ2W` concentration to 300.
|
149
|
+
Reset the IL6{serum} concentration to 100 every 500 hours.
|
150
|
+
Assume that the model is simulated for 2016 hours with
|
151
|
+
an interval of 2016."""
|
152
|
+
# Invoke the agent
|
153
|
+
app.invoke(
|
154
|
+
{"messages": [HumanMessage(content=prompt)]},
|
155
|
+
config=config
|
156
|
+
)
|
157
|
+
current_state = app.get_state(config)
|
158
|
+
reversed_messages = current_state.values["messages"][::-1]
|
159
|
+
# Loop through the reversed messages until a
|
160
|
+
# ToolMessage is found.
|
161
|
+
df = pd.DataFrame(columns=['name', 'status', 'content'])
|
162
|
+
names = []
|
163
|
+
statuses = []
|
164
|
+
contents = []
|
165
|
+
for msg in reversed_messages:
|
166
|
+
# Assert that the message is a ToolMessage
|
167
|
+
# and its status is "error"
|
168
|
+
if not isinstance(msg, ToolMessage):
|
169
|
+
continue
|
170
|
+
names.append(msg.name)
|
171
|
+
statuses.append(msg.status)
|
172
|
+
contents.append(msg.content)
|
173
|
+
df = pd.DataFrame({'name': names, 'status': statuses, 'content': contents})
|
174
|
+
# print (df)
|
175
|
+
assert any((df["status"] == "error") &
|
176
|
+
(df["name"] == "parameter_scan") &
|
177
|
+
(df["content"].str.startswith("Error: ValueError('Invalid parameter name:")))
|
178
|
+
assert any((df["status"] == "success") &
|
179
|
+
(df["name"] == "parameter_scan") &
|
180
|
+
(df["content"].str.startswith("Parameter scan results of")))
|
181
|
+
assert any((df["status"] == "success") &
|
182
|
+
(df["name"] == "get_modelinfo"))
|
183
|
+
|
122
184
|
def test_integration():
|
123
185
|
'''
|
124
186
|
Test the integration of the tools.
|
@@ -184,9 +246,9 @@ def test_integration():
|
|
184
246
|
reversed_messages = current_state.values["messages"][::-1]
|
185
247
|
# Loop through the reversed messages
|
186
248
|
# until a ToolMessage is found.
|
187
|
-
expected_header = ['Time', 'CRP
|
249
|
+
expected_header = ['Time', 'CRP{serum}', 'CRPExtracellular']
|
188
250
|
expected_header += ['CRP Suppression (%)', 'CRP (% of baseline)']
|
189
|
-
expected_header += ['CRP
|
251
|
+
expected_header += ['CRP{liver}']
|
190
252
|
predicted_artifact = []
|
191
253
|
for msg in reversed_messages:
|
192
254
|
if isinstance(msg, ToolMessage):
|
@@ -16,6 +16,8 @@ class TestBioModel(SysBioModel):
|
|
16
16
|
sbml_file_path: Optional[str] = Field(None, description="Path to an SBML file")
|
17
17
|
name: Optional[str] = Field(..., description="Name of the model")
|
18
18
|
description: Optional[str] = Field("", description="Description of the model")
|
19
|
+
param1: Optional[float] = Field(0.0, description="Parameter 1")
|
20
|
+
param2: Optional[float] = Field(0.0, description="Parameter 2")
|
19
21
|
|
20
22
|
def get_model_metadata(self) -> Dict[str, Union[str, int]]:
|
21
23
|
'''
|
@@ -23,15 +25,18 @@ class TestBioModel(SysBioModel):
|
|
23
25
|
'''
|
24
26
|
return self.biomodel_id
|
25
27
|
|
26
|
-
def
|
27
|
-
|
28
|
-
|
28
|
+
def update_parameters(self, parameters):
|
29
|
+
'''
|
30
|
+
Update the model parameters.
|
31
|
+
'''
|
32
|
+
self.param1 = parameters.get('param1', 0.0)
|
33
|
+
self.param2 = parameters.get('param2', 0.0)
|
34
|
+
|
35
|
+
def simulate(self, duration: Union[int, float]) -> List[float]:
|
29
36
|
'''
|
30
37
|
Simulate the model.
|
31
38
|
'''
|
32
|
-
param1
|
33
|
-
param2 = parameters.get('param2', 0.0)
|
34
|
-
return [param1 + param2 * t for t in range(int(duration))]
|
39
|
+
return [self.param1 + self.param2 * t for t in range(int(duration))]
|
35
40
|
|
36
41
|
def test_get_model_metadata():
|
37
42
|
'''
|
@@ -53,5 +58,6 @@ def test_simulate():
|
|
53
58
|
Test the simulate method of the BioModel class.
|
54
59
|
'''
|
55
60
|
model = TestBioModel(biomodel_id=123, name="Test Model", description="A test model")
|
56
|
-
|
61
|
+
model.update_parameters({'param1': 1.0, 'param2': 2.0})
|
62
|
+
results = model.simulate(duration=4.0)
|
57
63
|
assert results == [1.0, 3.0, 5.0, 7.0]
|