R/oncoprint.legend.R

Defines functions oncoprint.legend

#' Construct Oncoprint Legend Parameters
#'
#' @description
#' Internal helper function used to generate legend parameters for lesion
#' categories displayed in an oncoprint.
#'
#' @param lsn.type A character vector containing the lesion types to display
#' in the oncoprint legend.
#'
#' @return
#' A list containing:
#' \itemize{
#'   \item \code{title}: Legend title.
#'   \item \code{at}: Lesion categories represented in the legend.
#'   \item \code{labels}: Display labels for the lesion categories.
#' }
#'
#' @keywords internal
#' @noRd
oncoprint.legend <- function(lsn.type)
{
  res <- list()

  res$title <- "Lesion Category"
  res$at <- lsn.type
  res$labels <- sub("^(\\w?)", "\\U\\1", lsn.type, perl = TRUE)

  return(res)
}

Try the GRIN2 package in your browser

Any scripts or data that you put into this service are public.

GRIN2 documentation built on Aug. 22, 2026, 5:09 p.m.