plotAUC: Plot AUC curves

Description Usage Arguments Value Examples

View source: R/plotAUC.R

Description

The function is used to plot AUROC, AUPR, pAUROC and pAUPR curves.

Usage

1
2
3
4
plotAUC(table.methods, plot.method = c("auroc", "aupr", "top.precision",
  "fpr.precision"), roc.lim = c(0, 1, 0, 1), pr.lim = c(0, 1, 0, 1),
  top.precision.lim = c(0, 1000, 0, 1), fpr.precision.lim = c(0, 1, 0, 1),
  fill = F, color = NA, plot.ncol = 2, ...)

Arguments

table.methods

a list of confusion tables of comparison for multiple networks to the same reference network. The tables are the outputs of table.evalution. The names of the list names(table.methods) will be used to plot the legend of the curves.

plot.method

a character string indicates to plot AUROC ("auroc"), AUPR ("aupr"), precision vs top weighted edges ("top.precision") or precision vs false positive rate ("fpr.precision") curves.

roc.lim

a vector to specify the plot limits, i.e. xmin, xmax, ymin and ymax of AUROC curves.

pr.lim

a vector to specify the plot limits, i.e. xmin, xmax, ymin and ymax of AUPR curves.

top.precision.lim

a vector to specify the plot limits, i.e. xmin, xmax, ymin and ymax of precision vs top weighted edges curves.

fpr.precision.lim

a vector to specify the plot limits, i.e. xmin, xmax, ymin and ymax of precision vs false positive rate curves.

fill

logical. If TRUE, the area under the curvers will be filled with colors.

color

a color string vectors to specify the colors for the curves.

plot.ncol

the number of columns of the layout of mutliple plots.

...

additional options for geom_line(...).

Value

plotAUC returns plots.

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
26
##load librarys
library(RLowPC)
library(minet)
library(gridExtra)
library(ggplot2)
##get dream4 datasets
data(gnwdata)
data.exp<-gnwdata$size100$ts1[,-c(1:3)]
genes<-colnames(data.exp)
ref.edge<-gnwdata$size100$net1
ref.edge[,3]<-1
ref.adj<-edgelist2adjmatrix(ref.edge,genes)
##infer gene networks
inf.cor<-abs(cor(data.exp))
diag(inf.cor)<-0
inf.mi<-build.mim(data.exp)
inf.clr<-clr(inf.mi)
inf.mrnet<-mrnet(inf.mi)
##generate confusion tables
table.cor<-table.evaluate(inf.adj = inf.cor,ref.adj = ref.adj)
table.mi<-table.evaluate(inf.adj=inf.mi,ref.adj = ref.adj)
table.clr<-table.evaluate(inf.adj=inf.clr,ref.adj = ref.adj)
table.mrnet<-table.evaluate(inf.adj=inf.mrnet,ref.adj = ref.adj)
##put confusion tables into list, and set names as the methods
table.methods<-list(cor=table.cor,mi=table.mi,clr=table.clr,mrnet=table.mrnet)
plotAUC(table.methods,fill=T,lwd=1)

wyguo/RLowPC documentation built on May 28, 2017, 7:34 a.m.