R/GRgetMetrics.R

Defines functions GRgetMetrics

Documented in GRgetMetrics

#' GR metrics
#'
#' Given a SummarizedExperiment object created by \code{\link{GRfit}},
#' this function returns a table of GR metrics (as well as traditional 
#' metrics) for each experiment in the dataset.
#'
#' @param fitData a SummarizedExperiment object, generated by the GRfit 
#' function.
#'
#' @return A table with GR metrics and goodness of fit measures
#' @author Nicholas Clark
#' @details
#' Given a SummarizedExperiment object created by \code{\link{GRfit}},
#' this function returns a table of GR metrics and traditional metrics 
#' along with goodness of fit measures. It also identifies each fit 
#' as flat or sigmoidal. This is simply a convenient accessor function, 
#' equivalent to \code{cbind(as.data.frame(colData(fitData)), 
#' as.data.frame(t(assay(fitData))))}.
#' @seealso To create the object needed for this function, see
#' \code{\link{GRfit}}.
#' @examples
#' # Load Case A (example 1) input
#' data("inputCaseA")
#' head(inputCaseA)
#' # Run GRfit function with case = "A"
#' output1 = GRfit(inputData = inputCaseA,
#' groupingVariables = c('cell_line','treatment'))
#' metrics = GRgetMetrics(output1)
#' \dontrun{View(metrics)}
#' head(metrics)
#' @export

GRgetMetrics <- function(fitData) {
  return(cbind(as.data.frame(SummarizedExperiment::colData(fitData)), 
               as.data.frame(t(SummarizedExperiment::assay(fitData)))))
}
uc-bd2k/GRmetrics documentation built on Nov. 11, 2020, 4:10 p.m.