aiagents4pharma 1.46.0__py3-none-any.whl → 1.46.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.
@@ -2,4 +2,4 @@
2
2
  This file is used to import the modules in the package.
3
3
  """
4
4
 
5
- from . import kegg, ols, uniprot
5
+ from . import ols, uniprot
@@ -2,7 +2,6 @@
2
2
  Test cases for Talk2Biomodels.
3
3
  """
4
4
 
5
- from ..api.kegg import fetch_from_api, fetch_kegg_names
6
5
  from ..api.ols import fetch_from_ols
7
6
  from ..api.uniprot import search_uniprot_labels
8
7
 
@@ -30,32 +29,3 @@ def test_fetch_from_ols():
30
29
  assert isinstance(label_2, str), f"Expected string, got {type(label_2)}"
31
30
  assert label_1 == "plasma membrane"
32
31
  assert label_2.startswith("Error: 404")
33
-
34
-
35
- def test_fetch_kegg_names():
36
- """
37
- Test the fetch_kegg_names function.
38
- """
39
- ids = ["C00001", "C00002"]
40
- results = fetch_kegg_names(ids)
41
- assert results["C00001"] == "H2O"
42
- assert results["C00002"] == "ATP"
43
-
44
- # Try with an empty list
45
- results = fetch_kegg_names([])
46
- assert not results
47
-
48
-
49
- def test_fetch_from_api():
50
- """
51
- Test the fetch_from_api function.
52
- """
53
- base_url = "https://rest.kegg.jp/get/"
54
- query = "C00001"
55
- entry_data = fetch_from_api(base_url, query)
56
- assert entry_data.startswith("ENTRY C00001")
57
-
58
- # Try with an invalid query
59
- query = "C0000Q"
60
- entry_data = fetch_from_api(base_url, query)
61
- assert not entry_data
@@ -126,7 +126,7 @@ def test_all_species_annotations(make_graph):
126
126
  Here, we test the tool with three models since they have different use cases:
127
127
  - model 12 contains a species with no URL provided.
128
128
  - model 20 contains a species without description.
129
- - model 56 contains a species with database outside of KEGG, UniProt, and OLS.
129
+ - model 56 contains a species with database outside of UniProt, and OLS.
130
130
 
131
131
  We are testing a condition where the user asks for annotations
132
132
  of all species in a specific model.
@@ -19,7 +19,6 @@ from langgraph.prebuilt import InjectedState
19
19
  from langgraph.types import Command
20
20
  from pydantic import BaseModel, Field
21
21
 
22
- from ..api.kegg import fetch_kegg_annotations
23
22
  from ..api.ols import search_ols_labels
24
23
  from ..api.uniprot import search_uniprot_labels
25
24
 
@@ -298,8 +297,6 @@ class GetAnnotationTool(BaseTool):
298
297
  for ols_ontology_abbreviation in ols_ontology_abbreviations:
299
298
  if ols_ontology_abbreviation + "/" in link:
300
299
  link = link.replace(f"{ols_ontology_abbreviation}/", "")
301
- if "kegg.compound" in link:
302
- link = link.replace("kegg.compound/", "kegg.compound:")
303
300
  return link
304
301
 
305
302
  def _fetch_descriptions(self, data: list[dict[str, str]]) -> dict[str, str]:
@@ -338,14 +335,8 @@ class GetAnnotationTool(BaseTool):
338
335
  )
339
336
  for identifier in identifiers:
340
337
  results[identifier] = annotations.get(database, {}).get(identifier, "-")
341
- elif database == "kegg.compound":
342
- data = [
343
- {"Id": identifier, "Database": "kegg.compound"} for identifier in identifiers
344
- ]
345
- annotations = fetch_kegg_annotations(data)
346
- for identifier in identifiers:
347
- results[identifier] = annotations.get(database, {}).get(identifier, "-")
348
338
  else:
339
+ # For any other database types, do not fetch; mark as unknown
349
340
  for identifier in identifiers:
