aurelian 0.1.0__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.
Files changed (266) hide show
  1. aurelian/__init__.py +9 -0
  2. aurelian/agents/__init__.py +0 -0
  3. aurelian/agents/amigo/__init__.py +3 -0
  4. aurelian/agents/amigo/amigo_agent.py +77 -0
  5. aurelian/agents/amigo/amigo_config.py +85 -0
  6. aurelian/agents/amigo/amigo_evals.py +73 -0
  7. aurelian/agents/amigo/amigo_gradio.py +52 -0
  8. aurelian/agents/amigo/amigo_mcp.py +152 -0
  9. aurelian/agents/amigo/amigo_tools.py +152 -0
  10. aurelian/agents/biblio/__init__.py +42 -0
  11. aurelian/agents/biblio/biblio_agent.py +95 -0
  12. aurelian/agents/biblio/biblio_config.py +40 -0
  13. aurelian/agents/biblio/biblio_gradio.py +67 -0
  14. aurelian/agents/biblio/biblio_mcp.py +115 -0
  15. aurelian/agents/biblio/biblio_tools.py +164 -0
  16. aurelian/agents/biblio_agent.py +46 -0
  17. aurelian/agents/checklist/__init__.py +44 -0
  18. aurelian/agents/checklist/checklist_agent.py +86 -0
  19. aurelian/agents/checklist/checklist_config.py +28 -0
  20. aurelian/agents/checklist/checklist_gradio.py +70 -0
  21. aurelian/agents/checklist/checklist_mcp.py +86 -0
  22. aurelian/agents/checklist/checklist_tools.py +141 -0
  23. aurelian/agents/checklist/content/checklists.yaml +7 -0
  24. aurelian/agents/checklist/content/streams.csv +136 -0
  25. aurelian/agents/checklist_agent.py +40 -0
  26. aurelian/agents/chemistry/__init__.py +3 -0
  27. aurelian/agents/chemistry/chemistry_agent.py +47 -0
  28. aurelian/agents/chemistry/chemistry_config.py +71 -0
  29. aurelian/agents/chemistry/chemistry_evals.py +79 -0
  30. aurelian/agents/chemistry/chemistry_gradio.py +50 -0
  31. aurelian/agents/chemistry/chemistry_mcp.py +120 -0
  32. aurelian/agents/chemistry/chemistry_tools.py +121 -0
  33. aurelian/agents/chemistry/image_agent.py +15 -0
  34. aurelian/agents/d4d/__init__.py +30 -0
  35. aurelian/agents/d4d/d4d_agent.py +73 -0
  36. aurelian/agents/d4d/d4d_config.py +46 -0
  37. aurelian/agents/d4d/d4d_gradio.py +58 -0
  38. aurelian/agents/d4d/d4d_mcp.py +71 -0
  39. aurelian/agents/d4d/d4d_tools.py +157 -0
  40. aurelian/agents/d4d_agent.py +64 -0
  41. aurelian/agents/diagnosis/__init__.py +33 -0
  42. aurelian/agents/diagnosis/diagnosis_agent.py +54 -0
  43. aurelian/agents/diagnosis/diagnosis_config.py +48 -0
  44. aurelian/agents/diagnosis/diagnosis_evals.py +76 -0
  45. aurelian/agents/diagnosis/diagnosis_gradio.py +52 -0
  46. aurelian/agents/diagnosis/diagnosis_mcp.py +141 -0
  47. aurelian/agents/diagnosis/diagnosis_tools.py +204 -0
  48. aurelian/agents/diagnosis_agent.py +28 -0
  49. aurelian/agents/draw/__init__.py +3 -0
  50. aurelian/agents/draw/draw_agent.py +39 -0
  51. aurelian/agents/draw/draw_config.py +26 -0
  52. aurelian/agents/draw/draw_gradio.py +50 -0
  53. aurelian/agents/draw/draw_mcp.py +94 -0
  54. aurelian/agents/draw/draw_tools.py +100 -0
  55. aurelian/agents/draw/judge_agent.py +18 -0
  56. aurelian/agents/filesystem/__init__.py +0 -0
  57. aurelian/agents/filesystem/filesystem_config.py +27 -0
  58. aurelian/agents/filesystem/filesystem_gradio.py +49 -0
  59. aurelian/agents/filesystem/filesystem_mcp.py +89 -0
  60. aurelian/agents/filesystem/filesystem_tools.py +95 -0
  61. aurelian/agents/filesystem/py.typed +0 -0
  62. aurelian/agents/github/__init__.py +0 -0
  63. aurelian/agents/github/github_agent.py +83 -0
  64. aurelian/agents/github/github_cli.py +248 -0
  65. aurelian/agents/github/github_config.py +22 -0
  66. aurelian/agents/github/github_gradio.py +152 -0
  67. aurelian/agents/github/github_mcp.py +252 -0
  68. aurelian/agents/github/github_tools.py +408 -0
  69. aurelian/agents/github/github_tools.py.tmp +413 -0
  70. aurelian/agents/goann/__init__.py +13 -0
  71. aurelian/agents/goann/documents/Transcription_Factors_Annotation_Guidelines.md +1000 -0
  72. aurelian/agents/goann/documents/Transcription_Factors_Annotation_Guidelines.pdf +0 -0
  73. aurelian/agents/goann/documents/Transcription_Factors_Annotation_Guidelines_Paper.md +693 -0
  74. aurelian/agents/goann/documents/Transcription_Factors_Annotation_Guidelines_Paper.pdf +0 -0
  75. aurelian/agents/goann/goann_agent.py +90 -0
  76. aurelian/agents/goann/goann_config.py +90 -0
  77. aurelian/agents/goann/goann_evals.py +104 -0
  78. aurelian/agents/goann/goann_gradio.py +62 -0
  79. aurelian/agents/goann/goann_mcp.py +0 -0
  80. aurelian/agents/goann/goann_tools.py +65 -0
  81. aurelian/agents/gocam/__init__.py +52 -0
  82. aurelian/agents/gocam/documents/DNA-binding transcription factor activity annotation guidelines.docx +0 -0
  83. aurelian/agents/gocam/documents/DNA-binding transcription factor activity annotation guidelines.pdf +0 -0
  84. aurelian/agents/gocam/documents/DNA-binding_transcription_factor_activity_annotation_guidelines.md +100 -0
  85. aurelian/agents/gocam/documents/E3 ubiquitin ligases.docx +0 -0
  86. aurelian/agents/gocam/documents/E3 ubiquitin ligases.pdf +0 -0
  87. aurelian/agents/gocam/documents/E3_ubiquitin_ligases.md +134 -0
  88. aurelian/agents/gocam/documents/GO-CAM annotation guidelines README.docx +0 -0
  89. aurelian/agents/gocam/documents/GO-CAM annotation guidelines README.pdf +0 -0
  90. aurelian/agents/gocam/documents/GO-CAM modelling guidelines TO DO.docx +0 -0
  91. aurelian/agents/gocam/documents/GO-CAM modelling guidelines TO DO.pdf +0 -0
  92. aurelian/agents/gocam/documents/GO-CAM_annotation_guidelines_README.md +1 -0
  93. aurelian/agents/gocam/documents/GO-CAM_modelling_guidelines_TO_DO.md +3 -0
  94. aurelian/agents/gocam/documents/How to annotate complexes in GO-CAM.docx +0 -0
  95. aurelian/agents/gocam/documents/How to annotate complexes in GO-CAM.pdf +0 -0
  96. aurelian/agents/gocam/documents/How to annotate molecular adaptors.docx +0 -0
  97. aurelian/agents/gocam/documents/How to annotate molecular adaptors.pdf +0 -0
  98. aurelian/agents/gocam/documents/How to annotate sequestering proteins.docx +0 -0
  99. aurelian/agents/gocam/documents/How to annotate sequestering proteins.pdf +0 -0
  100. aurelian/agents/gocam/documents/How_to_annotate_complexes_in_GO-CAM.md +29 -0
  101. aurelian/agents/gocam/documents/How_to_annotate_molecular_adaptors.md +31 -0
  102. aurelian/agents/gocam/documents/How_to_annotate_sequestering_proteins.md +42 -0
  103. aurelian/agents/gocam/documents/Molecular adaptor activity.docx +0 -0
  104. aurelian/agents/gocam/documents/Molecular adaptor activity.pdf +0 -0
  105. aurelian/agents/gocam/documents/Molecular carrier activity.docx +0 -0
  106. aurelian/agents/gocam/documents/Molecular carrier activity.pdf +0 -0
  107. aurelian/agents/gocam/documents/Molecular_adaptor_activity.md +51 -0
  108. aurelian/agents/gocam/documents/Molecular_carrier_activity.md +41 -0
  109. aurelian/agents/gocam/documents/Protein sequestering activity.docx +0 -0
  110. aurelian/agents/gocam/documents/Protein sequestering activity.pdf +0 -0
  111. aurelian/agents/gocam/documents/Protein_sequestering_activity.md +50 -0
  112. aurelian/agents/gocam/documents/Signaling receptor activity annotation guidelines.docx +0 -0
  113. aurelian/agents/gocam/documents/Signaling receptor activity annotation guidelines.pdf +0 -0
  114. aurelian/agents/gocam/documents/Signaling_receptor_activity_annotation_guidelines.md +187 -0
  115. aurelian/agents/gocam/documents/Transcription coregulator activity.docx +0 -0
  116. aurelian/agents/gocam/documents/Transcription coregulator activity.pdf +0 -0
  117. aurelian/agents/gocam/documents/Transcription_coregulator_activity.md +36 -0
  118. aurelian/agents/gocam/documents/Transporter activity annotation annotation guidelines.docx +0 -0
  119. aurelian/agents/gocam/documents/Transporter activity annotation annotation guidelines.pdf +0 -0
  120. aurelian/agents/gocam/documents/Transporter_activity_annotation_annotation_guidelines.md +43 -0
  121. Regulatory Processes in GO-CAM.docx +0 -0
  122. Regulatory Processes in GO-CAM.pdf +0 -0
  123. aurelian/agents/gocam/documents/WIP_-_Regulation_and_Regulatory_Processes_in_GO-CAM.md +31 -0
  124. aurelian/agents/gocam/documents/md/DNA-binding_transcription_factor_activity_annotation_guidelines.md +131 -0
  125. aurelian/agents/gocam/documents/md/E3_ubiquitin_ligases.md +166 -0
  126. aurelian/agents/gocam/documents/md/GO-CAM_annotation_guidelines_README.md +1 -0
  127. aurelian/agents/gocam/documents/md/GO-CAM_modelling_guidelines_TO_DO.md +5 -0
  128. aurelian/agents/gocam/documents/md/How_to_annotate_complexes_in_GO-CAM.md +28 -0
  129. aurelian/agents/gocam/documents/md/How_to_annotate_molecular_adaptors.md +19 -0
  130. aurelian/agents/gocam/documents/md/How_to_annotate_sequestering_proteins.md +38 -0
  131. aurelian/agents/gocam/documents/md/Molecular_adaptor_activity.md +52 -0
  132. aurelian/agents/gocam/documents/md/Molecular_carrier_activity.md +59 -0
  133. aurelian/agents/gocam/documents/md/Protein_sequestering_activity.md +52 -0
  134. aurelian/agents/gocam/documents/md/Signaling_receptor_activity_annotation_guidelines.md +271 -0
  135. aurelian/agents/gocam/documents/md/Transcription_coregulator_activity.md +54 -0
  136. aurelian/agents/gocam/documents/md/Transporter_activity_annotation_annotation_guidelines.md +38 -0
  137. aurelian/agents/gocam/documents/md/WIP_-_Regulation_and_Regulatory_Processes_in_GO-CAM.md +39 -0
  138. aurelian/agents/gocam/documents/pandoc_md/Signaling_receptor_activity_annotation_guidelines.md +334 -0
  139. aurelian/agents/gocam/gocam_agent.py +243 -0
  140. aurelian/agents/gocam/gocam_config.py +85 -0
  141. aurelian/agents/gocam/gocam_curator_agent.py +46 -0
  142. aurelian/agents/gocam/gocam_evals.py +64 -0
  143. aurelian/agents/gocam/gocam_gradio.py +89 -0
  144. aurelian/agents/gocam/gocam_mcp.py +224 -0
  145. aurelian/agents/gocam/gocam_tools.py +294 -0
  146. aurelian/agents/linkml/__init__.py +0 -0
  147. aurelian/agents/linkml/linkml_agent.py +62 -0
  148. aurelian/agents/linkml/linkml_config.py +48 -0
  149. aurelian/agents/linkml/linkml_evals.py +66 -0
  150. aurelian/agents/linkml/linkml_gradio.py +45 -0
  151. aurelian/agents/linkml/linkml_mcp.py +181 -0
  152. aurelian/agents/linkml/linkml_tools.py +102 -0
  153. aurelian/agents/literature/__init__.py +3 -0
  154. aurelian/agents/literature/literature_agent.py +75 -0
  155. aurelian/agents/literature/literature_config.py +35 -0
  156. aurelian/agents/literature/literature_gradio.py +52 -0
  157. aurelian/agents/literature/literature_mcp.py +174 -0
  158. aurelian/agents/literature/literature_tools.py +182 -0
  159. aurelian/agents/monarch/__init__.py +0 -0
  160. aurelian/agents/monarch/monarch_agent.py +45 -0
  161. aurelian/agents/monarch/monarch_config.py +45 -0
  162. aurelian/agents/monarch/monarch_gradio.py +51 -0
  163. aurelian/agents/monarch/monarch_mcp.py +65 -0
  164. aurelian/agents/monarch/monarch_tools.py +112 -0
  165. aurelian/agents/oak/__init__.py +0 -0
  166. aurelian/agents/oak/oak_config.py +27 -0
  167. aurelian/agents/oak/oak_gradio.py +57 -0
  168. aurelian/agents/ontology_mapper/__init__.py +31 -0
  169. aurelian/agents/ontology_mapper/ontology_mapper_agent.py +57 -0
  170. aurelian/agents/ontology_mapper/ontology_mapper_config.py +50 -0
  171. aurelian/agents/ontology_mapper/ontology_mapper_evals.py +108 -0
  172. aurelian/agents/ontology_mapper/ontology_mapper_gradio.py +58 -0
  173. aurelian/agents/ontology_mapper/ontology_mapper_mcp.py +81 -0
  174. aurelian/agents/ontology_mapper/ontology_mapper_tools.py +147 -0
  175. aurelian/agents/paperqa/__init__.py +27 -0
  176. aurelian/agents/paperqa/paperqa_agent.py +66 -0
  177. aurelian/agents/paperqa/paperqa_cli.py +305 -0
  178. aurelian/agents/paperqa/paperqa_config.py +142 -0
  179. aurelian/agents/paperqa/paperqa_gradio.py +90 -0
  180. aurelian/agents/paperqa/paperqa_mcp.py +155 -0
  181. aurelian/agents/paperqa/paperqa_tools.py +566 -0
  182. aurelian/agents/phenopackets/__init__.py +3 -0
  183. aurelian/agents/phenopackets/phenopackets_agent.py +58 -0
  184. aurelian/agents/phenopackets/phenopackets_config.py +72 -0
  185. aurelian/agents/phenopackets/phenopackets_evals.py +99 -0
  186. aurelian/agents/phenopackets/phenopackets_gradio.py +55 -0
  187. aurelian/agents/phenopackets/phenopackets_mcp.py +178 -0
  188. aurelian/agents/phenopackets/phenopackets_tools.py +127 -0
  189. aurelian/agents/rag/__init__.py +40 -0
  190. aurelian/agents/rag/rag_agent.py +84 -0
  191. aurelian/agents/rag/rag_config.py +80 -0
  192. aurelian/agents/rag/rag_gradio.py +67 -0
  193. aurelian/agents/rag/rag_mcp.py +107 -0
  194. aurelian/agents/rag/rag_tools.py +189 -0
  195. aurelian/agents/rag_agent.py +54 -0
  196. aurelian/agents/robot/__init__.py +0 -0
  197. aurelian/agents/robot/assets/__init__.py +3 -0
  198. aurelian/agents/robot/assets/template.md +384 -0
  199. aurelian/agents/robot/robot_config.py +25 -0
  200. aurelian/agents/robot/robot_gradio.py +46 -0
  201. aurelian/agents/robot/robot_mcp.py +100 -0
  202. aurelian/agents/robot/robot_ontology_agent.py +139 -0
  203. aurelian/agents/robot/robot_tools.py +50 -0
  204. aurelian/agents/talisman/__init__.py +3 -0
  205. aurelian/agents/talisman/__main__.py +17 -0
  206. aurelian/agents/talisman/cli.py +70 -0
  207. aurelian/agents/talisman/run_talisman.py +18 -0
  208. aurelian/agents/talisman/talisman_agent.py +143 -0
  209. aurelian/agents/talisman/talisman_config.py +66 -0
  210. aurelian/agents/talisman/talisman_gradio.py +50 -0
  211. aurelian/agents/talisman/talisman_mcp.py +75 -0
  212. aurelian/agents/talisman/talisman_tools.py +962 -0
  213. aurelian/agents/ubergraph/__init__.py +40 -0
  214. aurelian/agents/ubergraph/ubergraph_agent.py +72 -0
  215. aurelian/agents/ubergraph/ubergraph_config.py +79 -0
  216. aurelian/agents/ubergraph/ubergraph_gradio.py +48 -0
  217. aurelian/agents/ubergraph/ubergraph_mcp.py +69 -0
  218. aurelian/agents/ubergraph/ubergraph_tools.py +118 -0
  219. aurelian/agents/uniprot/__init__.py +0 -0
  220. aurelian/agents/uniprot/uniprot_agent.py +43 -0
  221. aurelian/agents/uniprot/uniprot_config.py +43 -0
  222. aurelian/agents/uniprot/uniprot_evals.py +99 -0
  223. aurelian/agents/uniprot/uniprot_gradio.py +48 -0
  224. aurelian/agents/uniprot/uniprot_mcp.py +168 -0
  225. aurelian/agents/uniprot/uniprot_tools.py +136 -0
  226. aurelian/agents/web/__init__.py +0 -0
  227. aurelian/agents/web/web_config.py +27 -0
  228. aurelian/agents/web/web_gradio.py +48 -0
  229. aurelian/agents/web/web_mcp.py +50 -0
  230. aurelian/agents/web/web_tools.py +121 -0
  231. aurelian/chat.py +23 -0
  232. aurelian/cli.py +1004 -0
  233. aurelian/dependencies/__init__.py +0 -0
  234. aurelian/dependencies/workdir.py +78 -0
  235. aurelian/evaluators/model.py +9 -0
  236. aurelian/evaluators/substring_evaluator.py +30 -0
  237. aurelian/mcp/__init__.py +0 -0
  238. aurelian/mcp/amigo_mcp_test.py +86 -0
  239. aurelian/mcp/config_generator.py +123 -0
  240. aurelian/mcp/example_config.json +43 -0
  241. aurelian/mcp/generate_sample_config.py +37 -0
  242. aurelian/mcp/gocam_mcp_test.py +126 -0
  243. aurelian/mcp/linkml_mcp_tools.py +190 -0
  244. aurelian/mcp/mcp_discovery.py +87 -0
  245. aurelian/mcp/mcp_test.py +31 -0
  246. aurelian/mcp/phenopackets_mcp_test.py +103 -0
  247. aurelian/tools/__init__.py +0 -0
  248. aurelian/tools/web/__init__.py +0 -0
  249. aurelian/tools/web/url_download.py +51 -0
  250. aurelian/utils/__init__.py +0 -0
  251. aurelian/utils/async_utils.py +18 -0
  252. aurelian/utils/data_utils.py +32 -0
  253. aurelian/utils/documentation_manager.py +59 -0
  254. aurelian/utils/doi_fetcher.py +238 -0
  255. aurelian/utils/ontology_utils.py +68 -0
  256. aurelian/utils/pdf_fetcher.py +23 -0
  257. aurelian/utils/process_logs.py +100 -0
  258. aurelian/utils/pubmed_utils.py +238 -0
  259. aurelian/utils/pytest_report_to_markdown.py +67 -0
  260. aurelian/utils/robot_ontology_utils.py +112 -0
  261. aurelian/utils/search_utils.py +95 -0
  262. aurelian-0.1.0.dist-info/LICENSE +22 -0
  263. aurelian-0.1.0.dist-info/METADATA +109 -0
  264. aurelian-0.1.0.dist-info/RECORD +266 -0
  265. aurelian-0.1.0.dist-info/WHEEL +4 -0
  266. aurelian-0.1.0.dist-info/entry_points.txt +4 -0
