-
Notifications
You must be signed in to change notification settings - Fork 2
Configuring biodb
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 configure biodb behaviour.
When you create an instance of the Biodb
class:
mybiodb <- biodb::Biodb()
You get, by default (i.e.: when not setting info = FALSE
), a list of configuration setting.
This configuration setting can be modified either directly inside R with the BiodbConfig
class or beforehand by setting environment variables.
The main way to tune biodb to your needs is to use the BiodbConfig
single instance, accessible through the biodb
instance:
config <- mybiodb$getConfig()
If you look at the config instance, you will get a list of keys with their current values:
config
Get all available configuration keys:
config$getKeys()
Get description of a field:
config$getDescription('cache.directory')
Get a field value:
config$get('cache.directory')
If the field is boolean, you can use the following method instead:
if (config$isEnabled('offline')) 'Biodb is running offline.' else 'Biodb is running online.'
To get a complete of all configuration keys and their description, call:
config$listKeys()
Set a field value:
config$set('cache.directory', '~/my.biodb.cache')
config$get('cache.directory') # See modifications
If the field is boolean, you can use the following methods instead:
config$enable('offline') # set to TRUE
config$disable('offline') # set to FALSE
Get field default value:
config$getDefaultValue('cache.directory')
Environment variables can be used to overwrite default values.
To get the name of the environment variable associated with a particular key, call the following method:
config$getAssocEnvVar('cache.directory')