350
341
  results[identifier] = "-"
351
342
  return results
@@ -1,89 +1,89 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: aiagents4pharma
3
- Version: 1.46.0
3
+ Version: 1.46.2
4
4
  Summary: AI Agents for drug discovery, drug development, and other pharmaceutical R&D.
5
5
  License-File: LICENSE
6
6
  Classifier: License :: OSI Approved :: MIT License
7
7
  Classifier: Operating System :: OS Independent
8
8
  Classifier: Programming Language :: Python :: 3
9
9
  Requires-Python: >=3.12
10
- Requires-Dist: anndata==0.11.3
10
+ Requires-Dist: anndata==0.12.2
11
11
  Requires-Dist: azure-identity==1.24.0
12
- Requires-Dist: beautifulsoup4==4.13.4
12
+ Requires-Dist: beautifulsoup4==4.13.5
13
13
  Requires-Dist: cell2sentence==1.1.0
14
14
  Requires-Dist: cloudscraper==1.2.71
15
15
  Requires-Dist: copasi-basico==0.84
16
- Requires-Dist: coverage==7.6.4
16
+ Requires-Dist: coverage==7.10.6
17
17
  Requires-Dist: datasets==4.0.0
18
- Requires-Dist: einops==0.8.0
18
+ Requires-Dist: einops==0.8.1
19
19
  Requires-Dist: gdown==5.2.0
20
20
  Requires-Dist: gravis==0.1.0
21
- Requires-Dist: gseapy==1.1.8
22
- Requires-Dist: h5py==3.13.0
21
+ Requires-Dist: gseapy==1.1.9
22
+ Requires-Dist: h5py==3.14.0
23
23
  Requires-Dist: huggingface-hub==0.34.4
24
24
  Requires-Dist: hydra-core==1.3.2
25
- Requires-Dist: igraph==0.11.8
26
- Requires-Dist: ipykernel==6.29.5
25
+ Requires-Dist: igraph==0.11.9
26
+ Requires-Dist: ipykernel==6.30.1
27
27
  Requires-Dist: ipython==8.32.0
28
- Requires-Dist: joblib==1.4.2
28
+ Requires-Dist: joblib==1.5.2
29
29
  Requires-Dist: langchain-community==0.3.5
30
30
  Requires-Dist: langchain-core==0.3.40
31
- Requires-Dist: langchain-experimental==0.3.3
32
- Requires-Dist: langchain-milvus==0.2.0
31
+ Requires-Dist: langchain-experimental==0.3.4
32
+ Requires-Dist: langchain-milvus==0.2.1
33
33
  Requires-Dist: langchain-nvidia-ai-endpoints==0.3.9
34
34
  Requires-Dist: langchain-ollama==0.2.3
35
35
  Requires-Dist: langchain-openai==0.3.0
36
36
  Requires-Dist: langchain==0.3.7
37
37
  Requires-Dist: langgraph-supervisor==0.0.9
38
38
  Requires-Dist: langgraph==0.3.34
39
- Requires-Dist: matplotlib==3.9.2
40
- Requires-Dist: mkdocs-include-markdown-plugin==7.1.2
39
+ Requires-Dist: matplotlib==3.10.6
40
+ Requires-Dist: mkdocs-include-markdown-plugin==7.1.7
41
41
  Requires-Dist: mkdocs-jupyter==0.25.1
42
- Requires-Dist: mkdocs-material==9.5.47
42
+ Requires-Dist: mkdocs-material==9.6.18
43
43
  Requires-Dist: mkdocs==1.6.1
44
- Requires-Dist: mkdocstrings-python==1.12.2
45
- Requires-Dist: mkdocstrings==0.27.0
44
+ Requires-Dist: mkdocstrings-python==1.18.2
45
+ Requires-Dist: mkdocstrings==0.30.0
46
46
  Requires-Dist: nbformat==5.10.4
