confusionMatrix: ConfusionTable statistics for the benchmarked interactions...

Description Usage Arguments Details Value Examples

Description

A function takes as an benchmarked interactions object and outputs confusion table statistics.

Usage

1
2
confusionMatrix(interactionsBench, benchCol = "Bench", prefilterCol = NULL,
  thresholdID = NULL, thresholdValue = 0.05, statistics = "PPV")

Arguments

interactionsBench

GInteractions object with added benchmark benchmarkInteractions and OPTIONAL filterPreBenchGI metadata. However,prior this analysis, it is advised to reduce the number of true negatives by including only interactions entries that could be potentially benchmarked.To get that info run filterPreBenchGI and add filter column with metadata from this function to interactionsBench GInteractions object prior running benchmarkInteractions)

benchCol

character (default "Bench"), results of benchmarking procedure; eg a column name of the metadata which indicates the column where the result of benchmarking procedure is stored. A vector of 0's and 1's is expected.

prefilterCol

character (default NULL), results of prefiltering procedure; eg a column name of the metadata which indicates the column where the result of prefiltering procedure is stored. A vector of 0's and 1's is expected.

thresholdID

character (def:NULL) name which indicates a column where statistics of the modelling procedure is stored. This column is filtered such that everything below predefined threshold is considered to be statistically significant association (set to be equal to 0), whereas everything above that threshold is 0".

thresholdValue

numeric (def:0.05) A value of a threshold.

statistics

character (def "ConfusionMatrix"). Currentlty, "ConfusionMatrix" or "PPV" are options.

Details

Reports statistics based on the confusion matrix. There are four different categories in the confusion matrix: TP = (number of) true positive: interactions entry that was reported to be associated (reported gene-enhancer statistics lower than a predefined threshold) and was benchmarked. FP = (number of) false positive: interactions entry that was reported to be associated (reported gene-enhancer statistics lower than a predefined threshold) BUT was not overlapped with benchmark dataset FN = (number of) false negative: interactions entry that was NOT reported to be associated (reported gene-enhancer statistics NOT lower than a predefined threshold) BUT is benchmarked TN = (number of) true negative: interactions entry that was NOT reported to be associated (reported gene-enhancer statistics NOT lower than a predefined threshold) AND is NOT benchmarked. If no benchmark and no statistically significant data is entered, then 0 is reported.

The formulas used in this function are:

Sensitivity = TP/(TP+FN)

Specificity = TN/(TN+FP)

Accuracy = (TP+TN)/(TP+FN+FP+TN)

PPV = TP/(TP+FP)

NPV = TN/(TN+FN)

F1 = (2*TP)/((2*TP)+FP+FN)

Value

integer vector or a list. If "ConfusionMatrix" is requested then the output is list with following elements:TP,FP,TN,FN,Specificity, Accuracy,PPV, NPV,F1. Otherwise only PPV is reported.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
require(GenomicRanges)
require(InteractionSet)
   
   interactionsBench <- GInteractions(GRReg1_toy,GRReg1_toy$reg)
   interactionsBench$PValue <- seq(0, 1,length.out = length(GRReg1_toy))


confusionMatrix(interactionsBench,
                thresholdID = "PValue",
                thresholdValue = 0.05,
                benchCol = "anchor1.Bench1Exp",
                prefilterCol = "anchor1.Filter1Exp",
                statistics = "ConfusionMatrix")
                
confusionMatrix(interactionsBench,
                thresholdID = "PValue", 
                thresholdValue = 0.05,
                benchCol = "anchor1.Bench1Exp",
                prefilterCol = "anchor1.Filter1Exp",
                statistics = "PPV")
               
               
     

BIMSBbioinfo/reg2gene documentation built on May 3, 2019, 6:42 p.m.