@@ -0,0 +1,67 @@
1
+ import json
2
+ from pathlib import Path
3
+ from collections import defaultdict
4
+ import re
5
+ from typing import Iterator
6
+
7
+ import click
8
+
9
+
10
+ def report_md(log_path: str) -> str:
11
+ return '\n'.join(list(report_md_iter(log_path)))
12
+
13
+ def report_md_iter(log_path: str) -> Iterator[str]:
14
+ """
15
+ Parse pytest-reportlog output into structured format.
16
+
17
+ Args:
18
+ log_path:
19
+
20
+ Returns:
21
+
22
+ """
23
+
24
+ with open(log_path) as f:
25
+ outcome = None
26
+ duration = None
27
+ for line in f:
28
+ entry = json.loads(line)
29
+
30
+ # Only process TestReport entries
31
+ if entry.get('$report_type') != 'TestReport':
32
+ continue
33
+
34
+ nodeid = entry['nodeid']
35
+ outcome = entry.get('outcome')
36
+ duration = entry.get('duration')
37
+
38
+ if not outcome:
39
+ continue
40
+
41
+ yield f"## {nodeid}\n"
42
+
43
+
44
+
45
+ for p in entry.get('user_properties', []):
46
+ k = p[0]
47
+ v = p[1]
48
+
49
+ yield f"### {k}\n\n"
50
+ yield f"{v}\n"
51
+
52
+ yield "## Stats\n\n"
53
+ if outcome:
54
+ yield f"* Outcome: {outcome}\n"
55
+ if duration:
56
+ yield f"* Duration: {duration}\n"
57
+
58
+
59
+
60
+ @click.command()
61
+ @click.argument("log_path", type=click.Path(exists=True))
62
+ def main(log_path: str):
63
+ markdown = report_md(log_path)
64
+ print(markdown)
65
+
66
+ if __name__ == "__main__":
67
+ main()
@@ -0,0 +1,112 @@
1
+ from typing import Dict, Optional, List, Tuple
2
+
3
+ from aurelian.dependencies.workdir import WorkDir
4
+
5
+ MERGED_IMPORT_PATH = "_imports_.owl"
6
+
7
+ def run(cmd: str):
8
+ """
9
+ Run a command, raising an error if the command fails,
10
+ returning stdout
11
+
12
+ Args:
13
+ cmd:
14
+
15
+ Returns:
16
+
17
+ """
18
+ import subprocess
19
+ result = subprocess.run(cmd, shell=True, capture_output=True)
20
+ if result.returncode != 0:
21
+ stdout = result.stdout.decode()
22
+ stderr = result.stderr.decode()
23
+ raise Exception(f"Command failed: {cmd}\nError: {stderr}\nOutput: {stdout}")
24
+ return result.stdout.decode()
25
+
26
+ def parse_component_name(name: str) -> Tuple[str, Optional[str]]:
27
+ """
28
+ Parse file name
29
+
30
+ Example:
31
+
32
+ >>> parse_component_name("foo.owl")
33
+ ('foo', 'owl')
34
+ >>> parse_component_name("foo")
35
+ ('foo', None)
36
+
37
+
38
+ Args:
39
+ name:
40
+
41
+ Returns:
42
+
43
+ """
44
+ parts = name.split(".")
45
+ if len(parts) == 1:
46
+ return name, None
47
+ return ".".join(parts[:-1]), parts[-1]
48
+
49
+
50
+ def depends_on_csv(workdir: WorkDir, name: str) -> Optional[str]:
51
+ base, suffix = parse_component_name(name)
52
+ if not suffix:
53
+ suffix = "owl"
54
+ base = name
55
+ if suffix == "owl":
56
+ for d_suffix in ("tsv", "csv"):
57
+ d_name = f"{base}.{d_suffix}"
58
+ if workdir.check_file_exists(d_name):
59
+ return d_name
60
+ return None
61
+
62
+ def run_robot_template_command(workdir: WorkDir, template_path: str, prefix_map: Dict[str, str], output_path: Optional[str] = None, import_ontologies: Optional[List[str]] = None) -> str:
63
+ """
64
+ Generate a robot template command
65
+
66
+ Args:
67
+ workdir:
68
+ template_path:
69
+ prefix_map:
70
+ output_path:
71
+ import_ontologies:
72
+
73
+ Returns:
74
+
75
+ """
76
+ if output_path is None:
77
+ output_path = template_path.replace(".csv", ".owl")
78
+ prefixes = " ".join([f"--prefix '{k}: {v}'" for k, v in prefix_map.items()])
79
+ if not import_ontologies:
80
+ import_ontologies = []
81
+ import_owls = []
82
+ for import_ontology in import_ontologies:
83
+ local_name, suffix = parse_component_name(import_ontology)
84
+ if suffix == "owl":
85
+ import_ontology_owl = import_ontology
86
+ if not workdir.check_file_exists(import_ontology_owl):
87
+ depends_on = depends_on_csv(workdir, import_ontology_owl)
88
+ if not workdir.check_file_exists(depends_on):
89
+ raise Exception(f"Cannot make owl file {import_ontology_owl} as no {depends_on}")
90
+ run_robot_template_command(
91
+ workdir,
92
+ depends_on,
93
+ prefix_map=prefix_map,
94
+ output_path=import_ontology_owl,
95
+ )
96
+ else:
97
+ if suffix:
98
+ import_ontology_owl = import_ontology.replace(suffix, "owl")
99
+ else:
100
+ import_ontology_owl = import_ontology + ".owl"
101
+ run_robot_template_command(workdir, import_ontology, prefix_map=prefix_map, output_path=import_ontology_owl)
102
+ import_owls.append(import_ontology_owl)
103
+ if import_owls:
104
+ input_opts = [f"--input {owl}" for owl in import_owls]
105
+ cmd = f"cd {workdir.location} && robot merge {' '.join(input_opts)} --output {MERGED_IMPORT_PATH}"
106
+ run(cmd)
107
+ import_ontology_opt = f"--input {MERGED_IMPORT_PATH}"
108
+ else:
109
+ import_ontology_opt = ""
110
+ cmd = f"cd {workdir.location} && robot template {import_ontology_opt} --template {template_path} {prefixes} reason --output {output_path}"
111
+ run(cmd)
112
+ return output_path
@@ -0,0 +1,95 @@
1
+ import re
2
+
3
+ import requests
4
+ from duckduckgo_search import DDGS
5
+ from markdownify import markdownify
6
+
7
+ from aurelian.utils.pubmed_utils import doi_to_pmid, extract_doi_from_url, get_pmcid_text, get_pmid_text
8
+
9
+ MAX_LENGTH_TRUNCATE_CONTENT = 20000
10
+
11
+
12
+ def web_search(query: str, max_results=10, **kwargs) -> str:
13
+ """Search the web using DuckDuckGo
14
+
15
+ Example:
16
+ >>> result = web_search("Winner of 2024 nobel prize in chemistry")
17
+ >>> assert "Baker" in result
18
+
19
+
20
+ Args:
21
+ query:
22
+ max_results:
23
+ **kwargs:
24
+
25
+ Returns:
26
+
27
+ """
28
+ ddgs = DDGS(**kwargs)
29
+ results = ddgs.text(query, max_results=max_results)
30
+ if len(results) == 0:
31
+ return "No results found! Try a less restrictive/shorter query."
32
+ postprocessed_results = [f"[{result['title']}]({result['href']})\n{result['body']}" for result in results]
33
+ return "## Search Results\n\n" + "\n\n".join(postprocessed_results)
34
+
35
+
36
+ def retrieve_web_page(url: str) -> str:
37
+ """Retrieve the text of a web page.
38
+
39
+ Example:
40
+ >>> url = "https://en.wikipedia.org/wiki/COVID-19"
41
+ >>> text = retrieve_web_page(url)
42
+ >>> assert "COVID-19" in text
43
+
44
+ PMCs are redirected:
45
+
46
+ >>> url = "https://pmc.ncbi.nlm.nih.gov/articles/PMC5048378/"
47
+ >>> text = retrieve_web_page(url)
48
+ >>> assert "integrated stress response (ISR)" in text
49
+
50
+ URLs with DOIs:
51
+
52
+ >>> url = "https://microbiomejournal.biomedcentral.com/articles/10.1186/s40168-020-00889-8"
53
+ >>> text = retrieve_web_page(url)
54
+ >>> assert "photosynthesis" in text
55
+
56
+ Args:
57
+ url: URL of the web page
58
+
59
+ Returns:
60
+ str: The text of the web page
61
+
62
+ """
63
+ if url.startswith("https://pmc.ncbi.nlm.nih.gov/articles/PMC"):
64
+ url = url.strip("/")
65
+ pmc_id = url.split("/")[-1]
66
+ # print(f"REWIRING URL: Fetching PMC ID: {pmc_id}")
67
+ return get_pmcid_text(pmc_id)
68
+
69
+ doi = extract_doi_from_url(url)
70
+ if doi:
71
+ # print(f"REWIRING URL: Fetching DOI: {doi}")
72
+ pmid = doi_to_pmid(doi)
73
+ return get_pmid_text(pmid)
74
+
75
+ response = requests.get(url, timeout=20)
76
+ response.raise_for_status() # Raise an exception for bad status codes
77
+
78
+ # Convert the HTML content to Markdown
79
+ markdown_content = markdownify(response.text).strip()
80
+
81
+ # Remove multiple line breaks
82
+ markdown_content = re.sub(r"\n{3,}", "\n\n", markdown_content)
83
+
84
+ return truncate_content(markdown_content, 10000)
85
+
86
+
87
+ def truncate_content(content: str, max_length: int = MAX_LENGTH_TRUNCATE_CONTENT) -> str:
88
+ if len(content) <= max_length:
89
+ return content
90
+ else:
91
+ return (
92
+ content[: max_length // 2]
93
+ + f"\n..._This content has been truncated to stay below {max_length} characters_...\n"
94
+ + content[-max_length // 2 :]
95
+ )
@@ -0,0 +1,22 @@
1
+
2
+ The MIT License (MIT)
3
+
4
+ Copyright (c) 2025 Monarch Initiative
5
+
6
+ Permission is hereby granted, free of charge, to any person obtaining a copy
7
+ of this software and associated documentation files (the "Software"), to deal
8
+ in the Software without restriction, including without limitation the rights
9
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
+ copies of the Software, and to permit persons to whom the Software is
11
+ furnished to do so, subject to the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be included in
14
+ all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22
+ THE SOFTWARE.
@@ -0,0 +1,109 @@
1
+ Metadata-Version: 2.3
2
+ Name: aurelian
3
+ Version: 0.1.0
4
+ Summary: aurelian
5
+ License: MIT
6
+ Author: Author 1
7
+ Author-email: author@org.org
8
+ Requires-Python: >=3.11,<4.0
9
+ Classifier: License :: OSI Approved :: MIT License
10
+ Classifier: Programming Language :: Python :: 3
11
+ Classifier: Programming Language :: Python :: 3.11
12
+ Classifier: Programming Language :: Python :: 3.12
13
+ Classifier: Programming Language :: Python :: 3.13
14
+ Provides-Extra: bioservices
15
+ Provides-Extra: chem
16
+ Provides-Extra: gocam
17
+ Provides-Extra: gradio
18
+ Provides-Extra: linkml
19
+ Provides-Extra: pdfminer
20
+ Provides-Extra: pypaperbot
21
+ Provides-Extra: rdkit
22
+ Requires-Dist: bioservices (>=1.12.0) ; extra == "bioservices"
23
+ Requires-Dist: bs4 (>=0.0.2)
24
+ Requires-Dist: cairosvg (>=2.7.1,<3.0.0)
25
+ Requires-Dist: click
26
+ Requires-Dist: duckduckgo-search (>=7.3.2)
27
+ Requires-Dist: gocam ; extra == "gocam"
28
+ Requires-Dist: gradio (>=5.23.3,<6.0.0) ; extra == "gradio"
29
+ Requires-Dist: importlib-metadata (>=8.2.0)
30
+ Requires-Dist: linkml ; extra == "linkml"
31
+ Requires-Dist: linkml-store[llm,mongodb] (>=0.2.4)
32
+ Requires-Dist: logfire (>=3.5.3)
33
+ Requires-Dist: markdownify (>=0.14.1)
34
+ Requires-Dist: markitdown (>=0.1.1)
35
+ Requires-Dist: mcp[cli] (>=1.3.0,<2.0.0)
36
+ Requires-Dist: oaklib (>=0.6.19)
37
+ Requires-Dist: onnxruntime (<=1.19.0)
38
+ Requires-Dist: paper-qa (>=5.20.0,<6.0.0)
39
+ Requires-Dist: pdfminer-six ; extra == "pdfminer"
40
+ Requires-Dist: pydantic-ai (>=0.2.0)
41
+ Requires-Dist: pypaperbot (>=1.4.1) ; extra == "pypaperbot"
42
+ Requires-Dist: pytest-asyncio (>=0.25.3,<0.26.0)
43
+ Requires-Dist: rdkit ; extra == "rdkit" or extra == "chem"
44
+ Requires-Dist: tabulate (>=0.9.0)
45
+ Requires-Dist: undetected-chromedriver (>=3.5.5)
46
+ Requires-Dist: wikipedia (>=1.4.0)
47
+ Description-Content-Type: text/markdown
48
+
49
+ [![DOI](https://zenodo.org/badge/932483388.svg)](https://doi.org/10.5281/zenodo.15299996)
50
+
51
+ # Aurelian: Agentic Universal Research Engine for Literature, Integration, Annotation, and Navigation
52
+
53
+ | [Documentation](https://monarch-initiative.github.io/aurelian) |
54
+
55
+ ```
56
+ aurelian --help
57
+ ```
58
+
59
+ Most commands will start up a different AI agent.
60
+
61
+ ## Examples of use
62
+
63
+ ### TALISMAN
64
+
65
+ gene set enrichment
66
+
67
+ ### Aria
68
+
69
+ checking papers against checklists
70
+
71
+ ### GO-CAM agent
72
+
73
+ This agent is for exploring, chatting with, and reviewing GO-CAMs
74
+
75
+ Docs: [gocam_agent](https://monarch-initiative.github.io/aurelian/agents/gocam_agent/)
76
+
77
+ It can be used to generate reviews according to guidelines for GO-CAMs:
78
+
79
+ * [GO-CAM Reviews](https://cmungall.github.io/go-cam-reviews/)
80
+
81
+ It can also generate SVGs, demonstrating innate knowledge of both the visual grammar of pathway diagrams and the semantics of the underlying biology.
82
+
83
+
84
+ <img alt="img" src="https://cmungall.github.io/go-cam-reviews/figures/FIG-646ff70100005137-IL33_signaling_pathway__Human_.svg" />
85
+
86
+ ### GO-Ann agent
87
+
88
+ This agent is for exploring, chatting with, and reviewing standard annotations
89
+
90
+
91
+ Docs: [go_ann_agent](https://monarch-initiative.github.io/aurelian/agents/go_ann_agent/)
92
+
93
+ Example review using TF guidelines:
94
+
95
+ https://github.com/geneontology/go-annotation/issues/5743
96
+
97
+ ## Troubleshooting
98
+
99
+ ### Installing linkml-store
100
+
101
+ Some agents require linkml-store pre-indexed. E.g. a mongodb with gocams for cam agent.
102
+ Consult the [linkml-store documentation](https://linkml.io/linkml-store/) for more information.
103
+
104
+ ### Semantic search over ontologies
105
+
106
+ If an agent requires ontology search it will use the semsql/OAK sqlite database.
107
+ The first time querying it will use linkml-store to create an LLM index. Requires OAI key.
108
+ This may be slow first iteration. Will be cached until your pystow cache regenerates.
109
+