47
47
  Requires-Dist: numpy==1.26.4
48
48
  Requires-Dist: ollama==0.4.7
49
49
  Requires-Dist: openai==1.59.6
50
50
  Requires-Dist: openpyxl==3.1.5
51
- Requires-Dist: pandas==2.2.3
51
+ Requires-Dist: pandas==2.3.2
52
52
  Requires-Dist: pcst-fast==1.0.10
53
53
  Requires-Dist: plotly-express==0.4.1
54
54
  Requires-Dist: plotly==5.24.1
55
55
  Requires-Dist: pubchempy==1.0.4
56
56
  Requires-Dist: pyarrow==21.0.0
57
- Requires-Dist: pydantic==2.10.5
57
+ Requires-Dist: pydantic==2.11.7
58
58
  Requires-Dist: pygeneconverter==0.3
59
- Requires-Dist: pylint==3.3.1
60
- Requires-Dist: pymilvus==2.5.11
59
+ Requires-Dist: pylint==3.3.8
60
+ Requires-Dist: pymilvus==2.6.1
61
61
  Requires-Dist: pypdf==6.0.0
62
62
  Requires-Dist: pytest-asyncio==0.25.2
63
- Requires-Dist: pytest==8.3.3
63
+ Requires-Dist: pytest==8.4.1
64
64
  Requires-Dist: python-magic==0.4.27
65
- Requires-Dist: pyzotero==1.6.9
66
- Requires-Dist: requests==2.32.4
67
- Requires-Dist: scanpy==1.11.0
68
- Requires-Dist: scipy==1.15.2
65
+ Requires-Dist: pyzotero==1.6.11
66
+ Requires-Dist: requests==2.32.5
67
+ Requires-Dist: scanpy==1.11.4
68
+ Requires-Dist: scipy==1.16.1
69
69
  Requires-Dist: seaborn==0.13.2
70
70
  Requires-Dist: sentence-transformers==3.3.1
71
71
  Requires-Dist: setuptools==80.9.0
72
72
  Requires-Dist: streamlit-feedback==0.1.4
73
- Requires-Dist: streamlit==1.41.1
73
+ Requires-Dist: streamlit==1.49.1
74
74
  Requires-Dist: tabulate==0.9.0
75
75
  Requires-Dist: torch-geometric==2.6.1
76
76
  Requires-Dist: torch==2.8.0
77
77
  Requires-Dist: tqdm==4.67.1
78
78
  Requires-Dist: transformers==4.55.2
79
- Requires-Dist: umap-learn==0.5.7
79
+ Requires-Dist: umap-learn==0.5.9.post2
80
80
  Requires-Dist: xlsxwriter==3.2.5
81
81
  Provides-Extra: dev
82
82
  Requires-Dist: bandit==1.8.6; extra == 'dev'
83
83
  Requires-Dist: mypy==1.17.1; extra == 'dev'
84
84
  Requires-Dist: pip-audit==2.9.0; extra == 'dev'
85
85
  Requires-Dist: pre-commit==4.3.0; extra == 'dev'
86
- Requires-Dist: ruff==0.12.8; extra == 'dev'
86
+ Requires-Dist: ruff==0.12.11; extra == 'dev'
87
87
  Requires-Dist: safety==3.2.9; extra == 'dev'
88
88
  Requires-Dist: twine==6.1.0; extra == 'dev'
89
89
  Description-Content-Type: text/markdown
@@ -275,6 +275,7 @@ For contributors and developers, we have comprehensive documentation:
275
275
  - **[SonarCloud Integration](docs/developer/SONARCLOUD_SETUP.md)** - Code quality analysis and CI/CD integration
276
276
  - **[GitHub Workflows](docs/developer/WORKFLOWS.md)** - Understanding our CI/CD pipeline
277
277
  - **[Streamlit Security](docs/developer/STREAMLIT_SECURITY.md)** - File upload security implementation
