bnem: Boolean Nested Effects Model main function

Description Usage Arguments Value Author(s) See Also Examples

View source: R/bnem_main.r

Description

This function takes a prior network and normalized perturbation data as input and trains logical functions on that prior network

Usage

 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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
bnem(
  search = "greedy",
  fc = NULL,
  exprs = NULL,
  egenes = NULL,
  pkn = NULL,
  design = NULL,
  stimuli = NULL,
  inhibitors = NULL,
  signals = NULL,
  CNOlist = NULL,
  model = NULL,
  sizeFac = 10^-10,
  NAFac = 1,
  parameters = list(cutOffs = c(0, 1, 0), scoring = c(0.1, 0.2, 0.9)),
  parallel = NULL,
  method = "s",
  approach = "fc",
  relFit = FALSE,
  verbose = TRUE,
  reduce = TRUE,
  parallel2 = 1,
  initBstring = NULL,
  popSize = 100,
  pMutation = 0.5,
  maxTime = Inf,
  maxGens = Inf,
  stallGenMax = 10,
  relTol = 0.01,
  priorBitString = NULL,
  selPress = c(1.2, 1e-04),
  fit = "linear",
  targetBstring = "none",
  elitism = NULL,
  inversion = NULL,
  selection = c("t"),
  type = "SOCK",
  exhaustive = FALSE,
  delcyc = FALSE,
  seeds = 1,
  maxSteps = Inf,
  node = NULL,
  absorpII = TRUE,
  draw = TRUE,
  prior = NULL,
  maxInputsPerGate = 2
)

Arguments

search

Type of search heuristic. Either "greedy", "genetic" or "exhaustive". "greedy" uses a greedy algorithm to move through the local neighbourhood of a initial hyper-graph. "genetic" uses a genetic algorithm. "exhaustive" searches through the complete search space and is not recommended.

fc

Foldchanges of gene expression values or equivalent input (normalized pvalues, logodds, ...). If left NULL, the gene expression data is used to calculate naive foldchanges.

exprs

Optional normalized gene expression data.

egenes

list object; each list entry is named after an S-gene and contains the egenes which are potential children

pkn

Prior knowledge network.

design

Optional design matrix for the gene expression values, if available. If kept NULL, bnem needs either stimuli, inhibitors or a CNOlist object.

stimuli

Character vector of stimuli names.

inhibitors

Character vector of inhibitors.

signals

Optional character vector of signals. Signals are S-genes, which can directly regulate E-genes. If left NULL, alls stimuli and inhibitors are defined as signals.

CNOlist

CNOlist object if available.

model

Model object including the search space, if available.

sizeFac

Size factor penelizing the hyper-graph size.

NAFac

factor penelizing NAs in the data.

parameters

parameters for discrete case (not recommended); has to ba list with entries cutOffs and scoring: cutOffs = c(a,b,c) with a (cutoff for real zeros), b (cutoff for real effects), c = -1 for normal scoring, c between 0 and 1 for keeping only relevant between -1 and 0 for keeping only a specific quantile of E-genes, and c > 1 for keeping the top c E-genes; scoring = c(a,b,c) with a (weight for real effects), c (weight for real zeros), b (multiplicator for effects/zeros between a and c);

parallel

Parallelize the search. An integer value specifies the number of threads on the local machine. A list object as in list(c(1,2,3), c("machine1", "machine2", "machine3")) specifies the threads distributed on different machines (local or others).

method

Scoring method can be "cosine" a correlation, distance measure or a probability based score "llr". See ?cor and ?dist for details.

approach

default "fc" for foldchanges or signed effect probabilities, "abs" for absolute effects or probabilities

relFit

if TRUE a relative fit for each E-gene is computed (not recommended)

verbose

TRUE gives additional information during the search.

reduce

if TRUE reduces the search space for exhaustive search

parallel2

if TRUE parallelises the starts and not the search itself

initBstring

Binary string of the initial hyper-graph.

popSize

Population size (only "genetic").

pMutation

Probability for mutation (only "genetic").

maxTime

Define a maximal time (seconds) for the search.

maxGens

Maximal number of generations (only "genetic").

stallGenMax

Maximum number of stall generations (only "genetic").

relTol

Score tolerance for networks defined as optimal but with a lower score as the real optimum (only "genetic").

priorBitString

Binary string defining hyper-edges which are added to every hyper-graph. E.g. if you know hyper-edge 55 is definitly there and to fix that, set priorBitString[55] <- 1 (only "genetic").

selPress

Selection pressure for the stochastic universal sampling (only "genetic").

fit

"linear" or "nonlinear fit for stochastic universal sampling

targetBstring

define a binary string representing a network; if this network is found, the computation stops

elitism

Number of best hyper-graphs transferred to the next generation (only "genetic").

inversion

Number of worst hyper-graphs for which their binary strings are inversed (only "genetic").

selection

"t" for tournament selection and "s" for stochastic universal sampling (only "genetic").

type

type of the paralellisation on multpile machines (default: SOCK)

exhaustive

If TRUE an exhaustive search is conducted if the genetic algorithm would take longer (only "genetic").

delcyc

If TRUE deletes cycles in all hyper-graphs (not recommended).

seeds

how many starts for the greedy search? (default: 1)

maxSteps

Maximal number of steps (only "greedy").

node

vector of S-gene names, which are used in the greedy search; if node = NULL all nodes are considered

absorpII

Use inverse absorption.

draw

If TRUE draws the network evolution.

prior

Binary vector. A 1 specifies hyper-edges which should not be optimized (only "greedy").

maxInputsPerGate

If no model is supplied, one is created with maxInputsPerGate as maximum number of parents for each hyper-edge.

Value

List object including the optimized hyper-graph and its corresponding binary string.

Author(s)

Martin Pirkl

See Also

nem

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
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, signals = 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", model = model, CNOlist = CNOlist,
fc = fc, pkn = PKN, stimuli = "A", inhibitors = c("B","C","D"),
parallel = NULL, initBstring = initBstring, draw = FALSE, verbose = FALSE,
maxSteps = Inf)

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