Update LoadOmniPath.R - #72
Merged
Merged
Conversation
fix(LoadOmniPath): recover from OmnipathR organism-lookup failures (msraredon#70) RunNICHES(LR.database = "omnipath") aborted with "Can't combine `..1` and `..3`" (coalesce over latin_name_*) whenever an ancillary species-list service (OMA/Ensembl) was unreachable. The failure is upstream: newer OmnipathR (>= ~3.17) resolves `organism` via ncbi_taxid() -> taxon_names_table(), which downloads and strictly coalesces Ensembl/OMA/UniProt organism tables; a failed download yields a logical(NA) column that coalesce() refuses to combine. The OmniPath interaction server itself is unaffected, and NICHES already maps species -> NCBI taxid, so the organism-name translation is unnecessary. LoadOmniPath now fetches through a resilient helper: - try OmnipathR normally (unchanged behavior + caching when services are up); - on failure, fall back to a direct OmniPath REST query (omnipathdb.org/interactions?datasets=ligrecextra&organisms=<taxid>), which bypasses the organism-name lookup; the server performs ortholog translation, so mouse/rat symbols stay correct; - if both paths fail, raise a clear network-oriented error. Also mute OmnipathR's console log noise during the attempt, print a single provenance line (source, version, retrieval date, interaction count), and record it on attr(ground.truth, "omnipath_source"). Verified: human 6658, mouse 4434, rat 4225 interactions. Scope: R/LoadOmniPath.R only; no new dependencies.
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.
fix(LoadOmniPath): recover from OmnipathR organism-lookup failures (#70)
RunNICHES(LR.database = "omnipath") aborted with
"Can't combine
..1and..3" (coalesce over latin_name_*) whenever an ancillary species-list service (OMA/Ensembl) was unreachable. The failure is upstream: newer OmnipathR (>= ~3.17) resolvesorganismvia ncbi_taxid() -> taxon_names_table(), which downloads and strictly coalesces Ensembl/OMA/UniProt organism tables; a failed download yields a logical(NA) column that coalesce() refuses to combine. The OmniPath interaction server itself is unaffected, and NICHES already maps species -> NCBI taxid, so the organism-name translation is unnecessary.LoadOmniPath now fetches through a resilient helper:
Also mute OmnipathR's console log noise during the attempt, print a single provenance line (source, version, retrieval date, interaction count), and record it on attr(ground.truth, "omnipath_source").
Verified: human 6658, mouse 4434, rat 4225 interactions.
Scope: R/LoadOmniPath.R only; no new dependencies.