biodbExpasy is a biodb extension package that implements a connector to the Expasy ENZYME database [@bairoch2000_expasy].
Install using Bioconductor:
if (!requireNamespace("BiocManager", quietly=TRUE)) install.packages("BiocManager") BiocManager::install('biodbExpasy')
The first step in using biodbExpasy, is to create an instance of the biodb
class Biodb
from the main biodb package. This is done by calling the
constructor of the class:
mybiodb <- biodb::newInst()
During this step the configuration is set up, the cache system is initialized and extension packages are loaded.
We will see at the end of this vignette that the biodb instance needs to be
terminated with a call to the terminate()
method.
In biodb the connection to a database is handled by a connector instance that you can get from the factory. biodbExpasy implements a connector to a remote database. Here is the code to instantiate a connector:
conn <- mybiodb$getFactory()$createConn('expasy.enzyme')
To get the number of entries stored inside the database, run:
conn$getNbEntries()
To get some of the first entry IDs (accession numbers) from the database, run:
ids <- conn$getEntryIds(2) ids
To retrieve entries, use:
entries <- conn$getEntry(ids) entries
To convert a list of entries into a dataframe, run:
x <- mybiodb$entriesToDataframe(entries) x
You can access the web service "find" directly with the wsEnzymeByName method:
conn$wsEnzymeByName(name="Alcohol", retfmt="ids")
You can access the web service "find" directly with the wsEnzymeByComment method:
conn$wsEnzymeByComment(comment="best", retfmt="ids")
When done with your biodb instance you have to terminate it, in order to ensure release of resources (file handles, database connection, etc):
mybiodb$terminate()
sessionInfo()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.