Borealis-BioModeling / pysb-units

PySB add-on providing utilities to add units to models and perform dimensional analysis.
BSD 2-Clause "Simplified" License
1 stars 0 forks source link

Concentration to number of molecules converter #2

Open blakeaw opened 1 week ago

blakeaw commented 1 week ago

Suggested by James Pino:

Something like a units.Model.to_molecules(vol=...) converter that can take a model in concentration units and quickly yield its molecular counts. This would be useful for stochastic simulations.

blakeaw commented 5 days ago

This is partially addressed by PR https://github.com/Borealis-BioModeling/pysb-units/pull/4, which adds the new SimulationUnits class and the set_molecule_volume function that can be used to enforce automatic conversion of parameters with molar concentrations to molecular counts as part of the model definition.

However, the functionality of something like a Model.to_molecules function has yet to be fully implemented. This is a bit more difficult since the units for expressions that include a concentration must be reconstructed after applying the appropriate conversion to parameters and observables.