grow_DD {netcom} | R Documentation |
Grow a Duplication and Divergence Network
Description
Grows an already existing network by adding a node according to the Duplication and Divergence mechanism. Nodes can only attach to previously grown nodes.
Usage
grow_DD(
matrix,
x,
divergence,
link = 0,
connected = FALSE,
retcon = FALSE,
directed = TRUE
)
Arguments
matrix |
Existing network to experience growth. |
x |
The ID of the node to be grown. |
divergence |
Probability that the new node loses edges associated with the node it duplicates. Needs to be between zero and one. |
link |
Probability that the new node attaches to the node it duplicates. Defaults to 0. |
connected |
Binary argument determining if the newly grown node has to be connected to the existing network. Defaults to FALSE, to prevent rare computational slow-downs when it is unlikely to create a connected network. Defaults to FALSE. |
retcon |
Binary variable determining if already existing nodes can attach to new nodes. Defaults to FALSE. |
directed |
Binary variable determining if the network is directed, resulting in off-diagonal asymmetry in the adjacency matrix. Defaults to TRUE. |
Details
Different from Duplication & Mutation models in that edges can only be lost.
Value
An adjacency matrix.
References
Ispolatov, I., Krapivsky, P. L., & Yuryev, A. (2005). Duplication-divergence model of protein interaction network. Physical review E, 71(6), 061911.
Examples
# Import netcom
library(netcom)
size <- 10
existing_network <- matrix(sample(c(0,1), size = size^2, replace = TRUE), nrow = size, ncol = size)
new_network_prep <- matrix(0, nrow = size + 1, ncol = size + 1)
new_network_prep[1:size, 1:size] = existing_network
new_network <- grow_DD(matrix = new_network_prep, x = size + 1, divergence = 0.5)