This function also writes a Graphviz dot file that contains the same information (see writeDot
for more information about the dot file conventions).
writeNetwork(modelOriginal, modelComprExpanded, optimResT1, optimResT2, CNOlist,
tag = NULL,verbose=FALSE)
$stringsTol
. Strings that are in $stringsTol
are the ones that are within the relative tolerance limits around the best solution in the population across all generations of the optimisation. !If there is no time 2, then the argument optimResT2 should be = NA
This function maps back the edges weights from the optimised (expanded and compressed) model to the original model. The mapping back only works if the path has length 2 at most (i.e. you have node1-comp1-comp2-node2, where comp refer to nodes that have been compressed).
tmpdir<-tempdir()
setwd(tmpdir)
#load data
data(CNOlistToy,package="CellNOptR")
data(ToyModel,package="CellNOptR")
#pre-process model
indicesToy<-indexFinder(CNOlistToy,ToyModel,verbose=TRUE)
ToyNCNOindices<-findNONC(ToyModel,indicesToy,verbose=TRUE)
ToyNCNOcut<-cutNONC(ToyModel,ToyNCNOindices)
indicesToyNCNOcut<-indexFinder(CNOlistToy,ToyNCNOcut)
ToyNCNOcutComp<-compressModel(ToyNCNOcut,indicesToyNCNOcut)
indicesToyNCNOcutComp<-indexFinder(CNOlistToy,ToyNCNOcutComp)
ToyNCNOcutCompExp<-expandGates(ToyNCNOcutComp)
#optimise
ToyFields4Sim<-prep4sim(ToyNCNOcutCompExp)
initBstring<-rep(1,length(ToyNCNOcutCompExp$reacID))
ToyT1opt<-gaBinaryT1(
CNOlist=CNOlistToy,
model=ToyNCNOcutCompExp,
initBstring=initBstring,
verbose=TRUE,
maxGens=2,
popSize=5)
#write network
writeNetwork(
modelOriginal=ToyModel,
modelComprExpanded=ToyNCNOcutCompExp,
optimResT1=ToyT1opt,
optimResT2=NA,
CNOlist=CNOlistToy)
Run the code above in your browser using DataLab