Interactive NiceGUI oncology annotation platform for reviewing LLM-extracted progression events and systemic therapy timelines.
Project description
WATNEY 6
Interactive Oncology Annotation Platform
WATNEY is a browser-based tool for reviewing and annotating LLM-extracted oncology progression events from longitudinal clinical notes. It runs locally, stores all annotations in a per-project SQLite database, and is designed for multi-user annotation workflows in oncology research.
Developed by Justin Vinh at Dana-Farber Cancer Institute.
Features
- Project system — each cohort lives in its own folder with its own database, extraction files, exports, and checkpoints
- Extraction versioning — load multiple extraction CSVs into one project and switch between them from a dropdown; annotations persist across switches
- Automatic checkpoints — DB snapshots saved on a configurable interval (default 30 min); manual checkpoint available in Settings
- Side-by-side review of LLM-extracted progression events and full source clinical notes
- Click Source on any progression card to jump to and highlight the supporting evidence in the right panel
- Agent Intervals box with Start source / End source buttons linking directly to treatment date evidence in the notes
- Progression card highlighting — cards are highlighted in amber when the selected agent matches the
treatment_plan_at_timefield, surfacing the most likely progression event for that agent - Progression Summary table — shows all assigned events (date, agent, start/end, source, annotator, extraction version); updates immediately on save or remove
- Soft-delete — × button on each Progression Summary row deletes the annotation while preserving the record for audit; excluded from exports
- Assign agents to progression events with auto-populated start/end dates (editable; blur to auto-format to
YYYY-MM-DD) - No End Date — records
NAfor agents without a confirmed end date - Add clinician-derived progression events manually; custom agent names supported; optional agent discontinuation note (preset reasons or free text)
- NO PROGRESSION — records
NAprogression date for patients with confirmed no-progression - Undo the last annotation for any patient
- NLP drug search — Cmd/Ctrl-F (or Search button) expands drug names to all known aliases; click NLP to toggle
- Resizable panels — drag the center divider to redistribute left/right panel widths
- Sticky note header — note metadata pins to the top of the right panel while scrolling
- Extraction data viewer — collapsible tree view of the full LLM extraction JSON
- Exclude / un-exclude patients with required reason; excluded patients show a red banner
- Arrow key navigation between patients; patient list dialog with annotation status
- Import annotations from a prior export CSV or another project's
annotations.db - Multi-user support with per-session usernames and logout
- Export annotations to a timestamped CSV (also auto-saved to the project
exports/folder) - Demo mode — 3 synthetic oncology patients, fully isolated in-memory database, nothing written to disk
- Interactive tutorial — 14-step guided walkthrough, launches automatically in demo mode
- Multi-instance warning if more than one browser tab is open
- In-app update checker and one-click update from PyPI (Settings → Check for updates)
Installation
pip install watney
Dependencies installed automatically: nicegui, pandas, numpy, orjson, json-repair, pydantic, python-dateutil, requests.
Launching
watney
Opens the application in your browser at http://localhost:8080.
First-Time Setup
- Enter your name on the login screen
- Click + New Project and provide:
- A project name
- A folder path (will be created)
- The path to your extraction CSV
- WATNEY creates the project folder and opens it — subsequent logins jump straight back in via the recent projects list
To open an existing project, select it from Recent projects or type the folder path directly.
Project Folder Structure
MyProject/
├── project.json # project metadata and settings
├── annotations.db # annotation SQLite database
├── patients.db # patient exclusion tracking
├── extractions/ # copies of all loaded extraction CSVs
├── exports/ # timestamped export CSVs
└── checkpoints/ # automatic DB snapshots (up to 20 kept)
Global config (font size, recent projects, search behavior) is stored at:
~/.watney/config.json
Required Input Format
WATNEY expects a CSV with these three columns:
| Column | Description |
|---|---|
DFCI_MRN |
Patient identifier |
all_notes |
Concatenated longitudinal clinical notes |
generation |
LLM-extracted JSON (see schema below) |
Note Format
Notes within all_notes must be separated by a line of at least 20 = characters, with metadata headers:
Note Number: 1
Note Report ID: RPT001
Note Date: 2024-01-15
Note Dept: Neuro-Oncology
Note Author: Dr. Smith
[note text here]
====================
Note Number: 2
Note Report ID: RPT002
...
JSON Schema (generation column)
The fields WATNEY reads from:
{
"systemic_therapy": {
"agents": [
{
"drug_name": "Temozolomide",
"intervals": [
{
"start_date": "2023-01-01",
"start_date_rationale": {
"text": "initiated temozolomide 150 mg/m2",
"report_id": "RPT001"
},
"end_date": "2023-06-01",
"end_date_rationale": {
"text": "discontinued due to progression",
"report_id": "RPT004"
}
}
]
}
]
},
"progression": {
"progression_events": [
{
"progression_date": "2023-06-15",
"confidence_level": "high",
"treatment_plan_at_time": "Temozolomide",
"progression_date_rationale": {
"text": "new enhancing lesion at resection margin",
"report_id": "RPT005",
"note_date": "2023-06-15",
"author": "Dr. Smith"
}
}
]
}
}
Evidence text in text fields should be verbatim quotes from the corresponding note — this is what gets highlighted yellow when you click Source. Use ... or … to join non-contiguous passages from the same note; each segment is highlighted separately.
Workflow
1. Navigate patients
| Control | Action |
|---|---|
| Prev / Next buttons | Move between patients |
| ← → arrow keys | Move between patients |
| Patients button | Patient list dialog — see annotation status; jump to any patient |
2. Review Agent Intervals
Select an agent from the Agent Intervals dropdown to see its treatment intervals. Each interval row shows:
- Start date → End date
- Start source — jumps to and highlights the supporting note for the start date
- End source — jumps to and highlights the supporting note for the end date
3. Identify the progression event
Progression cards are highlighted in amber when the currently selected agent matches the treatment_plan_at_time field. A notice above the cards reads:
▶ Highlighted card: likely progression event for [Agent]
4. Assign an agent to a progression event
In each progression card:
- Select the responsible agent from the dropdown
- Review the auto-populated Start date and End date from the LLM extraction
- Edit either date if needed — blur the field to auto-format to
YYYY-MM-DD; click No End Date to recordNA - Click Save Agent Assignment
The Progression Summary table updates immediately.
5. Source navigation
Click Source on any progression card to scroll the right panel to the supporting note and highlight the evidence text. The search bar grays out while source highlight is active — click it to resume search.
6. Add clinician progression events
Use the form at the bottom of the left panel to manually record:
- Agent (required); add a custom agent name with the Add button
- Agent note — optional discontinuation reason; choose from a preset list or select Other and type free text; click No Note to clear
- Progression Date (required, auto-formats to YYYY-MM-DD); click NO PROGRESSION to record
NA - Agent Start date and End date (auto-filled from LLM data when you pick an agent)
- Supporting evidence and Report ID
- Who determined the progression
7. Exclude a patient
Click Exclude Patient near the patient header. A dialog asks for a required reason. Excluded patients show a red banner and their MRN is flagged in exports. Click Un-exclude Patient and provide a reason to reverse.
8. Remove or undo
- Remove Agent — clears the assignment from a specific card; Progression Summary updates immediately
- × button on a Progression Summary row — soft-deletes that annotation (preserved for audit, excluded from exports)
- Undo (nav bar) — hard-deletes the most recently modified annotation for the current patient
9. Export
Click Export in the nav bar to download all annotations as a timestamped CSV. The file is also saved to the project exports/ folder automatically. In demo mode, only demo annotations are exported — your real database is never touched.
10. Logout
Click Logout (top-right of the left panel) to return to the login screen. Demo annotations are permanently discarded on logout.
Demo Mode
Click Try Demo on the login screen to explore WATNEY with 3 synthetic oncology patients:
| Patient | Diagnosis | Agents | Progression Events |
|---|---|---|---|
| D000001 | NSCLC, EGFR exon 19 del | erlotinib → osimertinib | 2 |
| D000002 | DLBCL, GCB subtype | R-CHOP → R-ICE → liso-cel | 2 |
| D000003 | HR+/HER2− metastatic breast cancer | palbociclib + letrozole → abemaciclib + fulvestrant → everolimus + exemestane | 2 |
Demo annotations are stored in an isolated in-memory database and permanently discarded on logout. Nothing is written to your real project database.
Tutorial
Click Tutorial + Demo on the login screen to launch demo mode with a 14-step interactive walkthrough. Steps are navigated with Back / Next buttons or by clicking the dot indicators. Steps that reference a specific UI element will highlight it in the main interface.
Settings
Open Settings from the nav bar to:
- Report Text Size — font size slider (8–20 px), applied immediately
- Search Behavior — toggle whether Cmd/Ctrl-F opens the WATNEY search bar or the browser's native find
- Project — rename the project; view the annotations DB path
- Checkpoints — adjust the auto-checkpoint interval; trigger a manual checkpoint immediately; view last checkpoint timestamp
- Extractions — see all loaded extraction versions; load a new extraction CSV
- Import Annotations — import from a prior export CSV or another project's
annotations.db - Legacy Migration — migrate data from an old-style
watney_annotations/folder into a new project - Updates — check PyPI for a newer version; one-click update and restart prompt
- Annotation Stats — total annotations, unique patients, LLM-sourced vs clinician-sourced counts
Settings can be toggled closed by clicking the Settings button again.
Annotation Database
Each project stores two SQLite databases:
annotations.db — all progression event annotations
| Column | Description |
|---|---|
DFCI_MRN |
Patient identifier |
progression_date |
Date of the progression event |
progression_source |
LLM, manual, or exclusion_placeholder |
agent |
Assigned therapeutic agent |
agent_start |
Agent start date |
agent_start_source |
LLM or manual |
agent_end |
Agent end date |
agent_end_source |
LLM or manual |
evidence |
Supporting text from the note |
report_id |
Source note report ID |
determined_by |
Who determined the event (clinician entries) |
user |
Annotator username |
modification_timestamp |
ISO timestamp of last change |
extraction_version |
Filename of the extraction CSV the event came from |
deleted |
1 if soft-deleted; excluded from exports and summary |
deletion_reason |
Required reason entered at soft-delete time |
deletion_timestamp |
ISO timestamp of soft-delete |
import_source |
Filename of the import source (imported rows only) |
exclusion_flag |
True if patient excluded (legacy / demo fallback only) |
exclusion_reason |
Reason for exclusion (legacy / demo fallback only) |
unexclusion_reason |
Reason for un-exclusion (legacy / demo fallback only) |
agent_note |
Discontinuation reason for the agent (clinician entries); NA if not set |
patients.db — one row per patient; used for exclusion tracking in project mode
| Column | Description |
|---|---|
DFCI_MRN |
Patient identifier |
date_added |
When the patient was first loaded |
exclusion_flag |
True if excluded |
exclusion_reason |
Reason for exclusion |
excluded_by |
Username who excluded |
excluded_at |
ISO timestamp of exclusion |
unexclusion_reason |
Reason for un-exclusion |
unexcluded_by |
Username who un-excluded |
unexcluded_at |
ISO timestamp of un-exclusion |
Multiple Browser Tabs
If more than one browser tab connects to the WATNEY server simultaneously, a warning banner appears on the login screen. Multiple active sessions sharing a single server can cause unexpected UI behavior — close any extra tabs before annotating.
Citation
Justin Vinh. WATNEY: Interactive Oncology Annotation Platform.
https://github.com/justin-vinh/watney
License
MIT License
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file watney-6.1.1.tar.gz.
File metadata
- Download URL: watney-6.1.1.tar.gz
- Upload date:
- Size: 163.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
474175bcedb40afe1409deb0ff9e2bd79dc67e816867f3b661af0ccd67e6849f
|
|
| MD5 |
fdb7b49429064dc602562d0224d8714f
|
|
| BLAKE2b-256 |
3c42c6c66068f724b81349eccb0541f5a0708bf82323d33b49139f391ac04104
|
Provenance
The following attestation bundles were made for watney-6.1.1.tar.gz:
Publisher:
publish.yml on justin-vinh/watney_project
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
watney-6.1.1.tar.gz -
Subject digest:
474175bcedb40afe1409deb0ff9e2bd79dc67e816867f3b661af0ccd67e6849f - Sigstore transparency entry: 1913501970
- Sigstore integration time:
-
Permalink:
justin-vinh/watney_project@ec5f79cc217b77024759e7c9b11b303ff15ac007 -
Branch / Tag:
refs/tags/v6.1.1 - Owner: https://github.com/justin-vinh
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@ec5f79cc217b77024759e7c9b11b303ff15ac007 -
Trigger Event:
push
-
Statement type:
File details
Details for the file watney-6.1.1-py3-none-any.whl.
File metadata
- Download URL: watney-6.1.1-py3-none-any.whl
- Upload date:
- Size: 167.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f0bb573a6dc7ce1f57caf6ff3caf6cd0e9bc4b58e8f55b373cfca54812f7b32b
|
|
| MD5 |
94912d69cba3967b7d4e012451e88742
|
|
| BLAKE2b-256 |
eec348ca824d8dce63dd28247dcbb44babec40181b83958c676e4bc303e9b0bb
|
Provenance
The following attestation bundles were made for watney-6.1.1-py3-none-any.whl:
Publisher:
publish.yml on justin-vinh/watney_project
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
watney-6.1.1-py3-none-any.whl -
Subject digest:
f0bb573a6dc7ce1f57caf6ff3caf6cd0e9bc4b58e8f55b373cfca54812f7b32b - Sigstore transparency entry: 1913502153
- Sigstore integration time:
-
Permalink:
justin-vinh/watney_project@ec5f79cc217b77024759e7c9b11b303ff15ac007 -
Branch / Tag:
refs/tags/v6.1.1 - Owner: https://github.com/justin-vinh
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@ec5f79cc217b77024759e7c9b11b303ff15ac007 -
Trigger Event:
push
-
Statement type: