data(dream4)
network <- 1
reference <- dream4gold10[[network]]
nGenes <- length(unique(c(reference[,1],reference[,2])))
nPossibleEdges <- nGenes^2
# no self loops in reference (there are none)
any(as.character(reference[,1]) == as.character(reference[,2]))
# restrict reference to edges; first two columns (gene) only
reference <- reference[reference[,3] == 1,1:2]
nTimePoints <- length(unique(dream4ts10[[network]]$time))
edges1ts10s <- networkBMA( data = dream4ts10[[network]][,-(1:2)],
nTimePoints = nTimePoints, prior.prob = 0.1,
self = TRUE)
# self edges included in contingency table count
size <- nPossibleEdges
contingencyTables <- contabs(network = edges1ts10s, reference = reference,
size = size)
matrixFormat(contingencyTables)
edges1ts10 <- networkBMA( data = dream4ts10[[network]][,-(1:2)],
nTimePoints = nTimePoints, prior.prob = 0.1,
self = FALSE)
# self edges excluded in contingency table count
size <- nPossibleEdges - nGenes
contingencyTables <- contabs(network = edges1ts10, reference = reference,
size = size)
matrixFormat(contingencyTables)
Run the code above in your browser using DataLab