ggplot2_TPR_FPRPlot: Plot TPR and FPR of each combination

Description Usage Arguments Details Value Author(s) References Examples

View source: R/plot_TPR_FPR.R

Description

ggplot2_TPR_FPR function uses the full dataset list of DE genes as the ground truth to calculate the True Positive Rate (TPR) and False Positive Rate (FPR) for each sample combinations tested. The TPR and FPR are then plotted with FPR on x-axis and TPR on y-axis similar to a ROC curve.

Usage

1
2
3
4
5
6
7
ggplot2_TPR_FPRPlot(
  deg = NULL,
  count_table.filtered = NULL,
  stat = "mean",
  path = ".",
  save_plot = TRUE
)

Arguments

deg

The list of DE genes generated by one of ERSSA::DE_*.R scripts.

count_table.filtered

The filtered count table with non- and low-expression genes removed. Used to identify the genes found to be non-DE.

stat

The statistics used to summarize TPR and FPR at each replicate level. Options include 'mean' and 'median'. Default = 'mean'.

path

Path to which the plot will be saved. Default to current working directory.

save_plot

Boolean. Whether to save plot to drive. Default to TRUE.

Details

Using the list of DE genes generated from the full dataset as the ground truth should be done with caution. Since the true list of DE genes is not known, this is the best alternative. This plot enables the visualization of the sensitivity and (1-specificity) of the DE gene detection at the tested replicate levels. At a sufficient replicate level, a relatively high TPR can be reached with reasonable low FPR. Such a replicate level is sufficient for most studies as additional replicates produce little improvement in TPR.

Value

A list is returned containing:

Author(s)

Zixuan Shao, Zixuanshao.zach@gmail.com

References

H. Wickham. ggplot2: Elegant Graphics for Data Analysis. Springer-Verlag New York, 2009.

Examples

1
2
3
4
5
6
7
# load edgeR deg object generated by erssa_edger using example dataset
# example dataset containing 1000 genes, 4 replicates and 5 comb. per rep.
# level
data(deg.partial, package = "ERSSA")
data(count_table.filtered.partial, package = "ERSSA")

gg_TPR_FPR = ggplot2_TPR_FPRPlot(deg.partial, count_table.filtered.partial)

ERSSA documentation built on Nov. 8, 2020, 7:44 p.m.