R/load_genes.R

Defines functions load_genes

Documented in load_genes

#' Loads gene info
#'
#' Loads the info on the selected gene alignments
#'
#' @importFrom dplyr mutate select
#' @importFrom magrittr %>%
#' @importFrom readr read_csv
#'
#' @param csv the csv file containg the alignments
#' @param base used further on as the y axis position of the genes during
#' plotting
#'
#' @return a tibble contianign the parsed info
#'
#' @export

load_genes <- function(csv, base = 0) {
  read_csv(
    csv,
    col_names = c(
      "id", "gene", "chrom", "pos", "bitscore", "%id", "evalue", "query_length",
      "align_length"
    )
  ) %>%
    select(id, chrom, pos) %>%
    cbind(base = base)
}
DiDeoxy/PGDA documentation built on June 19, 2020, 5:38 a.m.