ewce_plot: Plot EWCE results

Description Usage Arguments Value Examples

View source: R/ewce_plot.r

Description

ewce_plot generates plots of EWCE enrichment results

Usage

1
ewce_plot(total_res, mtc_method = "bonferroni", ctd = NULL)

Arguments

total_res

results dataframe generated using bootstrap_enrichment_test or ewce_expression_data functions. Multiple results tables can be merged into one results table, as long as the 'list' column is set to distinguish them.

mtc_method

method to be used for multiple testing correction. Argument is passed to p.adjust. Valid options are "holm", "hochberg", "hommel", "bonferroni", "BH", "BY",

ctd

Should be provided so that the dendrogram can be taken from it and added to plots

Value

A ggplot containing the plot

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
library(ewceData)
# Load the single cell data
ctd <- ctd()

# Set the parameters for the analysis
# Use 3 bootstrap lists for speed, for publishable analysis use >10000
reps <- 3

# Load the gene list and get human orthologs
example_genelist <- example_genelist()
mouse_to_human_homologs <- mouse_to_human_homologs()
m2h <- unique(mouse_to_human_homologs[, c("HGNC.symbol", "MGI.symbol")])
mouse.hits <-
     unique(m2h[m2h$HGNC.symbol %in% example_genelist, "MGI.symbol"])
mouse.bg <- unique(c(m2h$MGI.symbol[1:100],mouse.hits))

# Bootstrap significance test, no control for transcript length or GC content
full_results <- bootstrap_enrichment_test(
    sct_data = ctd, hits = mouse.hits,
    bg = mouse.bg, reps = reps, annotLevel = 2,
    sctSpecies = "mouse", genelistSpecies = "mouse"
)

# Generate the plot
print(ewce_plot(full_results$results, mtc_method = "BH"))

NathanSkene/EWCE documentation built on June 19, 2021, 5:40 a.m.