#' add_intron
#'
#' modifies a plot to display the regions of a chromosome that are intronic
#' @param plot The ggplot object that will be modified
#' @param introns Data Frame of the regions of the genome that are intronic
#' @return The modified ggplot object
#' @import ggplot2
#' @export
add_intron <- function(plot, introns) {
#interating through the intervals that aren't exons, therefore must be introns
for (i in 1:nrow(introns)) {
if (introns[i, 1] < introns[i, 2]) {
plot <- plot + geom_rect(data=NULL, aes(xmin=introns[i, 1], xmax=introns[i, 2], ymin=-Inf, ymax=Inf),
fill="orangered1")
}
}
return(plot)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.