Skip to content

Commit 92b195f

Browse files
JDRomano2claude
andcommitted
Add Docker Compose infrastructure, fix API for Memgraph, add ista mapping config
- Fix API bugs: missing lodash import, _whereTemplate naming, hardcoded IPs - Replace Neo4j APOC calls with Memgraph-compatible schema introspection - Make DB connection env-driven (COMPTOX_AI_DATABASE_URL) - Add read-only Bolt proxy (Go) for public Memgraph Lab access - Add Docker Compose stack: Memgraph, bolt-proxy, API, Lab, Caddy - Add Caddy reverse proxy config with auto-TLS for api/lab subdomains - Add EC2 setup script and static site deploy script - Add GitHub Actions workflow for S3/CloudFront site deployment - Update Python GraphDB to use bolt:// URI scheme for Memgraph - Add ista YAML mapping config translating all 31 db.py parse calls - Add TODO.md for remaining preprocessing tasks Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 4d9163e commit 92b195f

26 files changed

+1410
-71
lines changed

.github/workflows/deploy-site.yml

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
name: Deploy Site
2+
3+
on:
4+
push:
5+
branches: [master]
6+
paths:
7+
- 'docs/**'
8+
- 'web/packages/app/**'
9+
10+
permissions:
11+
id-token: write
12+
contents: read
13+
14+
jobs:
15+
deploy:
16+
runs-on: ubuntu-latest
17+
steps:
18+
- uses: actions/checkout@v4
19+
20+
- name: Set up Python
21+
uses: actions/setup-python@v5
22+
with:
23+
python-version: '3.11'
24+
25+
- name: Set up Node
26+
uses: actions/setup-node@v4
27+
with:
28+
node-version: '20'
29+
30+
- name: Install Sphinx dependencies
31+
run: |
32+
pip install -r docs/requirements.txt 2>/dev/null || pip install sphinx sphinx-rtd-theme
33+
34+
- name: Build Sphinx docs
35+
run: make -C docs html
36+
37+
- name: Build React app
38+
working-directory: web/packages/app
39+
run: |
40+
npm ci
41+
npm run build
42+
43+
- name: Merge React app into docs
44+
run: |
45+
mkdir -p docs/build/html/browse
46+
cp -r web/packages/app/build/* docs/build/html/browse/
47+
48+
- name: Configure AWS credentials
49+
uses: aws-actions/configure-aws-credentials@v4
50+
with:
51+
role-to-assume: ${{ secrets.AWS_DEPLOY_ROLE_ARN }}
52+
aws-region: us-east-1
53+
54+
- name: Sync to S3
55+
run: aws s3 sync docs/build/html s3://${{ secrets.S3_BUCKET }} --delete
56+
57+
- name: Invalidate CloudFront
58+
if: ${{ secrets.CLOUDFRONT_DIST_ID != '' }}
59+
run: |
60+
aws cloudfront create-invalidation \
61+
--distribution-id ${{ secrets.CLOUDFRONT_DIST_ID }} \
62+
--paths "/*"

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,4 +106,6 @@ scripts/pfhxs
106106
node_modules
107107
build
108108

109+
web/packages/api/.env
110+
109111
docs/build/html/

CONFIG-default.yaml

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,14 @@
11
---
22
# Default configuration for ComptoxAI
3-
neo4j:
4-
username: neo4j
5-
password: neo4j
3+
database:
4+
username: ""
5+
password: ""
66
hostname: localhost
77
protocol: bolt
88
port: 7687
99

10-
mysql:
11-
user:
12-
passwd:
13-
host:
14-
1510
data:
16-
prefix: D:\data\
17-
tempdir: D:\data\comptox_ai\
11+
prefix: /data/
12+
tempdir: /tmp/comptox_ai/
1813

19-
...
14+
...

TODO.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# ComptoxAI TODO
2+
3+
## ista mapping preprocessing tasks
4+
5+
### 1. NCBI Gene `dbXrefs` compound field preprocessing
6+
The `Homo_sapiens.gene_info` file has a `dbXrefs` column containing pipe-delimited key-value pairs (e.g. `MIM:603369|HGNC:HGNC:1789|Ensembl:ENSG00000123080`). The ista YAML format doesn't support compound field splitting natively. Write a preprocessing script (`comptox_ai/build/scripts/preprocess_ncbi_gene.py`) that reads the TSV and adds separate `MIM`, `HGNC`, and `Ensembl` columns. Then uncomment the three xref property lines in `comptox_ai/build/comptox_mapping.yaml` under the Gene entity_type.
7+
8+
### 2. MolecularInitiatingEvent / AdverseOutcome `append_class`
9+
The original `db.py` adds MolecularInitiatingEvent and AdverseOutcome as additional OWL class assertions on existing KeyEvent individuals (`append_class=True`). The ista YAML `mode: enrich` adds data properties but may not add class assertions. If ista doesn't support this, run these Cypher queries against Memgraph after `owl2memgraph` import:
10+
11+
```cypher
12+
// Get MIE event IDs from aopdb.event_info WHERE event_type = 'molecular-initiating-event'
13+
MATCH (n:KeyEvent) WHERE n.xrefAOPWikiKEID IN [<MIE event_ids>]
14+
SET n:MolecularInitiatingEvent;
15+
16+
// Get AO event IDs from aopdb.event_info WHERE event_type = 'adverse-outcome'
17+
MATCH (n:KeyEvent) WHERE n.xrefAOPWikiKEID IN [<AO event_ids>]
18+
SET n:AdverseOutcome;
19+
```
20+
21+
### 3. AOP-DB `keIncludedInAOP` multi-value field expansion
22+
The `event_info` table's `AOP_ids` column contains `"; "`-delimited lists of AOP IDs per KeyEvent row (e.g. `"12; 45; 78"`). If ista doesn't auto-expand multi-value fields during relationship mapping, write a preprocessing step or custom SQL view that explodes each row into one `(event_id, AOP_id)` pair per row before the relationship mapping runs.

0 commit comments

Comments
 (0)