BridgeDb is a combination of an application programming interface (API), library, and set of data files for mapping identifiers for identical objects . Because BridgeDb is use by projects in bioinformatics, like WikiPathways  and PathVisio , identifier mapping databases are available for gene products (including proteins), metabolites, and metabolic conversions. We are also working on a disease database mapping file.
Questions can be directed to the BridgeDb Google Group.
The Bioconductor BridgeDbR package page describes how to install the package. After installation, the library can be loaded with the following command:
## Loading required package: rJava
*Note: if you have trouble with rJava (required package), please follow the instructions here for Ubuntu.
BridgeDb has a few core concepts which are explained in this section. Much of the API requires one to be familiar with these concepts, though some are not always applicable. The first concept is an example of that: organisms, which do not apply to metabolites.
However, for genes the organism is important: the same gene has different identifiers in different organisms. BridgeDb identifies organisms by their latin name and with a two character code. Because identifier mapping files provided by PathVisio have names with these short codes, it can be useful to have a conversion method:
code = getOrganismCode("Rattus norvegicus") code
##  "Rn"
Identifiers have a context and this context is often a database. For example, metabolite identfiers can be provided by the Human Metabolome Database (HMDB), ChemSpider, PubChem, ChEBI, and many others. Similarly, gene product identifiers can be provided by databases like Ensembl, (NCBI) Entrez Gene, Uniprot etc. Such a database providing identifiers is called a data source in BridgeDb.
Importantly, each such data source is identified by a human readable long name and by a short system code. This package has methods to interconvert one into the other:
fullName <- getFullName("Ce") fullName
##  "ChEBI"
code <- getSystemCode("ChEBI") code
##  "Ce"
Another useful aspect of BridgeDb is that it knows about the patterns of identifiers. If this pattern is unique enough, it can be used used to automatically find the data sources that match a particular identifier. For example:
##  "KEGG Pathway" "HMDB" ##  "SWISS-MODEL" "NCI Pathway Interaction Database" ##  "NCBI Protein" "HGNC" ##  "SUPFAM" "Wikipedia" ##  "EMBL" "LipidBank" ##  "ICD-11" "VMH metabolite"
##  "SWISS-MODEL" "NCI Pathway Interaction Database" ##  "NCBI Protein" "HGNC" ##  "SUPFAM" "Wikipedia" ##  "EMBL" "LipidBank" ##  "ICD-11" "Ensembl" ##  "VMH metabolite"
The BridgeDb package primarily provides the software framework, and not identifier mapping data. Identifier Mapping databases can be downloaded from various websites. The package knows about the download location (provided by PathVisio), and we can query for all gene product identifier mapping databases:
The package provides a convenience method to download such identifier mapping databases. For example, we can save the identifier mapping database for rat to the current folder with:
dbLocation <- getDatabase("Rattus norvegicus",location=getwd())
The dbLocation variable then contains the location of the identifier mapping file that was downloaded.
Mapping databases can also be manually downloaded for genes, metabolites, and gene variants from https://bridgedb.github.io/data/gene_database/:
Add the dbLocation with the following lines (first obtain in which folder, aka working directory ‘wd’, you are currently). Add the correct folder location at the dots:
getwd() dbLocation <- ("/home/..../BridgeDb/wikidata_diseases.bridge")
Once you have downloaded an identifier mapping database, either manually or via the getDatabase() method, you need to load the database for the identifier mappings to become available.
mapper <- loadDatabase(dbLocation)
With a loaded database, identifiers can be mapped. The mapping method uses system codes. So, to map the human Entrez Gene identifier (system code: L) 196410 to Affy identifiers (system code: X) we use:
location <- getDatabase("Homo sapiens") mapper <- loadDatabase(location) map(mapper, "L", "196410", "X")
Mind you, this returns more than one identifier, as BridgeDb is generally a one to many mapping database.
For mapping multiple identifiers, for example in a data frame, you can use the new “maps()” convenience method. Let’s assume we have a data frame, data, with a HMDB identifier in the second column, we can get Wikidata identifiers with this code:
input = data.frame( source= rep("Ch", length(data[,2])), identifer= data[,2] ) wikidata = maps(mapper, input, "Wd")
While you can download the gene and protein identifier mapping databases with the getDatabase() method, this mapping database cannot be used for metabolites. The mapping database for metabolites will have to be downloaded manually from Figshare, e.g. the February 2018 release version. A full overview of mappings files can be found in this Figshare collection.
Each mapping file record will allow you to download the .bridge file with the mappings.
If reproducibility is important to you, you can download the file with (mind you, these files are quite large):
file <- "metabolites_20180201.bridge" download.file( "https://ndownloader.figshare.com/files/10358973", location ) location = normalizePath(file) mapper <- loadDatabase(location)
With this mapper you can then map metabolite identifiers:
map(mapper, "456", source="Cs", target="Ck")
1. Iersel M van, Pico A, Kelder T, Gao J, Ho I, Hanspers K, Conklin B, Evelo C: The BridgeDb framework: Standardized access to gene, protein and metabolite identifier mapping services. BMC Bioinformatics 2010, 11:5+.
2. Pico AR, Kelder T, Iersel MP van, Hanspers K, Conklin BR, Evelo C: WikiPathways: Pathway editing for the people. PLoS Biol 2008, 6:e184+.
3. Iersel MP van, Kelder T, Pico AR, Hanspers K, Coort S, Conklin BR, Evelo C: Presenting and exploring biological pathways with PathVisio. BMC Bioinformatics, 9.