n <- 5 # number of genes
K <- 7 # number of perturbations experiments
# perturbation vector, entry is 0 if gene is inactivated and 1 otherwise
b <- c(0,1,1,1,1, # perturbation exp1: gene 1 perturbed, gene 2-5 unperturbed
1,0,1,1,1, # perturbation exp2: gene 2 perturbed, gene 1,3,4,5 unperturbed
1,1,0,1,1, # perturbation exp3....
1,1,1,0,1,
1,1,1,1,0,
1,0,0,1,1,
1,1,1,1,1)
# example network
T_nw <- matrix(c(0,1,1,0,0,
0,0,0,-1,0,
0,0,0,1,0,
0,0,0,0,1,
0,0,0,0,0), nrow=n,ncol=n,byrow=TRUE)
# compute theoretical activation of genes from example network with given perturbations
act_mat <- calcActivation(T_nw, b, n, K)
Run the code above in your browser using DataLab