feature(curation): Add functionality to filter results by curation#61
feature(curation): Add functionality to filter results by curation#61tonywu1999 merged 5 commits intodevelfrom
Conversation
WalkthroughAdds optional Changes
Sequence DiagramsequenceDiagram
participant User
participant getSubnetwork as getSubnetworkFromIndra
participant filterIndra as .filterIndraResponse
participant getCuration as .get_incorrect_curation_count
participant INDRA as INDRA_API
User->>getSubnetwork: Call (filter_by_curation=TRUE, api_key)
getSubnetwork->>filterIndra: Pass params & response
rect rgb(230,245,255)
Note over filterIndra: When filter_by_curation == TRUE
filterIndra->>getCuration: For each statement: request curation count
getCuration->>INDRA: HTTP GET /curation (stmt_hash, api_key)
INDRA-->>getCuration: Return count or error (fallback 0)
getCuration-->>filterIndra: incorrect_count
filterIndra->>filterIndra: Adjust evidence_count -= incorrect_count
filterIndra->>filterIndra: Throttle (short pause) between requests
end
filterIndra->>filterIndra: Apply evidence_count cutoff
filterIndra-->>getSubnetwork: Filtered results
getSubnetwork-->>User: Return subnetwork
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes
Possibly related PRs
Suggested labels
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (1 passed)
✨ Finishing touches🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
⏰ 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). (3)
🔇 Additional comments (3)
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 |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## devel #61 +/- ##
==========================================
- Coverage 63.89% 62.59% -1.30%
==========================================
Files 7 7
Lines 1227 1254 +27
==========================================
+ Hits 784 785 +1
- Misses 443 469 +26 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Actionable comments posted: 4
🧹 Nitpick comments (2)
R/utils_getSubnetworkFromIndra.R (1)
131-131: Consider adding progress indication for long-running operations.The 100ms delay between API requests (necessary to avoid rate limiting) means that processing 100 statements takes at least 10 seconds. Consider adding progress indication for better user experience.
Example:
if (filter_by_curation) { message(sprintf("Applying curation-based filtering to %d statements...", length(res))) for (i in seq_along(res)) { if (i %% 50 == 0) { message(sprintf("Processed %d/%d statements", i, length(res))) } # ... existing code ... } message("Curation filtering complete.") }man/getSubnetworkFromIndra.Rd (1)
17-19: LGTM! Documentation correctly describes new parameters.The documentation accurately reflects the new
filter_by_curationandapi_keyparameters.Consider enhancing the
api_keydocumentation to include security guidance:-\item{api_key}{string of INDRA API key for accessing curated statements.} +\item{api_key}{string of INDRA API key for accessing curated statements. +Required when filter_by_curation is TRUE. The API key should be kept secure +and not committed to version control.}Also applies to: 59-63
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (4)
NAMESPACE(1 hunks)R/getSubnetworkFromIndra.R(2 hunks)R/utils_getSubnetworkFromIndra.R(2 hunks)man/getSubnetworkFromIndra.Rd(2 hunks)
⏰ 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). (3)
- GitHub Check: pkgdown
- GitHub Check: test-coverage
- GitHub Check: build
🔇 Additional comments (3)
NAMESPACE (1)
21-21: LGTM! Imports support new curation API functionality.The
httr::GETandhttr::status_codeimports are correctly added to support the new.get_incorrect_curation_counthelper function.Also applies to: 25-25
R/getSubnetworkFromIndra.R (1)
65-65: LGTM! Parameters correctly passed to internal filter.The new parameters are properly passed to
.filterIndraResponsefor processing.R/utils_getSubnetworkFromIndra.R (1)
134-137: LGTM! Evidence count filter correctly repositioned.Moving the
evidence_countfilter to after the curation adjustment is the correct approach, ensuring that filtering is applied to the adjusted counts.
Summary by CodeRabbit
filter_by_curationparameter to filter subnetwork results by curation status (default: disabled).api_keyparameter to enable API authentication for enhanced filtering capabilities.Summary by CodeRabbit
Release Notes