mcell.pyi 40 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647
  1. from typing import List, Dict, Callable, Any
  2. from enum import Enum
  3. INT32_MAX = 2147483647 # do not use this constant in your code
  4. FLT_MAX = 3.40282346638528859812e+38 # do not use this constant in your code
  5. # "forward" declarations to make the type hints valid
  6. class BaseChkptMol():
  7. pass
  8. class ChkptSurfMol():
  9. pass
  10. class ChkptVolMol():
  11. pass
  12. class Color():
  13. pass
  14. class Complex():
  15. pass
  16. class Component():
  17. pass
  18. class ComponentType():
  19. pass
  20. class Config():
  21. pass
  22. class Count():
  23. pass
  24. class CountTerm():
  25. pass
  26. class ElementaryMolecule():
  27. pass
  28. class ElementaryMoleculeType():
  29. pass
  30. class GeometryObject():
  31. pass
  32. class InitialSurfaceRelease():
  33. pass
  34. class Instantiation():
  35. pass
  36. class Introspection():
  37. pass
  38. class Model():
  39. pass
  40. class MolWallHitInfo():
  41. pass
  42. class Molecule():
  43. pass
  44. class MoleculeReleaseInfo():
  45. pass
  46. class Notifications():
  47. pass
  48. class Observables():
  49. pass
  50. class ReactionInfo():
  51. pass
  52. class ReactionRule():
  53. pass
  54. class Region():
  55. pass
  56. class ReleasePattern():
  57. pass
  58. class ReleaseSite():
  59. pass
  60. class RngState():
  61. pass
  62. class Species():
  63. pass
  64. class Subsystem():
  65. pass
  66. class SurfaceClass():
  67. pass
  68. class SurfaceProperty():
  69. pass
  70. class SurfaceRegion():
  71. pass
  72. class VizOutput():
  73. pass
  74. class Wall():
  75. pass
  76. class WallWallHitInfo():
  77. pass
  78. class Warnings():
  79. pass
  80. class bngl_utils():
  81. pass
  82. class data_utils():
  83. pass
  84. class geometry_utils():
  85. pass
  86. class run_utils():
  87. pass
  88. class Vec3():
  89. def __init__(self, x : float = 0, y : float = 0, z : float = 0):
  90. self.x = x
  91. self.y = y
  92. self.z = z
  93. class Vec2():
  94. def __init__(self, u : float = 0, v : float = 0):
  95. self.u = u
  96. self.v = v
  97. class Orientation(Enum):
  98. DOWN = -1
  99. NONE = 0
  100. UP = 1
  101. NOT_SET = 2
  102. ANY = 3
  103. DEFAULT = 4
  104. class Notification(Enum):
  105. NONE = 0
  106. BRIEF = 1
  107. FULL = 2
  108. class WarningLevel(Enum):
  109. IGNORE = 0
  110. WARNING = 1
  111. ERROR = 2
  112. class VizMode(Enum):
  113. ASCII = 0
  114. CELLBLENDER_V1 = 1
  115. CELLBLENDER = 2
  116. class Shape(Enum):
  117. UNSET = 0
  118. SPHERICAL = 1
  119. REGION_EXPR = 2
  120. LIST = 3
  121. COMPARTMENT = 4
  122. class SurfacePropertyType(Enum):
  123. UNSET = 0
  124. REACTIVE = 1
  125. REFLECTIVE = 2
  126. TRANSPARENT = 3
  127. ABSORPTIVE = 4
  128. CONCENTRATION_CLAMP = 5
  129. FLUX_CLAMP = 6
  130. class ExprNodeType(Enum):
  131. UNSET = 0
  132. LEAF = 1
  133. ADD = 2
  134. SUB = 3
  135. class RegionNodeType(Enum):
  136. UNSET = 0
  137. LEAF_GEOMETRY_OBJECT = 1
  138. LEAF_SURFACE_REGION = 2
  139. UNION = 3
  140. DIFFERENCE = 4
  141. INTERSECT = 5
  142. class ReactionType(Enum):
  143. UNSET = 0
  144. UNIMOL_VOLUME = 1
  145. UNIMOL_SURFACE = 2
  146. VOLUME_VOLUME = 3
  147. VOLUME_SURFACE = 4
  148. SURFACE_SURFACE = 5
  149. class MoleculeType(Enum):
  150. UNSET = 0
  151. VOLUME = 1
  152. SURFACE = 2
  153. class BNGSimulationMethod(Enum):
  154. NONE = 0
  155. ODE = 1
  156. SSA = 2
  157. PLA = 3
  158. NF = 4
  159. class CountOutputFormat(Enum):
  160. UNSET = 0
  161. AUTOMATIC_FROM_EXTENSION = 1
  162. DAT = 2
  163. GDAT = 3
  164. STATE_UNSET = 'STATE_UNSET'
  165. STATE_UNSET_INT = -1
  166. BOND_UNBOUND = -1
  167. BOND_BOUND = -2
  168. BOND_ANY = -3
  169. PARTITION_EDGE_EXTRA_MARGIN_UM = 0.01
  170. DEFAULT_COUNT_BUFFER_SIZE = 100
  171. ALL_MOLECULES = 'ALL_MOLECULES'
  172. ALL_VOLUME_MOLECULES = 'ALL_VOLUME_MOLECULES'
  173. ALL_SURFACE_MOLECULES = 'ALL_SURFACE_MOLECULES'
  174. DEFAULT_CHECKPOINTS_DIR = 'checkpoints'
  175. DEFAULT_SEED_DIR_PREFIX = 'seed_'
  176. DEFAULT_SEED_DIR_DIGITS = 5
  177. DEFAULT_ITERATION_DIR_PREFIX = 'it_'
  178. ID_INVALID = -1
  179. NUMBER_OF_TRAINS_UNLIMITED = -1
  180. TIME_INFINITY = 1e140
  181. INT_UNSET = INT32_MAX
  182. FLT_UNSET = FLT_MAX
  183. RNG_SIZE = 256
  184. class BaseChkptMol():
  185. def __init__(
  186. self,
  187. id : int,
  188. species : Species,
  189. diffusion_time : float,
  190. birthday : float,
  191. flags : int,
  192. unimol_rxn_time : float = None
  193. ):
  194. self.id = id
  195. self.species = species
  196. self.diffusion_time = diffusion_time
  197. self.birthday = birthday
  198. self.flags = flags
  199. self.unimol_rxn_time = unimol_rxn_time
  200. class ChkptSurfMol():
  201. def __init__(
  202. self,
  203. pos : Vec2,
  204. orientation : Orientation,
  205. geometry_object : GeometryObject,
  206. wall_index : int,
  207. grid_tile_index : int,
  208. id : int,
  209. species : Species,
  210. diffusion_time : float,
  211. birthday : float,
  212. flags : int,
  213. unimol_rxn_time : float = None
  214. ):
  215. self.pos = pos
  216. self.orientation = orientation
  217. self.geometry_object = geometry_object
  218. self.wall_index = wall_index
  219. self.grid_tile_index = grid_tile_index
  220. self.id = id
  221. self.species = species
  222. self.diffusion_time = diffusion_time
  223. self.birthday = birthday
  224. self.flags = flags
  225. self.unimol_rxn_time = unimol_rxn_time
  226. class ChkptVolMol():
  227. def __init__(
  228. self,
  229. pos : Vec3,
  230. id : int,
  231. species : Species,
  232. diffusion_time : float,
  233. birthday : float,
  234. flags : int,
  235. unimol_rxn_time : float = None
  236. ):
  237. self.pos = pos
  238. self.id = id
  239. self.species = species
  240. self.diffusion_time = diffusion_time
  241. self.birthday = birthday
  242. self.flags = flags
  243. self.unimol_rxn_time = unimol_rxn_time
  244. class Color():
  245. def __init__(
  246. self,
  247. red : float = None,
  248. green : float = None,
  249. blue : float = None,
  250. alpha : float = 1,
  251. rgba : int = 0
  252. ):
  253. self.red = red
  254. self.green = green
  255. self.blue = blue
  256. self.alpha = alpha
  257. self.rgba = rgba
  258. class Complex():
  259. def __init__(
  260. self,
  261. name : str = None,
  262. elementary_molecules : List[ElementaryMolecule] = None,
  263. orientation : Orientation = Orientation.DEFAULT,
  264. compartment_name : str = None
  265. ):
  266. self.name = name
  267. self.elementary_molecules = elementary_molecules
  268. self.orientation = orientation
  269. self.compartment_name = compartment_name
  270. def to_bngl_str(
  271. self,
  272. ) -> 'str':
  273. pass
  274. def as_species(
  275. self,
  276. ) -> 'Species':
  277. pass
  278. class Component():
  279. def __init__(
  280. self,
  281. component_type : ComponentType,
  282. state : str = STATE_UNSET,
  283. bond : int = BOND_UNBOUND
  284. ):
  285. self.component_type = component_type
  286. self.state = state
  287. self.bond = bond
  288. def to_bngl_str(
  289. self,
  290. ) -> 'str':
  291. pass
  292. class ComponentType():
  293. def __init__(
  294. self,
  295. name : str,
  296. states : List[str] = None
  297. ):
  298. self.name = name
  299. self.states = states
  300. def inst(
  301. self,
  302. state : str = STATE_UNSET,
  303. bond : int = BOND_UNBOUND
  304. ) -> 'Component':
  305. pass
  306. def to_bngl_str(
  307. self,
  308. ) -> 'str':
  309. pass
  310. class Config():
  311. def __init__(
  312. self,
  313. seed : int = 1,
  314. time_step : float = 1e-6,
  315. use_bng_units : bool = False,
  316. surface_grid_density : float = 10000,
  317. interaction_radius : float = None,
  318. intermembrane_interaction_radius : float = None,
  319. vacancy_search_distance : float = 10,
  320. center_molecules_on_grid : bool = False,
  321. partition_dimension : float = 10,
  322. initial_partition_origin : List[float] = None,
  323. subpartition_dimension : float = 0.5,
  324. total_iterations : float = 1000000,
  325. check_overlapped_walls : bool = True,
  326. reaction_class_cleanup_periodicity : int = 500,
  327. species_cleanup_periodicity : int = 10000,
  328. molecules_order_random_shuffle_periodicity : int = 10000,
  329. sort_molecules : bool = False,
  330. memory_limit_gb : int = -1,
  331. initial_iteration : int = 0,
  332. initial_time : float = 0,
  333. initial_rng_state : RngState = None,
  334. append_to_count_output_data : bool = False,
  335. continue_after_sigalrm : bool = False
  336. ):
  337. self.seed = seed
  338. self.time_step = time_step
  339. self.use_bng_units = use_bng_units
  340. self.surface_grid_density = surface_grid_density
  341. self.interaction_radius = interaction_radius
  342. self.intermembrane_interaction_radius = intermembrane_interaction_radius
  343. self.vacancy_search_distance = vacancy_search_distance
  344. self.center_molecules_on_grid = center_molecules_on_grid
  345. self.partition_dimension = partition_dimension
  346. self.initial_partition_origin = initial_partition_origin
  347. self.subpartition_dimension = subpartition_dimension
  348. self.total_iterations = total_iterations
  349. self.check_overlapped_walls = check_overlapped_walls
  350. self.reaction_class_cleanup_periodicity = reaction_class_cleanup_periodicity
  351. self.species_cleanup_periodicity = species_cleanup_periodicity
  352. self.molecules_order_random_shuffle_periodicity = molecules_order_random_shuffle_periodicity
  353. self.sort_molecules = sort_molecules
  354. self.memory_limit_gb = memory_limit_gb
  355. self.initial_iteration = initial_iteration
  356. self.initial_time = initial_time
  357. self.initial_rng_state = initial_rng_state
  358. self.append_to_count_output_data = append_to_count_output_data
  359. self.continue_after_sigalrm = continue_after_sigalrm
  360. class Count():
  361. def __init__(
  362. self,
  363. name : str = None,
  364. file_name : str = None,
  365. expression : CountTerm = None,
  366. multiplier : float = 1,
  367. every_n_timesteps : float = 1,
  368. output_format : CountOutputFormat = CountOutputFormat.AUTOMATIC_FROM_EXTENSION
  369. ):
  370. self.name = name
  371. self.file_name = file_name
  372. self.expression = expression
  373. self.multiplier = multiplier
  374. self.every_n_timesteps = every_n_timesteps
  375. self.output_format = output_format
  376. def get_current_value(
  377. self,
  378. ) -> 'float':
  379. pass
  380. class CountTerm():
  381. def __init__(
  382. self,
  383. species_pattern : Complex = None,
  384. molecules_pattern : Complex = None,
  385. reaction_rule : ReactionRule = None,
  386. region : Region = None,
  387. node_type : ExprNodeType = ExprNodeType.LEAF,
  388. left_node : CountTerm = None,
  389. right_node : CountTerm = None,
  390. initial_reactions_count : int = 0
  391. ):
  392. self.species_pattern = species_pattern
  393. self.molecules_pattern = molecules_pattern
  394. self.reaction_rule = reaction_rule
  395. self.region = region
  396. self.node_type = node_type
  397. self.left_node = left_node
  398. self.right_node = right_node
  399. self.initial_reactions_count = initial_reactions_count
  400. def __add__(
  401. self,
  402. op2 : CountTerm
  403. ) -> 'CountTerm':
  404. pass
  405. def __sub__(
  406. self,
  407. op2 : CountTerm
  408. ) -> 'CountTerm':
  409. pass
  410. class ElementaryMolecule():
  411. def __init__(
  412. self,
  413. elementary_molecule_type : ElementaryMoleculeType,
  414. components : List[Component] = None,
  415. compartment_name : str = None
  416. ):
  417. self.elementary_molecule_type = elementary_molecule_type
  418. self.components = components
  419. self.compartment_name = compartment_name
  420. def to_bngl_str(
  421. self,
  422. with_compartment : bool = True
  423. ) -> 'str':
  424. pass
  425. class ElementaryMoleculeType():
  426. def __init__(
  427. self,
  428. name : str,
  429. components : List[ComponentType] = None,
  430. diffusion_constant_2d : float = None,
  431. diffusion_constant_3d : float = None,
  432. custom_time_step : float = None,
  433. custom_space_step : float = None,
  434. target_only : bool = False
  435. ):
  436. self.name = name
  437. self.components = components
  438. self.diffusion_constant_2d = diffusion_constant_2d
  439. self.diffusion_constant_3d = diffusion_constant_3d
  440. self.custom_time_step = custom_time_step
  441. self.custom_space_step = custom_space_step
  442. self.target_only = target_only
  443. def inst(
  444. self,
  445. components : List[Component] = None,
  446. compartment_name : str = None
  447. ) -> 'ElementaryMolecule':
  448. pass
  449. def to_bngl_str(
  450. self,
  451. ) -> 'str':
  452. pass
  453. class GeometryObject():
  454. def __init__(
  455. self,
  456. name : str,
  457. vertex_list : List[List[float]],
  458. wall_list : List[List[int]],
  459. is_bngl_compartment : bool = False,
  460. surface_compartment_name : str = None,
  461. surface_regions : List[SurfaceRegion] = None,
  462. surface_class : SurfaceClass = None,
  463. initial_surface_releases : List[InitialSurfaceRelease] = None,
  464. initial_color : Color = None,
  465. node_type : RegionNodeType = RegionNodeType.UNSET,
  466. left_node : Region = None,
  467. right_node : Region = None
  468. ):
  469. self.name = name
  470. self.vertex_list = vertex_list
  471. self.wall_list = wall_list
  472. self.is_bngl_compartment = is_bngl_compartment
  473. self.surface_compartment_name = surface_compartment_name
  474. self.surface_regions = surface_regions
  475. self.surface_class = surface_class
  476. self.initial_surface_releases = initial_surface_releases
  477. self.initial_color = initial_color
  478. self.node_type = node_type
  479. self.left_node = left_node
  480. self.right_node = right_node
  481. def translate(
  482. self,
  483. move : List[float]
  484. ) -> None:
  485. pass
  486. def __add__(
  487. self,
  488. other : Region
  489. ) -> 'Region':
  490. pass
  491. def __sub__(
  492. self,
  493. other : Region
  494. ) -> 'Region':
  495. pass
  496. def __mul__(
  497. self,
  498. other : Region
  499. ) -> 'Region':
  500. pass
  501. class InitialSurfaceRelease():
  502. def __init__(
  503. self,
  504. complex : Complex,
  505. number_to_release : int = None,
  506. density : float = None
  507. ):
  508. self.complex = complex
  509. self.number_to_release = number_to_release
  510. self.density = density
  511. class Instantiation():
  512. def __init__(
  513. self,
  514. release_sites : List[ReleaseSite] = None,
  515. geometry_objects : List[GeometryObject] = None,
  516. checkpointed_molecules : List[BaseChkptMol] = None
  517. ):
  518. self.release_sites = release_sites
  519. self.geometry_objects = geometry_objects
  520. self.checkpointed_molecules = checkpointed_molecules
  521. def add_release_site(
  522. self,
  523. s : ReleaseSite
  524. ) -> None:
  525. pass
  526. def find_release_site(
  527. self,
  528. name : str
  529. ) -> 'ReleaseSite':
  530. pass
  531. def add_geometry_object(
  532. self,
  533. o : GeometryObject
  534. ) -> None:
  535. pass
  536. def find_geometry_object(
  537. self,
  538. name : str
  539. ) -> 'GeometryObject':
  540. pass
  541. def find_volume_compartment_object(
  542. self,
  543. name : str
  544. ) -> 'GeometryObject':
  545. pass
  546. def find_surface_compartment_object(
  547. self,
  548. name : str
  549. ) -> 'GeometryObject':
  550. pass
  551. def load_bngl_compartments_and_seed_species(
  552. self,
  553. file_name : str,
  554. default_release_region : Region = None,
  555. parameter_overrides : Dict[str, float] = None
  556. ) -> None:
  557. pass
  558. class Introspection():
  559. def __init__(
  560. self,
  561. ):
  562. pass
  563. def get_molecule_ids(
  564. self,
  565. pattern : Complex = None
  566. ) -> 'List[int]':
  567. pass
  568. def get_molecule(
  569. self,
  570. id : int
  571. ) -> 'Molecule':
  572. pass
  573. def get_species_name(
  574. self,
  575. species_id : int
  576. ) -> 'str':
  577. pass
  578. def get_vertex(
  579. self,
  580. object : GeometryObject,
  581. vertex_index : int
  582. ) -> 'List[float]':
  583. pass
  584. def get_wall(
  585. self,
  586. object : GeometryObject,
  587. wall_index : int
  588. ) -> 'Wall':
  589. pass
  590. def get_vertex_unit_normal(
  591. self,
  592. object : GeometryObject,
  593. vertex_index : int
  594. ) -> 'List[float]':
  595. pass
  596. def get_wall_unit_normal(
  597. self,
  598. object : GeometryObject,
  599. wall_index : int
  600. ) -> 'List[float]':
  601. pass
  602. def get_wall_color(
  603. self,
  604. object : GeometryObject,
  605. wall_index : int
  606. ) -> 'Color':
  607. pass
  608. def set_wall_color(
  609. self,
  610. object : GeometryObject,
  611. wall_index : int,
  612. color : Color
  613. ) -> None:
  614. pass
  615. class Model():
  616. def __init__(
  617. self,
  618. config : Config = Config(),
  619. warnings : Warnings = Warnings(),
  620. notifications : Notifications = Notifications(),
  621. species : List[Species] = None,
  622. reaction_rules : List[ReactionRule] = None,
  623. surface_classes : List[SurfaceClass] = None,
  624. elementary_molecule_types : List[ElementaryMoleculeType] = None,
  625. release_sites : List[ReleaseSite] = None,
  626. geometry_objects : List[GeometryObject] = None,
  627. checkpointed_molecules : List[BaseChkptMol] = None,
  628. viz_outputs : List[VizOutput] = None,
  629. counts : List[Count] = None
  630. ):
  631. self.config = config
  632. self.warnings = warnings
  633. self.notifications = notifications
  634. self.species = species
  635. self.reaction_rules = reaction_rules
  636. self.surface_classes = surface_classes
  637. self.elementary_molecule_types = elementary_molecule_types
  638. self.release_sites = release_sites
  639. self.geometry_objects = geometry_objects
  640. self.checkpointed_molecules = checkpointed_molecules
  641. self.viz_outputs = viz_outputs
  642. self.counts = counts
  643. def initialize(
  644. self,
  645. print_copyright : bool = True
  646. ) -> None:
  647. pass
  648. def run_iterations(
  649. self,
  650. iterations : float
  651. ) -> 'int':
  652. pass
  653. def end_simulation(
  654. self,
  655. print_final_report : bool = True
  656. ) -> None:
  657. pass
  658. def add_subsystem(
  659. self,
  660. subsystem : Subsystem
  661. ) -> None:
  662. pass
  663. def add_instantiation(
  664. self,
  665. instantiation : Instantiation
  666. ) -> None:
  667. pass
  668. def add_observables(
  669. self,
  670. observables : Observables
  671. ) -> None:
  672. pass
  673. def dump_internal_state(
  674. self,
  675. with_geometry : bool = False
  676. ) -> None:
  677. pass
  678. def export_data_model(
  679. self,
  680. file : str = None
  681. ) -> None:
  682. pass
  683. def export_viz_data_model(
  684. self,
  685. file : str = None
  686. ) -> None:
  687. pass
  688. def export_geometry(
  689. self,
  690. output_files_prefix : str = None
  691. ) -> None:
  692. pass
  693. def release_molecules(
  694. self,
  695. release_site : ReleaseSite
  696. ) -> None:
  697. pass
  698. def run_reaction(
  699. self,
  700. reaction_rule : ReactionRule,
  701. reactant_ids : List[int],
  702. time : float
  703. ) -> 'List[int]':
  704. pass
  705. def add_vertex_move(
  706. self,
  707. object : GeometryObject,
  708. vertex_index : int,
  709. displacement : List[float]
  710. ) -> None:
  711. pass
  712. def apply_vertex_moves(
  713. self,
  714. collect_wall_wall_hits : bool = False,
  715. randomize_order : bool = True
  716. ) -> 'List[WallWallHitInfo]':
  717. pass
  718. def pair_molecules(
  719. self,
  720. id1 : int,
  721. id2 : int
  722. ) -> None:
  723. pass
  724. def unpair_molecules(
  725. self,
  726. id1 : int,
  727. id2 : int
  728. ) -> None:
  729. pass
  730. def get_paired_molecule(
  731. self,
  732. id : int
  733. ) -> 'int':
  734. pass
  735. def get_paired_molecules(
  736. self,
  737. ) -> 'Dict[uint32, uint32]':
  738. pass
  739. def register_mol_wall_hit_callback(
  740. self,
  741. function : Callable, # std::function<void(std::shared_ptr<MolWallHitInfo>, py::object)>,
  742. context : Any, # py::object,
  743. object : GeometryObject = None,
  744. species : Species = None
  745. ) -> None:
  746. pass
  747. def register_reaction_callback(
  748. self,
  749. function : Callable, # std::function<bool(std::shared_ptr<ReactionInfo>, py::object)>,
  750. context : Any, # py::object,
  751. reaction_rule : ReactionRule
  752. ) -> None:
  753. pass
  754. def load_bngl(
  755. self,
  756. file_name : str,
  757. observables_path_or_file : str = None,
  758. default_release_region : Region = None,
  759. parameter_overrides : Dict[str, float] = None,
  760. observables_output_format : CountOutputFormat = CountOutputFormat.AUTOMATIC_FROM_EXTENSION
  761. ) -> None:
  762. pass
  763. def export_to_bngl(
  764. self,
  765. file_name : str,
  766. simulation_method : BNGSimulationMethod = BNGSimulationMethod.ODE
  767. ) -> None:
  768. pass
  769. def save_checkpoint(
  770. self,
  771. custom_dir : str = None
  772. ) -> None:
  773. pass
  774. def schedule_checkpoint(
  775. self,
  776. iteration : int = 0,
  777. continue_simulation : bool = False,
  778. custom_dir : str = None
  779. ) -> None:
  780. pass
  781. def add_species(
  782. self,
  783. s : Species
  784. ) -> None:
  785. pass
  786. def find_species(
  787. self,
  788. name : str
  789. ) -> 'Species':
  790. pass
  791. def add_reaction_rule(
  792. self,
  793. r : ReactionRule
  794. ) -> None:
  795. pass
  796. def find_reaction_rule(
  797. self,
  798. name : str
  799. ) -> 'ReactionRule':
  800. pass
  801. def add_surface_class(
  802. self,
  803. sc : SurfaceClass
  804. ) -> None:
  805. pass
  806. def find_surface_class(
  807. self,
  808. name : str
  809. ) -> 'SurfaceClass':
  810. pass
  811. def add_elementary_molecule_type(
  812. self,
  813. mt : ElementaryMoleculeType
  814. ) -> None:
  815. pass
  816. def find_elementary_molecule_type(
  817. self,
  818. name : str
  819. ) -> 'ElementaryMoleculeType':
  820. pass
  821. def load_bngl_molecule_types_and_reaction_rules(
  822. self,
  823. file_name : str,
  824. parameter_overrides : Dict[str, float] = None
  825. ) -> None:
  826. pass
  827. def add_release_site(
  828. self,
  829. s : ReleaseSite
  830. ) -> None:
  831. pass
  832. def find_release_site(
  833. self,
  834. name : str
  835. ) -> 'ReleaseSite':
  836. pass
  837. def add_geometry_object(
  838. self,
  839. o : GeometryObject
  840. ) -> None:
  841. pass
  842. def find_geometry_object(
  843. self,
  844. name : str
  845. ) -> 'GeometryObject':
  846. pass
  847. def find_volume_compartment_object(
  848. self,
  849. name : str
  850. ) -> 'GeometryObject':
  851. pass
  852. def find_surface_compartment_object(
  853. self,
  854. name : str
  855. ) -> 'GeometryObject':
  856. pass
  857. def load_bngl_compartments_and_seed_species(
  858. self,
  859. file_name : str,
  860. default_release_region : Region = None,
  861. parameter_overrides : Dict[str, float] = None
  862. ) -> None:
  863. pass
  864. def add_viz_output(
  865. self,
  866. viz_output : VizOutput
  867. ) -> None:
  868. pass
  869. def add_count(
  870. self,
  871. count : Count
  872. ) -> None:
  873. pass
  874. def find_count(
  875. self,
  876. name : str
  877. ) -> 'Count':
  878. pass
  879. def load_bngl_observables(
  880. self,
  881. file_name : str,
  882. observables_path_or_file : str = None,
  883. parameter_overrides : Dict[str, float] = None,
  884. observables_output_format : CountOutputFormat = CountOutputFormat.AUTOMATIC_FROM_EXTENSION
  885. ) -> None:
  886. pass
  887. def get_molecule_ids(
  888. self,
  889. pattern : Complex = None
  890. ) -> 'List[int]':
  891. pass
  892. def get_molecule(
  893. self,
  894. id : int
  895. ) -> 'Molecule':
  896. pass
  897. def get_species_name(
  898. self,
  899. species_id : int
  900. ) -> 'str':
  901. pass
  902. def get_vertex(
  903. self,
  904. object : GeometryObject,
  905. vertex_index : int
  906. ) -> 'List[float]':
  907. pass
  908. def get_wall(
  909. self,
  910. object : GeometryObject,
  911. wall_index : int
  912. ) -> 'Wall':
  913. pass
  914. def get_vertex_unit_normal(
  915. self,
  916. object : GeometryObject,
  917. vertex_index : int
  918. ) -> 'List[float]':
  919. pass
  920. def get_wall_unit_normal(
  921. self,
  922. object : GeometryObject,
  923. wall_index : int
  924. ) -> 'List[float]':
  925. pass
  926. def get_wall_color(
  927. self,
  928. object : GeometryObject,
  929. wall_index : int
  930. ) -> 'Color':
  931. pass
  932. def set_wall_color(
  933. self,
  934. object : GeometryObject,
  935. wall_index : int,
  936. color : Color
  937. ) -> None:
  938. pass
  939. class MolWallHitInfo():
  940. def __init__(
  941. self,
  942. molecule_id : int,
  943. geometry_object : GeometryObject,
  944. wall_index : int,
  945. time : float,
  946. pos3d : List[float],
  947. time_before_hit : float,
  948. pos3d_before_hit : List[float]
  949. ):
  950. self.molecule_id = molecule_id
  951. self.geometry_object = geometry_object
  952. self.wall_index = wall_index
  953. self.time = time
  954. self.pos3d = pos3d
  955. self.time_before_hit = time_before_hit
  956. self.pos3d_before_hit = pos3d_before_hit
  957. class Molecule():
  958. def __init__(
  959. self,
  960. id : int = ID_INVALID,
  961. type : MoleculeType = MoleculeType.UNSET,
  962. species_id : int = ID_INVALID,
  963. pos3d : List[float] = None,
  964. orientation : Orientation = Orientation.NOT_SET,
  965. pos2d : List[float] = None,
  966. geometry_object : GeometryObject = None,
  967. wall_index : int = -1
  968. ):
  969. self.id = id
  970. self.type = type
  971. self.species_id = species_id
  972. self.pos3d = pos3d
  973. self.orientation = orientation
  974. self.pos2d = pos2d
  975. self.geometry_object = geometry_object
  976. self.wall_index = wall_index
  977. def remove(
  978. self,
  979. ) -> None:
  980. pass
  981. class MoleculeReleaseInfo():
  982. def __init__(
  983. self,
  984. complex : Complex,
  985. location : List[float]
  986. ):
  987. self.complex = complex
  988. self.location = location
  989. class Notifications():
  990. def __init__(
  991. self,
  992. bng_verbosity_level : int = 0,
  993. rxn_and_species_report : bool = False,
  994. simulation_stats_every_n_iterations : int = 0,
  995. rxn_probability_changed : bool = True,
  996. iteration_report : bool = True,
  997. wall_overlap_report : bool = False
  998. ):
  999. self.bng_verbosity_level = bng_verbosity_level
  1000. self.rxn_and_species_report = rxn_and_species_report
  1001. self.simulation_stats_every_n_iterations = simulation_stats_every_n_iterations
  1002. self.rxn_probability_changed = rxn_probability_changed
  1003. self.iteration_report = iteration_report
  1004. self.wall_overlap_report = wall_overlap_report
  1005. class Observables():
  1006. def __init__(
  1007. self,
  1008. viz_outputs : List[VizOutput] = None,
  1009. counts : List[Count] = None
  1010. ):
  1011. self.viz_outputs = viz_outputs
  1012. self.counts = counts
  1013. def add_viz_output(
  1014. self,
  1015. viz_output : VizOutput
  1016. ) -> None:
  1017. pass
  1018. def add_count(
  1019. self,
  1020. count : Count
  1021. ) -> None:
  1022. pass
  1023. def find_count(
  1024. self,
  1025. name : str
  1026. ) -> 'Count':
  1027. pass
  1028. def load_bngl_observables(
  1029. self,
  1030. file_name : str,
  1031. observables_path_or_file : str = None,
  1032. parameter_overrides : Dict[str, float] = None,
  1033. observables_output_format : CountOutputFormat = CountOutputFormat.AUTOMATIC_FROM_EXTENSION
  1034. ) -> None:
  1035. pass
  1036. class ReactionInfo():
  1037. def __init__(
  1038. self,
  1039. type : ReactionType,
  1040. reactant_ids : List[int],
  1041. product_ids : List[int],
  1042. reaction_rule : ReactionRule,
  1043. time : float,
  1044. pos3d : List[float],
  1045. geometry_object : GeometryObject = None,
  1046. wall_index : int = -1,
  1047. pos2d : List[float] = None
  1048. ):
  1049. self.type = type
  1050. self.reactant_ids = reactant_ids
  1051. self.product_ids = product_ids
  1052. self.reaction_rule = reaction_rule
  1053. self.time = time
  1054. self.pos3d = pos3d
  1055. self.geometry_object = geometry_object
  1056. self.wall_index = wall_index
  1057. self.pos2d = pos2d
  1058. class ReactionRule():
  1059. def __init__(
  1060. self,
  1061. name : str = None,
  1062. reactants : List[Complex] = None,
  1063. products : List[Complex] = None,
  1064. fwd_rate : float = None,
  1065. rev_name : str = None,
  1066. rev_rate : float = None,
  1067. variable_rate : List[List[float]] = None,
  1068. is_intermembrane_surface_reaction : bool = False
  1069. ):
  1070. self.name = name
  1071. self.reactants = reactants
  1072. self.products = products
  1073. self.fwd_rate = fwd_rate
  1074. self.rev_name = rev_name
  1075. self.rev_rate = rev_rate
  1076. self.variable_rate = variable_rate
  1077. self.is_intermembrane_surface_reaction = is_intermembrane_surface_reaction
  1078. def to_bngl_str(
  1079. self,
  1080. ) -> 'str':
  1081. pass
  1082. class Region():
  1083. def __init__(
  1084. self,
  1085. node_type : RegionNodeType = RegionNodeType.UNSET,
  1086. left_node : Region = None,
  1087. right_node : Region = None
  1088. ):
  1089. self.node_type = node_type
  1090. self.left_node = left_node
  1091. self.right_node = right_node
  1092. def __add__(
  1093. self,
  1094. other : Region
  1095. ) -> 'Region':
  1096. pass
  1097. def __sub__(
  1098. self,
  1099. other : Region
  1100. ) -> 'Region':
  1101. pass
  1102. def __mul__(
  1103. self,
  1104. other : Region
  1105. ) -> 'Region':
  1106. pass
  1107. class ReleasePattern():
  1108. def __init__(
  1109. self,
  1110. name : str = None,
  1111. release_interval : float = TIME_INFINITY,
  1112. train_duration : float = TIME_INFINITY,
  1113. train_interval : float = TIME_INFINITY,
  1114. number_of_trains : int = 1
  1115. ):
  1116. self.name = name
  1117. self.release_interval = release_interval
  1118. self.train_duration = train_duration
  1119. self.train_interval = train_interval
  1120. self.number_of_trains = number_of_trains
  1121. class ReleaseSite():
  1122. def __init__(
  1123. self,
  1124. name : str,
  1125. complex : Complex = None,
  1126. molecule_list : List[MoleculeReleaseInfo] = None,
  1127. release_time : float = 0,
  1128. release_pattern : ReleasePattern = None,
  1129. shape : Shape = Shape.UNSET,
  1130. region : Region = None,
  1131. location : List[float] = None,
  1132. site_diameter : float = 0,
  1133. site_radius : float = None,
  1134. number_to_release : float = None,
  1135. density : float = None,
  1136. concentration : float = None,
  1137. release_probability : float = 1
  1138. ):
  1139. self.name = name
  1140. self.complex = complex
  1141. self.molecule_list = molecule_list
  1142. self.release_time = release_time
  1143. self.release_pattern = release_pattern
  1144. self.shape = shape
  1145. self.region = region
  1146. self.location = location
  1147. self.site_diameter = site_diameter
  1148. self.site_radius = site_radius
  1149. self.number_to_release = number_to_release
  1150. self.density = density
  1151. self.concentration = concentration
  1152. self.release_probability = release_probability
  1153. class RngState():
  1154. def __init__(
  1155. self,
  1156. randcnt : int,
  1157. aa : int,
  1158. bb : int,
  1159. cc : int,
  1160. randslr : List[int],
  1161. mm : List[int],
  1162. rngblocks : int
  1163. ):
  1164. self.randcnt = randcnt
  1165. self.aa = aa
  1166. self.bb = bb
  1167. self.cc = cc
  1168. self.randslr = randslr
  1169. self.mm = mm
  1170. self.rngblocks = rngblocks
  1171. class Species():
  1172. def __init__(
  1173. self,
  1174. name : str = None,
  1175. diffusion_constant_2d : float = None,
  1176. diffusion_constant_3d : float = None,
  1177. custom_time_step : float = None,
  1178. custom_space_step : float = None,
  1179. target_only : bool = False,
  1180. elementary_molecules : List[ElementaryMolecule] = None,
  1181. orientation : Orientation = Orientation.DEFAULT,
  1182. compartment_name : str = None
  1183. ):
  1184. self.name = name
  1185. self.diffusion_constant_2d = diffusion_constant_2d
  1186. self.diffusion_constant_3d = diffusion_constant_3d
  1187. self.custom_time_step = custom_time_step
  1188. self.custom_space_step = custom_space_step
  1189. self.target_only = target_only
  1190. self.name = name
  1191. self.elementary_molecules = elementary_molecules
  1192. self.orientation = orientation
  1193. self.compartment_name = compartment_name
  1194. def inst(
  1195. self,
  1196. orientation : Orientation = Orientation.DEFAULT,
  1197. compartment_name : str = None
  1198. ) -> 'Complex':
  1199. pass
  1200. def to_bngl_str(
  1201. self,
  1202. ) -> 'str':
  1203. pass
  1204. def as_species(
  1205. self,
  1206. ) -> 'Species':
  1207. pass
  1208. class Subsystem():
  1209. def __init__(
  1210. self,
  1211. species : List[Species] = None,
  1212. reaction_rules : List[ReactionRule] = None,
  1213. surface_classes : List[SurfaceClass] = None,
  1214. elementary_molecule_types : List[ElementaryMoleculeType] = None
  1215. ):
  1216. self.species = species
  1217. self.reaction_rules = reaction_rules
  1218. self.surface_classes = surface_classes
  1219. self.elementary_molecule_types = elementary_molecule_types
  1220. def add_species(
  1221. self,
  1222. s : Species
  1223. ) -> None:
  1224. pass
  1225. def find_species(
  1226. self,
  1227. name : str
  1228. ) -> 'Species':
  1229. pass
  1230. def add_reaction_rule(
  1231. self,
  1232. r : ReactionRule
  1233. ) -> None:
  1234. pass
  1235. def find_reaction_rule(
  1236. self,
  1237. name : str
  1238. ) -> 'ReactionRule':
  1239. pass
  1240. def add_surface_class(
  1241. self,
  1242. sc : SurfaceClass
  1243. ) -> None:
  1244. pass
  1245. def find_surface_class(
  1246. self,
  1247. name : str
  1248. ) -> 'SurfaceClass':
  1249. pass
  1250. def add_elementary_molecule_type(
  1251. self,
  1252. mt : ElementaryMoleculeType
  1253. ) -> None:
  1254. pass
  1255. def find_elementary_molecule_type(
  1256. self,
  1257. name : str
  1258. ) -> 'ElementaryMoleculeType':
  1259. pass
  1260. def load_bngl_molecule_types_and_reaction_rules(
  1261. self,
  1262. file_name : str,
  1263. parameter_overrides : Dict[str, float] = None
  1264. ) -> None:
  1265. pass
  1266. class SurfaceClass():
  1267. def __init__(
  1268. self,
  1269. name : str,
  1270. properties : List[SurfaceProperty] = None,
  1271. type : SurfacePropertyType = SurfacePropertyType.UNSET,
  1272. affected_complex_pattern : Complex = None,
  1273. concentration : float = None
  1274. ):
  1275. self.name = name
  1276. self.properties = properties
  1277. self.type = type
  1278. self.affected_complex_pattern = affected_complex_pattern
  1279. self.concentration = concentration
  1280. class SurfaceProperty():
  1281. def __init__(
  1282. self,
  1283. type : SurfacePropertyType = SurfacePropertyType.UNSET,
  1284. affected_complex_pattern : Complex = None,
  1285. concentration : float = None
  1286. ):
  1287. self.type = type
  1288. self.affected_complex_pattern = affected_complex_pattern
  1289. self.concentration = concentration
  1290. class SurfaceRegion():
  1291. def __init__(
  1292. self,
  1293. name : str,
  1294. wall_indices : List[int],
  1295. surface_class : SurfaceClass = None,
  1296. initial_surface_releases : List[InitialSurfaceRelease] = None,
  1297. initial_color : Color = None,
  1298. node_type : RegionNodeType = RegionNodeType.UNSET,
  1299. left_node : Region = None,
  1300. right_node : Region = None
  1301. ):
  1302. self.name = name
  1303. self.wall_indices = wall_indices
  1304. self.surface_class = surface_class
  1305. self.initial_surface_releases = initial_surface_releases
  1306. self.initial_color = initial_color
  1307. self.node_type = node_type
  1308. self.left_node = left_node
  1309. self.right_node = right_node
  1310. def __add__(
  1311. self,
  1312. other : Region
  1313. ) -> 'Region':
  1314. pass
  1315. def __sub__(
  1316. self,
  1317. other : Region
  1318. ) -> 'Region':
  1319. pass
  1320. def __mul__(
  1321. self,
  1322. other : Region
  1323. ) -> 'Region':
  1324. pass
  1325. class VizOutput():
  1326. def __init__(
  1327. self,
  1328. output_files_prefix : str = None,
  1329. species_list : List[Species] = None,
  1330. mode : VizMode = VizMode.ASCII,
  1331. every_n_timesteps : float = 1
  1332. ):
  1333. self.output_files_prefix = output_files_prefix
  1334. self.species_list = species_list
  1335. self.mode = mode
  1336. self.every_n_timesteps = every_n_timesteps
  1337. class Wall():
  1338. def __init__(
  1339. self,
  1340. geometry_object : GeometryObject,
  1341. wall_index : int,
  1342. vertices : List[List[float]],
  1343. area : float,
  1344. unit_normal : List[float],
  1345. is_movable : bool = True
  1346. ):
  1347. self.geometry_object = geometry_object
  1348. self.wall_index = wall_index
  1349. self.vertices = vertices
  1350. self.area = area
  1351. self.unit_normal = unit_normal
  1352. self.is_movable = is_movable
  1353. class WallWallHitInfo():
  1354. def __init__(
  1355. self,
  1356. wall1 : Wall,
  1357. wall2 : Wall
  1358. ):
  1359. self.wall1 = wall1
  1360. self.wall2 = wall2
  1361. class Warnings():
  1362. def __init__(
  1363. self,
  1364. high_reaction_probability : WarningLevel = WarningLevel.IGNORE,
  1365. molecule_placement_failure : WarningLevel = WarningLevel.ERROR
  1366. ):
  1367. self.high_reaction_probability = high_reaction_probability
  1368. self.molecule_placement_failure = molecule_placement_failure
  1369. class bngl_utils():
  1370. def __init__(
  1371. self,
  1372. ):
  1373. pass
  1374. def load_bngl_parameters(
  1375. self,
  1376. file_name : str,
  1377. parameter_overrides : Dict[str, float] = None
  1378. ) -> 'Dict[str, float]':
  1379. pass
  1380. class data_utils():
  1381. def __init__(
  1382. self,
  1383. ):
  1384. pass
  1385. def load_dat_file(
  1386. self,
  1387. file_name : str
  1388. ) -> 'List[List[float]]':
  1389. pass
  1390. class geometry_utils():
  1391. def __init__(
  1392. self,
  1393. ):
  1394. pass
  1395. def create_box(
  1396. self,
  1397. name : str,
  1398. edge_dimension : float = None,
  1399. xyz_dimensions : List[float] = None
  1400. ) -> 'GeometryObject':
  1401. pass
  1402. def create_icosphere(
  1403. self,
  1404. name : str,
  1405. radius : float,
  1406. subdivisions : int
  1407. ) -> 'GeometryObject':
  1408. pass
  1409. def validate_volumetric_mesh(
  1410. self,
  1411. model : Model,
  1412. geometry_object : GeometryObject
  1413. ) -> None:
  1414. pass
  1415. class run_utils():
  1416. def __init__(
  1417. self,
  1418. ):
  1419. pass
  1420. def get_last_checkpoint_dir(
  1421. self,
  1422. seed : int
  1423. ) -> 'str':
  1424. pass
  1425. def remove_cwd(
  1426. self,
  1427. paths : List[str]
  1428. ) -> 'List[str]':
  1429. pass
  1430. AllMolecules = Species('ALL_MOLECULES')
  1431. AllVolumeMolecules = Species('ALL_VOLUME_MOLECULES')
  1432. AllSurfaceMolecules = Species('ALL_SURFACE_MOLECULES')