R/load_gtf.R

Defines functions load_gtf

Documented in load_gtf

#' @title Load a gtf file from GENCODE as a dataframe.
#'
#' @description This function combines import with loading the gtf file as a dataframe in the R Global Environment
#' @usage load_gtf(x)
#' @param x The name of the downloaded gtf file from GENCODE website
#' @export
#' @keywords
#' @seealso \code{\link[rtracklayer]{import}}
#' @return A dataframe of the gtf file selected
#' examples \dontrun {
#' # You don't have to run this
#' load_gtf("gencode.v27.lncRNAs.gtf")
#’}
load_gtf <- function(x) {
  gtf <- rtracklayer::import(x)
  a <- as.data.frame(gtf)
  assign(deparse(substitute(gtf_df)), a, envir = .GlobalEnv)
}
monahton/GencodeInterrogator documentation built on Dec. 24, 2019, 1:31 p.m.