plotROC: Create ROC plot

Description Usage Arguments Details Value Author(s) Examples

View source: R/plotROC.R

Description

Create receiver operating characteristic (ROC) plot at various threshold settings.

Usage

1
plotROC(seqs, score, group, label, refGroup, title, legTitle)

Arguments

seqs

Sequin names

score

How to rank ROC points

group

How to group ROC points

label

True-positive (TP) or false positive (FP)

refGroup

Reference ratio groups

title

Label of the plot. Default to NULL.

legTitle

Title of the legend. Default to Ratio.

Details

Create a receiver operating characteristic (ROC) plot at various threshold settings. The true positive rate (TPR) is plotted on the x-axis and false positive rate (FPR) is plotted on the y-axis.

The function requires a scoring threshold function, and illustrates the performance of the data as the threshold is varied. Common scoring threshold include p-value, sequencing depth and allele frequency, etc.

ROC plot is a useful diagnostic performance tool; it provides tools to select possibly optimal models and to discard suboptimal ones. In particularly, the AUC statistics indicate the performance of the model relatively to a random experiment (AUC 0.5).

Value

The function prints ROC plot and return it's AUC statistics.

Author(s)

Ted Wong t.wong@garvan.org.au

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
library(Anaquin)

#
# Data set generated by DESeq2 and Anaquin. described in Section 5.6.3.3 of
# the user guide.
#
data(UserGuideData_5.6.3)

# Sequin names
seqs <- row.names(UserGuideData_5.6.3)

# Expected log-fold
group <- abs(UserGuideData_5.6.3$ExpLFC)

# How the ROC curves are ranked
score <- 1-UserGuideData_5.6.3$Pval

# Classified labels (TP/FP)
label <- UserGuideData_5.6.3$Label

plotROC(seqs, score, group, label, title='ROC Plot', refGroup=0)

Example output

Loading required package: ggplot2


|   |    AUC|
|--:|------:|
|  4| 0.9062|
|  3| 0.8939|
|  2| 0.7955|
|  1| 0.6713|
$AUC
       AUC
4 4 0.9062
3 3 0.8939
2 2 0.7955
1 1 0.6713

Anaquin documentation built on Nov. 8, 2020, 5:23 p.m.