findResiduals: compute residuals

Description Usage Arguments Value Author(s) Examples

View source: R/bnem_main.r

Description

calculates residuals (data and optimized network do not match) and visualizes them

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
findResiduals(
  bString,
  CNOlist,
  model,
  fc = NULL,
  exprs = NULL,
  egenes = NULL,
  NEMlist = NULL,
  parameters = list(cutOffs = c(0, 1, 0), scoring = c(0.1, 0.2, 0.9)),
  method = "s",
  sizeFac = 10^-10,
  main = "residuals for decoupled vertices",
  sub = paste0("green residuals are added effects (left positive,",
    " right negative) and red residuals are deleted ", "effects"),
  cut = TRUE,
  approach = "fc",
  parallel = NULL,
  verbose = TRUE,
  ...
)

Arguments

bString

Binary vector denoting the network given a model

CNOlist

CNOlist object

model

Network model object.

fc

ORS of the data as numeric matrix.

exprs

Optional activation scheme of the data as numeric matrix.

egenes

Atachment of the E-genes (optional) as list named after S-genes.

NEMlist

NEMlist object (optional).

parameters

see ?bnem

method

Scoring method (optional).

sizeFac

Zeta parameter to penelize network size.

main

Main title of the figure.

sub

Subtitle of the figure.

cut

If TRUE does not visualize experiments/S-genes which do not have any residuals.

approach

see ?bnem

parallel

the number of threads used for computation.

verbose

verbose output

...

additional parameters for ?epiNEM::HeatmapOP

Value

numeric matrices indicating experiments and/or genes, where the network and the data disagree

Author(s)

Martin Pirkl

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
sifMatrix <- rbind(c("A", 1, "B"), c("A", 1, "C"), c("B", 1, "D"),
c("C", 1, "D"))
write.table(sifMatrix, file = "temp.sif", sep = "\t", row.names = FALSE,
col.names = FALSE,
quote = FALSE)
PKN <- CellNOptR::readSIF("temp.sif")
unlink('temp.sif')
CNOlist <- dummyCNOlist("A", c("B","C","D"), maxStim = 1, maxInhibit = 2,
signal = c("A", "B","C","D"))
model <- CellNOptR::preprocessing(CNOlist, PKN, maxInputsPerGate = 100)
exprs <- matrix(rnorm(nrow(slot(CNOlist, "cues"))*10), 10,
nrow(slot(CNOlist, "cues")))
fc <- computeFc(CNOlist, exprs)
initBstring <- rep(0, length(model$reacID))
res <- bnem(search = "greedy", CNOlist = CNOlist, fc = fc, model = model,
parallel = NULL, initBstring = initBstring, draw = FALSE, verbose = FALSE,
maxSteps = Inf)
rownames(fc) <- seq_len(nrow(fc))
## val <- validateGraph(CNOlist = CNOlist, fc = fc, model = model,
## bString = res$bString, Egenes = 10, Sgene = 4)
residuals <- findResiduals(res$bString, CNOlist, model, fc = fc)

MartinFXP/B-NEM documentation built on Aug. 30, 2020, 8:22 a.m.