Skip to content

Update LoadOmniPath.R - #72

Merged
noahwang1991 merged 1 commit into
msraredon:masterfrom
noahwang1991:master
Aug 13, 2026
Merged

Update LoadOmniPath.R#72
noahwang1991 merged 1 commit into
msraredon:masterfrom
noahwang1991:master

Conversation

@noahwang1991

Copy link
Copy Markdown
Collaborator

fix(LoadOmniPath): recover from OmnipathR organism-lookup failures (#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=), 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.

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.
@noahwang1991
noahwang1991 merged commit 6ffded4 into msraredon:master Aug 13, 2026
1 check failed
@msraredon msraredon linked an issue Aug 13, 2026 that may be closed by this pull request
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.

Omnipath LR. database giving error

1 participant