vcell icon indicating copy to clipboard operation
vcell copied to clipboard

Bug when using multiple anchors in rule-based compartments NFSim

Open vcellmike opened this issue 3 years ago • 4 comments

The rule-based model with three compartments and three reactions transport molecules anchored to a membrane to a volume. It manifests itself only when there are two different membranes. Model Compartments_bug2022a

The simplest model has 2 molecules R, A and 2 species R in pm , A in cyt. R is anchored to two membranes pm and em and is initially located in pm.

The first reaction reversibly binds A to R in pm. The next moves any complex with R to em. The third moves aby complex with A to cyt. The bug: the model creates R-A in cytosol, where R can not be located.

If R moving to em is disabled, R-A stays in pm - no error.

vcellmike avatar Dec 20 '22 22:12 vcellmike

The behavior is consistent with our current implementation, as follows: The reaction A_translocate tries to move ApmRpm to the cyt, the result being AcytRpm Since cyt is not a permitted destination for R, the algorithm tries to find a possible destination that's acceptable for both A and R If none is found, we throw an exception If exactly one is found, that's the correct destination If more than one is found (in our case pm and em are both acceptable) we throw an exception because we don't know how to choose between them.

danv61 avatar Dec 21 '22 20:12 danv61

For deterministic BNG it properly gives an error and does not allow saving, but for NFSim VCell generates species in a wrong compartment, which is a bug.

vcellmike avatar Jan 03 '23 17:01 vcellmike

In short term could prevent anchoring molecule in multiple compartments, but limit to anchor to a single compartment. Need to decide and possibly revisit more complete fix in 7.6 Jim, Michael and Dan will discuss. Jim will query to see how many models have multiple anchors.

ACowan0105 avatar Jan 17 '23 17:01 ACowan0105

see #770 which is a stop-gap measure to create a warning.

jcschaff avatar Feb 01 '23 18:02 jcschaff