Convert Gene IDs Between Each Other and Fetch Annotations from Biomart
Overview
Gene Symbols or Ensembl Gene IDs are converted using the Bimap interface in 'AnnotationDbi' in convertId2() for the most common use cases in data analysis. The main function in the package is convert.bm() which queries BioMart using the full capacity of the API provided through the 'biomaRt' package. Presets and defaults are provided for convenience but all "marts", "filters" and "attributes" can be set by the user. Function convert.alias() converts Gene Symbols to Aliases and vice versa and function likely_symbol() attempts to determine the most likely current Gene Symbol.
New features
convertId2()gained anoutputargument and can now convert to Entrez Gene IDs in addition to Gene Symbols and Ensembl Gene IDs.output = "auto"keeps the previous behaviour;"symbol","ensembl"and"entrez"force the return type regardless of the input type. Entrez output is useful for offline, network-independent retrieval, e.g. for KEGG pathway enrichment.get.bm()andconvert.bm()gained abiomart.fallbackargument. When the primaryhostfails, the Ensembl mirror sites are tried in turn. Set it toNULLto disable fallback.get.bm()andconvert.bm()gained achunk.sizeargument. Large ID lists are split into chunks to avoid server timeouts. Set it toInfto disable chunking.
Show all changes in 0.4.0Hide the rest of the changes in 0.4.0
todisp2()gainedbiomart.fallbackandchunk.sizeas well, and now degrades gracefully: if every BioMart host fails it falls back to the data frame inlab, or toconvertId2(), instead of aborting.get.bm()now detects versioned Ensembl gene IDs (e.g.ENSG00000111199.5) in the input and stops with an informative message, since BioMart'sensembl_gene_idfilter expects unversioned IDs.likely_symbol()caches the HGNC table for the duration of the R session and gained arefreshargument to force a fresh download. Anindex_thresholdargument controls when inverted indices are built for batch lookups.
Bug fixes
convert.alias()checked fororg.Hs.eg.dbeven whenspecies = "Mouse", producing a misleading error message.likely_symbol()returned different results above and belowindex_threshold: the indexed path recorded only the first alias of a matched gene, so a query naming any later alias was returned unresolved. The query itself is now trimmed as well, so a padded symbol still matches.convertId2()aborted on input consisting entirely ofNA, and on empty input. It now returns an all-NAresult of the same length.unify_gene_ids()returnedNAfor everyhgnc_symbolwhen all BioMart hosts failed but the AnnotationDbi lookup succeeded. The AnnotationDbi result was recorded in a separate column and never promoted intohgnc_symbol, so the degradation to "AnnotationDbi results only" that the documentation and the verbose output describe did not actually take place.unify_gene_ids()could abort with "NAs are not allowed in subscripted assignments" when the gene symbol column containedNA.- The deduplication filters could fabricate a row: an
NAin a row-selection condition does not drop the row but yields one filled withNA, which could then be taken for the single surviving candidate of its group. One filter could also abort outright on anNAgene name. - The Ensembl-placeholder fix in the deduplication step never ran in ENSG-only mode, where there is no gene symbol column.
convert.bm()accepts both"row.names"and"rownames"as the special value ofidselecting the row names. Only the former worked, while the documentation named the latter..with_biomart_fallback()treated aNULLreturn value from a successful query as a failed host, and reported an unhelpful error when no host was configured at all.get.bm()aborted on R >= 4.2 whenbiom.data.setwas given as a multi-element vector of user-supplied data set names.likely_symbol()aborted when a query containing|could not be resolved. Such a query is now returned unchanged, as any other unresolved symbol is.
Documentation
- Documented the
previous_symbolcolumn oflikely_symbol()and corrected the column list foroutput = "all". - Corrected the return value description of
unify_gene_ids(): the intermediate lookup columns are dropped unlesskeep_intermediates = TRUE.
Internal
- Extracted the deduplication filters, the AnnotationDbi lookup helpers and the HGNC field tokeniser into documented, individually testable unexported functions.
- Test helpers no longer live in
R/, and BioMart availability is probed with an actual connection rather than a port-level check. AnnotationDbimoved fromDependstoImports. The package imports everything it needs from it, so nothing changes for the functions in this package, butlibrary(convertid)no longer attachesAnnotationDbito the search path. Code that relied on that side effect should calllibrary(AnnotationDbi)itself.- The test suite uses the third edition of
testthat.URLandBugReportsfields were added toDESCRIPTION.
From NEWS.md in the release
Install
Health
- OK13 OK2026-09-04
- ERROR12 OK, 1 ERROR2026-08-31
- OK13 OK2026-08-27
- ERROR12 OK, 1 ERROR2026-08-25
- OK13 OK2026-08-05
Show 9 earlier changesHide 9 earlier changes
- NOTE12 OK, 1 NOTE2026-08-01
- OK13 OK2026-06-27
- ERROR12 OK, 1 ERROR2026-06-21
- OK13 OK2026-06-09
- ERROR12 OK, 1 ERROR2026-06-08
- OK12 OK2026-04-25
- NOTE13 OK, 1 NOTE2026-04-13
- ERROR12 OK, 1 NOTE, 1 ERROR2026-04-12
- NOTE13 OK, 1 NOTE2026-03-10
Documentation
- Help pages
- 42 (35 internal)includes a package overview page
- Examples that run
- 0%1 only when donttest examples are enabled (R CMD check --as-cran) · 11 never run
- Exported functions with examples
- 100%
- Documented parameters
- 95%
- Return-value docs
- 100%
- Help pages citing references
- 0%
Downloads
Repository
Commits over time
Commit identities over time
Checks run against github.com/vfey/convertid on 2026-10-18.
No development-tooling practices detected in the upstream repository.
Dependencies
Installing convertid adds 21 packages (16 with compiled code, 19 MB of source tarballs). Heaviest: stringi 11 MB, Rcpp 1.8 MB, openssl 1.1 MB. 3 more not on CRAN are not measured.
Code & Tests
People & History
Pick two releases to compare their code metrics.
- 0.4.0Latest
- 0.3.42026-07-20 · diff ↗
- RR 4.6.0 released · 2026-04-24
- 0.3.0
- 0.2.12026-02-05 · diff ↗
- 0.2.02026-02-03 · diff ↗
- 0.1.122026-01-09 · diff ↗
- RR 4.5.0 released · 2025-04-11
- 0.1.102025-02-06 · diff ↗
- RR 4.4.0 released · 2024-04-24
- 0.1.82023-11-29 · diff ↗
- 0.1.72023-11-04 · diff ↗
- 0.1.62023-10-06 · diff ↗
- 0.1.52023-10-05 · diff ↗
- RR 4.3.0 released · 2023-04-21
- RR 4.2.0 released · 2022-04-22
Package metadata
- First published
- 2021-08-21
- Total releases
- 14 / 5 yrs
- License
- GPL-3 OSI
- Minimum R
- ≥ 3.5.0
- Download size
- 57 KB
Cite
Cite this package
Run in R for the authors' preferred citation:
citation("convertid")This package has no citation file, so citation() returns this entry built from DESCRIPTION.
Cite the R Observatory
For a number measured here: a download total, a coverage figure, an archival date.
From data release v2026-10-22, which the citation names so these numbers can be found later. More on citing and the projects behind them.