R/line_annotation.R

Defines functions line_annotation

#' @importFrom rlang .data
line_annotation <- function(alignment, line_width) {

  seq_names <- pad_seq_names(safe_rownames(alignment))
  starts <- line_start_positions(alignment = alignment, line_width = line_width)
  pad <- number_width(starts) + 1
  fmt <- paste0('%s% ', pad, 'd')

  expand.grid(seq = seq_names, start = starts) %>%
    dplyr::mutate(annotation = sprintf(fmt, .data$seq, .data$start)) %>%
    dplyr::pull(.data$annotation)
}

Try the agvgd package in your browser

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

agvgd documentation built on Sept. 11, 2022, 1:07 a.m.