Skip to content

ProteinStructureView improvements#700

Open
davereinhart wants to merge 3 commits into
release-2026.2.5from
davereinhart/proteinstructureview-improvements
Open

ProteinStructureView improvements#700
davereinhart wants to merge 3 commits into
release-2026.2.5from
davereinhart/proteinstructureview-improvements

Conversation

@davereinhart

Copy link
Copy Markdown
Contributor

This pull request refactors and enhances the ProteinStructureView component to support viewing protein structures beyond just AlphaFold, including experimental and template models from PDBe and SWISS-MODEL via 3D-Beacons. The structure selection logic is improved, and the UI is updated to allow users to choose among overlapping models. Additionally, the display of the protein structure button in ScoreSetView is now conditional on the presence of mapped variants.

Protein structure viewer enhancements:

  • Refactored ProteinStructureView.vue to support multiple structure sources (AlphaFold, PDBe, SWISS-MODEL) using 3D-Beacons, with logic to fetch, filter, and select structures covering the scored residues. The UI now includes a segment selector when multiple or partial models are available, and the coloring logic is generalized to all structure types. [1] [2] [3] [4] [5] [6] [7] [8]

Improved UI logic:

  • The "Protein Structure" button in ScoreSetView.vue is now only shown when mapped variants are present and a UniProt ID is available, preventing display when no structure visualization is possible. [1] [2]

These changes provide more robust and flexible protein structure visualization, supporting a wider range of use cases and improving the user experience.

Some existing scoresets useful for testing these changes:

  • urn:mavedb:00000730-a-1
  • urn:mavedb:00001167-a-1
  • urn:mavedb:00000688-a-1

Query the AlphaFold prediction API with the UniProt ID directly instead of
first fetching the UniProt XML entry, parsing out AlphaFoldDB references, and
having the user select one. This removes the AlphaFold ID dropdown and its
supporting state.
- Drop fetchUniprotData, the alphaFoldData computed property, and the
  alphaFoldData/selectedAlphaFold watchers; the uniprotId watcher now renders
  the viewer directly.
- fetchAlphaFoldCifUrl and render key off uniprotId; the model is matched by
  entryId AF-<uniprotId>-F1 to disambiguate multi-entry responses (e.g. P42167).
- Remove now-unused jquery, FloatLabel, and Select imports and the
  uniprotData/selectedAlphaFold data fields.# Please enter the commit message for your changes. Lines starting
The viewer assumed a single canonical AlphaFold model (AF-<id>-F1), which
does not exist for proteins over ~2700 aa, so those score sets rendered no
structure (and silently errored).
When no canonical AlphaFold model is available, fetch experimental (PDBe)
and template (SWISS-MODEL) structures from 3D-Beacons and let the user switch
between the covering segments via a dropdown. Normal-length proteins keep
loading their single AlphaFold model as before.
- Overlay heatmap scores on every structure: canonical-numbered models
  (AlphaFold, SWISS-MODEL) directly, and PDBe experimental structures via
  their SIFTS UniProt mapping (uniprot_accession selection). Always apply the
  selection with nonSelectedColor so molstar's per-chain default never shows.
- Default to the structure that best covers the scored residues, and re-pick
  when score data arrives after the structures load.
- Map clicked-residue events back to canonical UniProt positions (unp_seq_id)
  so clicking a residue selects and scrolls to the matching heatmap column on
  SIFTS-mapped structures.
- Contain the dropdown overlay's scroll (overscroll-behavior) so it no longer
  chains into the molstar viewer, and dispose the previous molstar plugin when
  switching structures.
- Offer only structures overlapping the assayed residues, and always show the
  segment selector for fragment structures (hidden only for a single
  full-length AlphaFold model).
@coveralls

Copy link
Copy Markdown

Coverage Status

coverage: 2.596%. remained the same — davereinhart/proteinstructureview-improvements into release-2026.2.5

@davereinhart davereinhart linked an issue Jul 9, 2026 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Handle protein fragments in the structure viewer.

2 participants