R/symbolicToTruthTable.R

Defines functions symbolicToTruthTable

Documented in symbolicToTruthTable

# Convert a SymbolicBooleanNetwork object 
# <network> to a BooleanNetwork object
symbolicToTruthTable <- function(network)
{
  stopifnot(inherits(network, "SymbolicBooleanNetwork"))
  res <- list(genes = network$genes,
              fixed = network$fixed,
              interactions = lapply(network$interactions, function(int)
              {
                newInt <- .Call("getTruthTable_R", int, length(network$genes))
                names(newInt) <- c("input","func")
                newInt$expression <- stringFromParseTree(int)
                return(newInt)
              }))
  class(res) <- "BooleanNetwork"
  return(res)
}

Try the BoolNet package in your browser

Any scripts or data that you put into this service are public.

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