Skip to content

Add experimental counterpart discovery for predicted models - #28

Merged
CedricHermansBIT merged 13 commits into
mainfrom
feature/experimental-counterpart-search
Oct 6, 2026
Merged

CedricHermansBIT merged 13 commits into
mainfrom
feature/experimental-counterpart-search

Conversation

@CedricHermansBIT

Copy link
Copy Markdown
Member

Adds a predicted-to-experimental workflow that closes the loop between model confidence and local conformational comparison.

Highlights:

  • searches experimental PDB polymer entities by the selected prediction-chain sequence using the public RCSB sequence service;
  • supports configurable minimum sequence identity (default 90%) and requests experimental results only;
  • enriches hits with chain, method, resolution and entry metadata from the RCSB Data API;
  • links each candidate to its current PDBe entry page for archive/validation context;
  • loads a selected candidate directly into RamplotR's existing Compare tab, preserving the query chain and preferring the matching experimental chain;
  • immediately hands the result to the Conformational Change Explorer rather than inventing a new prediction-vs-experiment quality score;
  • keeps the network layer client-side so the workflow remains compatible with normal Shiny and static Shinylive/webR deployments;
  • documents that sequence similarity does not imply identical functional state, ligand state or biological context;
  • mocks RCSB search/metadata responses in the end-to-end browser test for deterministic CI.

The selected amino-acid sequence is sent to the public RCSB sequence-search service only when the user explicitly runs the search.

@CedricHermansBIT
CedricHermansBIT marked this pull request as ready for review October 6, 2026 19:00
Copilot AI balanced review requested due to automatic review settings October 6, 2026 19:00
@CedricHermansBIT
CedricHermansBIT merged commit fbed2bf into main Oct 6, 2026
9 checks passed

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟡 Changes recommended

Sequence extraction, query-chain tracking and search-state handling can produce incorrect or misleading results.

Review effort: Balanced
Findings: 4 Medium severity

Open (4)
What changed in this PR

Adds experimental PDB counterpart discovery for predicted models, connecting sequence search to RamplotR’s existing Compare workflow.

Changes:

  • Adds client-side RCSB searches, candidate metadata and PDBe links.
  • Enables direct comparison with preferred chain selection.
  • Documents interpretation and privacy, and extends automated checks.
File Description
tests/​ui-contract.R Checks search-script inclusion.
tests/​prediction-browser.cjs Adds mocked search-to-comparison coverage.
tests/​inspection.R Tests chain sequence extraction.
shinyRam/​www/​styles.css Styles search controls and candidate cards.
shinyRam/​www/​experimental-search.js Implements search, metadata retrieval and comparison events.
shinyRam/​R/​inspection.R Adds query-sequence extraction.
shinyRam/​app.R Adds discovery UI, search state and comparison integration.
README.md Introduces the feature and documentation link.
docs/​experimental-counterparts.md Explains workflow, limitations, privacy and testing.
.github/​workflows/​scientific-tests.yml Adds JavaScript syntax checking.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread shinyRam/app.R
structure <- req(loaded())
if (is.null(structure$prediction) || current_model() != 1L) return()
chain <- req(input$experimentalSearchChain)
query <- ram_chain_query_sequence(classified(),chain)
Comment thread shinyRam/app.R
Comment on lines +1533 to +1547
if (nchar(query$sequence) < 20L) {
experimental_search_status(list(state="error",
message="The selected chain is too short for a useful sequence search."))
return()
}
if (!is.finite(query$known_fraction) || query$known_fraction < 0.60) {
experimental_search_status(list(state="error",
message="Too much of this chain is unresolved or non-standard for a reliable protein-sequence search."))
return()
}
identity <- suppressWarnings(as.numeric(input$experimentalIdentity))
if (!is.finite(identity)) identity <- 0.90
request_id <- experimental_search_request()+1L
experimental_search_request(request_id)
experimental_search_results(NULL)
Comment thread shinyRam/app.R
if (!is.list(item) || is.null(item$pdb_id)) return()
pdb_id <- toupper(trimws(as.character(item$pdb_id)))
chain_b <- if (is.null(item$chain)) "" else as.character(item$chain)
chain_a <- isolate(input$experimentalSearchChain)
Comment on lines +172 to +174
const enriched = (await Promise.all(
hits.slice(0, rows).map(hit => enrichHit(hit, entryCache))
)).filter(Boolean);
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.

2 participants