#' Expasy ENZYME database. entry class.
#'
#' Entry class for Expasy ENZYME database.
#'
#' @seealso
#' \code{\link{BiodbTxtEntry}}.
#'
#' @examples
#' # Create an instance with default settings:
#' mybiodb <- biodb::newInst()
#'
#' # Get a connector that inherits from ExpasyEnzymeConn:
#' conn <- mybiodb$getFactory()$createConn('expasy.enzyme')
#'
#' # Get the first entry
#' e <- conn$getEntry('1.1.1.1')
#'
#' # Terminate instance.
#' mybiodb$terminate()
#'
#' @import biodb
#' @import R6
#' @import stringr
#' @export
ExpasyEnzymeEntry <- R6::R6Class("ExpasyEnzymeEntry",
inherit=
biodb::BiodbTxtEntry
,
private=list(
doParseFieldsStep2=function(parsed.content) {
# Cofactors may be listed on a single line, separated by a semicolon.
if (self$hasField('COFACTOR')) {
v <- unlist(strsplit(self$getFieldValue('COFACTOR'), ' *; *'))
self$setFieldValue('COFACTOR', v)
}
# Synonyms
g <- stringr::str_match(parsed.content, "^AN\\s+(.+?)\\.?$")
results <- g[ ! is.na(g[,1]), , drop=FALSE]
if (nrow(results) > 0)
self$appendFieldValue('name', results[,2])
}
))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.