Plot p-values of methytmle objects

# S3 method for methytmle
plot(x, ..., type = "both")

Arguments

x

Object of class methytmle as produced by an appropriate call to methyvim.

...

Additional arguments passed plot as necessary.

type

The type of plot to build: one of side-by-side histograms (type "both") comparing raw p-values to FDR-adjusted p-values (using the FDR-MSA correction) or either of these two histogram separately. Set this argument to "raw_pvals" for a histogram of the raw p-values, and to "fdr_pvals" for a histogram of the FDR-corrected p-values.

Value

Object of class ggplot containing a histogram or side-by-side histograms of the raw (marginal) and corrected p-values, with the latter computed automatically using the method of Tuglus and van der Laan.

Examples

suppressMessages(library(SummarizedExperiment)) library(methyvimData) data(grsExample) var_int <- as.numeric(colData(grsExample)[, 1])
#> Error in (function (classes, fdef, mtable) { methods <- .findInheritedMethods(classes, fdef, mtable) if (length(methods) == 1L) return(methods[[1L]]) else if (length(methods) == 0L) { cnames <- paste0("\"", vapply(classes, as.character, ""), "\"", collapse = ", ") stop(gettextf("unable to find an inherited method for function %s for signature %s", sQuote(fdef@generic), sQuote(cnames)), domain = NA) } else stop("Internal error in finding inherited methods; didn't return a unique method", domain = NA)})(list(structure("DataFrame", package = "S4Vectors")), structure(function (x, use.names = FALSE, ...) standardGeneric("mcols"), generic = structure("mcols", package = "S4Vectors"), package = "S4Vectors", group = list(), valueClass = character(0), signature = c("x", "use.names"), default = `\001NULL\001`, skeleton = (function (x, use.names = FALSE, ...) stop("invalid call in method dispatch to 'mcols' (no default method)", domain = NA))(x, use.names, ...), class = structure("standardGeneric", package = "methods")), <environment>): unable to find an inherited method for function ‘mcols’ for signature ‘"DataFrame"’
methyvim_out_ate <- suppressWarnings( methyvim(data_grs = grsExample, sites_comp = 25, var_int = var_int, vim = "ate", type = "Mval", filter = "limma", filter_cutoff = 0.1, parallel = FALSE, tmle_type = "glm" ) )
#> Error in methyvim(data_grs = grsExample, sites_comp = 25, var_int = var_int, vim = "ate", type = "Mval", filter = "limma", filter_cutoff = 0.1, parallel = FALSE, tmle_type = "glm"): object 'var_int' not found
plot(methyvim_out_ate)
#> Error in plot(methyvim_out_ate): object 'methyvim_out_ate' not found