extend_subnets {Corbi} | R Documentation |
Extend subnetworks by pairwise overlapping two sets of smaller subnetworks.
extend_subnets(subnet1, subnet2, size = 0)
subnet1 |
The matrix representing the first set of subnetworks |
subnet2 |
The matrix representing the second set of subnetworks |
size |
The desired size of extended subnetworks |
Enumerate all possible subnetworks of desired size by pairwise overlapping two sets of
subnetworks of size s1
and s2
. The desired size should be between
max(s1,s2)+1
and s1+s2-1
. Invalid desired size will be replaced by the
minimum allowed value max(s1,s2)+1
.
A matrix represents the extended subnetworks, in which each row represents a subnetwork.
library(Corbi) net <- matrix(FALSE, nrow=10, ncol=10) net[sample.int(100, 20)] <- TRUE net <- net | t(net) subnets <- get_subnets(net, 3) subnets[[4]] <- extend_subnets(subnets[[3]], subnets[[2]], 4)