plotPerf_multi: Plots a set of ROC/PR curves with average.

Description Usage Arguments Details Value Examples

View source: R/plotPerf_multi.R

Description

Plots a set of ROC/PR curves with average.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
plotPerf_multi(
  inList,
  plotTitle = "performance",
  plotType = "ROC",
  xlab = "TPR",
  ylab = "FPR",
  meanCol = "darkblue",
  xlim = c(0, 1),
  ylim = c(0, 1)
)

Arguments

inList

(list or ROCR::performance object) ROCR::performance objects, one per iteration

plotTitle

(numeric) plot title

plotType

(char) one of ROC | PR | custom. Affects x/y labels

xlab

(char) x-axis label

ylab

(char) y-axis label

meanCol

(char) colour for mean trendline

xlim

(numeric) min/max extent for x-axis

ylim

(numeric) min/max extent for y-axis

Details

Plots average curves with individual curves imposed.

Value

No value. Side effect of plotting ROC and PR curves

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
inDir <- system.file("extdata","example_output",package="netDx")
all_rng <- list.files(path = inDir, pattern = 'rng.')
fList <- paste(inDir,all_rng,'predictionResults.txt',sep=getFileSep())
rocList <- list()
for (k in seq_len(length(fList))) {
  dat <- read.delim(fList[1],sep='\t',header=TRUE,as.is=TRUE)
  predClasses <- c('LumA', 'notLumA')
  pred_col1 <- sprintf('%s_SCORE',predClasses[1])
  pred_col2 <- sprintf('%s_SCORE',predClasses[2])
  idx1 <- which(colnames(dat) == pred_col1)
  idx2 <- which(colnames(dat) == pred_col2)
 pred <- ROCR::prediction(dat[,idx1]-dat[,idx2], 
		dat$STATUS==predClasses[1])
 rocList[[k]] <- ROCR::performance(pred,'tpr','fpr')
}
plotPerf_multi(rocList,'ROC')

BaderLab/netDx documentation built on Sept. 26, 2021, 9:13 a.m.