[Bioc-devel] org.Hs.eg.db and KEGG pathways
Lluís Revilla
||u|@@rev|||@ @end|ng |rom gm@||@com
Sat Nov 14 16:49:05 CET 2026
Hi,
Thanks Lori for announcing that orgs will be deprecated.
As I only use the data as an illustrative example I'll remove the
dependency to it.
Sean, I might copy the licensed subset of data which I used instead of
using the latest data with a more restrictive license.
But this might help Robert or myself if I find it is better to have more
data than just a few genes I used as an example.
Your scripts and advice will surely come handy. Thanks!
Thanks Vincent for sharing off-list the short-term plan to restore the
data.
Lluís
Missatge de Sean Davis <seandavi using gmail.com> del dia dv., 13 de nov. 2026 a
les 18:42:
> Hi Lluís, Robert,
>
> I can't speak for whether org.Hs.eg.db will get its PATH map back, but the
> NA values come from KEGG's restrictions on redistribution, so I wouldn't
> count on it. If what you need is a gene-to-pathway map for examples or
> tests, an openly licensed one is easy to get, and I can offer one route.
>
> I've been building bioc-on-ice, which republishes public annotation (NCBI
> Gene, GO, Ensembl, HGNC, WikiPathways, and others) as Parquet files plus a
> small DuckDB file of views. There's no account and nothing to install
> beyond the duckdb R package. Each release sits in a dated folder, so a
> vignette can pin one and get the same answer every time. Details and
> release notes are here:
>
> https://bioconice.cancerdatasci.org/releases?utm_source=bioc-devel&utm_medium=email&utm_campaign=org-hs-eg-db-kegg
>
> KEGG is not in it, for the same licensing reason. WikiPathways is (CC0,
> refreshed monthly): 991 human pathways covering 9,031 Entrez genes in the
> current release. Reactome (also CC0) is next on the list.
>
> 1. A drop-in for as.list(org.Hs.egPATH)
> ---------------------------------------
>
> library(DBI)
> con <- dbConnect(duckdb::duckdb())
> dbExecute(con, "INSTALL httpfs; LOAD httpfs;")
> dbExecute(con, "ATTACH '
> https://data.bioconice.cancerdatasci.org/v2026-11-08/bioconice.duckdb'
> AS bioc (READ_ONLY)")
>
> gp <- dbGetQuery(con, "
> SELECT gp.gene_id, gp.pathway_id, p.name
> FROM bioc.annotation.wikipathways__gene_pathway gp
> JOIN bioc.annotation.wikipathways__pathway p USING (pathway_id)
> WHERE gp.taxon_id = 9606")
> dbDisconnect(con, shutdown = TRUE)
>
> # Same shape as as.list(org.Hs.egPATH): Entrez gene ID -> pathway IDs
> egPATH <- split(gp$pathway_id, gp$gene_id)
> egPATH[["7157"]] # TP53: WP710, WP4754, WP615, ...
>
> # Pathway ID -> name
> pathway_names <- unique(gp[, c("pathway_id", "name")])
>
> # Gene sets the way most enrichment tools take them
> term2gene <- gp[, c("pathway_id", "gene_id")] #
> clusterProfiler::enricher(TERM2GENE = )
> pathways <- split(gp$gene_id, gp$pathway_id) # fgsea(pathways = )
>
> A named list covers what code usually does with org.Hs.egPATH:
> egPATH[keys] replaces mget(keys, org.Hs.egPATH), and lengths(egPATH)
> counts pathways per gene. If something really needs an
> environment, list2env(egPATH) gives you one.
>
> One caveat: these are different pathways from KEGG's, with different gene
> sets. Any enrichment results shown in a vignette will change, not just the
> IDs.
>
> The "v2026-11-08" in the URL is the pin. Use "latest" instead to track the
> newest release. That host keeps weekly releases for about a month. For
> something that has to build for years, like a vignette, use the monthly
> archive on Hugging Face instead: each month's release is tagged YYYY-MM
> there, and tags are never deleted. The two WikiPathways files are about
> 360 KB together, so download them rather than querying in place
> (anonymous Hugging Face requests are rate-limited):
>
> base <- "
> https://huggingface.co/datasets/seandavis/bioconice/resolve/2026-11/annotation/
> "
> for (f in c("wikipathways__gene_pathway.parquet",
> "wikipathways__pathway.parquet"))
> download.file(paste0(base, f), f, mode = "wb")
>
> con <- dbConnect(duckdb::duckdb())
> gp <- dbGetQuery(con, "
> SELECT gp.gene_id, gp.pathway_id, p.name
> FROM 'wikipathways__gene_pathway.parquet' gp
> JOIN 'wikipathways__pathway.parquet' p USING (pathway_id)
> WHERE gp.taxon_id = 9606")
> dbDisconnect(con, shutdown = TRUE)
> egPATH <- split(gp$pathway_id, gp$gene_id)
>
> The 2026-11 tag is release 2026-11-01. Its manifest.json lists every
> source version that went into it, if you want to cite exactly what you
> used. The whole release is browsable at
>
> https://huggingface.co/datasets/seandavis/bioconice?utm_source=bioc-devel&utm_medium=email&utm_campaign=org-hs-eg-db-kegg
>
> 2. Rolling your own OrgDb with a pathway column
> -----------------------------------------------
>
> If you'd rather keep the select()/mapIds() interface, AnnotationForge can
> build an org package straight from the same tables. This builds and
> installs (I tested it today); the GOALL tables come from your installed
> GO.db.
>
> library(DBI)
> con <- dbConnect(duckdb::duckdb())
> dbExecute(con, "INSTALL httpfs; LOAD httpfs;")
> dbExecute(con, "ATTACH '
> https://data.bioconice.cancerdatasci.org/v2026-11-08/bioconice.duckdb'
> AS bioc (READ_ONLY)")
> q <- function(sql) dbGetQuery(con, sql)
>
> # makeOrgPackage rules: each table's first column is GID, and the other
> # column names become select() columns, so they must be unique.
> gene_info <- q("SELECT DISTINCT gene_id AS GID, symbol AS SYMBOL,
> description AS GENENAME
> FROM bioc.annotation.ncbi__gene WHERE taxon_id = 9606")
> chromosome <- q("SELECT DISTINCT gene_id AS GID, chromosome AS CHR
> FROM bioc.annotation.ncbi__gene
> WHERE taxon_id = 9606 AND chromosome IS NOT NULL")
> go <- q("SELECT DISTINCT gene_id AS GID, go_id AS GO, evidence AS EVIDENCE
> FROM bioc.annotation.ncbi__gene_go WHERE taxon_id = 9606")
> wikipathways <- q("SELECT DISTINCT gene_id AS GID, pathway_id AS
> WIKIPATHWAYS
> FROM bioc.annotation.wikipathways__gene_pathway WHERE
> taxon_id = 9606")
> xref <- function(ns) q(sprintf(
> "SELECT DISTINCT source_id AS GID, target_id AS %s
> FROM bioc.annotation.identifier_mapping
> WHERE taxon_id = 9606 AND source_namespace = 'ENTREZ' AND
> target_namespace = '%s'",
> ns, ns))
> alias <- xref("ALIAS"); ensembl <- xref("ENSEMBL")
> uniprot <- xref("UNIPROT"); omim <- xref("OMIM")
> dbDisconnect(con, shutdown = TRUE) # run every query before this line
>
> AnnotationForge::makeOrgPackage(
> gene_info = gene_info, chromosome = chromosome, go = go,
> alias = alias, ensembl = ensembl, uniprot = uniprot, omim = omim,
> wikipathways = wikipathways,
> version = "0.0.1", maintainer = "You <you using example.org>", author = "You",
> outputDir = ".", tax_id = "9606", genus = "Homo", species = "sapiens",
> goTable = "go")
>
> install.packages("org.Hsapiens.eg.db", repos = NULL, type = "source")
> library(org.Hsapiens.eg.db)
> select(org.Hsapiens.eg.db, keys = "TP53", keytype = "SYMBOL",
> columns = c("GID", "WIKIPATHWAYS"))
>
> # The org.Hs.egPATH-style list, from the OrgDb
> egPATH <- mapIds(org.Hsapiens.eg.db, keys(org.Hsapiens.eg.db, "GID"),
> column = "WIKIPATHWAYS", keytype = "GID", multiVals =
> "list")
> egPATH <- egPATH[!vapply(egPATH, function(v) all(is.na(v)), TRUE)]
>
> Things that tripped me up:
>
> - The key column is GID, not ENTREZID. That's how makeOrgPackage names it,
> so code that hardcodes keytype = "ENTREZID" needs a change.
> - Packages built this way have the OrgDb object only, no org.Xx.egPATH
> style bimaps. Those come only with the official org packages. mapIds()
> as above gives you the same list.
> - The installed package is about 750 MB, almost all of it the GOALL
> tables. Drop go/goTable if you only need pathways.
> - GOALL is computed from your local GO.db. If that GO release differs from
> the one NCBI's gene2go used, some terms can drop out of the ancestor
> closure.
>
> If you need KEGG itself and you're fine with KEGG's terms, KEGGREST will
> fetch it at run time. For a vignette that has to build on the build
> machines, I'd avoid the network dependency.
>
> Happy to help if either of you tries this and hits a snag.
>
> Sean
>
> On Fri, Nov 13, 2026 at 12:49 PM Kern, Lori via Bioc-devel <
> bioc-devel using r-project.org> wrote:
>
>> We are aiming to deprecate this functionality. We realized it was too
>> close to release to implement this change on developers, and it should be
>> reverted in the new orgs that were uploaded this morning. It should be
>> remedied on the next build report.
>>
>> Developers should prepare as we will likely replace orgs in devel early
>> this coming cycle that will exclude this information. We will announce
>> more details about any additional features that will be deprecated at that
>> time.
>>
>>
>> Lori Kern
>>
>> Bioconductor Core Team
>>
>> Roswell Park Comprehensive Cancer Center
>>
>> Department of Biostatistics & Bioinformatics
>>
>> Elm & Carlton Streets
>>
>> Buffalo, New York 14263
>>
>> ________________________________
>> From: Bioc-devel <bioc-devel-bounces using r-project.org> on behalf of Robert
>> M. Flight <rflight79 using gmail.com>
>> Sent: Thursday, November 12, 2026 7:10 PM
>> To: Lluís Revilla <lluis.revilla using gmail.com>
>> Cc: bioc-devel <bioc-devel using r-project.org>
>> Subject: Re: [Bioc-devel] org.Hs.eg.db and KEGG pathways
>>
>> Hi Lluis,
>>
>> I am also affected by this, as I was using some of the KEGG pathway data
>> available from the org packages for some example analyses in my package
>> vignette. I hadn't had a chance to look into it yet, but I'm sure what you
>> describe is exactly what is behind the error I'm currently seeing in the
>> 3.24 build report.
>>
>> Cheers,
>> -Robert
>>
>> On Thu, Nov 12, 2026 at 4:55 PM Lluís Revilla <lluis.revilla using gmail.com>
>> wrote:
>>
>> > Hi list,
>> >
>> > Recently, I received a notification that my package was failing the
>> build
>> > on devel.
>> > The error comes from the object at org.Hs.eg.db::org.Hs.egPATH having a
>> > long list of NA:
>> >
>> > packageVersion("org.Hs.eg.db")
>> > ## [1] '3.24.4'
>> > all(vapply(org.Hs.eg.db::org.Hs.egPATH, is.na, TRUE))
>> > ## [1] TRUE
>> >
>> > The object contained some data related to KEGG which restricted access
>> to
>> > its database.
>> >
>> > It is a suggested package and I can work around the issue but I thought
>> I
>> > would check before I go down this route if this will be fixed on the
>> > org.Hs.eg.db package or not.
>> >
>> > Many thanks to Bioconductor for maintaining it,
>> > Cheers,
>> >
>> > Lluís
>> >
>> > PS: I'm not sure if some other packages are affected by this update.
>> >
>> > [[alternative HTML version deleted]]
>> >
>> > _______________________________________________
>> > Bioc-devel using r-project.org mailing list
>> >
>> https://secure-web.cisco.com/1Fr9LrhBnIBzC19gzU7IdbyooJnTL9WwnDRjd95lu9Ms7jJBJ7uFCHRdfchzrQ3AIu2jH6Enu70a7VInBs93PjRhMosnDwjUku7-gcKFBpUFz8oNGgp_8K6Sb51pFpldGPXbhQYwwCmQAjTmLANY0x9Bw7w4srmo0QTyk3XubQMNPSAFzLrx6_912FbcVz6wKgUGcmeBf_CIdQk2sseuFb-gz1ojledyG3E8pP4cDUDShmEAR6-GTHppr_7GTY8sdtki35gg9gxEX0-9XbCQSNCFqm79oWX-rBNz5QBmpfLL2VcZYu5gaz0JjmxM3-_Hs/https%3A%2F%2Fstat.ethz.ch%2Fmailman%2Flistinfo%2Fbioc-devel
>> >
>>
>> [[alternative HTML version deleted]]
>>
>> _______________________________________________
>> Bioc-devel using r-project.org mailing list
>>
>> https://secure-web.cisco.com/1Fr9LrhBnIBzC19gzU7IdbyooJnTL9WwnDRjd95lu9Ms7jJBJ7uFCHRdfchzrQ3AIu2jH6Enu70a7VInBs93PjRhMosnDwjUku7-gcKFBpUFz8oNGgp_8K6Sb51pFpldGPXbhQYwwCmQAjTmLANY0x9Bw7w4srmo0QTyk3XubQMNPSAFzLrx6_912FbcVz6wKgUGcmeBf_CIdQk2sseuFb-gz1ojledyG3E8pP4cDUDShmEAR6-GTHppr_7GTY8sdtki35gg9gxEX0-9XbCQSNCFqm79oWX-rBNz5QBmpfLL2VcZYu5gaz0JjmxM3-_Hs/https%3A%2F%2Fstat.ethz.ch%2Fmailman%2Flistinfo%2Fbioc-devel
>>
>>
>>
>> This email message may contain legally privileged and/or confidential
>> information. If you are not the intended recipient(s), or the employee or
>> agent responsible for the delivery of this message to the intended
>> recipient(s), you are hereby notified that any disclosure, copying,
>> distribution, or use of this email message is prohibited. If you have
>> received this message in error, please notify the sender immediately by
>> e-mail and delete this email message from your computer. Thank you.
>> [[alternative HTML version deleted]]
>>
>> _______________________________________________
>> Bioc-devel using r-project.org mailing list
>> https://stat.ethz.ch/mailman/listinfo/bioc-devel
>>
>
[[alternative HTML version deleted]]
More information about the Bioc-devel
mailing list