Repository navigation
GO enrichment of proteins selected in the Viewer - #150
t0mdavid-m wants to merge 14 commits into
Conversation
A GO enrichment cell (Layout Manager, Functional analysis) tests the GO terms of the proteins selected in a run: check boxes in the protein, proteoform and PrSM tables, or a box or lasso on the proteoform heatmap. In a comparison it tests the entries selected on the volcano plot (box, lasso, All changed, Higher, Lower), the comparison table or the clustered heatmap, against all tested entries. GO terms come from MyGene.info and are cached per workspace. Builds openms-insight from claude/project-thread-pnhysh (multi_select). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FkEGenFwDY5phFgzqdmeFg
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FkEGenFwDY5phFgzqdmeFg
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FkEGenFwDY5phFgzqdmeFg
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars.
|
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FkEGenFwDY5phFgzqdmeFg
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FkEGenFwDY5phFgzqdmeFg
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FkEGenFwDY5phFgzqdmeFg
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FkEGenFwDY5phFgzqdmeFg
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FkEGenFwDY5phFgzqdmeFg
Streamlit draws the checkbox input at 0x0, so a forced click on it fails with "Element is outside of the viewport" (also on develop). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FkEGenFwDY5phFgzqdmeFg
|
The desktop end-to-end test failed in 255a802 makes the scenario click the checkbox's label instead. Checked locally against the Describe experiment page: the old click fails with the same error, and the label click toggles the box off and back on. Generated by Claude Code |
The Run page keeps the previous run's "Workflow completed successfully." until the new run shows as running, so the second (identification) run was taken as finished right after Start. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FkEGenFwDY5phFgzqdmeFg
|
With the checkbox fix in, the e2e scenario now gets further, to the second (identification) run, and fails there: This PR did not cause it either. Until now the scenario never reached this step. The Run page keeps showing the previous run's "Workflow completed successfully." until the new run shows as running, so a026359 makes the scenario wait for the Stop Workflow button of the new run, for up to 60 s, before it waits for the result. Generated by Claude Code |
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FkEGenFwDY5phFgzqdmeFg
The Run page rerenders every second while a run is going and kept the previous run's "Workflow completed successfully." on screen, so the identification run was read as finished after its first seconds. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FkEGenFwDY5phFgzqdmeFg
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FkEGenFwDY5phFgzqdmeFg
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FkEGenFwDY5phFgzqdmeFg
Requested by Tom · project thread
What changes
The Layout Manager has a new GO enrichment component, in the new group Functional analysis, for every identification run and for comparisons. It tests which Gene Ontology terms are over-represented in a selection of proteins (biological process, cellular component, molecular function). It shows a bar chart of the most significant terms and an Insight table of all of them. A selector next to the category sets how many terms the chart shows (10, 15, 20, 30 or 50).
In a run (identification on), proteins are selected in the other components of the grid:
In a comparison, proteoforms (or proteins or features, depending on the level) are selected:
Shared behaviour
GO analysis
openms_insight.analysis.enrichment. It uses a one-sided Fisher's exact test with Benjamini-Hochberg correction per category.cache/go/annotations.json, so each protein is looked up once. Unknown proteins are retried after 30 days.mygeneis added torequirements.txt.Code
src/render/go_terms.py(Streamlit-free): the backgrounds, the selection mapping, the annotation cache and the enrichment.src/render/go_view.py: the cell.render.pyandquant_cells.pypassmulti_select=to the tables, the heatmaps and the volcano; the volcano also getsselection_presets=True.hierarchy_data.pynow carries the accession.tests/e2e/electron-workflows.js(desktop end-to-end test; it failed the same way on develop):openms-insight
claude/project-thread-hxjbbs.INSIGHT_REF=claude/project-thread-pnhysh. Set it back toclaude/project-thread-hxjbbsonce Fix openmp windows #41 merges.Screenshots
The screenshots use a synthetic workspace: real E. coli accessions, with made-up identifications and abundances (ribosomal proteins lower in heat, chaperones higher). The GO terms are real MyGene.info annotations.
Current selection styling. Run: box plus Shift-lasso on the proteoform heatmap (light, then dark):


Run: check boxes in the protein table, with the toggle to the right of the title:

Comparison: Higher in heat on the volcano and the clustered heatmap (light, then dark):


GO results, taken before the restyle. Comparison: Higher in heat, with the chart set to 20 terms (protein folding at the top):

Comparison: Lower in heat:

Video (recorded before the restyle, under 3 minutes): go-enrichment-selection.mp4
The media were committed and removed in the next commit, so the diff does not contain them.
Testing
pytest tests/: 594 passed, 5 skipped.tests/test_go_terms.pycovers accessions and labels, the run background, the comparison selection per level, the annotation cache (hits, retry of unknown proteins, network errors) and the term table.pylint --errors-onlyon the changed files: clean.streamlit run app.py local, in light and dark theme, as in the screenshots.🤖 Generated with Claude Code
https://claude.ai/code/session_01FkEGenFwDY5phFgzqdmeFg