Learn R Programming

Rato (version 0.1.0)

node.raw.score: Node score in network dynamics

Description

This function evaluates the significance of one or more nodes in a network given a system. It initially tests the dynamics of the network under a healthy state (i.e., without any perturbation). Then, it removes the specified nodes and runs the ODE again. The function compares the final state of the network under the perturbation to that of the healthy network to assess the importance of the nodes for network health.

Usage

node.raw.score(
  system,
  M,
  x0,
  nodes,
  initial_params = list(),
  times = seq(0, 100, 1),
  reduction = mean
)

Value

A list `L` with the following entries:

- L$score: The score of the nodes.

- L$normalized.score: The normalized score of the nodes.

Arguments

system

A function defining the system's dynamics: `system(time, x, params)`, which returns a list of state deltas `dx`.

M

The initial adjacency matrix of the network.

x0

Initial conditions of the network's nodes (numeric vector).

nodes

Nodes of interest to be removed.

initial_params

Either a list of initial parameters or a function of type `f(M) -> list` that takes the adjacency matrix of the network as input and returns the initial parameters of the system.

times

A vector of time points for the ODE solver.

reduction

A reduction function applied to the ODE solution. The output of this function must be a numeric value. The default is `mean`.

Examples

Run this code
   node_file <- system.file("extdata", "IL17.nodes.csv", package = "Rato")
   edge_file <- system.file("extdata", "IL17.edges.csv", package = "Rato")

   g <- Rato::graph.from.csv(node_file, edge_file, sep=",", header=TRUE)
   
   
   # Get the raw score of a node in the network
   score <- Rato::node.raw.score(
       Rato::Michaelis.Menten  # Use the Michaelis-Menten equation
     , g$M               # The GRN as an adjacency matrix
     , g$initial_values  # The initial values of the genes
     , g$node_index("ko:K03171") # The gene of interest
     , initial_params = list('f' = 1, 'h'=2, 'B'=0.01) # Parameters of the Michaelis-Menten equation
   )

Run the code above in your browser using DataLab