Learn R Programming

wrProteo (version 1.5.0)

summarizeForROC: Summarize statistical test result for plotting ROC-curves

Description

summarizeForROC takes statistical testing results (obtained using testRobustToNAimputation or moderTest2grp, based on limma) and calculates specifcity and sensitivity values for plotting ROC-curves along a panel of thresholds. Based on column from test$annot and argument 'spec' TP,FP,FN and TN are determined. Special consideration is made to 3 species mix samples as found in proteomics benchmark-tests. See also ROC on Wkipedia for explanations of TP,FP,FN and TN as well as examples. An optional plot may be produced, too. Return matrix with TP,FP,FN,TN,spec,sens,prec,accur and FDR count values along the various thrsholds specified in column 'alph'. Note that numerous other packages also provide support for building and plotting ROC-curves : Eg rocPkgShort, ROCR, pROC or ROCit

Usage

summarizeForROC(
  test,
  useComp = 1,
  tyThr = "BH",
  thr = NULL,
  columnTest = NULL,
  FCthrs = NULL,
  spec = c("H", "E", "S"),
  annotCol = "spec",
  filterMat = "filter",
  tit = NULL,
  color = 1,
  plotROC = TRUE,
  pch = 1,
  bg = NULL,
  overlPlot = FALSE,
  silent = FALSE,
  callFrom = NULL
)

Arguments

test

(class MArrayLM, S3-object from limma) from testing (eg testRobustToNAimputation or test2grp

useComp

(character or integer) in case multiple comparisons (ie multiple columns 'test$tyThr'); which pairwise comparison to used

tyThr

(character,length=1) type of stat test-result to be used for sensitivity and specificity calculations (eg 'BH','lfdr' or 'p.value'), must be list-element of 'test'

thr

(numeric) stat test (FDR/p-value) threshold, if NULL a panel of 108 p-value threshold-levels values will be used for calculating specifcity and sensitivity

columnTest

depreciated, please use 'useComp' instead

FCthrs

(numeric) Fold-Change threshold (display as line) give as Fold-change and NOT log2(FC), default at 1.5, set to NA for omitting

spec

(character) labels for species will be matched to column 'spec' of test$annot and used for sensitivity and specificity calculations. Important : 1st label for matrix (expected as constant) and subsequent labels for spike-ins (variable)

annotCol

(character) column name of test$annot to use to separate species

filterMat

(character) name (or index) of element of test containing matrix or vector of logical filtering results

tit

(character) optinal custom title in graph

color

(character or integer) color in graph

plotROC

(logical) toogle plot on or off

pch

(integer) type of symbol to be used (see par)

bg

(character) backgroud in plot (see par)

overlPlot

(logical) overlay to existing plot if TRUE

silent

(logical) suppress messages

callFrom

(character) allows easier tracking of message(s) produced

Value

matrix including imputed values or list of final and matrix with number of imputed by group (plus optional plot)

See Also

replot the figure plotROC, calculate AUC using AucROC, robust test for preparing tables testRobustToNAimputation, moderTest2grp, test2grp, eBayes in package limma, t.test

Examples

Run this code
# NOT RUN {
set.seed(2019); test1 <- list(annot=cbind(spec=c(rep("b",35), letters[sample.int(n=3,
  size=150,replace=TRUE)])), BH=matrix(c(runif(35,0,0.01), runif(150)), ncol=1))
tail(roc1 <- summarizeForROC(test1, spec=c("a","b","c")))

# }

Run the code above in your browser using DataLab