| BiodbEntryFields | R Documentation |
A class for handling description of all entry fields.
A class for handling description of all entry fields.
The unique instance of this class is handle by the BiodbMain
class and accessed through the getEntryFields() method.
new()New instance initializer. No BiodbEntryFields instance must be created directly. Instead, call the getEntryFields() method of BiodbMain.
BiodbEntryFields$new(parent)
parentThe BiodbMain instance.
Nothing.
notifyCfgUpdate()Call back method called when a value is modified inside the configuration.
BiodbEntryFields$notifyCfgUpdate(k, v)
kThe config key name.
vThe value associated with the key.
Nothing.
isAlias()Tests if names are aliases.
BiodbEntryFields$isAlias(name)
nameA character vector of names or aliases to test.
A logical vector, the same length as name, with TRUE
for name values that are an alias of a field, and FALSE otherwise."
formatName()Format field name(s) for biodb format: set to lower case and remove dot or underscore characters depending on configuration.
BiodbEntryFields$formatName(name)
nameA character vector of names or aliases to test.
A character vector of formatted names.
isDefined()Tests if names are defined fields.
BiodbEntryFields$isDefined(name)
nameA character vector of names or aliases to test.
A logical vector, the same length as name, with TRUE
for name values that corresponds to a defined field.
checkIsDefined()Tests if names are valid defined fields. Throws an error if any name does not correspond to a defined field.
BiodbEntryFields$checkIsDefined(name)
nameA character vector of names or aliases to test.
Nothing.
getRealName()Gets the real names (main names) of fields. If some name is not found neither in aliases nor in real names, an error is thrown.
BiodbEntryFields$getRealName(name, fail = TRUE)
nameA character vector of names or aliases.
failFails if name is unknown.
A character vector, the same length as name, with the real
field name for each name given (i.e. each alias is replaced with the
real name).
get()Gets a BiodbEntryField instance.
BiodbEntryFields$get(name, drop = TRUE)
nameA character vector of names or aliases.
dropIf TRUE and only one name has been submitted, returns a single BiodbEntryField instance instead of a list.
A named list of BiodbEntryField instances. The names of the list are the real names of the entry fields, thus they may be different from the one provided inside the name argument.
getFieldNames()Gets the main names of all fields.
BiodbEntryFields$getFieldNames(type = NULL, computable = NULL)
typeSet this parameter to a character vector in order to return only the names of the fields corresponding to the types specified.
computableIf set to TRUE, returns only the names of computable fields. If set to FALSE, returns only the names of fields that are not computable.
A character vector containing all selected field names.
getDatabaseIdField()Gets a database ID field.
BiodbEntryFields$getDatabaseIdField(database)
databaseThe name (i.e.: Biodb ID) of a database.
accession numbers) for this database.
print()Prints information about the instance.
BiodbEntryFields$print()
Nothing.
define()Defines fields.
BiodbEntryFields$define(def)
defA named list of field definitions. The names of the list are the main names of the fields.
Nothing.
terminate()Terminates the instance. This method will be called automatically by the BiodbMain instance when you call
BiodbEntryFields$terminate()
BiodbMain:terminate().
Nothing.
clone()The objects of this class are cloneable with this method.
BiodbEntryFields$clone(deep = FALSE)
deepWhether to make a deep clone.
BiodbMain and child class
BiodbEntryField.
# Getting information about the accession field:
mybiodb <- biodb::newInst()
entry.field <- mybiodb$getEntryFields()$get('accession')
# Test if a name is an alias of a field
mybiodb$getEntryFields()$isAlias('genesymbols')
# Test if a name is associated with a defined field
mybiodb$getEntryFields()$isDefined('name')
# Terminate instance.
mybiodb$terminate()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.