Summarize statistical test result for plotting ROC-curves
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
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 )
test |
(class |
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 |
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 |
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 |
filterMat |
(character) name (or index) of element of |
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 |
bg |
(character) backgroud in plot (see |
overlPlot |
(logical) overlay to existing plot if |
silent |
(logical) suppress messages |
callFrom |
(character) allows easier tracking of message(s) produced |
matrix including imputed values or list of final and matrix with number of imputed by group (plus optional plot)
replot the figure plotROC
, calculate AUC using AucROC
, robust test for preparing tables testRobustToNAimputation
, moderTest2grp
, test2grp
, eBayes
in package limma, t.test
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")))
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.