getFitDT: The optimization function that finds the scaling factor for...

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/getFitDT.R

Description

This function is called from gaBinaryDT. Using the model passed as input, it finds a scaling factor that minimizes the mean squared error between the data from the boolean simulation and the experimental data. A spline is fitted to the experimental data to allow this.

Usage

1
getFitDT(simResults, CNOlist, model, indexList, sizeFac = 1e-04, NAFac = 1, nInTot, boolUpdates, lowerB, upperB)

Arguments

simResults

The simulation results as output from simulatorDT

CNOlist

A CNOlist on which the score is based (based on all valueSignals).

model

A model list.

indexList

A list of indexes of species stimulated/inhibited/signals, as produced by indexfinder applied on the model and CNOlist above.

sizeFac

The scaling factor for the size term in the objective function, default to 0.0001.

NAFac

The scaling factor for the NA term in the objective function, default to 1.

nInTot

The number of inputs in the model prior to cutting, used to normalise the size penalty.

boolUpdates

The number of synchronous updates performed by the boolean simulator.

lowerB

The lower bound for the optimized value of the scaling factor.

upperB

The upper bound for the optimized value of the scaling factor.

Details

The function optim() is used to find the optimal scaling factor.

Value

This function returns a list with elements:

score

The mean squared error between simulation and experiment with NA and model size penalties.

estimate

The scaling factor used to compare boolean and real data.

xCoords

The x-axis coordinates after multiplication with the scaling factor.

yInter

The interpolated values of the experimental data.

yBool

The boolean simulation results at each time point.

Author(s)

A. MacNamara

See Also

gaBinaryDT, simulatorDT

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
28
29
30
31
32
33
# this function is usually contained within gaBinaryDT
# but the output can be viewed as follows:

library(CellNOptR)
library(CNORdt)
data(CNOlistPB, package="CNORdt")
data(modelPB, package="CNORdt")

# pre-processing
indexOrig <- indexFinder(CNOlist=CNOlistPB, model=modelPB, verbose=TRUE)
fields4Sim <- prep4sim(model=modelPB)

boolUpdates = 10
simResults <- simulatorDT(
  CNOlist=CNOlistPB,
  model=modelPB,
  simList=fields4Sim,
  indices=indexOrig,
  boolUpdates=boolUpdates
)
simResults = convert2array(simResults, dim(CNOlistPB$valueSignals[[1]])[1],
length(modelPB$namesSpecies), boolUpdates)

optimRes <- getFitDT(
  simResults=simResults,
  CNOlist=CNOlistPB,
  model=modelPB,
  indexList=indexOrig,
  boolUpdates=boolUpdates,
  lowerB=0.8,
  upperB=10,
  nInTot=length(which(modelPB$interMat == -1))
)

CNORdt documentation built on Nov. 8, 2020, 11:11 p.m.