R/Intron_tracker.R

Defines functions intron_tracker

Documented in intron_tracker

#' Intron Tracker 
#' 
#' Determines the region of a single chromosome that contains introns
#' @param chr the chromosome whose exonic and in turn intronic regions we are determining
#' @return a dataframe with the loction of the introns for the given chromosome
#' @import TxDb.Hsapiens.UCSC.hg19.knownGene
#' @import ggbio
#' @import GenomeInfoDb
#' @import GenomicFeatures
#' @export

intron_tracker <- function(chr) {
  genome = TxDb.Hsapiens.UCSC.hg19.knownGene
  
  #to test use "chr17"
  seqlevels(genome) <- chr
  ex <- exons(genome)
  ex <- as.data.frame(ex)
  
  temp1 <- head(ex["end"], -1)
  temp2 <- tail(ex["start"], -1)
  
  return(data.frame("start" = temp1, "end" = temp2))
}
cheejus2/Intron_Vis documentation built on Dec. 8, 2019, 10:35 a.m.