Learn R Programming

CNORdt (version 1.14.0)

getFitDT: The optimization function that finds the scaling factor for the boolean simulation

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

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.

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.

Details

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

See Also

gaBinaryDT, simulatorDT

Examples

Run this code
# 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))
)

Run the code above in your browser using DataLab