vcell icon indicating copy to clipboard operation
vcell copied to clipboard

BNGL import erroneously scales initial conditions by 2e-5

Open CodeByDrescher opened this issue 1 year ago • 4 comments

When BNGL is imported and option "Molecules" is selected, all initial counts are multiplied by 2e-5. No scaling (everything is OK) when "Concentration" option is selected.

CodeByDrescher avatar Jul 30 '24 17:07 CodeByDrescher

Save this file with .bngl extension and import with volume 1: once as Concentrations (no changes), once with Molecules - all initial counts will be scaled.

begin model begin parameters kp1 1.667e-06 # ligand-monomer binding, units: /molecule/s km1 0.06 # ligand-monomer dissociation, units: /s end parameters begin molecule types egf(r) egfr(l,r,Y1068~Y~pY) end molecule types begin seed species egf(r) 1.2e6 egfr(l,r,Y1068~Y) 1.8e5 end seed species begin reaction rules egfr(l,r) + egf(r) <-> egfr(l!1,r).egf(r!1) kp1, km1 #ligand-monomer end reaction rules begin observables Molecules Efgr_total egfr() end observables end model

vcellmike avatar Jan 14 '25 20:01 vcellmike

Clarification from Michael: if "molecules" are selected during import, the number specified in the bngl input file is to be considered as the absolute number of molecules, regardless of volume.
For example, egfr(l,r,Y1068~Y) 1.8e5 means we have 1.8e5 molecules in our volume.

danv61 avatar Jan 17 '25 19:01 danv61

Jim thinks it is ignoring the volume = 1 (or uses that as an extra scalar for default cell volume) and instead using 1/50,000 as a scale factor because default cell size is 50,000 cubic microns.

ACowan0105 avatar May 06 '25 16:05 ACowan0105

okay, then problem was when we imported BNGL models as within a ode application, we always coerced the application initial conditions to be "concentration", even if the user chose "molecules". A bit difficult to track down, but I found the fix.

jcschaff avatar Jul 30 '25 21:07 jcschaff

fixed in #1567

jcschaff avatar Nov 23 '25 22:11 jcschaff