LoLab-MSM / pysb

Python framework for Systems Biology modeling [Lopez Lab Mods]
BSD 2-Clause "Simplified" License
6 stars 8 forks source link

Merge pysb.tools.bngSSA simulator back into pysb.bng #14

Closed JamesPino closed 6 years ago

JamesPino commented 9 years ago

BNGs ssa simulator is currently in pysb.bng.run_ssa. Every time it is called it generates the network, currently only has capabilities to run 1 simulation.

I wrote a bngSSA simulate class located pysb.tools.bngSSA. It is based off Leonards simulate class. We can initialize the simulator, generating the network only once. This allows us to 1.) save time by not regenerating the network when running the model again 2.) allow multiple runs with the same call.

I think the best thing to do is completely separate run_ssa from pysb.bng. Right now pysb.tools.stochkit simulator and pysb.tools.cupSODA solver are in tools. The base ode solver is in pysb.integrate. If we did an overhaul and move all simulate methods to a common area, I think it would be easier to see the options. I an idea pysb.simulator(model,tspan,method = 'bng_ssa' ['cupSODA','lsoda','stochkit','pla',...], args). Having each method in a separate location seems cumbersome.

Any thoughts?

I wrote this to train models in parallel using ssa. Each process starts a perl call to run_network. I pass the bngl file created by the simulator the pregenerated network. Right now I cannot think of a way to discard this at the end of the simulations. If we recall BNGssa.run(), we don't want to use the cleanup flag because it deletes the network. Right now it just leaves it there. Does anyone have any suggestions on what to do with the temporary generated network at the end of the script?

alubbock commented 6 years ago

This was implemented a while ago (run_ssa is now in pysb.bng). Longer term, it should probably be deprecated in favor of the BngSimulator (or at least make run_ssa a thin wrapper to the Simulator).