getAdja: Get Adjacency Matrix.

Description Usage Arguments Value See Also Examples

View source: R/getAdja.R

Description

The function returns the adjacency matrix of the network computed with the "doILP" function.

Usage

1
getAdja(res, n, annot=NULL)

Arguments

res

Result returned by the "doILP" function.

n

Integer: the number of nodes of the inferred network.

annot

Vector of character strings: the annotation of the edges as returned by "getEdgeAnnot".

Value

Numeric matrix: the adjacency matrix of the network.

See Also

doILP

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
n <- 3 # number of genes
K <- 4 # number of experiments
T_ <- 4 # number of time points

# generate random observation matrix
obs <- array(rnorm(n*K*T_), c(n,K,T_))

baseline <- c(0.75, 0, 0)

delta <- rep(0.75, n)

# perturbation vector, entry is 0 if gene is inactivated and 1 otherwise
b <- c(0,1,1, # perturbation exp1: gene 1 perturbed, gene 2,3 unperturbed
       1,0,1, # perturbation exp2: gene 2 perturbed, gene 1,3 unperturbed
       1,1,0, # perturbation exp3....
       1,1,1)
            
delta_type <- "perGene"
lambda <- 1/10
annot <- getEdgeAnnot(n)

#infer the network
res <- doILP(obs, delta, lambda, b, n, K, T_, annot, delta_type, prior=NULL,
             sourceNode=NULL, sinkNode=NULL, all.int=FALSE, all.pos=FALSE, flag_time_series=TRUE)

# make the adjacency matrix
adja <- getAdja(res, n)

lpNet documentation built on Nov. 8, 2020, 7:08 p.m.