tutorial.rst 4.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. *******************
  2. Python API Tutorial
  3. *******************
  4. Overview
  5. ########
  6. This tutorial shows how to use MCell4 Python API with BioNetGen language to construct a model of a cell with two organelles
  7. that uses volume-volume and volume-surface reactions.
  8. You will gradually build, simulate, and visualize the model and after completing all the steps, this will be the result:
  9. .. image:: ../images/tutorial_result.png
  10. Using the Tutorial
  11. ##################
  12. The tutorial is provided as a series of Python files where each file
  13. is a runnable model.
  14. These tutorial files serve as guidelines and the recommended usage of the tutorial
  15. is to write your own model file by following steps in these individual files
  16. and copying code snippets from there int your file.
  17. Each explanation is a multiline comment starting with the section index followed
  18. by the index of the comment as shown below:
  19. .. code-block:: python
  20. """
  21. 0010-1)
  22. The main difference ...
  23. To highlight changes in the subsequent sections, the explanations
  24. from a previous section are removed and replaced with a reference
  25. to the comment index so that it can be found in the preceding files if needed.
  26. .. code-block:: python
  27. #0010-1)
  28. """
  29. 0020-1)
  30. In the previous section ...
  31. In the BioNetGen language, no multiline comments are allowed, so
  32. previous comment indices are prefixed with ## and the new ones with just one #.
  33. .. code-block:: python
  34. ## 0030-3)
  35. # 0040-3)
  36. # Specify ...
  37. Tutorial Sections
  38. #################
  39. 0. | Diffusion of a volume molecule
  40. | `0000_vol_mol_diffusion/model.py <https://github.com/mcellteam/mcell_tests/blob/master/tests/tutorial//0000_vol_mol_diffusion/model.py>`_
  41. | `0000_vol_mol_diffusion/viz.blend <https://github.com/mcellteam/mcell_tests/blob/master/tests/tutorial/0000_vol_mol_diffusion/viz.blend>`_
  42. 1. | Adding a box to the model
  43. | `0010_vol_mol_diffusion_in_box/model.py <https://github.com/mcellteam/mcell_tests/blob/master/tests/tutorial//0010_vol_mol_diffusion_in_box/model.py>`_
  44. 2. | Replacing the box with an icosphere
  45. | `0020_vol_mol_diffusion_in_icosphere/model.py <https://github.com/mcellteam/mcell_tests/blob/master/tests/tutorial//0020_vol_mol_diffusion_in_icosphere/model.py>`_
  46. 3. | Defining species and molecule releases with BNGL (BioNetGen language)
  47. | `0030_mol_release_with_bngl_and_compartments/model.py <https://github.com/mcellteam/mcell_tests/blob/master/tests/tutorial//0030_mol_release_with_bngl_and_compartments/model.py>`_
  48. | `0030_mol_release_with_bngl_and_compartments/model.bngl <https://github.com/mcellteam/mcell_tests/blob/master/tests/tutorial/0030_mol_release_with_bngl_and_compartments/model.bngl>`_
  49. 4. | Volume-volume and volume-surface reaction definition with BNGL
  50. | `0040_vol_and_surf_reactions/model.py <https://github.com/mcellteam/mcell_tests/blob/master/tests/tutorial//0040_vol_and_surf_reactions/model.py>`_
  51. | `0040_vol_and_surf_reactions/model.bngl <https://github.com/mcellteam/mcell_tests/blob/master/tests/tutorial/0040_vol_and_surf_reactions/model.bngl>`_
  52. 5. | Counting molecules
  53. | `0050_counting/model.py <https://github.com/mcellteam/mcell_tests/blob/master/tests/tutorial/0050_counting/model.py>`_
  54. | `0050_counting/model.bngl <https://github.com/mcellteam/mcell_tests/blob/master/tests/tutorial/0050_counting/model.bngl>`_
  55. 6. | Complete organelle model
  56. | `0060_full_organelle_model/model.py <https://github.com/mcellteam/mcell_tests/blob/master/tests/tutorial/0060_full_organelle_model/model.py>`_
  57. | `0060_full_organelle_model/model.bngl <https://github.com/mcellteam/mcell_tests/blob/master/tests/tutorial/0060_full_organelle_model/model.bngl>`_
  58. 7. | Optimizing simulation performance
  59. | `0070_simulation_performance/model.py <https://github.com/mcellteam/mcell_tests/blob/master/tests/tutorial/0070_simulation_performance/model.py>`_
  60. | `0070_simulation_performance/model.bngl <https://github.com/mcellteam/mcell_tests/blob/master/tests/tutorial/0070_simulation_performance/model.bngl>`_