add curation filtering on Shiny for network interpretation#121
add curation filtering on Shiny for network interpretation#121tonywu1999 merged 5 commits intodevelfrom
Conversation
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review infoConfiguration used: Organization UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughAdds a boolean Changes
Sequence Diagram(s)sequenceDiagram
participant UI as UI (Checkbox)
participant Server as visualizeNetworkServer
participant Params as getInputParameters
participant Extract as extractSubnetwork
participant Indra as getSubnetworkFromIndra
participant Codegen as generate_network_code
UI->>Server: user toggles filterByCuration
Server->>Params: collect input params (includes filterByCuration)
Params-->>Server: params{filterByCuration}
Server->>Extract: call extractSubnetwork(..., filterByCuration)
Note right of Extract: forwards as filter_by_curation
Extract->>Indra: getSubnetworkFromIndra(..., filter_by_curation=BOOL, api_key="")
Server->>Codegen: generate_network_code(params) (emits filter_by_curation=params$filterByCuration)
Codegen-->>Server: generated network construction code
Server-->>UI: render updated network
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Failed to generate code suggestions for PR |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In @R/module-visualize-network-server.R:
- Around line 616-618: The generated code now adds filter_by_curation but the
server runtime path forces api_key = "" creating a mismatch; update
generate_network_code to include api_key = "" when the server path forces it, or
better remove the forced api_key = "" in the server runtime so both
code-generation (generate_network_code) and server runtime rely on the same
default behavior; locate generate_network_code and the server runtime block that
sets api_key = "" and either add the same forced api_key parameter to
generate_network_code or eliminate the hard-coded api_key = "" in the server
path so both paths are consistent.
🧹 Nitpick comments (1)
R/module-visualize-network-server.R (1)
244-260: PreferisTRUE()to coercefilterByCurationinto a strict scalar boolean.Current code works, but
as.logical()can yieldNAif the input ever becomes a non-boolean string;isTRUE()safely normalizesNULL/FALSE/TRUEintoFALSE/TRUE.Proposed refactor
- filterByCuration <- if(is.null(input$filterByCuration)) { - FALSE # Default to FALSE if somehow NULL - } else { - as.logical(input$filterByCuration) - } + filterByCuration <- isTRUE(input$filterByCuration)
📜 Review details
Configuration used: defaults
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
R/module-visualize-network-server.R
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: build
🔇 Additional comments (2)
R/module-visualize-network-server.R (2)
531-535: Propagation offilterByCurationintoextractSubnetwork()looks consistent.
286-303: This review comment is based on incorrect assumptions about parameter support. Bothfilter_by_curationandapi_keyare documented, supported parameters ingetSubnetworkFromIndra()and will not cause runtime errors. Passingapi_key = ""is equivalent to the function default, so no change is necessary.Likely an incorrect or invalid review comment.
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@R/module-visualize-network-server.R`:
- Around line 286-296: The function extractSubnetwork currently requires
filterByCuration and breaks callers that pass seven args; make filterByCuration
optional by giving it a default value in the function signature (e.g.,
filterByCuration = FALSE) so existing calls (such as in
tests/testthat/test_network_visualization.R) continue to work; ensure the
default is used when calling getSubnetworkFromIndra (function
getSubnetworkFromIndra invocation already passes filter_by_curation =
filterByCuration) so behavior is unchanged for callers that do pass the
argument.
Motivation and context
Detailed changes
Unit tests added or modified
Coding guidelines / potential issues