How to run similations in batch

76 views
Skip to first unread message

Kun

unread,
Aug 22, 2023, 9:25:11 PM8/22/23
to VCell Open Discussion Forum
I have a rule-based model, and I want to generate a large number of simulations with different initializations, how to automatically do this without manually specifying the initialization conditions for each simulation run?

Thanks in advance!

Blinov,Michael

unread,
Aug 23, 2023, 11:05:05 AM8/23/23
to VCell Open Discussion Forum
Yes, for any simulation in the Simulation tab, you can add multiple simulations with different parameter overrides specified in an external batch file. 

You create your_favorite_name.dat file that has the list of modified parameters at each line, in the format (no spaces around "="):
a=10, b=100, c=200, e=50, f=110, g=240
e=50, f=110, g=240
a=80, b=70, c=22

Each line corresponds to a new simulation with these parameter overrides.  Then you click on an icon right from "Delete Simulation" (it has a "settings wheel", mouse over - "Import Batch Simulation data"), and select the .dat file. After import, multiple simulations (one per line of .dat file) will be generated, each simulation with parameters defined on the corresponding line in the .dat file. Then all simulations can be selected (e.g., command+shift on Mac) and run together. The results can be exported together by selecting the next icon "Export Batch Simulation Results".

Note that parameters in the batch file correspond to parameters in Generated Math, and not directly to parameters specified in the model. All global parameters can be directly defined in the .dat file. However, local parameters have to be defined as they are mentioned in Generated Math tab, e.g., kf_r0 - local parameter kf in a reaction r0.

As rule-based models are preprocessed (rules are flattened to a reaction network),  parameters in Generated Math may be different from those you define in Physiology or Applications.  All global parameters can be directly defined in the .dat file. However, parameters that are defined as local (e.g., kf as a forward rate for reaction rules) cannot be specified in the batch file. Instead, individual rates and initial conditions for generated species can be specified. For example, for "Rule-based_Ran_ransport" model in the Tutorials folder, the first two lines of the following batch file are correct, but the third line will be not understood:
Kr_Transport_DirectHalf_0=55, Kf_C_p1_InverseHalf_0=12
s14_init_uM=10, s10_init_uM=5
kf=100, Ran_C_nuc=100

To define new values of rate parameters and initial conditions, they have to be defined as global parameters (e.g. krp and RanC_start ). Global parameters for rate constants are defined in the Kinetics tab. Global parameters for initial conditions have to be first specified under "Parameters and Functions" tab in the "Parameters, Functions, Units, etc." window, and then referred to in the Applications->Specifications->Species tab.  Then the batch simulation file can have lines as
RanC_start=100, krp=10
RanC_start=101, krp=12
RanC_start=102, krp=13

Hope that you'll find this feature useful. Please feel free to ask more questions and give suggestions and comments.

Best,
Michael

Michael L. Blinov, Ph.D. | Associate Professor

Director, Graduate Program in Systems Biology 

Investigator, Center for Cell Analysis and Modeling  |  UConn Health

400 Farmington Avenue, Farmington CT 06030-6406​

Web: https://health.uconn.edu/blinov-lab/

Email: bli...@uchc.edu 



From: vcell-...@googlegroups.com <vcell-...@googlegroups.com> on behalf of Kun <b22...@gmail.com>
Sent: Tuesday, August 22, 2023 9:25 PM
To: VCell Open Discussion Forum <vcell-...@googlegroups.com>
Subject: [VCell] How to run similations in batch
 
*** Attention: This is an external email. Use caution responding, opening attachments or clicking on links. ***
I have a rule-based model, and I want to generate a large number of simulations with different initializations, how to automatically do this without manually specifying the initialization conditions for each simulation run?

Thanks in advance!

--
You received this message because you are subscribed to the Google Groups "VCell Open Discussion Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vcell-discus...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vcell-discuss/31a5f05b-9db0-4074-ad76-5595ad979047n%40googlegroups.com.

Kun

unread,
Aug 24, 2023, 10:30:49 AM8/24/23
to VCell Open Discussion Forum
Hi Prof. Blinov,

Thank you so much for your detailed instructions, which are really helpful!

Now I can import batch simulations and run experiments together, but when I select multiple simulations and want to export batch results, the Export Batch Simulation Results icon becomes grey and I cannot click it.


vcell.png

Vasilescu,Dan

unread,
Aug 24, 2023, 12:29:58 PM8/24/23
to VCell Open Discussion Forum
The 2 batch simulation buttons only work when a template simulation is selected. So, for exporting, the user needs to select the template simulation and press the "Export batch simulation results" button; then the code will automatically detect the batch simulations that belong to the template and export their results.

Regards,
Dan

Sent: Thursday, August 24, 2023 10:30 AM

To: VCell Open Discussion Forum <vcell-...@googlegroups.com>
Subject: Re: [VCell] How to run similations in batch
 

Kun

unread,
Aug 25, 2023, 9:22:27 AM8/25/23
to VCell Open Discussion Forum
Hi Dan, 

Thanks for your explanation. I tried as you advised. I could select the template simulation and click the button 'Export Batch Simulation Data', however, the small window showing 'Retriving results' appears for a whilw and then disappear, then nothing happens next. I could view the results of each individual result of the batch simulation, so I think the results exist, and I failed to figure out why the result retriving seems failed.vcell.png

Blinov,Michael

unread,
Aug 25, 2023, 9:40:24 AM8/25/23
to VCell Open Discussion Forum
Hello,

Sorry, VCell has so many undocumented features 😉
When you select the base simulation and click on "Export Batch Simulation Results", the simulation results are automatically downloaded into the local VCell home directory vcell_home/batchResults, on my Mac it is 

/Users/my_user_name/.vcell/batchResults

