#' transcriptDB_mod
#'
#' modifies the Gene model output from a transcriptDb object so that the intron intronic regions can be visualized on the plot
#' @param wh The genes of interest for this model
#' @param introns Data Frame of the regions of the genome that are intronic
#' @return object that specifies what the the genes of interest are
#' @import ggplot2
#' @import TxDb.Hsapiens.UCSC.hg19.knownGene
#' @export
#' @references Based off of the ggbio documentation available on bioconductor:
#' http://bioconductor.org/packages/release/bioc/vignettes/ggbio/inst/doc/ggbio.pdf
#' Original Author: Tengfei Yin
transcriptDB_mod <- function(gene1, gene2, introns) {
# input should be "BRCA1" and "NBR1" to test
wh <- genesymbol[c(gene1, gene2)]
wh <- range(wh, ignore.strand = TRUE)
#creating a gene model from an example TranscriptDb object
txdb <- TxDb.Hsapiens.UCSC.hg19.knownGene
p <- autoplot(txdb, which = wh)
print(p)
#printing out modified plots with introns displayed
p <- add_intron(p, introns)
print(p)
return(p)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.