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)
parent
The BiodbMain instance.
Nothing.
notifyCfgUpdate()
Call back method called when a value is modified inside the configuration.
BiodbEntryFields$notifyCfgUpdate(k, v)
k
The config key name.
v
The value associated with the key.
Nothing.
isAlias()
Tests if names are aliases.
BiodbEntryFields$isAlias(name)
name
A 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)
name
A character vector of names or aliases to test.
A character vector of formatted names.
isDefined()
Tests if names are defined fields.
BiodbEntryFields$isDefined(name)
name
A 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)
name
A 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)
name
A character vector of names or aliases.
fail
Fails 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)
name
A character vector of names or aliases.
drop
If 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)
type
Set this parameter to a character vector in order to return only the names of the fields corresponding to the types specified.
computable
If 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)
database
The 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)
def
A 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)
deep
Whether 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.