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.
- aurelian/__init__.py +9 -0
- aurelian/agents/__init__.py +0 -0
- aurelian/agents/amigo/__init__.py +3 -0
- aurelian/agents/amigo/amigo_agent.py +77 -0
- aurelian/agents/amigo/amigo_config.py +85 -0
- aurelian/agents/amigo/amigo_evals.py +73 -0
- aurelian/agents/amigo/amigo_gradio.py +52 -0
- aurelian/agents/amigo/amigo_mcp.py +152 -0
- aurelian/agents/amigo/amigo_tools.py +152 -0
- aurelian/agents/biblio/__init__.py +42 -0
- aurelian/agents/biblio/biblio_agent.py +95 -0
- aurelian/agents/biblio/biblio_config.py +40 -0
- aurelian/agents/biblio/biblio_gradio.py +67 -0
- aurelian/agents/biblio/biblio_mcp.py +115 -0
- aurelian/agents/biblio/biblio_tools.py +164 -0
- aurelian/agents/biblio_agent.py +46 -0
- aurelian/agents/checklist/__init__.py +44 -0
- aurelian/agents/checklist/checklist_agent.py +86 -0
- aurelian/agents/checklist/checklist_config.py +28 -0
- aurelian/agents/checklist/checklist_gradio.py +70 -0
- aurelian/agents/checklist/checklist_mcp.py +86 -0
- aurelian/agents/checklist/checklist_tools.py +141 -0
- aurelian/agents/checklist/content/checklists.yaml +7 -0
- aurelian/agents/checklist/content/streams.csv +136 -0
- aurelian/agents/checklist_agent.py +40 -0
- aurelian/agents/chemistry/__init__.py +3 -0
- aurelian/agents/chemistry/chemistry_agent.py +47 -0
- aurelian/agents/chemistry/chemistry_config.py +71 -0
- aurelian/agents/chemistry/chemistry_evals.py +79 -0
- aurelian/agents/chemistry/chemistry_gradio.py +50 -0
- aurelian/agents/chemistry/chemistry_mcp.py +120 -0
- aurelian/agents/chemistry/chemistry_tools.py +121 -0
- aurelian/agents/chemistry/image_agent.py +15 -0
- aurelian/agents/d4d/__init__.py +30 -0
- aurelian/agents/d4d/d4d_agent.py +73 -0
- aurelian/agents/d4d/d4d_config.py +46 -0
- aurelian/agents/d4d/d4d_gradio.py +58 -0
- aurelian/agents/d4d/d4d_mcp.py +71 -0
- aurelian/agents/d4d/d4d_tools.py +157 -0
- aurelian/agents/d4d_agent.py +64 -0
- aurelian/agents/diagnosis/__init__.py +33 -0
- aurelian/agents/diagnosis/diagnosis_agent.py +54 -0
- aurelian/agents/diagnosis/diagnosis_config.py +48 -0
- aurelian/agents/diagnosis/diagnosis_evals.py +76 -0
- aurelian/agents/diagnosis/diagnosis_gradio.py +52 -0
- aurelian/agents/diagnosis/diagnosis_mcp.py +141 -0
- aurelian/agents/diagnosis/diagnosis_tools.py +204 -0
- aurelian/agents/diagnosis_agent.py +28 -0
- aurelian/agents/draw/__init__.py +3 -0
- aurelian/agents/draw/draw_agent.py +39 -0
- aurelian/agents/draw/draw_config.py +26 -0
- aurelian/agents/draw/draw_gradio.py +50 -0
- aurelian/agents/draw/draw_mcp.py +94 -0
- aurelian/agents/draw/draw_tools.py +100 -0
- aurelian/agents/draw/judge_agent.py +18 -0
- aurelian/agents/filesystem/__init__.py +0 -0
- aurelian/agents/filesystem/filesystem_config.py +27 -0
- aurelian/agents/filesystem/filesystem_gradio.py +49 -0
- aurelian/agents/filesystem/filesystem_mcp.py +89 -0
- aurelian/agents/filesystem/filesystem_tools.py +95 -0
- aurelian/agents/filesystem/py.typed +0 -0
- aurelian/agents/github/__init__.py +0 -0
- aurelian/agents/github/github_agent.py +83 -0
- aurelian/agents/github/github_cli.py +248 -0
- aurelian/agents/github/github_config.py +22 -0
- aurelian/agents/github/github_gradio.py +152 -0
- aurelian/agents/github/github_mcp.py +252 -0
- aurelian/agents/github/github_tools.py +408 -0
- aurelian/agents/github/github_tools.py.tmp +413 -0
- aurelian/agents/goann/__init__.py +13 -0
- aurelian/agents/goann/documents/Transcription_Factors_Annotation_Guidelines.md +1000 -0
- aurelian/agents/goann/documents/Transcription_Factors_Annotation_Guidelines.pdf +0 -0
- aurelian/agents/goann/documents/Transcription_Factors_Annotation_Guidelines_Paper.md +693 -0
- aurelian/agents/goann/documents/Transcription_Factors_Annotation_Guidelines_Paper.pdf +0 -0
- aurelian/agents/goann/goann_agent.py +90 -0
- aurelian/agents/goann/goann_config.py +90 -0
- aurelian/agents/goann/goann_evals.py +104 -0
- aurelian/agents/goann/goann_gradio.py +62 -0
- aurelian/agents/goann/goann_mcp.py +0 -0
- aurelian/agents/goann/goann_tools.py +65 -0
- aurelian/agents/gocam/__init__.py +52 -0
- aurelian/agents/gocam/documents/DNA-binding transcription factor activity annotation guidelines.docx +0 -0
- aurelian/agents/gocam/documents/DNA-binding transcription factor activity annotation guidelines.pdf +0 -0
- aurelian/agents/gocam/documents/DNA-binding_transcription_factor_activity_annotation_guidelines.md +100 -0
- aurelian/agents/gocam/documents/E3 ubiquitin ligases.docx +0 -0
- aurelian/agents/gocam/documents/E3 ubiquitin ligases.pdf +0 -0
- aurelian/agents/gocam/documents/E3_ubiquitin_ligases.md +134 -0
- aurelian/agents/gocam/documents/GO-CAM annotation guidelines README.docx +0 -0
- aurelian/agents/gocam/documents/GO-CAM annotation guidelines README.pdf +0 -0
- aurelian/agents/gocam/documents/GO-CAM modelling guidelines TO DO.docx +0 -0
- aurelian/agents/gocam/documents/GO-CAM modelling guidelines TO DO.pdf +0 -0
- aurelian/agents/gocam/documents/GO-CAM_annotation_guidelines_README.md +1 -0
- aurelian/agents/gocam/documents/GO-CAM_modelling_guidelines_TO_DO.md +3 -0
- aurelian/agents/gocam/documents/How to annotate complexes in GO-CAM.docx +0 -0
- aurelian/agents/gocam/documents/How to annotate complexes in GO-CAM.pdf +0 -0
- aurelian/agents/gocam/documents/How to annotate molecular adaptors.docx +0 -0
- aurelian/agents/gocam/documents/How to annotate molecular adaptors.pdf +0 -0
- aurelian/agents/gocam/documents/How to annotate sequestering proteins.docx +0 -0
- aurelian/agents/gocam/documents/How to annotate sequestering proteins.pdf +0 -0
- aurelian/agents/gocam/documents/How_to_annotate_complexes_in_GO-CAM.md +29 -0
- aurelian/agents/gocam/documents/How_to_annotate_molecular_adaptors.md +31 -0
- aurelian/agents/gocam/documents/How_to_annotate_sequestering_proteins.md +42 -0
- aurelian/agents/gocam/documents/Molecular adaptor activity.docx +0 -0
- aurelian/agents/gocam/documents/Molecular adaptor activity.pdf +0 -0
- aurelian/agents/gocam/documents/Molecular carrier activity.docx +0 -0
- aurelian/agents/gocam/documents/Molecular carrier activity.pdf +0 -0
- aurelian/agents/gocam/documents/Molecular_adaptor_activity.md +51 -0
- aurelian/agents/gocam/documents/Molecular_carrier_activity.md +41 -0
- aurelian/agents/gocam/documents/Protein sequestering activity.docx +0 -0
- aurelian/agents/gocam/documents/Protein sequestering activity.pdf +0 -0
- aurelian/agents/gocam/documents/Protein_sequestering_activity.md +50 -0
- aurelian/agents/gocam/documents/Signaling receptor activity annotation guidelines.docx +0 -0
- aurelian/agents/gocam/documents/Signaling receptor activity annotation guidelines.pdf +0 -0
- aurelian/agents/gocam/documents/Signaling_receptor_activity_annotation_guidelines.md +187 -0
- aurelian/agents/gocam/documents/Transcription coregulator activity.docx +0 -0
- aurelian/agents/gocam/documents/Transcription coregulator activity.pdf +0 -0
- aurelian/agents/gocam/documents/Transcription_coregulator_activity.md +36 -0
- aurelian/agents/gocam/documents/Transporter activity annotation annotation guidelines.docx +0 -0
- aurelian/agents/gocam/documents/Transporter activity annotation annotation guidelines.pdf +0 -0
- aurelian/agents/gocam/documents/Transporter_activity_annotation_annotation_guidelines.md +43 -0
- Regulatory Processes in GO-CAM.docx +0 -0
- Regulatory Processes in GO-CAM.pdf +0 -0
- aurelian/agents/gocam/documents/WIP_-_Regulation_and_Regulatory_Processes_in_GO-CAM.md +31 -0
- aurelian/agents/gocam/documents/md/DNA-binding_transcription_factor_activity_annotation_guidelines.md +131 -0
- aurelian/agents/gocam/documents/md/E3_ubiquitin_ligases.md +166 -0
- aurelian/agents/gocam/documents/md/GO-CAM_annotation_guidelines_README.md +1 -0
- aurelian/agents/gocam/documents/md/GO-CAM_modelling_guidelines_TO_DO.md +5 -0
- aurelian/agents/gocam/documents/md/How_to_annotate_complexes_in_GO-CAM.md +28 -0
- aurelian/agents/gocam/documents/md/How_to_annotate_molecular_adaptors.md +19 -0
- aurelian/agents/gocam/documents/md/How_to_annotate_sequestering_proteins.md +38 -0
- aurelian/agents/gocam/documents/md/Molecular_adaptor_activity.md +52 -0
- aurelian/agents/gocam/documents/md/Molecular_carrier_activity.md +59 -0
- aurelian/agents/gocam/documents/md/Protein_sequestering_activity.md +52 -0
- aurelian/agents/gocam/documents/md/Signaling_receptor_activity_annotation_guidelines.md +271 -0
- aurelian/agents/gocam/documents/md/Transcription_coregulator_activity.md +54 -0
- aurelian/agents/gocam/documents/md/Transporter_activity_annotation_annotation_guidelines.md +38 -0
- aurelian/agents/gocam/documents/md/WIP_-_Regulation_and_Regulatory_Processes_in_GO-CAM.md +39 -0
- aurelian/agents/gocam/documents/pandoc_md/Signaling_receptor_activity_annotation_guidelines.md +334 -0
- aurelian/agents/gocam/gocam_agent.py +243 -0
- aurelian/agents/gocam/gocam_config.py +85 -0
- aurelian/agents/gocam/gocam_curator_agent.py +46 -0
- aurelian/agents/gocam/gocam_evals.py +64 -0
- aurelian/agents/gocam/gocam_gradio.py +89 -0
- aurelian/agents/gocam/gocam_mcp.py +224 -0
- aurelian/agents/gocam/gocam_tools.py +294 -0
- aurelian/agents/linkml/__init__.py +0 -0
- aurelian/agents/linkml/linkml_agent.py +62 -0
- aurelian/agents/linkml/linkml_config.py +48 -0
- aurelian/agents/linkml/linkml_evals.py +66 -0
- aurelian/agents/linkml/linkml_gradio.py +45 -0
- aurelian/agents/linkml/linkml_mcp.py +181 -0
- aurelian/agents/linkml/linkml_tools.py +102 -0
- aurelian/agents/literature/__init__.py +3 -0
- aurelian/agents/literature/literature_agent.py +75 -0
- aurelian/agents/literature/literature_config.py +35 -0
- aurelian/agents/literature/literature_gradio.py +52 -0
- aurelian/agents/literature/literature_mcp.py +174 -0
- aurelian/agents/literature/literature_tools.py +182 -0
- aurelian/agents/monarch/__init__.py +0 -0
- aurelian/agents/monarch/monarch_agent.py +45 -0
- aurelian/agents/monarch/monarch_config.py +45 -0
- aurelian/agents/monarch/monarch_gradio.py +51 -0
- aurelian/agents/monarch/monarch_mcp.py +65 -0
- aurelian/agents/monarch/monarch_tools.py +112 -0
- aurelian/agents/oak/__init__.py +0 -0
- aurelian/agents/oak/oak_config.py +27 -0
- aurelian/agents/oak/oak_gradio.py +57 -0
- aurelian/agents/ontology_mapper/__init__.py +31 -0
- aurelian/agents/ontology_mapper/ontology_mapper_agent.py +57 -0
- aurelian/agents/ontology_mapper/ontology_mapper_config.py +50 -0
- aurelian/agents/ontology_mapper/ontology_mapper_evals.py +108 -0
- aurelian/agents/ontology_mapper/ontology_mapper_gradio.py +58 -0
- aurelian/agents/ontology_mapper/ontology_mapper_mcp.py +81 -0
- aurelian/agents/ontology_mapper/ontology_mapper_tools.py +147 -0
- aurelian/agents/paperqa/__init__.py +27 -0
- aurelian/agents/paperqa/paperqa_agent.py +66 -0
- aurelian/agents/paperqa/paperqa_cli.py +305 -0
- aurelian/agents/paperqa/paperqa_config.py +142 -0
- aurelian/agents/paperqa/paperqa_gradio.py +90 -0
- aurelian/agents/paperqa/paperqa_mcp.py +155 -0
- aurelian/agents/paperqa/paperqa_tools.py +566 -0
- aurelian/agents/phenopackets/__init__.py +3 -0
- aurelian/agents/phenopackets/phenopackets_agent.py +58 -0
- aurelian/agents/phenopackets/phenopackets_config.py +72 -0
- aurelian/agents/phenopackets/phenopackets_evals.py +99 -0
- aurelian/agents/phenopackets/phenopackets_gradio.py +55 -0
- aurelian/agents/phenopackets/phenopackets_mcp.py +178 -0
- aurelian/agents/phenopackets/phenopackets_tools.py +127 -0
- aurelian/agents/rag/__init__.py +40 -0
- aurelian/agents/rag/rag_agent.py +84 -0
- aurelian/agents/rag/rag_config.py +80 -0
- aurelian/agents/rag/rag_gradio.py +67 -0
- aurelian/agents/rag/rag_mcp.py +107 -0
- aurelian/agents/rag/rag_tools.py +189 -0
- aurelian/agents/rag_agent.py +54 -0
- aurelian/agents/robot/__init__.py +0 -0
- aurelian/agents/robot/assets/__init__.py +3 -0
- aurelian/agents/robot/assets/template.md +384 -0
- aurelian/agents/robot/robot_config.py +25 -0
- aurelian/agents/robot/robot_gradio.py +46 -0
- aurelian/agents/robot/robot_mcp.py +100 -0
- aurelian/agents/robot/robot_ontology_agent.py +139 -0
- aurelian/agents/robot/robot_tools.py +50 -0
- aurelian/agents/talisman/__init__.py +3 -0
- aurelian/agents/talisman/__main__.py +17 -0
- aurelian/agents/talisman/cli.py +70 -0
- aurelian/agents/talisman/run_talisman.py +18 -0
- aurelian/agents/talisman/talisman_agent.py +143 -0
- aurelian/agents/talisman/talisman_config.py +66 -0
- aurelian/agents/talisman/talisman_gradio.py +50 -0
- aurelian/agents/talisman/talisman_mcp.py +75 -0
- aurelian/agents/talisman/talisman_tools.py +962 -0
- aurelian/agents/ubergraph/__init__.py +40 -0
- aurelian/agents/ubergraph/ubergraph_agent.py +72 -0
- aurelian/agents/ubergraph/ubergraph_config.py +79 -0
- aurelian/agents/ubergraph/ubergraph_gradio.py +48 -0
- aurelian/agents/ubergraph/ubergraph_mcp.py +69 -0
- aurelian/agents/ubergraph/ubergraph_tools.py +118 -0
- aurelian/agents/uniprot/__init__.py +0 -0
- aurelian/agents/uniprot/uniprot_agent.py +43 -0
- aurelian/agents/uniprot/uniprot_config.py +43 -0
- aurelian/agents/uniprot/uniprot_evals.py +99 -0
- aurelian/agents/uniprot/uniprot_gradio.py +48 -0
- aurelian/agents/uniprot/uniprot_mcp.py +168 -0
- aurelian/agents/uniprot/uniprot_tools.py +136 -0
- aurelian/agents/web/__init__.py +0 -0
- aurelian/agents/web/web_config.py +27 -0
- aurelian/agents/web/web_gradio.py +48 -0
- aurelian/agents/web/web_mcp.py +50 -0
- aurelian/agents/web/web_tools.py +121 -0
- aurelian/chat.py +23 -0
- aurelian/cli.py +1004 -0
- aurelian/dependencies/__init__.py +0 -0
- aurelian/dependencies/workdir.py +78 -0
- aurelian/evaluators/model.py +9 -0
- aurelian/evaluators/substring_evaluator.py +30 -0
- aurelian/mcp/__init__.py +0 -0
- aurelian/mcp/amigo_mcp_test.py +86 -0
- aurelian/mcp/config_generator.py +123 -0
- aurelian/mcp/example_config.json +43 -0
- aurelian/mcp/generate_sample_config.py +37 -0
- aurelian/mcp/gocam_mcp_test.py +126 -0
- aurelian/mcp/linkml_mcp_tools.py +190 -0
- aurelian/mcp/mcp_discovery.py +87 -0
- aurelian/mcp/mcp_test.py +31 -0
- aurelian/mcp/phenopackets_mcp_test.py +103 -0
- aurelian/tools/__init__.py +0 -0
- aurelian/tools/web/__init__.py +0 -0
- aurelian/tools/web/url_download.py +51 -0
- aurelian/utils/__init__.py +0 -0
- aurelian/utils/async_utils.py +18 -0
- aurelian/utils/data_utils.py +32 -0
- aurelian/utils/documentation_manager.py +59 -0
- aurelian/utils/doi_fetcher.py +238 -0
- aurelian/utils/ontology_utils.py +68 -0
- aurelian/utils/pdf_fetcher.py +23 -0
- aurelian/utils/process_logs.py +100 -0
- aurelian/utils/pubmed_utils.py +238 -0
- aurelian/utils/pytest_report_to_markdown.py +67 -0
- aurelian/utils/robot_ontology_utils.py +112 -0
- aurelian/utils/search_utils.py +95 -0
- aurelian-0.1.0.dist-info/LICENSE +22 -0
- aurelian-0.1.0.dist-info/METADATA +109 -0
- aurelian-0.1.0.dist-info/RECORD +266 -0
- aurelian-0.1.0.dist-info/WHEEL +4 -0
- 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
|
+
[](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
|
+
|