Add ClinicalxCRAFT: LLM-orchestrated cohort investigator over TCGA data - #3
Open
nitchakorn wants to merge 7 commits into
Open
Add ClinicalxCRAFT: LLM-orchestrated cohort investigator over TCGA data#3nitchakorn wants to merge 7 commits into
nitchakorn wants to merge 7 commits into
Conversation
Lets clinicians ask free-text questions about a cancer cohort and watch an agent investigate it via CRAFT MCP (schema discovery, NL-to-SQL, execution) — zero hand-written SQL anywhere. Ships two entrypoints: a free-text investigator (app.py) and a dashboard version (app_dashboard.py) that opens on a live cohort snapshot plus an embedded per-patient specimen ledger before taking a scoped follow-up question. Cohort is KIRC (kidney renal clear cell carcinoma), the deepest-covered cohort in the Pan-Cancer Atlas. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TjFkCejVPKEfT1u9gLwCTG
The per-patient table (imaging links, mutations, protein, purity) is the useful thing to see first, not the aggregate bar-chart snapshot — that's now collapsed into an expander below, still used as context for follow-up questions. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TjFkCejVPKEfT1u9gLwCTG
Enables a public Streamlit Community Cloud deployment: no shell env and no browser reachable from a hosted server for the interactive CRAFT OAuth callback, so both get bootstrapped from st.secrets at startup instead. Falls back silently to local env vars / token cache file when no secrets.toml exists (local dev, unchanged). Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TjFkCejVPKEfT1u9gLwCTG
Author
asyncio TaskGroups (used internally by the mcp SDK's streamable HTTP transport) wrap failures in an ExceptionGroup — str(e) on those only says "unhandled errors in a TaskGroup (N sub-exception)", hiding what actually failed. Recurse into .exceptions and also show the full traceback so a failed connection is debuggable from the deployed app itself. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TjFkCejVPKEfT1u9gLwCTG
BUILD_YOUR_OWN_COHORT.md gives clinicians a copy-paste Claude Code prompt that re-derives coverage numbers and driver genes for a new TCGA cohort from scratch (no assumptions carried over from KIRC) and rebuilds the dashboard + specimen ledger against real query results. Linked from the README. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TjFkCejVPKEfT1u9gLwCTG
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
app.py(free-text investigator) andapp_dashboard.py(opens on a live cohort snapshot + embedded per-patient specimen ledger, then takes a scoped follow-up question).Test plan
py_compilepasses on all modulesstreamlit run apps/clinicalq/app_dashboard.pywithNEBIUS_API_KEYset and CRAFT OAuth configuredhttps://claude.ai/code/session_01TjFkCejVPKEfT1u9gLwCTG