# globals.R
# ::rtemisseq::
# EDG rtemis.org
# rtemis ----
msg2start <- getFromNamespace("msg2start", "rtemis")
msg2done <- getFromNamespace("msg2done", "rtemis")
# rtemislive ----
rthelp <- function(..., title = NULL, class = "rthelp") {
div(
div(HTML(paste0(title, " Instructions")),
style = "color: #808080; font-weight: 300; padding-bottom:.5em;"
),
HTML(paste0("", paste(..., sep = "
")), ""),
class = class
)
} # rtemislive::rthelp
rthelp_inline <- function(..., title = NULL, class = "rthelp-inline") {
rthelp(..., title = title, class = class)
} # rtemislive::rthelp_inline
#' Create bulleted list
#'
#' @return div
rthelplist <- function(x, bullet = bsicons::bs_icon("arrow-right-short"), class = "rthelplist") {
div(
htmltools::HTML(
paste0(
bullet, "", x, "", "
"
)
),
class = class
)
} # rtemisseq::rthelplist
bold <- function(x) {
paste0("", x, "")
}
hilite <- function(x) {
paste0("", x, "")
}
nannot <- function(n) {
ngettext(n, "annotation", "annotations")
}
#' Summarize a3 object in HTML
#'
#' @param x a3 object
#'
#' @return HTML string
#' @author EDG
summarize_a3 <- function(x) {
n_site <- length(x$Annotations$Site)
n_region <- length(x$Annotations$Region)
n_ptm <- length(x$Annotations$PTM)
n_cleavage <- length(x$Annotations$Cleavage_site)
n_variant <- length(x$Annotations$Variant)
htmltools::HTML(
paste0(
if (!is.null(x$Description)) paste0("Description: ", hilite(x$Description), "
"),
if (!is.null(x$UniprotID)) paste0("Uniprot ID: ", hilite(x$UniprotID), "
"),
paste0("Sequence length: ", hilite(length(x$Sequence)), "
"),
"