278
+ - **[Azure Deployment](developer/AZURE_DEPLOYMENT.md)** - Understanding our Azure deployment setup
278
279
 
279
280
  #### How to contribute
280
281
 
@@ -28,8 +28,7 @@ aiagents4pharma/talk2biomodels/__init__.py,sha256=DxARZJu91m4WHW4PBSZvlMb1MCbjvk
28
28
  aiagents4pharma/talk2biomodels/install.md,sha256=9YAEeW_vG5hv7WiMnNEzgKQIgVyHnpk1IIWXg_jhLxE,1520
29
29
  aiagents4pharma/talk2biomodels/agents/__init__.py,sha256=4wPy6hWRJksX6z8qX1cVjFctZLpsja8JMngKHqn49N4,129
30
30
  aiagents4pharma/talk2biomodels/agents/t2b_agent.py,sha256=b_9pjnY3VGPRrzy-LCFrbJCkP1PT3M30NiQq6gbavaA,3267
31
- aiagents4pharma/talk2biomodels/api/__init__.py,sha256=2fKfvp7tj6fr6mhesQo2flaNpW5cINjzx_o_zUpTzZc,98
32
- aiagents4pharma/talk2biomodels/api/kegg.py,sha256=znaXYtw6HZe5XoX7wyl0hi1anHd2vzKRgVzt0HZ_TU0,2836
31
+ aiagents4pharma/talk2biomodels/api/__init__.py,sha256=KGok9mCa6RT8whDj3jT3kcpFO1yHxk5vVD8IExsI5Bc,92
33
32
  aiagents4pharma/talk2biomodels/api/ols.py,sha256=QSvbsD0V07-w0OU-wPQ4EypXi9bn_xl0NyliZQxRvCU,2173
34
33
  aiagents4pharma/talk2biomodels/api/uniprot.py,sha256=jXoyd7BhIQA9JNaGMVPzORpQ5k1Ix9iYYduMv6YG7hw,1147
35
34
  aiagents4pharma/talk2biomodels/configs/__init__.py,sha256=WgGZbEtZiVR8EVJeH3iIJ6LxBGFafAjfCftptnTm2Ds,75
@@ -55,10 +54,10 @@ aiagents4pharma/talk2biomodels/states/state_talk2biomodels.py,sha256=kKtVBfSK92h
55
54
  aiagents4pharma/talk2biomodels/tests/BIOMD0000000449_url.xml,sha256=RkWbstfLrT1mAfOtZf7JsBz6poyWg6-5G7H_IdVXEXg,72630
56
55
  aiagents4pharma/talk2biomodels/tests/__init__.py,sha256=U3PsTiUZaUBD1IZanFGkDIOdFieDVJtGKQ5-woYUo8c,45
57
56
  aiagents4pharma/talk2biomodels/tests/article_on_model_537.pdf,sha256=rfBnG9XSGRZodq-NQsouQQ3dvm4JKcrAqEkoAQJmuDc,470738
58
- aiagents4pharma/talk2biomodels/tests/test_api.py,sha256=0Gyakd5Yaa0CxUH18040xl-TBrNKGi6aDaIyVFF1d9A,1724
57
+ aiagents4pharma/talk2biomodels/tests/test_api.py,sha256=rfH2_K2pC5fm3DcyKJSHOBcN6Mzz3D37oJEpFCE1Jek,970
59
58
  aiagents4pharma/talk2biomodels/tests/test_ask_question.py,sha256=lMrFI5URqUEz0Cv3WOoj8vhR_ciwDOgoJlqh1dOdaik,1523
60
59
  aiagents4pharma/talk2biomodels/tests/test_basico_model.py,sha256=F_1AbFRcXIDahQKcS-Nq0v45bEozLUOYx_oyyFN0hxw,2429
