Learn R Programming

BoolNet (version 1.44)

loadNetwork: Load a Boolean network from a file

Description

Loads a Boolean network or probabilistic Boolean network from a file and converts it to an internal transition table representation.

Usage

loadNetwork(file, bodySeperator = ",")

Arguments

file
The name of the file to be read
bodySeperator
An optional separation character to divide the target factors and the formulas. Default is ",".

Value

  • If only one function per gene is specified, a structure of class BooleanNetwork representing the network is returned. It has the following components:
  • genesA vector of gene names involved in the network. This list determines the indices of genes in inputs of functions or in state bit vectors.
  • interactionsA list with length(genes) elements, where the i-th element describes the transition function for the i-th gene. Each element has the following sub-components: [object Object],[object Object],[object Object]
  • fixedA vector specifying which genes are knocked-out or over-expressed. For each gene, there is one element which is set to 0 if the gene is knocked-out, to 1 if the gene is over-expressed, and to -1 if the gene is not fixed at all, i. e. can change its value according to the supplied transition function. Constant genes are automatically set to fixed values.
  • If there is at least one gene with two or more alternative transition functions, a structure of class ProbabilisticBooleanNetwork is returned. This structure is similar to BooleanNetwork, but allows for storing more than one function in an interaction. It consists of the following components:
  • genesA vector of gene names involved in the network. This list determines the indices of genes in inputs of functions or in state bit vectors.
  • interactionsA list with length(genes) elements, where the i-th element describes the alternative transition functions for the i-th gene. Each element is a list of transition functions. In this second-level list, each element has the the following sub-components: [object Object],[object Object],[object Object],[object Object]
  • fixedA vector specifying which genes are knocked-out or over-expressed. For each gene, there is one element which is set to 0 if the gene is knocked-out, to 1 if the gene is over-expressed, and to -1 if the gene is not fixed at all, i. e. can change its value according to the supplied transition function. You can knock-out and over-express genes using fixGenes.

Details

The routine supports a description language based on the Boolean operators AND (&), or (|), and NOT (!). The first line contains a header. In case of a Boolean network with only one function per gene, the header is "targets, functions"; in a probabilistic network, there is an optional third column "probabilities". All subsequent lines contain Boolean rules. A rule consists of a target gene, a separator, a Boolean expression to calculate a transition step for the target gene, and an optional probability for the rule (for probabilistic Boolean networks only -- see below). The EBNF description of the rule format is as follows:

Rule = GeneName Separator BooleanExpression [Separator Probability]; BooleanExpression = GeneName | "!" BooleanExpression | "(" BooleanExpression ")" | BooleanExpression " & " BooleanExpression | BooleanExpression " | " BooleanExpression; GeneName = ? A gene name from the list of involved genes ?; Separator = ? The field , usually "," ?; Probability = ? A floating-point number ?;

If there is exactly one rule for each gene, a Boolean network of class BooleanNetwork is created. In these networks, constant genes are automatically fixed (e.g. knocked-out or over-expressed). This means that they are always set to the constant value, and states with the complementary value are not considered in transition tables etc. If you would like to change this behaviour, use fixGenes to reset the fixing.

If two or more rules exist for the same gene, the function returns a probabilistic network of class ProbabilisticBooleanNetwork. In this case, alternative rules may be annotated with probabilities, which must sum up to 1 for all rules that belong to the same gene. If no probabilities are supplied, uniform distribution is assumed.

See Also

getAttractors, markovSimulation, toPajek, stateTransition, fixGenes

Examples

Run this code
library(BoolNet)

# write example network to file
sink("testNet.bn")
cat("targets, functions
")
cat("Gene1, !Gene2 | !Gene3
")
cat("Gene2, Gene3 & Gene4
")
cat("Gene3, Gene2 & !Gene1
")
cat("Gene4, 1
")
sink()

# read file
net <- loadNetwork("testNet.bn")
print(net)

Run the code above in your browser using DataLab