File: symbolicToTruthTable.R

package info (click to toggle)
r-cran-boolnet 2.1.9-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 3,016 kB
  • sloc: ansic: 12,452; sh: 16; makefile: 2
file content (18 lines) | stat: -rw-r--r-- 636 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18

# 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)
}