123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647 |
- from typing import List, Dict, Callable, Any
- from enum import Enum
- INT32_MAX = 2147483647 # do not use this constant in your code
- FLT_MAX = 3.40282346638528859812e+38 # do not use this constant in your code
- # "forward" declarations to make the type hints valid
- class BaseChkptMol():
- pass
- class ChkptSurfMol():
- pass
- class ChkptVolMol():
- pass
- class Color():
- pass
- class Complex():
- pass
- class Component():
- pass
- class ComponentType():
- pass
- class Config():
- pass
- class Count():
- pass
- class CountTerm():
- pass
- class ElementaryMolecule():
- pass
- class ElementaryMoleculeType():
- pass
- class GeometryObject():
- pass
- class InitialSurfaceRelease():
- pass
- class Instantiation():
- pass
- class Introspection():
- pass
- class Model():
- pass
- class MolWallHitInfo():
- pass
- class Molecule():
- pass
- class MoleculeReleaseInfo():
- pass
- class Notifications():
- pass
- class Observables():
- pass
- class ReactionInfo():
- pass
- class ReactionRule():
- pass
- class Region():
- pass
- class ReleasePattern():
- pass
- class ReleaseSite():
- pass
- class RngState():
- pass
- class Species():
- pass
- class Subsystem():
- pass
- class SurfaceClass():
- pass
- class SurfaceProperty():
- pass
- class SurfaceRegion():
- pass
- class VizOutput():
- pass
- class Wall():
- pass
- class WallWallHitInfo():
- pass
- class Warnings():
- pass
- class bngl_utils():
- pass
- class data_utils():
- pass
- class geometry_utils():
- pass
- class run_utils():
- pass
- class Vec3():
- def __init__(self, x : float = 0, y : float = 0, z : float = 0):
- self.x = x
- self.y = y
- self.z = z
- class Vec2():
- def __init__(self, u : float = 0, v : float = 0):
- self.u = u
- self.v = v
- class Orientation(Enum):
- DOWN = -1
- NONE = 0
- UP = 1
- NOT_SET = 2
- ANY = 3
- DEFAULT = 4
- class Notification(Enum):
- NONE = 0
- BRIEF = 1
- FULL = 2
- class WarningLevel(Enum):
- IGNORE = 0
- WARNING = 1
- ERROR = 2
- class VizMode(Enum):
- ASCII = 0
- CELLBLENDER_V1 = 1
- CELLBLENDER = 2
- class Shape(Enum):
- UNSET = 0
- SPHERICAL = 1
- REGION_EXPR = 2
- LIST = 3
- COMPARTMENT = 4
- class SurfacePropertyType(Enum):
- UNSET = 0
- REACTIVE = 1
- REFLECTIVE = 2
- TRANSPARENT = 3
- ABSORPTIVE = 4
- CONCENTRATION_CLAMP = 5
- FLUX_CLAMP = 6
- class ExprNodeType(Enum):
- UNSET = 0
- LEAF = 1
- ADD = 2
- SUB = 3
- class RegionNodeType(Enum):
- UNSET = 0
- LEAF_GEOMETRY_OBJECT = 1
- LEAF_SURFACE_REGION = 2
- UNION = 3
- DIFFERENCE = 4
- INTERSECT = 5
- class ReactionType(Enum):
- UNSET = 0
- UNIMOL_VOLUME = 1
- UNIMOL_SURFACE = 2
- VOLUME_VOLUME = 3
- VOLUME_SURFACE = 4
- SURFACE_SURFACE = 5
- class MoleculeType(Enum):
- UNSET = 0
- VOLUME = 1
- SURFACE = 2
- class BNGSimulationMethod(Enum):
- NONE = 0
- ODE = 1
- SSA = 2
- PLA = 3
- NF = 4
- class CountOutputFormat(Enum):
- UNSET = 0
- AUTOMATIC_FROM_EXTENSION = 1
- DAT = 2
- GDAT = 3
- STATE_UNSET = 'STATE_UNSET'
- STATE_UNSET_INT = -1
- BOND_UNBOUND = -1
- BOND_BOUND = -2
- BOND_ANY = -3
- PARTITION_EDGE_EXTRA_MARGIN_UM = 0.01
- DEFAULT_COUNT_BUFFER_SIZE = 100
- ALL_MOLECULES = 'ALL_MOLECULES'
- ALL_VOLUME_MOLECULES = 'ALL_VOLUME_MOLECULES'
- ALL_SURFACE_MOLECULES = 'ALL_SURFACE_MOLECULES'
- DEFAULT_CHECKPOINTS_DIR = 'checkpoints'
- DEFAULT_SEED_DIR_PREFIX = 'seed_'
- DEFAULT_SEED_DIR_DIGITS = 5
- DEFAULT_ITERATION_DIR_PREFIX = 'it_'
- ID_INVALID = -1
- NUMBER_OF_TRAINS_UNLIMITED = -1
- TIME_INFINITY = 1e140
- INT_UNSET = INT32_MAX
- FLT_UNSET = FLT_MAX
- RNG_SIZE = 256
- class BaseChkptMol():
- def __init__(
- self,
- id : int,
- species : Species,
- diffusion_time : float,
- birthday : float,
- flags : int,
- unimol_rxn_time : float = None
- ):
- self.id = id
- self.species = species
- self.diffusion_time = diffusion_time
- self.birthday = birthday
- self.flags = flags
- self.unimol_rxn_time = unimol_rxn_time
- class ChkptSurfMol():
- def __init__(
- self,
- pos : Vec2,
- orientation : Orientation,
- geometry_object : GeometryObject,
- wall_index : int,
- grid_tile_index : int,
- id : int,
- species : Species,
- diffusion_time : float,
- birthday : float,
- flags : int,
- unimol_rxn_time : float = None
- ):
- self.pos = pos
- self.orientation = orientation
- self.geometry_object = geometry_object
- self.wall_index = wall_index
- self.grid_tile_index = grid_tile_index
- self.id = id
- self.species = species
- self.diffusion_time = diffusion_time
- self.birthday = birthday
- self.flags = flags
- self.unimol_rxn_time = unimol_rxn_time
- class ChkptVolMol():
- def __init__(
- self,
- pos : Vec3,
- id : int,
- species : Species,
- diffusion_time : float,
- birthday : float,
- flags : int,
- unimol_rxn_time : float = None
- ):
- self.pos = pos
- self.id = id
- self.species = species
- self.diffusion_time = diffusion_time
- self.birthday = birthday
- self.flags = flags
- self.unimol_rxn_time = unimol_rxn_time
- class Color():
- def __init__(
- self,
- red : float = None,
- green : float = None,
- blue : float = None,
- alpha : float = 1,
- rgba : int = 0
- ):
- self.red = red
- self.green = green
- self.blue = blue
- self.alpha = alpha
- self.rgba = rgba
- class Complex():
- def __init__(
- self,
- name : str = None,
- elementary_molecules : List[ElementaryMolecule] = None,
- orientation : Orientation = Orientation.DEFAULT,
- compartment_name : str = None
- ):
- self.name = name
- self.elementary_molecules = elementary_molecules
- self.orientation = orientation
- self.compartment_name = compartment_name
- def to_bngl_str(
- self,
- ) -> 'str':
- pass
- def as_species(
- self,
- ) -> 'Species':
- pass
- class Component():
- def __init__(
- self,
- component_type : ComponentType,
- state : str = STATE_UNSET,
- bond : int = BOND_UNBOUND
- ):
- self.component_type = component_type
- self.state = state
- self.bond = bond
- def to_bngl_str(
- self,
- ) -> 'str':
- pass
- class ComponentType():
- def __init__(
- self,
- name : str,
- states : List[str] = None
- ):
- self.name = name
- self.states = states
- def inst(
- self,
- state : str = STATE_UNSET,
- bond : int = BOND_UNBOUND
- ) -> 'Component':
- pass
- def to_bngl_str(
- self,
- ) -> 'str':
- pass
- class Config():
- def __init__(
- self,
- seed : int = 1,
- time_step : float = 1e-6,
- use_bng_units : bool = False,
- surface_grid_density : float = 10000,
- interaction_radius : float = None,
- intermembrane_interaction_radius : float = None,
- vacancy_search_distance : float = 10,
- center_molecules_on_grid : bool = False,
- partition_dimension : float = 10,
- initial_partition_origin : List[float] = None,
- subpartition_dimension : float = 0.5,
- total_iterations : float = 1000000,
- check_overlapped_walls : bool = True,
- reaction_class_cleanup_periodicity : int = 500,
- species_cleanup_periodicity : int = 10000,
- molecules_order_random_shuffle_periodicity : int = 10000,
- sort_molecules : bool = False,
- memory_limit_gb : int = -1,
- initial_iteration : int = 0,
- initial_time : float = 0,
- initial_rng_state : RngState = None,
- append_to_count_output_data : bool = False,
- continue_after_sigalrm : bool = False
- ):
- self.seed = seed
- self.time_step = time_step
- self.use_bng_units = use_bng_units
- self.surface_grid_density = surface_grid_density
- self.interaction_radius = interaction_radius
- self.intermembrane_interaction_radius = intermembrane_interaction_radius
- self.vacancy_search_distance = vacancy_search_distance
- self.center_molecules_on_grid = center_molecules_on_grid
- self.partition_dimension = partition_dimension
- self.initial_partition_origin = initial_partition_origin
- self.subpartition_dimension = subpartition_dimension
- self.total_iterations = total_iterations
- self.check_overlapped_walls = check_overlapped_walls
- self.reaction_class_cleanup_periodicity = reaction_class_cleanup_periodicity
- self.species_cleanup_periodicity = species_cleanup_periodicity
- self.molecules_order_random_shuffle_periodicity = molecules_order_random_shuffle_periodicity
- self.sort_molecules = sort_molecules
- self.memory_limit_gb = memory_limit_gb
- self.initial_iteration = initial_iteration
- self.initial_time = initial_time
- self.initial_rng_state = initial_rng_state
- self.append_to_count_output_data = append_to_count_output_data
- self.continue_after_sigalrm = continue_after_sigalrm
- class Count():
- def __init__(
- self,
- name : str = None,
- file_name : str = None,
- expression : CountTerm = None,
- multiplier : float = 1,
- every_n_timesteps : float = 1,
- output_format : CountOutputFormat = CountOutputFormat.AUTOMATIC_FROM_EXTENSION
- ):
- self.name = name
- self.file_name = file_name
- self.expression = expression
- self.multiplier = multiplier
- self.every_n_timesteps = every_n_timesteps
- self.output_format = output_format
- def get_current_value(
- self,
- ) -> 'float':
- pass
- class CountTerm():
- def __init__(
- self,
- species_pattern : Complex = None,
- molecules_pattern : Complex = None,
- reaction_rule : ReactionRule = None,
- region : Region = None,
- node_type : ExprNodeType = ExprNodeType.LEAF,
- left_node : CountTerm = None,
- right_node : CountTerm = None,
- initial_reactions_count : int = 0
- ):
- self.species_pattern = species_pattern
- self.molecules_pattern = molecules_pattern
- self.reaction_rule = reaction_rule
- self.region = region
- self.node_type = node_type
- self.left_node = left_node
- self.right_node = right_node
- self.initial_reactions_count = initial_reactions_count
- def __add__(
- self,
- op2 : CountTerm
- ) -> 'CountTerm':
- pass
- def __sub__(
- self,
- op2 : CountTerm
- ) -> 'CountTerm':
- pass
- class ElementaryMolecule():
- def __init__(
- self,
- elementary_molecule_type : ElementaryMoleculeType,
- components : List[Component] = None,
- compartment_name : str = None
- ):
- self.elementary_molecule_type = elementary_molecule_type
- self.components = components
- self.compartment_name = compartment_name
- def to_bngl_str(
- self,
- with_compartment : bool = True
- ) -> 'str':
- pass
- class ElementaryMoleculeType():
- def __init__(
- self,
- name : str,
- components : List[ComponentType] = None,
- diffusion_constant_2d : float = None,
- diffusion_constant_3d : float = None,
- custom_time_step : float = None,
- custom_space_step : float = None,
- target_only : bool = False
- ):
- self.name = name
- self.components = components
- self.diffusion_constant_2d = diffusion_constant_2d
- self.diffusion_constant_3d = diffusion_constant_3d
- self.custom_time_step = custom_time_step
- self.custom_space_step = custom_space_step
- self.target_only = target_only
- def inst(
- self,
- components : List[Component] = None,
- compartment_name : str = None
- ) -> 'ElementaryMolecule':
- pass
- def to_bngl_str(
- self,
- ) -> 'str':
- pass
- class GeometryObject():
- def __init__(
- self,
- name : str,
- vertex_list : List[List[float]],
- wall_list : List[List[int]],
- is_bngl_compartment : bool = False,
- surface_compartment_name : str = None,
- surface_regions : List[SurfaceRegion] = None,
- surface_class : SurfaceClass = None,
- initial_surface_releases : List[InitialSurfaceRelease] = None,
- initial_color : Color = None,
- node_type : RegionNodeType = RegionNodeType.UNSET,
- left_node : Region = None,
- right_node : Region = None
- ):
- self.name = name
- self.vertex_list = vertex_list
- self.wall_list = wall_list
- self.is_bngl_compartment = is_bngl_compartment
- self.surface_compartment_name = surface_compartment_name
- self.surface_regions = surface_regions
- self.surface_class = surface_class
- self.initial_surface_releases = initial_surface_releases
- self.initial_color = initial_color
- self.node_type = node_type
- self.left_node = left_node
- self.right_node = right_node
- def translate(
- self,
- move : List[float]
- ) -> None:
- pass
- def __add__(
- self,
- other : Region
- ) -> 'Region':
- pass
- def __sub__(
- self,
- other : Region
- ) -> 'Region':
- pass
- def __mul__(
- self,
- other : Region
- ) -> 'Region':
- pass
- class InitialSurfaceRelease():
- def __init__(
- self,
- complex : Complex,
- number_to_release : int = None,
- density : float = None
- ):
- self.complex = complex
- self.number_to_release = number_to_release
- self.density = density
- class Instantiation():
- def __init__(
- self,
- release_sites : List[ReleaseSite] = None,
- geometry_objects : List[GeometryObject] = None,
- checkpointed_molecules : List[BaseChkptMol] = None
- ):
- self.release_sites = release_sites
- self.geometry_objects = geometry_objects
- self.checkpointed_molecules = checkpointed_molecules
- def add_release_site(
- self,
- s : ReleaseSite
- ) -> None:
- pass
- def find_release_site(
- self,
- name : str
- ) -> 'ReleaseSite':
- pass
- def add_geometry_object(
- self,
- o : GeometryObject
- ) -> None:
- pass
- def find_geometry_object(
- self,
- name : str
- ) -> 'GeometryObject':
- pass
- def find_volume_compartment_object(
- self,
- name : str
- ) -> 'GeometryObject':
- pass
- def find_surface_compartment_object(
- self,
- name : str
- ) -> 'GeometryObject':
- pass
- def load_bngl_compartments_and_seed_species(
- self,
- file_name : str,
- default_release_region : Region = None,
- parameter_overrides : Dict[str, float] = None
- ) -> None:
- pass
- class Introspection():
- def __init__(
- self,
- ):
- pass
- def get_molecule_ids(
- self,
- pattern : Complex = None
- ) -> 'List[int]':
- pass
- def get_molecule(
- self,
- id : int
- ) -> 'Molecule':
- pass
- def get_species_name(
- self,
- species_id : int
- ) -> 'str':
- pass
- def get_vertex(
- self,
- object : GeometryObject,
- vertex_index : int
- ) -> 'List[float]':
- pass
- def get_wall(
- self,
- object : GeometryObject,
- wall_index : int
- ) -> 'Wall':
- pass
- def get_vertex_unit_normal(
- self,
- object : GeometryObject,
- vertex_index : int
- ) -> 'List[float]':
- pass
- def get_wall_unit_normal(
- self,
- object : GeometryObject,
- wall_index : int
- ) -> 'List[float]':
- pass
- def get_wall_color(
- self,
- object : GeometryObject,
- wall_index : int
- ) -> 'Color':
- pass
- def set_wall_color(
- self,
- object : GeometryObject,
- wall_index : int,
- color : Color
- ) -> None:
- pass
- class Model():
- def __init__(
- self,
- config : Config = Config(),
- warnings : Warnings = Warnings(),
- notifications : Notifications = Notifications(),
- species : List[Species] = None,
- reaction_rules : List[ReactionRule] = None,
- surface_classes : List[SurfaceClass] = None,
- elementary_molecule_types : List[ElementaryMoleculeType] = None,
- release_sites : List[ReleaseSite] = None,
- geometry_objects : List[GeometryObject] = None,
- checkpointed_molecules : List[BaseChkptMol] = None,
- viz_outputs : List[VizOutput] = None,
- counts : List[Count] = None
- ):
- self.config = config
- self.warnings = warnings
- self.notifications = notifications
- self.species = species
- self.reaction_rules = reaction_rules
- self.surface_classes = surface_classes
- self.elementary_molecule_types = elementary_molecule_types
- self.release_sites = release_sites
- self.geometry_objects = geometry_objects
- self.checkpointed_molecules = checkpointed_molecules
- self.viz_outputs = viz_outputs
- self.counts = counts
- def initialize(
- self,
- print_copyright : bool = True
- ) -> None:
- pass
- def run_iterations(
- self,
- iterations : float
- ) -> 'int':
- pass
- def end_simulation(
- self,
- print_final_report : bool = True
- ) -> None:
- pass
- def add_subsystem(
- self,
- subsystem : Subsystem
- ) -> None:
- pass
- def add_instantiation(
- self,
- instantiation : Instantiation
- ) -> None:
- pass
- def add_observables(
- self,
- observables : Observables
- ) -> None:
- pass
- def dump_internal_state(
- self,
- with_geometry : bool = False
- ) -> None:
- pass
- def export_data_model(
- self,
- file : str = None
- ) -> None:
- pass
- def export_viz_data_model(
- self,
- file : str = None
- ) -> None:
- pass
- def export_geometry(
- self,
- output_files_prefix : str = None
- ) -> None:
- pass
- def release_molecules(
- self,
- release_site : ReleaseSite
- ) -> None:
- pass
- def run_reaction(
- self,
- reaction_rule : ReactionRule,
- reactant_ids : List[int],
- time : float
- ) -> 'List[int]':
- pass
- def add_vertex_move(
- self,
- object : GeometryObject,
- vertex_index : int,
- displacement : List[float]
- ) -> None:
- pass
- def apply_vertex_moves(
- self,
- collect_wall_wall_hits : bool = False,
- randomize_order : bool = True
- ) -> 'List[WallWallHitInfo]':
- pass
- def pair_molecules(
- self,
- id1 : int,
- id2 : int
- ) -> None:
- pass
- def unpair_molecules(
- self,
- id1 : int,
- id2 : int
- ) -> None:
- pass
- def get_paired_molecule(
- self,
- id : int
- ) -> 'int':
- pass
- def get_paired_molecules(
- self,
- ) -> 'Dict[uint32, uint32]':
- pass
- def register_mol_wall_hit_callback(
- self,
- function : Callable, # std::function<void(std::shared_ptr<MolWallHitInfo>, py::object)>,
- context : Any, # py::object,
- object : GeometryObject = None,
- species : Species = None
- ) -> None:
- pass
- def register_reaction_callback(
- self,
- function : Callable, # std::function<bool(std::shared_ptr<ReactionInfo>, py::object)>,
- context : Any, # py::object,
- reaction_rule : ReactionRule
- ) -> None:
- pass
- def load_bngl(
- self,
- file_name : str,
- observables_path_or_file : str = None,
- default_release_region : Region = None,
- parameter_overrides : Dict[str, float] = None,
- observables_output_format : CountOutputFormat = CountOutputFormat.AUTOMATIC_FROM_EXTENSION
- ) -> None:
- pass
- def export_to_bngl(
- self,
- file_name : str,
- simulation_method : BNGSimulationMethod = BNGSimulationMethod.ODE
- ) -> None:
- pass
- def save_checkpoint(
- self,
- custom_dir : str = None
- ) -> None:
- pass
- def schedule_checkpoint(
- self,
- iteration : int = 0,
- continue_simulation : bool = False,
- custom_dir : str = None
- ) -> None:
- pass
- def add_species(
- self,
- s : Species
- ) -> None:
- pass
- def find_species(
- self,
- name : str
- ) -> 'Species':
- pass
- def add_reaction_rule(
- self,
- r : ReactionRule
- ) -> None:
- pass
- def find_reaction_rule(
- self,
- name : str
- ) -> 'ReactionRule':
- pass
- def add_surface_class(
- self,
- sc : SurfaceClass
- ) -> None:
- pass
- def find_surface_class(
- self,
- name : str
- ) -> 'SurfaceClass':
- pass
- def add_elementary_molecule_type(
- self,
- mt : ElementaryMoleculeType
- ) -> None:
- pass
- def find_elementary_molecule_type(
- self,
- name : str
- ) -> 'ElementaryMoleculeType':
- pass
- def load_bngl_molecule_types_and_reaction_rules(
- self,
- file_name : str,
- parameter_overrides : Dict[str, float] = None
- ) -> None:
- pass
- def add_release_site(
- self,
- s : ReleaseSite
- ) -> None:
- pass
- def find_release_site(
- self,
- name : str
- ) -> 'ReleaseSite':
- pass
- def add_geometry_object(
- self,
- o : GeometryObject
- ) -> None:
- pass
- def find_geometry_object(
- self,
- name : str
- ) -> 'GeometryObject':
- pass
- def find_volume_compartment_object(
- self,
- name : str
- ) -> 'GeometryObject':
- pass
- def find_surface_compartment_object(
- self,
- name : str
- ) -> 'GeometryObject':
- pass
- def load_bngl_compartments_and_seed_species(
- self,
- file_name : str,
- default_release_region : Region = None,
- parameter_overrides : Dict[str, float] = None
- ) -> None:
- pass
- def add_viz_output(
- self,
- viz_output : VizOutput
- ) -> None:
- pass
- def add_count(
- self,
- count : Count
- ) -> None:
- pass
- def find_count(
- self,
- name : str
- ) -> 'Count':
- pass
- def load_bngl_observables(
- self,
- file_name : str,
- observables_path_or_file : str = None,
- parameter_overrides : Dict[str, float] = None,
- observables_output_format : CountOutputFormat = CountOutputFormat.AUTOMATIC_FROM_EXTENSION
- ) -> None:
- pass
- def get_molecule_ids(
- self,
- pattern : Complex = None
- ) -> 'List[int]':
- pass
- def get_molecule(
- self,
- id : int
- ) -> 'Molecule':
- pass
- def get_species_name(
- self,
- species_id : int
- ) -> 'str':
- pass
- def get_vertex(
- self,
- object : GeometryObject,
- vertex_index : int
- ) -> 'List[float]':
- pass
- def get_wall(
- self,
- object : GeometryObject,
- wall_index : int
- ) -> 'Wall':
- pass
- def get_vertex_unit_normal(
- self,
- object : GeometryObject,
- vertex_index : int
- ) -> 'List[float]':
- pass
- def get_wall_unit_normal(
- self,
- object : GeometryObject,
- wall_index : int
- ) -> 'List[float]':
- pass
- def get_wall_color(
- self,
- object : GeometryObject,
- wall_index : int
- ) -> 'Color':
- pass
- def set_wall_color(
- self,
- object : GeometryObject,
- wall_index : int,
- color : Color
- ) -> None:
- pass
- class MolWallHitInfo():
- def __init__(
- self,
- molecule_id : int,
- geometry_object : GeometryObject,
- wall_index : int,
- time : float,
- pos3d : List[float],
- time_before_hit : float,
- pos3d_before_hit : List[float]
- ):
- self.molecule_id = molecule_id
- self.geometry_object = geometry_object
- self.wall_index = wall_index
- self.time = time
- self.pos3d = pos3d
- self.time_before_hit = time_before_hit
- self.pos3d_before_hit = pos3d_before_hit
- class Molecule():
- def __init__(
- self,
- id : int = ID_INVALID,
- type : MoleculeType = MoleculeType.UNSET,
- species_id : int = ID_INVALID,
- pos3d : List[float] = None,
- orientation : Orientation = Orientation.NOT_SET,
- pos2d : List[float] = None,
- geometry_object : GeometryObject = None,
- wall_index : int = -1
- ):
- self.id = id
- self.type = type
- self.species_id = species_id
- self.pos3d = pos3d
- self.orientation = orientation
- self.pos2d = pos2d
- self.geometry_object = geometry_object
- self.wall_index = wall_index
- def remove(
- self,
- ) -> None:
- pass
- class MoleculeReleaseInfo():
- def __init__(
- self,
- complex : Complex,
- location : List[float]
- ):
- self.complex = complex
- self.location = location
- class Notifications():
- def __init__(
- self,
- bng_verbosity_level : int = 0,
- rxn_and_species_report : bool = False,
- simulation_stats_every_n_iterations : int = 0,
- rxn_probability_changed : bool = True,
- iteration_report : bool = True,
- wall_overlap_report : bool = False
- ):
- self.bng_verbosity_level = bng_verbosity_level
- self.rxn_and_species_report = rxn_and_species_report
- self.simulation_stats_every_n_iterations = simulation_stats_every_n_iterations
- self.rxn_probability_changed = rxn_probability_changed
- self.iteration_report = iteration_report
- self.wall_overlap_report = wall_overlap_report
- class Observables():
- def __init__(
- self,
- viz_outputs : List[VizOutput] = None,
- counts : List[Count] = None
- ):
- self.viz_outputs = viz_outputs
- self.counts = counts
- def add_viz_output(
- self,
- viz_output : VizOutput
- ) -> None:
- pass
- def add_count(
- self,
- count : Count
- ) -> None:
- pass
- def find_count(
- self,
- name : str
- ) -> 'Count':
- pass
- def load_bngl_observables(
- self,
- file_name : str,
- observables_path_or_file : str = None,
- parameter_overrides : Dict[str, float] = None,
- observables_output_format : CountOutputFormat = CountOutputFormat.AUTOMATIC_FROM_EXTENSION
- ) -> None:
- pass
- class ReactionInfo():
- def __init__(
- self,
- type : ReactionType,
- reactant_ids : List[int],
- product_ids : List[int],
- reaction_rule : ReactionRule,
- time : float,
- pos3d : List[float],
- geometry_object : GeometryObject = None,
- wall_index : int = -1,
- pos2d : List[float] = None
- ):
- self.type = type
- self.reactant_ids = reactant_ids
- self.product_ids = product_ids
- self.reaction_rule = reaction_rule
- self.time = time
- self.pos3d = pos3d
- self.geometry_object = geometry_object
- self.wall_index = wall_index
- self.pos2d = pos2d
- class ReactionRule():
- def __init__(
- self,
- name : str = None,
- reactants : List[Complex] = None,
- products : List[Complex] = None,
- fwd_rate : float = None,
- rev_name : str = None,
- rev_rate : float = None,
- variable_rate : List[List[float]] = None,
- is_intermembrane_surface_reaction : bool = False
- ):
- self.name = name
- self.reactants = reactants
- self.products = products
- self.fwd_rate = fwd_rate
- self.rev_name = rev_name
- self.rev_rate = rev_rate
- self.variable_rate = variable_rate
- self.is_intermembrane_surface_reaction = is_intermembrane_surface_reaction
- def to_bngl_str(
- self,
- ) -> 'str':
- pass
- class Region():
- def __init__(
- self,
- node_type : RegionNodeType = RegionNodeType.UNSET,
- left_node : Region = None,
- right_node : Region = None
- ):
- self.node_type = node_type
- self.left_node = left_node
- self.right_node = right_node
- def __add__(
- self,
- other : Region
- ) -> 'Region':
- pass
- def __sub__(
- self,
- other : Region
- ) -> 'Region':
- pass
- def __mul__(
- self,
- other : Region
- ) -> 'Region':
- pass
- class ReleasePattern():
- def __init__(
- self,
- name : str = None,
- release_interval : float = TIME_INFINITY,
- train_duration : float = TIME_INFINITY,
- train_interval : float = TIME_INFINITY,
- number_of_trains : int = 1
- ):
- self.name = name
- self.release_interval = release_interval
- self.train_duration = train_duration
- self.train_interval = train_interval
- self.number_of_trains = number_of_trains
- class ReleaseSite():
- def __init__(
- self,
- name : str,
- complex : Complex = None,
- molecule_list : List[MoleculeReleaseInfo] = None,
- release_time : float = 0,
- release_pattern : ReleasePattern = None,
- shape : Shape = Shape.UNSET,
- region : Region = None,
- location : List[float] = None,
- site_diameter : float = 0,
- site_radius : float = None,
- number_to_release : float = None,
- density : float = None,
- concentration : float = None,
- release_probability : float = 1
- ):
- self.name = name
- self.complex = complex
- self.molecule_list = molecule_list
- self.release_time = release_time
- self.release_pattern = release_pattern
- self.shape = shape
- self.region = region
- self.location = location
- self.site_diameter = site_diameter
- self.site_radius = site_radius
- self.number_to_release = number_to_release
- self.density = density
- self.concentration = concentration
- self.release_probability = release_probability
- class RngState():
- def __init__(
- self,
- randcnt : int,
- aa : int,
- bb : int,
- cc : int,
- randslr : List[int],
- mm : List[int],
- rngblocks : int
- ):
- self.randcnt = randcnt
- self.aa = aa
- self.bb = bb
- self.cc = cc
- self.randslr = randslr
- self.mm = mm
- self.rngblocks = rngblocks
- class Species():
- def __init__(
- self,
- name : str = None,
- diffusion_constant_2d : float = None,
- diffusion_constant_3d : float = None,
- custom_time_step : float = None,
- custom_space_step : float = None,
- target_only : bool = False,
- elementary_molecules : List[ElementaryMolecule] = None,
- orientation : Orientation = Orientation.DEFAULT,
- compartment_name : str = None
- ):
- self.name = name
- self.diffusion_constant_2d = diffusion_constant_2d
- self.diffusion_constant_3d = diffusion_constant_3d
- self.custom_time_step = custom_time_step
- self.custom_space_step = custom_space_step
- self.target_only = target_only
- self.name = name
- self.elementary_molecules = elementary_molecules
- self.orientation = orientation
- self.compartment_name = compartment_name
- def inst(
- self,
- orientation : Orientation = Orientation.DEFAULT,
- compartment_name : str = None
- ) -> 'Complex':
- pass
- def to_bngl_str(
- self,
- ) -> 'str':
- pass
- def as_species(
- self,
- ) -> 'Species':
- pass
- class Subsystem():
- def __init__(
- self,
- species : List[Species] = None,
- reaction_rules : List[ReactionRule] = None,
- surface_classes : List[SurfaceClass] = None,
- elementary_molecule_types : List[ElementaryMoleculeType] = None
- ):
- self.species = species
- self.reaction_rules = reaction_rules
- self.surface_classes = surface_classes
- self.elementary_molecule_types = elementary_molecule_types
- def add_species(
- self,
- s : Species
- ) -> None:
- pass
- def find_species(
- self,
- name : str
- ) -> 'Species':
- pass
- def add_reaction_rule(
- self,
- r : ReactionRule
- ) -> None:
- pass
- def find_reaction_rule(
- self,
- name : str
- ) -> 'ReactionRule':
- pass
- def add_surface_class(
- self,
- sc : SurfaceClass
- ) -> None:
- pass
- def find_surface_class(
- self,
- name : str
- ) -> 'SurfaceClass':
- pass
- def add_elementary_molecule_type(
- self,
- mt : ElementaryMoleculeType
- ) -> None:
- pass
- def find_elementary_molecule_type(
- self,
- name : str
- ) -> 'ElementaryMoleculeType':
- pass
- def load_bngl_molecule_types_and_reaction_rules(
- self,
- file_name : str,
- parameter_overrides : Dict[str, float] = None
- ) -> None:
- pass
- class SurfaceClass():
- def __init__(
- self,
- name : str,
- properties : List[SurfaceProperty] = None,
- type : SurfacePropertyType = SurfacePropertyType.UNSET,
- affected_complex_pattern : Complex = None,
- concentration : float = None
- ):
- self.name = name
- self.properties = properties
- self.type = type
- self.affected_complex_pattern = affected_complex_pattern
- self.concentration = concentration
- class SurfaceProperty():
- def __init__(
- self,
- type : SurfacePropertyType = SurfacePropertyType.UNSET,
- affected_complex_pattern : Complex = None,
- concentration : float = None
- ):
- self.type = type
- self.affected_complex_pattern = affected_complex_pattern
- self.concentration = concentration
- class SurfaceRegion():
- def __init__(
- self,
- name : str,
- wall_indices : List[int],
- surface_class : SurfaceClass = None,
- initial_surface_releases : List[InitialSurfaceRelease] = None,
- initial_color : Color = None,
- node_type : RegionNodeType = RegionNodeType.UNSET,
- left_node : Region = None,
- right_node : Region = None
- ):
- self.name = name
- self.wall_indices = wall_indices
- self.surface_class = surface_class
- self.initial_surface_releases = initial_surface_releases
- self.initial_color = initial_color
- self.node_type = node_type
- self.left_node = left_node
- self.right_node = right_node
- def __add__(
- self,
- other : Region
- ) -> 'Region':
- pass
- def __sub__(
- self,
- other : Region
- ) -> 'Region':
- pass
- def __mul__(
- self,
- other : Region
- ) -> 'Region':
- pass
- class VizOutput():
- def __init__(
- self,
- output_files_prefix : str = None,
- species_list : List[Species] = None,
- mode : VizMode = VizMode.ASCII,
- every_n_timesteps : float = 1
- ):
- self.output_files_prefix = output_files_prefix
- self.species_list = species_list
- self.mode = mode
- self.every_n_timesteps = every_n_timesteps
- class Wall():
- def __init__(
- self,
- geometry_object : GeometryObject,
- wall_index : int,
- vertices : List[List[float]],
- area : float,
- unit_normal : List[float],
- is_movable : bool = True
- ):
- self.geometry_object = geometry_object
- self.wall_index = wall_index
- self.vertices = vertices
- self.area = area
- self.unit_normal = unit_normal
- self.is_movable = is_movable
- class WallWallHitInfo():
- def __init__(
- self,
- wall1 : Wall,
- wall2 : Wall
- ):
- self.wall1 = wall1
- self.wall2 = wall2
- class Warnings():
- def __init__(
- self,
- high_reaction_probability : WarningLevel = WarningLevel.IGNORE,
- molecule_placement_failure : WarningLevel = WarningLevel.ERROR
- ):
- self.high_reaction_probability = high_reaction_probability
- self.molecule_placement_failure = molecule_placement_failure
- class bngl_utils():
- def __init__(
- self,
- ):
- pass
- def load_bngl_parameters(
- self,
- file_name : str,
- parameter_overrides : Dict[str, float] = None
- ) -> 'Dict[str, float]':
- pass
- class data_utils():
- def __init__(
- self,
- ):
- pass
- def load_dat_file(
- self,
- file_name : str
- ) -> 'List[List[float]]':
- pass
- class geometry_utils():
- def __init__(
- self,
- ):
- pass
- def create_box(
- self,
- name : str,
- edge_dimension : float = None,
- xyz_dimensions : List[float] = None
- ) -> 'GeometryObject':
- pass
- def create_icosphere(
- self,
- name : str,
- radius : float,
- subdivisions : int
- ) -> 'GeometryObject':
- pass
- def validate_volumetric_mesh(
- self,
- model : Model,
- geometry_object : GeometryObject
- ) -> None:
- pass
- class run_utils():
- def __init__(
- self,
- ):
- pass
- def get_last_checkpoint_dir(
- self,
- seed : int
- ) -> 'str':
- pass
- def remove_cwd(
- self,
- paths : List[str]
- ) -> 'List[str]':
- pass
- AllMolecules = Species('ALL_MOLECULES')
- AllVolumeMolecules = Species('ALL_VOLUME_MOLECULES')
- AllSurfaceMolecules = Species('ALL_SURFACE_MOLECULES')
|