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
)
(class MArrayLM
, S3-object from limma) from testing (eg testRobustToNAimputation
or test2grp
(character or integer) in case multiple comparisons (ie multiple columns 'test$tyThr'); which pairwise comparison to used
(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'
(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
depreciated, please use 'useComp' instead
(numeric) Fold-Change threshold (display as line) give as Fold-change and NOT log2(FC), default at 1.5, set to NA
for omitting
(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)
(character) column name of test$annot
to use to separate species
(character) name (or index) of element of test
containing matrix or vector of logical filtering results
(character) optinal custom title in graph
(character or integer) color in graph
(logical) toogle plot on or off
(integer) type of symbol to be used (see par
)
(character) backgroud in plot (see par
)
(logical) overlay to existing plot if TRUE
(logical) suppress messages
(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
# 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