-
Notifications
You must be signed in to change notification settings - Fork 2
Accessing database entries by accession number
This page has been generated automatically from a package vignette. Please do not edit, since your modifications will later be removed.
In this vignette, we will explain how to download and access entry information from databases.
First you need to create an instance of the Biodb
class:
mybiodb <- biodb::Biodb$new()
A database ID is required for choosing which database to access. To get the list of available database IDs, just run:
mybiodb$getDbsInfo()$getIds()
To obtain an entry from a database you have to call the getEntry()
method from the BiodbFactory
class. The following example access the KEGG Compound database in order to retrieve the entry number 2:
entry <- mybiodb$getFactory()$getEntry('kegg.compound', id = 'C00005')
From an entry instance, you can access different values stored in fields. Here is an example to get back the entry number (or accession number) used to obtain this entry:
entry$getFieldValue('accession')
We can have a list of all available fields for an entry:
entry$getFieldNames()
You can also get a data frame of the field values with the method getFieldsAsDataFrame()
:
entry$getFieldsAsDataFrame()