R/plot.GO.output.R

Defines functions plot.GO.output

Documented in plot.GO.output

#' @name plot.GO.output
#' @aliases plot.GO.output
#' 
#' @title Plot GO enrichment output
#'
#' @description Creates a dot plot of GO terms
#'
#' @param result The result file from the perform.GO.enrichment
#'
#' @export plot.GO.output

plot.GO.output <- function(result) {
  
  result$rank <- -log10(result$rank)
  result$cluster <- as.character(result$cluster)
  
  ggplot2::ggplot(data = result, ggplot2::aes(y = Term, x = cluster, color = rank)) + 
    ggplot2::geom_point(ggplot2::aes(size = rank)) + ggplot2::scale_size_continuous() + 
    ggplot2::theme_bw() + ggplot2::guides(color=ggplot2::guide_legend(title="-log10(rank)"), size=ggplot2::guide_legend(title="-log10(rank)"))
  
}
connorhknight/IBRAP documentation built on March 9, 2023, 7:01 p.m.