contabs: Contingency tables for networks with probabilistic edges. In networkBMA: Regression-based network inference using Bayesian Model Averaging

Description

Contingency table values relative to known truth for probabilistic networks given thresholds on edge probabilies.

Usage

 1 contabs(network, reference, size, thresholds = NULL)

Arguments

 network A network represented as a data frame in which each row corresponds to an edge with nonzero estimated probability. The first column gives the name of the regulator, the second column gives the name of the regulated gene, and the third column gives the estimated probability for the regulator-gene pair. If the third column is omitted it is assumed that all edges are assigned probability 1. reference A reference network represented as a two-column data frame in which each row corresponds to an edge, and the columns give the regulator and target genes, respectively. This is the true underlying network for determining the contingency table values. size The size of the network if all possible edges were included. thresholds Threshold values on the probability of edges being in the network for which contingency tables are desired. The default is all distinct nonzero probabilities in the network. Thresholds should be specified as probabilities rather than percentages.

Details

Pairs for which edges do not exist in reference are not enumerated, because their numbers could be very large. Instead, the size parameter is used to account for pairs that are not edges. However, the assumption is that all edges that are in the network but not in the reference are accounted for in size.
Care must be taken in specifying size. For example, if the reference does not contain self-edges while the network does, and size does not count self-edges, then contabs will not give the correct number of false negatives.

Value

Outputs a data frame giving the contingency table values for the specified thresholds, with row names being the threshold values. The variables (columns) are of the data frame are as follows:

 TP true positives, or regulator-gene pairs correctly identified as being linked in the reference network, FN false negatives, or gene pairs that are linked in the reference network but not in the proposed network, FP false positives, or gene pairs that are linked in the proposed network but not in the reference network, TN true negatives, or gene pairs that are not linked both networks.