61
- aiagents4pharma/talk2biomodels/tests/test_get_annotation.py,sha256=T5RvNfiyz9Z49LBo6FkOOaD7f3vSalklF6Oi1Qj3-Kk,8179
60
+ aiagents4pharma/talk2biomodels/tests/test_get_annotation.py,sha256=L4fTQaY2rnkfHwfPSC6GdXD2T3NGTIqNoF2dRklBIQA,8173
62
61
  aiagents4pharma/talk2biomodels/tests/test_getmodelinfo.py,sha256=PlVDIQZaZw8a94_Muw5GMa2Kop6foEBGhp3x-412cQA,3258
63
62
  aiagents4pharma/talk2biomodels/tests/test_integration.py,sha256=t8jR45pX7hKBGOjXySQ-XG5wJpTt41jGba74T8zuIdI,4838
64
63
  aiagents4pharma/talk2biomodels/tests/test_load_biomodel.py,sha256=8nVSDa8_z85dyvxa8aYGQR0YGZDtpzLF5HhBmifCk6w,895
@@ -71,7 +70,7 @@ aiagents4pharma/talk2biomodels/tests/test_sys_bio_model.py,sha256=poMxOsKhg8USnp
71
70
  aiagents4pharma/talk2biomodels/tools/__init__.py,sha256=j6wTW09BOwFMzHERfJbsajctDsNxJDtWJHUE3FmTu-A,279
72
71
  aiagents4pharma/talk2biomodels/tools/ask_question.py,sha256=IbolM6zbYKHd_UCfLMa8bawt9fJH59cCUtkLB_wtxKI,4495
73
72
  aiagents4pharma/talk2biomodels/tools/custom_plotter.py,sha256=dk5HUmPwSTIRp2sbd8Q8__fwSE8m13UseonvcpyDs00,6636
74
- aiagents4pharma/talk2biomodels/tools/get_annotation.py,sha256=spP_EVDlkbg7DfpzZw4YyIIYAsiax5EoJxB0f0gjVbM,13312
73
+ aiagents4pharma/talk2biomodels/tools/get_annotation.py,sha256=oHERHdY4KinQFg9udufEgJP3tE3x0gtoWWy4Kna9H78,12854
75
74
  aiagents4pharma/talk2biomodels/tools/get_modelinfo.py,sha256=mVAqO2TRWIlD93ZsMggs2N3629sxHZWnOisW7r_yBU0,5987
76
75
  aiagents4pharma/talk2biomodels/tools/load_arguments.py,sha256=LZQNkAikXhG0AKRnfLUqqpa5hNAyVGSwPQ4_nBu-DSw,4009
77
76
  aiagents4pharma/talk2biomodels/tools/load_biomodel.py,sha256=025-E5qo2uiJVvHIhyeDh1tfmXTeIguSgS0KIY0LiyY,1208
@@ -329,7 +328,7 @@ aiagents4pharma/talk2scholars/tools/zotero/utils/review_helper.py,sha256=-q-UuzP
329
328
  aiagents4pharma/talk2scholars/tools/zotero/utils/write_helper.py,sha256=K1EatPfC-riGyFmkOAS3ReNBaGPY-znne1KqOnFahkI,7339
330
329
  aiagents4pharma/talk2scholars/tools/zotero/utils/zotero_path.py,sha256=sKkfJu3u4LKSZjfoQRfeqz26IESHRwBtcSDzLMLlJMo,6311
331
330
  aiagents4pharma/talk2scholars/tools/zotero/utils/zotero_pdf_downloader.py,sha256=DBrF5IiF7VRP58hUK8T9LST3lQWLFixLUfnpMSTccoQ,4614
