R/plot_CoGAPS_ChiSq.R

Defines functions plot_CoGAPS_ChiSq

Documented in plot_CoGAPS_ChiSq

#'Plots the mean ChiSq values of a set of CoGAPS results
#'
#' @description plot_CoGAPS_ChiSq() plots the mean ChiSq values of a set of CoGAPS results.
#' 
#' @param CoGAPS_res_set a CoGAPS result set.
#' @keywords plot_CoGAPS_ChiSq
#' @export
#' @return A ggplot2 object
#' @examples
#' plot_CoGAPS_ChiSq(myCoGAPSres)


plot_CoGAPS_ChiSq <- function(CoGAPS_set) {
  nRuns <- length(CoGAPS_set)
  ChiSq <- sapply(seq(1,nRuns,1), function(x) {
    CoGAPS_set[[x]]@metadata$meanChiSq
  })
  tmp <- as.data.frame(names(CoGAPS_set))
  colnames(tmp) <- c("run")
  tmp$ChiSq <- ChiSq
  print(tmp)
  p <- ggplot(tmp, aes(x=run, y=ChiSq, group=1)) + geom_point() + geom_line()
  return(p)
}
jacobheng/cellwrangler documentation built on Aug. 12, 2019, 6:49 a.m.