CVODE error with SBML


74
views
0
11 weeks ago by
I am getting this error while copying SBMLs during mitosis:

Error: CVODE Error: CV_CONV_FAILURE, Module: CVODE, Function: CVode, Message: At t = 0 and h = 7.85582e-10, the corrector convergence test failed repeatedly or with |h| = hmin.

Error: rr::IntegratorException::IntegratorException(const std::string &, const std::string &)what: CVODE Error: CV_CONV_FAILURE: Convergence test failures occurred too many times (= MXNCF = 10) during one internal timestep or occurred with |h| = hmin., where: virtual double rr::CVODEIntegrator::integrate(double, double)


This is only happening when I tried to assign different Initial conditions to each cell ID initially. However, I do have copy SBMLs from parent cell to Child Cell.

self.copySBMLs(_fromCell= parentCell, _toCell=childCell) # Copy the SBML to the child Cell

The way I am adding SBML initially is this (  I start with an initial 9 cells )
self.addSBMLToCellIds(_modelFile=modelFile, _modelName='PC_ODE', _ids=[1], _stepSize=stepSize,_initialConditions=IC1)
self.addSBMLToCellIds(_modelFile=modelFile, _modelName='PC_ODE', _ids=[2], _stepSize=stepSize,_initialConditions=IC2)
self.addSBMLToCellIds(_modelFile=modelFile, _modelName='PC_ODE', _ids=[3], _stepSize=stepSize,_initialConditions=IC3)
self.addSBMLToCellIds(_modelFile=modelFile, _modelName='PC_ODE', _ids=[4], _stepSize=stepSize,_initialConditions=IC4)
self.addSBMLToCellIds(_modelFile=modelFile, _modelName='PC_ODE', _ids=[5], _stepSize=stepSize,_initialConditions=IC5)
self.addSBMLToCellIds(_modelFile=modelFile, _modelName='PC_ODE', _ids=[6], _stepSize=stepSize,_initialConditions=IC6)
self.addSBMLToCellIds(_modelFile=modelFile, _modelName='PC_ODE', _ids=[7], _stepSize=stepSize,_initialConditions=IC7)
self.addSBMLToCellIds(_modelFile=modelFile, _modelName='PC_ODE', _ids=[8], _stepSize=stepSize,_initialConditions=IC8)
self.addSBMLToCellIds(_modelFile=modelFile, _modelName='PC_ODE', _ids=[9], _stepSize=stepSize,_initialConditions=IC9)

Where each IC # is a dictionary of values.

I would highly appreciate your help.

Kind regards,
Mahua


5 Answers


0
11 weeks ago by
Could you post your SBML model here? It might happen that for some "edge cases" in terms of parameter choice of the SBML model you might end up with this type of warning.
0
11 weeks ago by
I suspect one of more of your parameter sets is giving the SBML solver problems. You can try a dedicated SBML solver (Like COPASI or CellDesigner) to see if they also have problems with particular parameter sets.

In CC3D, you can try to narrow down which set is the problem by commenting out all the SBML initialization but one and hunting down the problematic set.

Also, have python print you IC# texts just to make sure they exist and their syntax is correct.
0
11 weeks ago by
I fixed the issue with having multiple SBML with initial conditions specified for each within the SBML, since I needed to assign different initial conditions to each cell ID while the overall model remains the same.

The CVODE error was occurring only when the mitosis was about to happen. I suspect that would be because I could not figure out how to specify initial conditions as the last state of the cell and pass it on to the child cell. The zero initial conditions in the parent SBML could be the problem.


However, I am still confused if I am doing the right thing by giving the same model name to all the SBMLs. Since the model is not changing nor the parameters, but only the initial conditions, I thought it only needs to be specified at the beginning. Here is the snippets of my code as well as the SBML as attached.


****
modelFile1 = './Simulation/S3_diffusion10.xml'
modelFile2 = './Simulation/S3_diffusion11.xml'
modelFile3 = './Simulation/S3_diffusion12.xml'
modelFile4 = './Simulation/S3_diffusion13.xml'


self.addSBMLToCellIds(_modelFile=modelFile1, _modelName='PC_ODE', _ids=[1], _stepSize=stepSize)
self.addSBMLToCellIds(_modelFile=modelFile2, _modelName='PC_ODE', _ids=[2], _stepSize=stepSize)
self.addSBMLToCellIds(_modelFile=modelFile3, _modelName='PC_ODE', _ids=[3], _stepSize=stepSize)
self.addSBMLToCellIds(_modelFile=modelFile4, _modelName='PC_ODE', _ids=[4], _stepSize=stepSize)

for cell in self.cellListByType(self.PCANCER, self.QCANCER, self.PSTEM, self.QSTEM):
               self.setSBMLValue(_modelName='PC_ODE', _valueName='Glu_out', _value=Glu_out,
            _cell=cell) # This is glucose out
             self.setSBMLValue(_modelName='PC_ODE', _valueName='Glutamine_out', _value=Glutamine_out,
            _cell=cell) # This is glutamine out




*** This is during the mitosis steppable :
State_parentcell=self.getSBMLState(_modelName='PC_ODE',_cell=parentCell) # Get all the states
self.copySBMLs(_fromCell= parentCell, _toCell=childCell) # Copy the SBML to the child Cell
self.setSBMLState(_modelName='PC_ODE', _cell=childCell, _state=State_parentcell)




At this point I just set the state of the child cell to be equal to that of the parent cell. However, Since the SBML had zero initial conditions, I think that is where the error was being generated.
File attached: S3_diffusion.xml (418.43 KB)

Am I right in giving the same name with the models with different initial conditions for different cell ID?







0
11 weeks ago by
"Am I right in giving the same name with the models with different initial conditions for different cell ID?"
Yes, the _modelName is specific for the particular cell so there is no confusion (to CC3D) that the same name refers to different SBML for different cells.

"At this point I just set the state of the child cell to be equal to that of the parent cell."
Be careful here. Make sure you know exactly what units the SBML file is using. SBML by default uses mass (grams, moles, ...), tools like COPASI convert things to concentration units (gram/liter, molarity, ...). So if your SBML units are grams (so CC3D uses it as grams/cell) and you divide the cell and then assign the same amount to both parent and daughter you will have doubled the amount of stuff. If your SBML is actually using concentration then you are OK since the amount/cell is the concentration times the cell's volume.
0
11 weeks ago by
Thank you Dr. Sluka. Yes, my model uses concentration.
Please login to add an answer/comment or follow this question.

Similar posts:
Search »