BiodbEntryFields-class {biodb}R Documentation

A class for handling description of all entry fields.

Description

The unique instance of this class is handle by the BiodbMain class and accessed through the getEntryFields() method.

Methods

checkIsDefined(name)

:

Tests if names are valid defined fields. Throws an error if any name does not correspond to a defined field.

name: A character vector of names or aliases to test.

Returned value: None.

define(def)

:

Defines fields.

def: A named list of field definitions. The names of the list are the main names of the fields.

Returned value: None.

formatName(name)

:

Format field name(s) for biodb format: set to lower case and remove dot or underscore characters depending on configuration.

name: A character vector of names or aliases to test.

Returned value: A character vector of formatted names.

get(name, drop = TRUE)

:

Gets a BiodbEntryField instance.

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.

Returned value: 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.

getDatabaseIdField(database)

:

Gets a database ID field.

database: The name (i.e.: Biodb ID) of a database.

Returned value: The name of the field handling identifiers (i.e.: accession numbers) for this database.

getFieldNames(type = NULL, computable = NULL)

:

Gets the main names of all fields.

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.

Returned value: A character vector containing all selected field names.

getRealName(name, fail = TRUE)

:

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.

name: A character vector of names or aliases.

fail: Fails if name is unknown.

Returned value: 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).

isAlias(name)

:

Tests if names are aliases.

name: A character vector of names or aliases to test.

Returned value: A logical vector, the same length as 'name', with TRUE for name values that are an alias of a field, and FALSE otherwise.

isDefined(name)

:

Tests if names are defined fields.

name: A character vector of names or aliases to test.

Returned value: A logical vector, the same length as 'name', with TRUE for name values that corresponds to a defined field.

See Also

BiodbMain and child class BiodbEntryField.

Examples

# 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()


[Package biodb version 1.0.4 Index]