To see the path to your vcell_home, click on Help -> VCell Properties...

Best,
Michael

Michael L. Blinov, Ph.D. | Associate Professor

Director, Graduate Program in Systems Biology 

Investigator, Center for Cell Analysis and Modeling  |  UConn Health

400 Farmington Avenue, Farmington CT 06030-6406​

Web: https://health.uconn.edu/blinov-lab/

Email: bli...@uchc.edu 


Sent: Friday, August 25, 2023 9:22 AM

Kun

unread,
Aug 25, 2023, 9:50:12 PM8/25/23
to VCell Open Discussion Forum
Hi Prof. Blinov, thank you for your instruction, now I can see my results!

Best regards,
Xikun

在2023年8月25日星期五 UTC+8 21:40:24<Blinov,Michael> 写道:
Hello,

Sorry, VCell has so many undocumented features 😉
When you select the base simulation and click on "Export Batch Simulation Results", the simulation results are automatically downloaded into the local VCell home directory vcell_home/batchResults, on my Mac it is 

/Users/my_user_name/.vcell/batchResults

To see the path to your vcell_home, click on Help -> VCell Properties...

Best,
Michael

Michael L. Blinov, Ph.D. | Associate Professor

Director, Graduate Program in Systems Biology 

Investigator, Center for Cell Analysis and Modeling  |  UConn Health

400 Farmington Avenue, Farmington CT 06030-6406​

Web: https://health.uconn.edu/blinov-lab/

Email: bli...@uchc.edu 


Kun

unread,
Aug 29, 2023, 11:19:24 AM8/29/23
to VCell Open Discussion Forum
I'm trying to run a large batch of simulation (998), and a warning pops up for each simulation as shown in the figure below. I have to click the 'OK' button 998 times to run my simulations.

Is there any method to turn off this warning?

Besides, I found that local run does not trigger this warning, however, local run seems not applicable to batch simulation? Is there any method to run batch simulation locally on my own computer.

Thanks!

Blinov,Michael

unread,
Aug 29, 2023, 12:55:18 PM8/29/23
to VCell Open Discussion Forum
Hello,

  1. VCell warnings cannot be turned off, the only way to eliminate warnings is to check them carefully and eliminate the reason of the warning. It can be because of too many or too few timepoints, inconsistent solver, etc. Warnings sometimes are different for server and local simulations. Please post the warning and we can comment on how to fix a particular warning.

  2. You can create multiple simulations using "Import Batch Simulations Data" and run each individual simulation locally, but the results are just displayed and not saved in the database. So, to enable the export of bath simulation results, they must be run on a server.
Cheers,
Michael



Sent: Tuesday, August 29, 2023 11:19 AM

Kun

unread,
Aug 29, 2023, 9:22:13 PM8/29/23
to VCell Open Discussion Forum
Thanks for the explanation and I'm sorry I forgot to attach the screenshot of the warning. Now it is attached below.

vcell.png

Blinov,Michael

unread,
Aug 30, 2023, 1:22:18 PM8/30/23
to vcell-...@googlegroups.com
Yes, this is the standard warning that the simulation results dataset is large. As it is just 6MB versus the recommended 5MB, it's easy to correct by "Edit Simulation" -> Solver or Mesh, and then limiting the number of data points. For your screenshot, you change "Keep .. at most 1000 time samples" to ""Keep .. at most 950 time samples" or a similar number. You can play with output options any way you want, having them at regular intervals or at specific times.

Best,
Michael

Sent: Tuesday, August 29, 2023 9:22 PM

To: VCell Open Discussion Forum <vcell-...@googlegroups.com>

Kun

unread,
Sep 1, 2023, 8:56:59 AM9/1/23
to VCell Open Discussion Forum
Thanks a lot for this solution, it works well!

Best regards,
Xikun

Kun

unread,
Oct 4, 2023, 8:53:25 AM10/4/23
to VCell Open Discussion Forum
Hello, may I ask an additional question regarding this post, which is: What does ' DirectHalf_0 ' and ' InverseHalf_0  ' mean when specifying the forward and inverse rates? Aren't Kf and Kr and the reaction name enough to indicate which rate we are trying to specify?

Thanks!

Blinov,Michael

unread,
Oct 17, 2023, 10:19:52 AM10/17/23
to VCell Open Discussion Forum
Hello,

Sorry for a delayed answer - everyone in the team was at COMBINE and ICSB meetings.

Rates in rule-based models are adjusted based on symmetry factors. It means that a microscopic rate defined in VCell interface assumes that there is a single way for a reaction to proceed. However, the same rate constant is applied to generated reactions with multiple possible ways of applying the reaction. 

Specifically, if a binding rule​ A+B -> A.B has a rate r, then when it is applied to the species A.A, then there are two ways of B binding to A.A (to the right and to the left A). So, the rate for reaction​ A.A + B -> A.A.B is 2*r. Same for A.A.B -> A.A + B - it also has a doubled rate.

Reversely, if a rule​ A+B -> A.B with a rate r is applied to two identical species A, then the rate for reaction​ A + A-> A.A will be 0.5*r, enabling the real rate to be r.  There is a rigorous derivation for mass-action based on ideal gas and populations of molecules.

Internally, we call the rates DirectHalf and InverseHalf to signify that these rates are applied to reactions lacking any symmetry (or to a half of a symmetric species). It is also used when we generate a reaction network (Specification -> Network -> Create new VCell BioModel) in which all reactions are irreversible, so we keep track of whether a reaction is generated by a direct or inverse rule. 

Hope it clears the situation,
Michael

Sent: Wednesday, October 4, 2023 8:53 AM

To: VCell Open Discussion Forum <vcell-...@googlegroups.com>
Subject: Re: [VCell] How to run similations in batch
 
Reply all
Reply to author
Forward
0 new messages