# >>>>>>>>>>>>>>>> Load network and generate random initial states <<<<<<<<<<<<<<<<<
# Load the example network
data(lac_operon_net)
# Generate a single initial state
initial_state <- sample(c(0, 1), length(lac_operon_net$genes), replace = TRUE)
# Generate multiple (10) initial states
initial_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))
# No initial states are provided
reached_states <- get_reached_states(lac_operon_net, method = "BNp", params = params,
steps = 100, repeats = 10)
# A single initial state is provided
reached_states <- get_reached_states(lac_operon_net, method = "BNp", params = params,
steps = 100, initial_states = initial_state, repeats = 10)
# Multiple initial states are provided
reached_states <- get_reached_states(lac_operon_net, method = "BNp", params = params,
steps = 100, initial_states = initial_states)
# >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> 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)
# No initial states are provided
reached_states <- get_reached_states(lac_operon_net, method = "SDDS", params = params,
steps = 100, repeats = 10)
# A single initial state is provided
reached_states <- get_reached_states(lac_operon_net, method = "SDDS", params = params,
steps = 100, initial_states = initial_state, repeats = 10)
# Multiple initial states are provided
reached_states <- get_reached_states(lac_operon_net, method = "SDDS", params = params,
steps = 100, initial_states = initial_states)
# >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> 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)
# No initial states are provided
reached_states <- get_reached_states(lac_operon_net, method = "PEW", params = params,
steps = 100, repeats = 10)
# A single initial state is provided
reached_states <- get_reached_states(lac_operon_net, method = "PEW", params = params,
steps = 100, initial_states = initial_state, repeats = 10)
# Multiple initial states are provided
reached_states <- get_reached_states(lac_operon_net, method = "PEW", params = params,
steps = 100, initial_states = initial_states)
Run the code above in your browser using DataLab