stateTransition: Perform a transition to the next state

View source: R/stateTransition.R

stateTransitionR Documentation

Perform a transition to the next state

Description

Calculates the next state in a supplied network for a given current state

Usage

stateTransition(network,
                state,
                type = c("synchronous","asynchronous","probabilistic"),
                geneProbabilities, 
                chosenGene, 
                chosenFunctions,
                timeStep = 0)

Arguments

network

A network structure of class BooleanNetwork, SymbolicBooleanNetwork or ProbabilisticBooleanNetwork. These networks can be read from files by loadNetwork, generated by generateRandomNKNetwork, or reconstructed by reconstructNetwork.

state

The current state of the network, encoded as a vector with one 0-1 element for each gene. If network is of class SymbolicBooleanNetwork and makes use of more than one predecessor state, this can also be a matrix with the genes in the columns and multiple predecessor states in the rows.

type

The type of transition to be performed.

If set to "synchronous", all genes are updated using the corresponding transition functions.

If set to "asynchronous", only one gene is updated. This gene is either chosen randomly or supplied in parameter chosenGene.

If set to "probabilistic", one transition function is chosen for each gene, and the genes are updated synchronously. The functions are either chosen randomly depending on their probabilities, or they are supplied in parameter chosenFunctions.

Default is "synchronous" for objects of class BooleanNetwork and SymbolicBooleanNetwork, and "probabilistic" for objects of class ProbabilisticBooleanNetwork.

geneProbabilities

An optional vector of probabilities for the genes if type="asynchronous". By default, each gene has the same probability to be chosen for the next state transition. These probabilities can be modified by supplying a vector of probabilities for the genes which sums up to one.

chosenGene

If type="asynchronous" and this parameter is supplied, no random update is performed. Instead, the gene with the supplied name or index is chosen for the next transition.

chosenFunctions

If type="probabilistic", this parameter can contain a set of function indices for each gene. In this case, transition functions are not chosen randomly, but the provided functions are used in the state transition.

timeStep

An optional parameter that specifies the current time step associated with state. This is only relevant for networks of class SymbolicBooleanNetwork that make use of time-dependent predicates (timelt, timeis, timegt). Otherwise, this parameter is ignored.

Value

The subsequent state of the network, encoded as a vector with one 0-1 element for each gene.

See Also

loadNetwork, generateRandomNKNetwork, generateState

Examples

## Not run: 
# load example network
data(cellcycle)

# calculate a synchronous state transition
print(stateTransition(cellcycle, c(1,1,1,1,1,1,1,1,1,1)))

# calculate an asynchronous state transition of gene CycA
print(stateTransition(cellcycle, c(1,1,1,1,1,1,1,1,1,1),
                      type="asynchronous", chosenGene="CycA"))
                      
# load probabilistic network
data(examplePBN)

# perform a probabilistic state transition
print(stateTransition(examplePBN, c(0,1,1),
                      type="probabilistic"))       

## End(Not run)

BoolNet documentation built on Oct. 2, 2023, 5:08 p.m.