Repository navigation
Add experimental counterpart discovery for predicted models - #28
Merged
Merged
Conversation
There was a problem hiding this comment.
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
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.
| structure <- req(loaded()) | ||
| if (is.null(structure$prediction) || current_model() != 1L) return() | ||
| chain <- req(input$experimentalSearchChain) | ||
| query <- ram_chain_query_sequence(classified(),chain) |
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) |
| 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); |
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.

Adds a predicted-to-experimental workflow that closes the loop between model confidence and local conformational comparison.
Highlights:
The selected amino-acid sequence is sent to the public RCSB sequence-search service only when the user explicitly runs the search.