instantiation.yaml 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319
  1. ReleasePattern:
  2. superclass: BaseDataClass
  3. doc: |
  4. Defines a release pattern that specifies repeating molecule releases.
  5. Can be used by a ReleaseSite.
  6. items:
  7. - name: name
  8. type: str
  9. default: unset
  10. doc: Name of the release pattern.
  11. - name: release_interval
  12. type: float
  13. default: TIME_INFINITY
  14. doc: |
  15. During a train of releases, release molecules after every t seconds.
  16. Default is to release only once.
  17. - name: train_duration
  18. type: float
  19. default: TIME_INFINITY
  20. doc: |
  21. The train of releases lasts for t seconds before turning off.
  22. Default is to never turn off.
  23. - name: train_interval
  24. type: float
  25. default: TIME_INFINITY
  26. doc: |
  27. A new train of releases happens every t seconds.
  28. Default is to never have a new train.
  29. The train interval must not be shorter than the train duration.
  30. - name: number_of_trains
  31. type: int
  32. default: 1
  33. doc: |
  34. Repeat the release process for n trains of releases. Default is one train.
  35. For unlimited number of trains use a constant NUMBER_OF_TRAINS_UNLIMITED.
  36. MoleculeReleaseInfo:
  37. superclass: BaseDataClass
  38. doc: |
  39. Defines a pair (molecule, location). Used in ReleaseSite when its shape is Shape.LIST.
  40. items:
  41. - name: complex
  42. type: Complex*
  43. doc: |
  44. Complex instance defining the molecule that will be released.
  45. Orientation of the complex instance is used to define orientation of the released molecule,
  46. when Orientation.DEFAULT is set, volume molecules are released with Orientation.NONE and
  47. surface molecules are released with Orientation.UP.
  48. Compartment must not be set because this specific release definition states the location.
  49. - name: location
  50. type: List[float]
  51. doc: |
  52. 3D position where the molecule will be released.
  53. If a molecule has a 2D diffusion constant, it will be
  54. placed on the surface closest to the coordinate given.
  55. Argument must have exactly three floating point values [x, y, z].
  56. ReleaseSite:
  57. superclass: BaseDataClass
  58. doc: |
  59. Defines a release site that specifies where, when and how should molecules be released.
  60. examples: tests/pymcell4/1100_point_release/model.py
  61. items:
  62. - name: name
  63. type: str
  64. doc: Name of the release site
  65. - name: complex
  66. type: Complex*
  67. default: unset
  68. doc: |
  69. Defines the species of the molecule that will be released. Not used for the LIST shape.
  70. Must be set when molecule_list is empty and unset when molecule_list is not empty.
  71. Orientation of the complex instance is used to define orientation of the released molecule,
  72. when Orientation.DEFAULT is set, volume molecules are released with Orientation.NONE and
  73. surface molecules are released with Orientation.UP.
  74. When compartment is specified and region is not set, this sets shape to Shape.COMPARTMENT and
  75. the molecules are released into the compartment.
  76. When this is a release of volume molecules, and both compartment and region are set,
  77. this sets shape to Shape.REGION_EXPR and the target region is the intersection
  78. of the region and the compartment.
  79. - name: molecule_list
  80. type: List[MoleculeReleaseInfo*]
  81. default: empty
  82. doc: |
  83. Used for LIST shape release mode.
  84. Only one of number_to_release, density, concentration or molecule_list can be set.
  85. - name: release_time
  86. type: float
  87. default: 0
  88. doc: |
  89. Specifies time in seconds when the release event is executed.
  90. In case when a release pattern is used, this is the time of the first release.
  91. Equivalent to MDL's RELEASE_PATTERN command DELAY.
  92. - name: release_pattern
  93. type: ReleasePattern*
  94. default: unset
  95. doc: |
  96. Use the release pattern to define schedule of releases.
  97. The default is to release the specified number of molecules at the set release_time.
  98. - name: shape
  99. type: Shape
  100. default: Shape.UNSET
  101. doc: |
  102. Defines how the molecules shoudl be released.
  103. Set automatically for these cases to the following values\:
  104. region is set - Shape.REGION_EXPR,
  105. region is not set and complex uses a compartment - Shape.COMPARTMENT,
  106. molecule_list is set - Shape.LIST,
  107. location is set - Shape.SPHERICAL.
  108. - name: region
  109. type: Region*
  110. default: unset
  111. doc: |
  112. Defines a volume or surface region where to release molecules.
  113. Setting it sets shape to Shape.REGION_EXPR.
  114. When this is a release of volume molecules, and both compartment and region are set,
  115. this sets shape to Shape.REGION_EXPR and the target region is the intersection
  116. of the region and the compartment.
  117. - name: location
  118. type: List[float]
  119. default: unset
  120. doc: |
  121. Defines center of a sphere where to release molecules.
  122. Setting it sets shape to Shape.SPHERICAL.
  123. - name: site_diameter
  124. type: float
  125. default: 0
  126. doc: |
  127. For a geometrical release site, this releases molecules uniformly within
  128. a radius r computed as site_diameter/2.
  129. Used only when shape is Shape.SPHERICAL.
  130. Maximum one of site_diameter or site_radius may be set.
  131. - name: site_radius
  132. type: float
  133. default: unset
  134. doc: |
  135. For a geometrical release site, this releases molecules uniformly within
  136. a radius site_radius.
  137. Used only when shape is Shape.SPHERICAL.
  138. Maximum one of site_diameter or site_radius may be set.
  139. - name: number_to_release
  140. type: float
  141. default: unset
  142. doc: |
  143. Sets number of molecules to release. Cannot be set when shape is Shape.LIST.
  144. Only one of number_to_release, density, concentration or molecule_list can be set.
  145. Value is truncated (floored) to an integer.
  146. - name: density
  147. type: float
  148. default: unset
  149. doc: |
  150. Unit is molecules per square micron (for surfaces).
  151. Only one of number_to_release, density, concentration or molecule_list can be set.
  152. Cannot be set when shape is Shape.LIST.
  153. - name: concentration
  154. type: float
  155. default: unset
  156. doc: |
  157. Unit is molar (moles per liter) for volumes.
  158. Only one of number_to_release, density, concentration or molecule_list can be set.
  159. Cannot be set when shape is Shape.LIST.
  160. - name: release_probability
  161. type: float
  162. default: 1
  163. doc: |
  164. This release does not occur every time, but rather with probability p.
  165. Either the whole release occurs or none of it does; the probability does not
  166. apply molecule-by-molecule. release_probability must be in the interval [0, 1].
  167. InitialSurfaceRelease:
  168. superclass: BaseDataClass
  169. doc: Defines molecules to be released onto a SurfaceRegion right when simulation starts
  170. items:
  171. - name: complex
  172. type: Complex*
  173. doc: |
  174. Defines the species of the molecule that will be released.
  175. - name: number_to_release
  176. type: int
  177. default: unset
  178. doc: |
  179. Number of molecules to be released onto a region,
  180. only one of number_to_release and density can be set.
  181. - name: density
  182. type: float
  183. default: unset
  184. doc: |
  185. Density of molecules to be released onto a region,
  186. only one of number_to_release and density can be set.
  187. Instantiation:
  188. doc: |
  189. Container used to hold instantiation-related model data.
  190. Instantiation is usually specific for each model, defines
  191. the geometry and initial setup of molecule releases.
  192. examples: tests/pymcell4/1250_organelle_move
  193. items:
  194. - name: release_sites
  195. type: List[ReleaseSite*]
  196. default: empty
  197. doc: |
  198. List of release sites to be included in the model.
  199. - name: geometry_objects
  200. type: List[GeometryObject*]
  201. default: empty
  202. doc: |
  203. List of geometry objects to be included in the model.
  204. - name: checkpointed_molecules
  205. type: List[BaseChkptMol*]
  206. default: empty
  207. doc: |
  208. Used when resuming simulation from a checkpoint.
  209. methods:
  210. - name: add_release_site
  211. doc: Adds a reference to the release site s to the list of release sites.
  212. params:
  213. - name: s
  214. type: ReleaseSite*
  215. - name: find_release_site
  216. doc: Finds a release site by its name, returns None if no such release site is present.
  217. return_type: ReleaseSite*
  218. params:
  219. - name: name
  220. type: str
  221. - name: add_geometry_object
  222. doc: Adds a reference to the geometry object o to the list of geometry objects.
  223. params:
  224. - name: o
  225. type: GeometryObject*
  226. - name: find_geometry_object
  227. doc: Finds a geometry object by its name, returns None if no such geometry object is present.
  228. return_type: GeometryObject*
  229. params:
  230. - name: name
  231. type: str
  232. - name: find_volume_compartment_object
  233. doc: |
  234. Finds a geometry object by its name, the geometry object must be a BNGL compartment.
  235. Returns None if no such geometry object is present.
  236. return_type: GeometryObject*
  237. params:
  238. - name: name
  239. type: str
  240. - name: find_surface_compartment_object
  241. doc: |
  242. Finds a geometry object that is a BNGL compartment and its surface name is name.
  243. Returns None if no such geometry object is present.
  244. return_type: GeometryObject*
  245. params:
  246. - name: name
  247. type: str
  248. - name: load_bngl_compartments_and_seed_species
  249. doc: |
  250. First loads section compartments and for each 3D compartment that does not
  251. already exist as a geometry object in this Instantiation object, creates a
  252. box with compartment's volume and also sets its 2D (membrane) compartment name.
  253. When multiple identical geometry objects are added to the final Model object,
  254. only one copy is left so one can merge multiple Instantiation objects that created
  255. compartments assuming that their volume is the same.
  256. Then loads section seed species from a BNGL file and creates release sites according to it.
  257. All elementary molecule types used in the seed species section must be already defined in subsystem.
  258. If an item in the BNGL seed species section does not have its compartment set,
  259. the argument default_region must be set and the molecules are then released into or onto the
  260. default_region.
  261. examples: tests/pymcell4/2100_gradual_bngl_load/model.py
  262. params:
  263. - name: file_name
  264. type: str
  265. doc: Path to the BNGL file.
  266. - name: default_release_region
  267. type: Region*
  268. default: unset
  269. doc: |
  270. Used as region for releases for seed species that have no compartments specified.
  271. - name: parameter_overrides
  272. type: Dict[str, float]
  273. default: empty
  274. doc: |
  275. For each key k in the parameter_overrides, if it is defined in the BNGL's parameters section,
  276. its value is ignored and instead value parameter_overrides[k] is used.