Skip to content

Feat fast gmt2mat - #506

Open
ivokwee wants to merge 19 commits into
edgyfrom
feat-fast-gmt2mat
Open

Feat fast gmt2mat#506
ivokwee wants to merge 19 commits into
edgyfrom
feat-fast-gmt2mat

Conversation

@ivokwee

@ivokwee ivokwee commented Aug 1, 2026

Copy link
Copy Markdown
Member

Replace with faster implementation of PR from plaid bigomics/plaid#13

ESCRI11 and others added 18 commits June 22, 2026 12:05
Fix failing annotation for uniprots for non primates
reactome.org's live SVG exporter is now behind Cloudflare and returns 403
to server-side requests. Route R-HSA ids through the local SBGN renderer
instead: fix getReactomeSVG.SBGN (filename mapping + broken returns) so it
renders the bundled .sbgn files and returns a path/NULL, and point
getPathwayImage at it. getReactomeSVG now returns NULL on failed download.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Switch Reactome diagrams from SBGNview (which re-renders in generic SBGN
style, not matching reactome.org) to Reactome's own native SVGs. Since the
live exporter is Cloudflare-blocked, fetch them from a self-hosted mirror
(REACTOME_SVG_URL) on demand and cache on disk. Sub-pathways with no diagram
of their own resolve to the nearest ancestor diagram via a precomputed
offline map (inst/extdata/reactome_diagram_map.tsv), so no reactome.org call
is made at runtime. getReactomeSVG.SBGN and the bundled inst/sbgn files are
now unused.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The map was keyed off humanPathwaysWithDiagrams.txt (1137), but the SVG
tarball ships 1382 diagrams, so common pathways like R-HSA-109581 had a
diagram but no map entry and showed "not available". Rebuild the map with the
diagram set = ids that actually have an SVG, so every target is guaranteed a
file. Coverage goes from 91% (2647) to 100% (2883).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
getReactomeSVG now prefers the gzipped native SVGs bundled in playdata
(inst/extdata/reactome-svg), decompressing on demand to the on-disk cache via
fast raw-byte streaming, and falls back to the hosted mirror (REACTOME_SVG_URL)
when playdata doesn't ship them. The diagram map is likewise read from playdata,
falling back to playbase's own copy during the transition.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Drop the transition fallbacks per single-source design: the diagram map is read
solely from playdata (playbase's copy removed), and getReactomeSVG serves only
the gzipped SVGs bundled in playdata -- the hosted-mirror path (REACTOME_SVG_URL)
and its baseurl arg are gone. Deployment guarantees playdata is up to date.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Completes the single-source refactor whose code change was accidentally left
out of the previous commit (which only removed the map file). getReactomeSVG
now serves solely from playdata's gzipped SVGs (no baseurl / REACTOME_SVG_URL),
reactomeDiagramMap reads only playdata, and the roxygen docs + NAMESPACE are
regenerated to match.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
We ended up serving native SVGs, so the SBGN renderer is unused. Undo the
modifications made to it during the abandoned SBGN approach; leave the
(dormant) function otherwise untouched.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Reactome diagrams: native SVGs via playdata + offline map
A client reported UniProt ranking failed when IDs had a space after the
semicolon: "I3L1P8;Q02978" worked but "I3L1P8; Q02978" did not.

Root cause: the split tokens were never actually trimmed - trimws() was
only used as a filter predicate, not applied to the values. A leading
space made the Swiss-Prot test grep("^[OPQ][0-9]", ...) miss (the ^
anchor hit the space), demoting Swiss-Prot IDs to TrEMBL, and the stray
space leaked into the output feature string.

Fix: trim the tokens themselves. Handles one or multiple spaces and
padding anywhere. Adds a regression test.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@ivokwee
ivokwee requested a review from ESCRI11 August 1, 2026 18:10
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.

3 participants