332
- aiagents4pharma-1.46.0.dist-info/METADATA,sha256=AVFonSHolN2s2XvewoYumpZQpWkWI2wuiTgVF3AvNpE,16928
333
- aiagents4pharma-1.46.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
334
- aiagents4pharma-1.46.0.dist-info/licenses/LICENSE,sha256=IcIbyB1Hyk5ZDah03VNQvJkbNk2hkBCDqQ8qtnCvB4Q,1077
335
- aiagents4pharma-1.46.0.dist-info/RECORD,,
331
+ aiagents4pharma-1.46.2.dist-info/METADATA,sha256=EnSy3phI9yOyB4Rlkagi5T2jneuEGBITExl3Zt9MHCQ,17036
332
+ aiagents4pharma-1.46.2.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
333
+ aiagents4pharma-1.46.2.dist-info/licenses/LICENSE,sha256=IcIbyB1Hyk5ZDah03VNQvJkbNk2hkBCDqQ8qtnCvB4Q,1077
334
+ aiagents4pharma-1.46.2.dist-info/RECORD,,
@@ -1,87 +0,0 @@
1
- """
2
- This module contains the API for fetching Kegg database
3
- """
4
-
5
- import re
6
-
7
- import requests
8
-
9
-
10
- def fetch_from_api(base_url: str, query: str) -> str:
11
- """Fetch data from the given API endpoint."""
12
- try:
13
- response = requests.get(base_url + query, timeout=10)
14
- response.raise_for_status()
15
- return response.text
16
- except requests.exceptions.RequestException as e:
17
- print(f"Error fetching data for query {query}: {e}")
18
- return ""
19
-
20
-
21
- def fetch_kegg_names(ids: list[str], batch_size: int = 10) -> dict[str, str]:
22
- """
23
- Fetch the names of multiple KEGG entries using the KEGG REST API in batches.
24
-
25
- Args:
26
- ids (List[str]): List of KEGG IDs.
27
- batch_size (int): Maximum number of IDs to include in a single request.
28
-
29
- Returns:
30
- Dict[str, str]: A mapping of KEGG IDs to their names.
31
- """
32
- if not ids:
33
- return {}
34
-
35
- base_url = "https://rest.kegg.jp/get/"
36
- entry_name_map = {}
37
-
38
- # Process IDs in batches
39
- for i in range(0, len(ids), batch_size):
40
- batch = ids[i : i + batch_size]
41
- query = "+".join(batch)
42
- entry_data = fetch_from_api(base_url, query)
43
-
44
- # if not entry_data:
45
- # continue
46
- entries = entry_data.split("///")
47
- for entry in entries:
48
- if not entry.strip():
49
- continue
50
- lines = entry.strip().split("\n")
51
- entry_line = next((line for line in lines if line.startswith("ENTRY")), None)
52
- name_line = next((line for line in lines if line.startswith("NAME")), None)
53
-
54
- # if not entry_line and not name_line:
55
- # continue
56
- entry_id = entry_line.split()[1]
57
- # Split multiple names in the NAME field and clean them
58
- names = [
59
- re.sub(r"[^a-zA-Z0-9\s]", "", name).strip()
60
- for name in name_line.replace("NAME", "").strip().split(";")
61
- ]
62
- # Join cleaned names into a single string
63
- entry_name_map[entry_id] = " ".join(names).strip()
64
-
65
- return entry_name_map
66
-
67
-
68
- def fetch_kegg_annotations(
69
- data: list[dict[str, str]], batch_size: int = 10
70
- ) -> dict[str, dict[str, str]]:
71
- """Fetch KEGG entry descriptions grouped by database type."""
72
- grouped_data = {}
73
- for entry in data:
74
- db_type = entry["Database"].lower()
75
- grouped_data.setdefault(db_type, []).append(entry["Id"])
76
-
77
- results = {}
78
- for db_type, ids in grouped_data.items():
79
- results[db_type] = fetch_kegg_names(ids, batch_size=batch_size)
80
-
81
- return results
82
-
83
-
84
- # def get_protein_name_or_label(data: List[Dict[str, str]],
85
- # batch_size: int = 10) -> Dict[str, Dict[str, str]]:
86
- # """Fetch descriptions for KEGG-related identifiers."""
87
- # return fetch_kegg_annotations(data, batch_size=batch_size)