# >>>>>>>>>>>>>>>> Load network and generate random initial states <<<<<<<<<<<<<<<<<
# Load the example network
data(lac_operon_net)
# Generate some random states
states <- matrix(sample(c(0, 1), 10 * length(lac_operon_net$genes),
replace = TRUE), nrow = 10, ncol = length(lac_operon_net$genes))
# >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> Method: BNp <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
# Define the parameters for the BNp method
params <- rep(0.05, length(lac_operon_net$genes))
# Obtain frequency of pairwise transitions
pairwise_trans <- count_pairwise_trans(lac_operon_net, states = states,
method = "BNp", params = params, steps = 100, repeats = 10)
# >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> Method: SDDS <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
# Define the parameters for the SDDS method
props <- rep(0.95, length(lac_operon_net$genes))
params <- list(p00 = props, p01 = props, p10 = props, p11 = props)
# Obtain frequency of pairwise transitions
pairwise_trans <- count_pairwise_trans(lac_operon_net, states = states,
method = "SDDS", params = params, steps = 100, repeats = 10)
# >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> Method: PEW <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
# Extract edges from the network
edges <- extract_edges(lac_operon_net)
# Define the parameters for the PEW method
p_on <- runif(nrow(edges))
p_off <- runif(nrow(edges))
params <- list(p_on = p_on, p_off = p_off)
# Obtain frequency of pairwise transitions
pairwise_trans <- count_pairwise_trans(lac_operon_net, states = states,
method = "PEW", params = params, steps = 100, repeats = 10)
Run the code above in your browser using DataLab