- Install Docker and Docker Compose.
- Copy the root environment template and adjust credentials if needed:
cp .env.example .env
- Start the stack from the repository root:
The Flask application listens on
docker compose up --build
http://localhost:50505, PostgreSQL onlocalhost:5433.
- Copy the script-specific environment file:
cp scripts/.env.example scripts/.env
- Create a dedicated virtual environment for the script utilities:
python -m venv .venv source .venv/bin/activate - Install the script dependencies:
python -m pip install -r scripts/requirements.txt
- Run utilities from the repository root:
python scripts/interop_utils.py --list python scripts/interop_utils.py --ingest-bulk
The --list flag prints the current registry contents. --ingest-bulk ingests all gene and strain entities using the configuration defined in scripts/.env.
- If your tables were dropped or you are starting fresh, you can (re)create the schema and seed lookup rows with:
This command creates all tables and seeds the
python scripts/interop_utils.py --init-db
entitytable (gene,strain) and thesource_dbtable (Bigg,ALEdb,PMKbase,Pankb). It is idempotent and safe to run multiple times.
- How does ingest work?
scripts/utils/ingest.pyreads anentitieslist and upserts rows intoregistryandmapping, generating stable UIDs (G-for genes,S-for strains). It deduplicates per(source_db, entity_type, local_id)and writes toaudit_log.
- How are synonyms added for NCBI assemblies (sequence IDs)?
- For ALEdb strains, ingest calls
fetch_ncbi_assembliesinscripts/utils/ncbi_assemblies.pyand stores returned assembly accessions as synonyms for the strain’s UID.
- For ALEdb strains, ingest calls
- How are synonyms added for NCBI Gene and UniProt?
- When an entity includes both
gene_idandstrain_id, ingest callsfetch_ncbi_gene_synonymsandfetch_uniprot_id(seescripts/utils/ncbi_assemblies.pyandscripts/utils/uniprot.py). New values are inserted intosynonymsand logged as “Added synonym …”.
- When an entity includes both
- Will existing synonyms be logged again?
- No. Existing (uid, synonym) pairs are skipped to keep inserts and audit entries idempotent.
- Can I remove specific synonyms later?
- Yes. Use cleanup with a
synonymssection to remove targeted (uid, synonym) pairs. Seescripts/examples/example_cleanup.jsonandscripts/utils/cleanup.py.
- Yes. Use cleanup with a
- Run all backend tests:
Ensure your
python3 -m pytest src/backend/tests
.envpoints to a reachable Postgres if tests touch the DB.
GET /<resource>/<local_id_or_uid>
Returns the registry entry for a gene or strain using either its local identifier or UID. Valid resources aregeneandstrain.GET /pair/<gene_id,strain_id>
Retrieves the combined interoperability payload for a specific gene/strain pair.GET /
Renders the HTML dashboard summarizing recent mappings and search results.
Generate and view the auto-documented backend API reference:
- Install dev deps (includes Sphinx):
pip install -r requirements-dev.txt - Build HTML docs:
make -C docs html - Open
docs/_build/html/index.htmlin a browser to view
- Log in:
azd login - Deploy:
azd up - When prompted, select resource group
rg-recon-dbinterop. - The terminal shows a deployment status link; follow it to track success/failure.
- After code changes, rerun
azd upto redeploy.