Title: | Code for using BridgeDb identifier mapping framework from within R |
---|---|
Description: | Use BridgeDb functions and load identifier mapping databases in R. It uses GitHub, Zenodo, and Figshare if you use this package to download identifier mappings files. |
Authors: | Christ Leemans <[email protected]>, Egon Willighagen <[email protected]>, Denise Slenter, Anwesha Bohler <[email protected]>, Lars Eijssen <[email protected]>, Tooba Abbassi-Daloii |
Maintainer: | Egon Willighagen <[email protected]> |
License: | AGPL-3 |
Version: | 2.17.1 |
Built: | 2024-11-07 03:26:58 UTC |
Source: | https://github.com/bioc/BridgeDbR |
R package for using BridgeDb directly from R.
Christ Leemans Anwesha Bohler Denise Slenter Lars Eijssen Tooba Abbassi-Daloii
Maintainer: Egon Willighagen <[email protected]>
Data sources are defined by a title and a short system code. This method determines if a data source is known with the given full name.
fullNameExists(name)
fullNameExists(name)
name |
full name of the data source |
exists |
boolean that indicates if a data is known with the given name |
Egon Willighagen
exists <- fullNameExists("HMDB")
exists <- fullNameExists("HMDB")
Returns the attributes of the given identifier.
getAttributes(mapper, source, identifier)
getAttributes(mapper, source, identifier)
mapper |
loaded BridgeDb identifier mapper |
source |
system code of the data source |
identifier |
identifier to return the attributes for |
mappings |
a vector of attributes |
Egon Willighagen
## Not run: location <- getDatabase("Homo sapiens") mapper <- loadDatabase(location) getAttributes(mapper, "L", "672") ## End(Not run)
## Not run: location <- getDatabase("Homo sapiens") mapper <- loadDatabase(location) getAttributes(mapper, "L", "672") ## End(Not run)
This method returns a list of file names of BridgeDb identifier mapping files as they are available from the mapping file download site. The optional code parameter can be used to restrict the list to a specific organism.
Occassionally, the ID mapping file download website changes the pattern of the file names. In that case, you can provide an alternative filename pattern to recognize files on the download site.
This method uses data from https://bridgedb.github.io/data/gene_database/.
getBridgeNames(code, website, pattern)
getBridgeNames(code, website, pattern)
code |
the organism code |
website |
optional parameter that allows you to provide a different location to download BridgeDb Derby files from. |
pattern |
optional parameter to change the filename pattern of the BridgeDb Derby files. |
list |
the list of available BridgeDb mapping files |
Egon Willighagen Christ Leemans
files <- getBridgeNames("Hs") ## Not run: prereleases <- getBridgeNames( website="http://bridgedb.org/data/gene_database/pre-release/", pattern="metabolites_\d*.bridge" ) ## End(Not run)
files <- getBridgeNames("Hs") ## Not run: prereleases <- getBridgeNames( website="http://bridgedb.org/data/gene_database/pre-release/", pattern="metabolites_\d*.bridge" ) ## End(Not run)
Downloads a identifier mapping database for the given organism. The optional location parameter can be used to indicate where the file should be stored. If not give, it will save it in a temporary folder.
This method extracts links from https://bridgedb.github.io/data/gene_database/ to identifier mapping databases hosted on Zenodo and Figshare, two public data archives.
getDatabase(organism,location,website)
getDatabase(organism,location,website)
organism |
the organism name |
location |
optional parameter to indicate where the database should be saved |
website |
optional URL of the server where to look for BridgeDb identifier mapping databases |
location |
the location where the database was saved |
Egon Willighagen Christ Leemans
## Not run: location <- getDatabase("Bacillus subtilis") ## Not run: location <- getDatabase("Homo sapiens")
## Not run: location <- getDatabase("Bacillus subtilis") ## Not run: location <- getDatabase("Homo sapiens")
Return a DataSource object based on either a name, Bioregistry.io prefix, or system code.
getDataSource(name,code,prefix)
getDataSource(name,code,prefix)
name |
the name of the data source |
code |
the system code of the data source |
prefix |
the Bioregistry.io prefix of the data source |
dataSource |
a DataSource Java object |
Egon Willighagen
dataSource <- getDataSource(code="Ce")
dataSource <- getDataSource(code="Ce")
Data sources are defined by a title and a short system code. This method converts a system code into a full name.
getFullName(syscode)
getFullName(syscode)
syscode |
the system code of the data source |
systemCode |
the full name of the data source |
Egon Willighagen Christ Leemans
name <- getFullName("Ce")
name <- getFullName("Ce")
This method runs through all data sources it knows about, and looks for sources of which the identifier pattern matches the given identifier.
getMatchingSources(identifier)
getMatchingSources(identifier)
identifier |
identifier to test |
list |
list of matching data sources |
Egon Willighagen Christ Leemans
list <- getMatchingSources("555")
list <- getMatchingSources("555")
This method converts a organism latin name into a code.
getOrganismCode(name)
getOrganismCode(name)
name |
latin name of an organism |
systemCode |
the code of the organism |
Egon Willighagen Christ Leemans
systemCode <- getOrganismCode("Mus musculus")
systemCode <- getOrganismCode("Mus musculus")
Gets the properties of an BridgeDb ID mapping database.
getProperties(mapper)
getProperties(mapper)
mapper |
loaded BridgeDb identifier mapper |
properties |
a data frame with the properties |
Egon Willighagen
## Not run: location <- getDatabase("Bacillus subtilis") mapper <- loadDatabase(location) getProperties(mapper) ## End(Not run)
## Not run: location <- getDatabase("Bacillus subtilis") mapper <- loadDatabase(location) getProperties(mapper) ## End(Not run)
Data sources are defined by a title and a short system code. This method converts a name into a system code.
getSystemCode(name)
getSystemCode(name)
name |
name of the data source |
systemCode |
the system code of the data source |
Egon Willighagen Christ Leemans
systemCode <- getSystemCode("ChEBI")
systemCode <- getSystemCode("ChEBI")
Loads a BridgeDb identifier mapping database (.bridge file) as an IDMapper Java-Object.
loadDatabase(location)
loadDatabase(location)
location |
location on the hard disk of the BridgeDb file |
The return Java-Object is a Java class implementing the BridgeDb IDMapper interface. It is the required mapper class that is used as input for other methods that need an IDMapper.
mapper |
an IDMapper object |
Egon Willighagen
## Not run: location <- getDatabase("Bacillus subtilis") mapper <- loadDatabase(location) ## End(Not run)
## Not run: location <- getDatabase("Bacillus subtilis") mapper <- loadDatabase(location) ## End(Not run)
Converts one identifier into other identifiers for the given target data source.
map(mapper, source, identifier, target, compactIdentifier)
map(mapper, source, identifier, target, compactIdentifier)
mapper |
loaded BridgeDb identifier mapper |
source |
system code of the data source |
identifier |
identifier to be converted |
target |
system code of the target data source (optional) |
compactIdentifier |
the Bioregistry.io compact identifier to convert |
mappings |
a data frame of mapped identifiers for the target data source |
Egon Willighagen
## Not run: location <- getDatabase("Bacillus subtilis") mapper <- loadDatabase(location) map(mapper, "En", "BSn5_00025", "S") map(mapper, "En", "BSn5_00025") location <- getDatabase("Homo sapiens") mapper <- loadDatabase(location) map(mapper, "En", "ENSG00000139618") map(mapper, compactIdentifier="uniprot:P51587") ## End(Not run)
## Not run: location <- getDatabase("Bacillus subtilis") mapper <- loadDatabase(location) map(mapper, "En", "BSn5_00025", "S") map(mapper, "En", "BSn5_00025") location <- getDatabase("Homo sapiens") mapper <- loadDatabase(location) map(mapper, "En", "ENSG00000139618") map(mapper, compactIdentifier="uniprot:P51587") ## End(Not run)
Converts one identifier into other identifiers for the given target data source.
maps(mapper, identifiers, target)
maps(mapper, identifiers, target)
mapper |
loaded BridgeDb identifier mapper |
identifiers |
data frame with identifiers to be converted, with a source and a identifier column |
target |
system code of the target data source (optional) |
mappings |
a data frame of mapped identifiers for the target data source |
Egon Willighagen
## Not run: location <- getDatabase("Bacillus subtilis") mapper <- loadDatabase(location) input = data.frame( source= c("L"), identifier= c("885041") ) maps(mapper,input) ## End(Not run)
## Not run: location <- getDatabase("Bacillus subtilis") mapper <- loadDatabase(location) input = data.frame( source= c("L"), identifier= c("885041") ) maps(mapper,input) ## End(Not run)
Return a DataSource of the newly registered data source, based on either a name or system code.
registerDataSource(code,name)
registerDataSource(code,name)
code |
the system code of the data source |
name |
the name of the data source |
dataSource |
a DataSource Java object |
Egon Willighagen
newDataSource <- registerDataSource(code="Cks", name="KNApSAcK")
newDataSource <- registerDataSource(code="Cks", name="KNApSAcK")
Data sources are defined by a title and a short system code. This method determines if a data source is known with the given system code.
systemCodeExists(code)
systemCodeExists(code)
code |
system code of the data source |
exists |
boolean that indicates if a data is known with the given system code |
Egon Willighagen
exists <- systemCodeExists("Ce")
exists <- systemCodeExists("Ce")
Checks if the given identifier exists in the given mapping file
xrefExists(mapper, source, identifier, compactIdentifier)
xrefExists(mapper, source, identifier, compactIdentifier)
mapper |
loaded BridgeDb identifier mapper |
source |
system code of the data source |
identifier |
identifier to be searched |
compactIdentifier |
the Bioregistry.io compact identifier to check |
boolean |
true, if the given identifier is found in the mapping database |
Egon Willighagen
## Not run: location <- getDatabase("Bacillus subtilis") mapper <- loadDatabase(location) xrefExists(mapper, "L", "885041") xrefExists(mapper, compactIdentifier="ncbigene:885041") ## End(Not run)
## Not run: location <- getDatabase("Bacillus subtilis") mapper <- loadDatabase(location) xrefExists(mapper, "L", "885041") xrefExists(mapper, compactIdentifier="ncbigene:885041") ## End(Not run)