-
Notifications
You must be signed in to change notification settings - Fork 0
Web Interface
RareSim includes a browser-based interface for running patient diagnosis interactively. It consists of a Vue 3 frontend and a FastAPI backend.
Terminal 1 — backend:
Create a .env file at the project root with RARESIM_ROOT=/path/to/RareSim (see Installation), then:
```bash
uvicorn raresim_api.main:app --reload --port 8000
```
Terminal 2 — frontend:
```bash
cd packages/raresim-frontend
npm install
npm run dev
```
Then open http://localhost:3000.
The left panel handles patient input and method selection.
A searchbar at the top lets you find HPO terms by name (e.g. typing "ataxia" returns all matching phenotypes). Each result has two buttons:
- + Include — adds the term to the patient's HPO term list
- − Exclude — marks the term as excluded; excluded terms are filtered out before diagnosis runs
Excluded terms are sent to the backend as excluded_hpo_terms and removed from the patient's HPO set before any similarity method runs.
-
HPO Terms — paste HPO IDs directly (e.g.
HP:0001251, HP:0000545). Terms are parsed and displayed as tags. - Raw Text — paste clinical notes. Use the Extract bar to map text to HPO terms via dictionary lookup, FastHPOCR, GPT-4o-mini, PhenoBrain, or BioNER.
Select one or more methods to run. Available methods:
| Method | Badge | Notes |
|---|---|---|
| Resnik BMA | IC | Semantic similarity using information content |
| Lin BMA | IC | Lin's normalized semantic similarity |
| JC BMA | IC | Jiang-Conrath semantic similarity |
| Jaccard | set | Set overlap: intersection / union |
| Dice | set | Set overlap: 2 × intersection / (A + B) |
| TF-IDF (HPO) | txt | TF-IDF over HPO term presence — HPO-terms mode only |
| TF-IDF (HPO Labels) | txt | TF-IDF over HPO label text — HPO-terms mode only |
| TF-IDF (Text) | txt | TF-IDF over raw clinical text — raw-text mode only |
| TF-IDF (Hybrid) | txt | Patient HPO labels vs. disease description — both modes |
| Transformer | emb | Sentence transformer embeddings |
| LLM | llm | GPT-based ranking |
| HPO2Vec+ | emb | Node2Vec embeddings on enriched HPO graph |
| Autoencoder | nn | Denoising autoencoder latent space similarity. |
Slider to control how many results are returned per method (5, 10, 15, or 20).
The right panel shows diagnosis results after running.
When multiple methods are selected, filter buttons appear above the results list —> one per method plus an "All" option. Clicking a method shows only that method's top-K results
Each card shows:
- Rank, disease label, disease ID
- Method used (shown as a badge)
- Score with a visual bar
- Expandable detail section with shared phenotypes and top term matches
After running a diagnosis, click Save Patient to save the session to disk. Choose the format before saving:
- JSON — saves HPO terms, raw text, methods used, and full results
- Phenopacket — saves HPO terms in GA4GH phenopacket format with results in metadata
Files are saved to outputs/webapp/patient_profiles/ and can be retrieved via GET /api/patients.
| Method | Path | Description |
|---|---|---|
| POST | /api/extract |
Extract HPO terms from clinical text |
| POST | /api/diagnose |
Run similarity diagnosis |
| GET | /api/hpo/search?q= |
Search HPO terms by label |
| POST | /api/patients/save |
Save patient session to disk |
| GET | /api/health |
Health check |
Getting Started
Web Interface (Frontend)
Project Overview
Similarity Methods
Validation Tools
Evaluate RareSim methods
- Evaluation Workflow Overview
- Batch Runners and Shared Utilities
- Evaluation Cache Format
- Evaluator and Metrics
- Adding a New Evaluation Method
Ontology Scripts
Datasets
TODO
Shared Artifact Generation
- Shared Artifact Overview
- Raw Sources and Ontology Loading
- Disease ID Normalization and Mapping
- Disease Profile Construction
- Artifact File Reference and Runtime Loading
- Full Artifact Workflow