Ejemplo n.º 1
0
def parse_bngl_strings_to_complex_representations(counts_df):
    # returns a list of pairs (mcell.Complex, int), the second item is count
    res = []
    for index, row in counts_df.iterrows():
        # constructor m.Complex parses the BNGL representaion into
        # a MCell4 API representation
        # (see https://cnl.salk.edu/~ahusar/mcell4_documentation/generated/subsystem.html#complex
        cplx = m.Complex(row['species'])
        res.append((cplx, row['count']))

    return res
Ejemplo n.º 2
0
def read_species_file(file_name):
    # load the .species file as a list of pairs (mcell.Complex, int), the second item is count
    res = []
    with open(file_name, 'r') as f:
        for line in f:
            if not line.strip():
                continue

            items = line.split()
            assert len(items) == 2, "Invalid input file contents " + line

            # constructor m.Complex parses the BNGL representaion into
            # a MCell4 API representation
            # (see https://cnl.salk.edu/~ahusar/mcell4_documentation/generated/subsystem.html#complex
            cplx = m.Complex(items[0])
            res.append((cplx, str(items[1])))

    return res
Ejemplo n.º 3
0
import mcell as m

# numerical attribute
c = m.Color(red=1, green=0, blue=0, alpha=1)

c2 = copy.deepcopy(c)
c2.red = 0.5

# check that the original object is correct
assert c.red == 1
assert c2.red == 0.5

# object - first level copy
rs = m.ReleaseSite(name='test',
                   complex=m.Complex('A'),
                   shape=m.Shape.SPHERICAL,
                   location=(1, 2, 3),
                   number_to_release=1000)

rs2 = copy.deepcopy(rs)
rs2.complex.name = 'B'

assert rs.complex.name == 'A'
assert rs2.complex.name == 'B'

# object in vector
cplx = m.Complex('X(a~0!1).Y(b~Q!1)')

ct = m.ComponentType('z', ['E', 'R'])
Ejemplo n.º 4
0
import mcell as m

from parameters import *
from subsystem import *
from geometry import *

# ---- instantiation ----

# ---- release sites ----

rel_a = m.ReleaseSite(
    name = 'rel_a',
    complex = m.Complex('a'),
    region = Cell - (Organelle_1 + Organelle_2),
    number_to_release = 2000
)

rel_b = m.ReleaseSite(
    name = 'rel_b',
    complex = m.Complex('b'),
    region = Organelle_1,
    number_to_release = 1000
)

rel_t1 = m.ReleaseSite(
    name = 'rel_t1',
    complex = m.Complex('t1', orientation = m.Orientation.UP),
    region = Organelle_1_top,
    number_to_release = 700
)
Ejemplo n.º 5
0
model.notifications.rxn_and_species_report = False

model.config.partition_dimension = 2
model.config.subpartition_dimension = 0.2

model.initialize()


model.run_iterations(1)

num_VS = params['num_VS']
num_VCP = params['num_VCP']
num_VEC = params['num_VEC']
        
ids_VSCP = model.get_molecule_ids(pattern = m.Complex('@CP:V(s!1).S(v!1)'))
ids_VSPM = model.get_molecule_ids(pattern = m.Complex('@PM:V(s!1).S(v!1)'))
ids_VSEC = model.get_molecule_ids(pattern = m.Complex('@EC:V(s!1).S(v!1)'))

ids_VCP = model.get_molecule_ids(pattern = m.Complex('@CP:V'))
ids_VPM = model.get_molecule_ids(pattern = m.Complex('@PM:V'))
ids_VEC = model.get_molecule_ids(pattern = m.Complex('@EC:V'))


assert len(ids_VSCP) == 0
assert len(ids_VSPM) == num_VS
assert len(ids_VSEC) == 0

assert len(ids_VCP) == num_VCP
assert len(ids_VPM) == num_VS
assert len(ids_VEC) == num_VEC
Ejemplo n.º 6
0
import sys
import os

MCELL_PATH = os.environ.get('MCELL_PATH', '')
if MCELL_PATH:
    sys.path.append(os.path.join(MCELL_PATH, 'lib'))
else:
    print("Error: variable MCELL_PATH that is used to find the mcell library was not set.")
    sys.exit(1)
    
import mcell as m

cplx = m.Complex('A(x~0)')
   
assert str(cplx) == 'A(x~0)'
   
assert "elementary_molecule_type=(ElementaryMoleculeType 'A'" in cplx.__str__(all_details=True) 


# species 
spec = m.Species('A', diffusion_constant_3d = 1e-6)

assert str(spec) == 'A'

assert "diffusion_constant_3d=1e-06" in spec.__str__(True) 

# geometry object
box = m.geometry_utils.create_box('box', 1)

#print(len(str(box)))
assert len(str(box)) < 150
Ejemplo n.º 7
0
import os

MCELL_PATH = os.environ.get('MCELL_PATH', '')
if MCELL_PATH:
    sys.path.append(os.path.join(MCELL_PATH, 'lib'))
else:
    print(
        "Error: variable MCELL_PATH that is used to find the mcell library was not set."
    )
    sys.exit(1)

import mcell as m

# single property
rs1 = m.ReleaseSite('rel1',
                    complex=m.Complex('X(y!1).Y(x!1)'),
                    shape=m.Shape.SPHERICAL,
                    location=(1, 1, 1),
                    number_to_release=10)

rs2 = m.ReleaseSite('rel1',
                    complex=m.Complex('X(y!1).Y(x!1)'),
                    shape=m.Shape.SPHERICAL,
                    location=(0.1, 0.1, 0.1),
                    number_to_release=10)

assert rs1 != rs2

rs3 = m.ReleaseSite('rel1',
                    complex=m.Complex('Y(x!1).X(y!1)'),
                    shape=m.Shape.SPHERICAL,
Ejemplo n.º 8
0
# WARNING: This is an automatically generated file and will be overwritten
#          by CellBlender on the next model export.

import os
import shared
import mcell as m

from parameters import *
from subsystem import *
from geometry import *
MODEL_PATH = os.path.dirname(os.path.abspath(__file__))

instantiation = m.Instantiation()
for mol in ['A', 'B']:
    cplx = m.Complex(mol)

    box1_sr1_rel = m.ReleaseSite(name='box1_sr1_rel_' + mol,
                                 complex=cplx,
                                 region=box1_sr1,
                                 number_to_release=40)

    box1_sr2_rel = m.ReleaseSite(name='box1_sr2_rel' + mol,
                                 complex=cplx,
                                 region=box1_sr2,
                                 number_to_release=60)

    box2_rel = m.ReleaseSite(name='box2_rel' + mol,
                             complex=cplx,
                             region=box2,
                             number_to_release=30)
Ejemplo n.º 9
0
    sys.path.append(os.path.join(MCELL_PATH, 'lib'))
else:
    print(
        "Error: variable MCELL_PATH that is used to find the mcell library was not set."
    )
    sys.exit(1)

import mcell as m

params = m.bngl_utils.load_bngl_parameters('test.bngl')

box1 = m.geometry_utils.create_box('box1', 0.5)
box2 = m.geometry_utils.create_box('box2', 1)
box3 = m.geometry_utils.create_box('box3', 1.5)

ct_box2 = m.CountTerm(species_pattern=m.Complex('A'), region=box2)
ct_box1 = m.CountTerm(species_pattern=m.Complex('A'), region=box1)

ct_box2_minus_ct_box1 = ct_box2 - ct_box1

# setting region that will be ignored
ct_box2_minus_ct_box1.region = box3

count = m.Count(name='z', expression=ct_box2_minus_ct_box1, file_name='x.dat')

# ---- load bngl file ----

# must be checked during initialization
model = m.Model()

model.load_bngl('test.bngl')
Ejemplo n.º 10
0
model.add_geometry_object(Sphere1)
model.add_geometry_object(Sphere2)

# load information on species and on our reaction
model.load_bngl('model.bngl')

# define reflective surface classes for our regions - same as in the lipid raft example so that
# our molecules don't diffuse away for the regions where the 'cells' touch
# when using the surface class, the molecules weirdly agreggate at its boundary,
# this is probably something to be checked.
# however in reality the whole object won't more so quickly so
# this might not be an issue
lipid_raft_A = m.SurfaceClass(name='lipid_raft_A',
                              type=m.SurfacePropertyType.REFLECTIVE,
                              affected_complex_pattern=m.Complex('A'))

lipid_raft_B = m.SurfaceClass(name='lipid_raft_B',
                              type=m.SurfacePropertyType.REFLECTIVE,
                              affected_complex_pattern=m.Complex('B'))
model.add_surface_class(lipid_raft_A)
model.add_surface_class(lipid_raft_B)

Sphere1_right.surface_class = lipid_raft_A
Sphere2_left.surface_class = lipid_raft_B

# release molecules in specified regions
rel_A = m.ReleaseSite(name='rel_A',
                      complex=m.Complex('A', orientation=m.Orientation.UP),
                      region=Sphere1_right,
                      number_to_release=350)
Ejemplo n.º 11
0
import mcell as m

# numerical attribute
c = m.Color(red=1, green=0, blue=0, alpha=1)

c2 = copy.copy(c)
c2.red = 0.5

# check that the original object is correct
assert c.red == 1
assert c2.red == 0.5

# object
rs = m.ReleaseSite(name='test',
                   complex=m.Complex('A'),
                   shape=m.Shape.SPHERICAL,
                   location=(1, 2, 3),
                   number_to_release=1000)

rs2 = copy.copy(rs)
rs2.complex = m.Complex('B')

assert rs.complex.to_bngl_str() == 'A'
assert rs2.complex.to_bngl_str() == 'B'

# vector
ct = m.ComponentType('u', states=['0'])

ct2 = copy.copy(ct)
ct2.states = ['X', 'Y']
Ejemplo n.º 12
0
from subsystem import *
from geometry import *
MODEL_PATH = os.path.dirname(os.path.abspath(__file__))


# ---- instantiation ----

# ---- release sites ----

# ---- surface classes assignment ----

box_bottom.surface_class = reflect_edge
# ---- compartments assignment ----

rel_m = m.ReleaseSite(
    name = 'rel_m',
    complex = m.Complex('M'),
    region = box_bottom,
    number_to_release = 3755
)

# ---- create instantiation object and add components ----

instantiation = m.Instantiation()
instantiation.add_geometry_object(box)
instantiation.add_release_site(rel_m)

# load seed species information from bngl file
instantiation.load_bngl_compartments_and_seed_species(os.path.join(MODEL_PATH, 'model.bngl'), None, shared.parameter_overrides)

Ejemplo n.º 13
0
from geometry import *
MODEL_PATH = os.path.dirname(os.path.abspath(__file__))


# ---- instantiation ----

# ---- release sites ----

# ---- surface classes assignment ----

Plane.surface_class = empty
# ---- compartments assignment ----

vol1_rel = m.ReleaseSite(
    name = 'vol1_rel',
    complex = m.Complex('vol1'),
    region = Cube,
    number_to_release = 2000
)

# ---- create instantiation object and add components ----

instantiation = m.Instantiation()
instantiation.add_geometry_object(Plane)
instantiation.add_geometry_object(Cube)
instantiation.add_release_site(vol1_rel)

# load seed species information from bngl file
instantiation.load_bngl_compartments_and_seed_species(os.path.join(MODEL_PATH, 'model.bngl'), None, shared.parameter_overrides)

Ejemplo n.º 14
0
                         output_files_prefix='./viz_data/seed_' +
                         str(SEED).zfill(5) + '/Scene',
                         every_n_timesteps=5000)
model.add_viz_output(viz_output)

gdat_file = ''
if 'GDAT' in params and params['GDAT'] == 1:
    gdat_file = os.path.splitext(bngl_file)[0] + '.gdat'

model.load_bngl(bngl_file,
                './react_data/seed_' + str(SEED).zfill(5) + '/' + gdat_file,
                default_compartment)

rel_site = m.ReleaseSite(
    name='x',
    complex=m.Complex('A@PM'),
    #shape = model.find_geometry_object('CP'),
    number_to_release=12345678900)

model.add_release_site(rel_site)

# ---- configuration ----

model.config.time_step = TIME_STEP
model.config.seed = SEED
model.config.total_iterations = ITERATIONS

model.config.partition_dimension = MCELL_DEFAULT_COMPARTMENT_EDGE_LENGTH
model.config.subpartition_dimension = MCELL_DEFAULT_COMPARTMENT_EDGE_LENGTH

model.initialize()
Ejemplo n.º 15
0
# ---- add components ----

model.add_geometry_object(Cube)

model.load_bngl('model.bngl', '', Cube)


surf = m.SurfaceClass(
    name = 'surf',
    type = m.SurfacePropertyType.REACTIVE
)

rxn = m.ReactionRule(
    name = 'rxn',
    reactants = [ m.Complex('v', orientation = m.Orientation.DOWN), m.Complex('surf', orientation = m.Orientation.UP) ],
    products = [ m.Complex('s', orientation = m.Orientation.UP) ],
    fwd_rate = 1e+07
)

Cube_membrane.surface_class = surf

model.add_surface_class(surf)
model.add_reaction_rule(rxn)


# ---- initialization and execution ----

model.initialize()

if DUMP:
Ejemplo n.º 16
0
assert C.to_bngl_str() == 'C~0~1~Z'
assert N.to_bngl_str() == 'N'

C_inst = C.inst('1', 2)
C_inst2 = C.inst(1)
assert C_inst.to_bngl_str() == 'C~1!2'
assert C_inst2.to_bngl_str() == 'C~1'

CaM = m.ElementaryMoleculeType('CaM', [C, N], diffusion_constant_3d=1e-6)
assert CaM.to_bngl_str() == 'CaM(C~0~1~Z,N)'

CaM_inst = CaM.inst([C.inst(0), N.inst(1)])
assert CaM_inst.to_bngl_str() == 'CaM(C~0,N~1)'

cplx_inst = m.Complex(elementary_molecules=[
    CaM.inst([C.inst(2, 1), N.inst(bond=2)]),
    CaM.inst([C.inst('Z', 1), N.inst(bond=2)])
])
assert cplx_inst.to_bngl_str() == 'CaM(C~2!1,N!2).CaM(C~Z!1,N!2)'

cplx2 = m.Complex('Ca', compartment_name='CP')
assert cplx2.to_bngl_str() == 'Ca@CP'

cplx3 = m.Complex('A(a!1).B(b!1)', compartment_name='CP')
assert cplx3.to_bngl_str() == '@CP:A(a!1).B(b!1)'

cplx4 = m.Complex('A(a!1)@IN.B(b!1)')
assert cplx4.to_bngl_str() == 'A(a!1)@IN.B(b!1)'

CaMC0N1_species = m.Species(
    elementary_molecules=[CaM.inst([C.inst(0), N.inst(1)])])
assert CaMC0N1_species.to_bngl_str() == 'CaM(C~0,N~1)'
Ejemplo n.º 17
0
# test to check that the Complex constructor correctly initializes internal 
# representation

import sys
import os

MCELL_PATH = os.environ.get('MCELL_PATH', '')
if MCELL_PATH:
    sys.path.append(os.path.join(MCELL_PATH, 'lib'))
else:
    print("Error: variable MCELL_PATH that is used to find the mcell library was not set.")
    sys.exit(1)
    
import mcell as m

c = m.Complex('@C1:A(b~X!1).B(a!1)')
#print(c)

assert len(c.elementary_molecules) == 2

em0 = c.elementary_molecules[0]
em1 = c.elementary_molecules[1]
assert len(em0.components) == 1
assert len(em1.components) == 1

assert em0.elementary_molecule_type.name == 'A'

comp0 = em0.components[0]
assert comp0.bond == 1
assert comp0.state == 'X'
Ejemplo n.º 18
0
import mcell as m

from parameters import *
from subsystem import *
from geometry import *

# ---- instantiation ----

# ---- release sites ----

rel_a = m.ReleaseSite(name='rel_a',
                      complex=m.Complex('a'),
                      shape=m.Shape.SPHERICAL,
                      location=(0, 0, 0),
                      site_diameter=0,
                      number_to_release=1000)

# ---- surface classes assignment ----

# ---- compartments assignment ----

# ---- instantiation data ----

instantiation = m.Instantiation()
instantiation.add_geometry_object(Cube)
instantiation.add_release_site(rel_a)
Ejemplo n.º 19
0
# WARNING: This is an automatically generated file and will be overwritten
#          by CellBlender on the next model export.

import os
import mcell as m

MODEL_PATH = os.path.dirname(os.path.abspath(__file__))

from parameters import *
from subsystem import *
from geometry import *

# ---- observables ----

viz_output = m.VizOutput(mode=m.VizMode.ASCII,
                         output_files_prefix='./viz_data/seed_' +
                         str(SEED).zfill(5) + '/Scene',
                         every_n_timesteps=1)

count_a = m.Count(expression=m.CountTerm(species_pattern=m.Complex('a')),
                  file_name='./react_data/seed_' + str(SEED).zfill(5) +
                  '/a.dat')

# ---- create observables object and add components ----

observables = m.Observables()
observables.add_count(count_a)
observables.add_viz_output(viz_output)
Ejemplo n.º 20
0
import os
import shared
import mcell as m

from parameters import *

# ---- subsystem ----

MODEL_PATH = os.path.dirname(os.path.abspath(__file__))

empty = m.SurfaceClass(name='empty', type=m.SurfacePropertyType.REACTIVE)

unnamed_reaction_rule_0 = m.ReactionRule(
    name='unnamed_reaction_rule_0',
    reactants=[
        m.Complex('vol1', orientation=m.Orientation.DOWN),
        m.Complex('empty', orientation=m.Orientation.UP)
    ],
    products=[m.Complex('vol2', orientation=m.Orientation.UP)],
    fwd_rate=1e7)

# ---- create subsystem object and add components ----

subsystem = m.Subsystem()
subsystem.add_surface_class(empty)
subsystem.add_reaction_rule(unnamed_reaction_rule_0)

# load subsystem information from bngl file
subsystem.load_bngl_molecule_types_and_reaction_rules(
    os.path.join(MODEL_PATH, 'model.bngl'), shared.parameter_overrides)
Ejemplo n.º 21
0
MCELL_PATH = os.environ.get('MCELL_PATH', '')
if MCELL_PATH:
    sys.path.append(os.path.join(MCELL_PATH, 'lib'))
else:
    print(
        "Error: variable MCELL_PATH that is used to find the mcell library was not set."
    )
    sys.exit(1)

import mcell as m

# single property
sc1 = m.SurfaceClass('sc',
                     type=m.SurfacePropertyType.REFLECTIVE,
                     affected_complex_pattern=m.Complex('X(y!1).Y(x!1)'))

sc2 = m.SurfaceClass('sc',
                     type=m.SurfacePropertyType.TRANSPARENT,
                     affected_complex_pattern=m.Complex('X(y!1).Y(x!1)'))

assert sc1 != sc2

sc3 = m.SurfaceClass('sc',
                     type=m.SurfacePropertyType.TRANSPARENT,
                     affected_complex_pattern=m.Complex('Y(x!1).X(y!1)'))

assert sc3 == sc2

# multiple properties
p1_1 = m.SurfaceProperty(type=m.SurfacePropertyType.REFLECTIVE,
Ejemplo n.º 22
0
# WARNING: This is an automatically generated file and will be overwritten
#          by CellBlender on the next model export.

import os
import shared
import mcell as m

from parameters import *

# ---- subsystem ----

MODEL_PATH = os.path.dirname(os.path.abspath(__file__))

react_a_plus_b = m.ReactionRule(name='react_a_plus_b',
                                reactants=[m.Complex('a'),
                                           m.Complex('b')],
                                products=[m.Complex('c')],
                                variable_rate=var_rate_react_a_plus_b_0)

# ---- create subsystem object and add components ----

subsystem = m.Subsystem()
subsystem.add_reaction_rule(react_a_plus_b)

# load subsystem information from bngl file
subsystem.load_bngl_molecule_types_and_reaction_rules(
    os.path.join(MODEL_PATH, 'model.bngl'), shared.parameter_overrides)


# set additional information about species and molecule types that cannot be stored in BNGL,
# elementary molecule types are already in the subsystem after they were loaded from BNGL
Ejemplo n.º 23
0
# ---- default configuration overrides ----

if customization and 'custom_config' in dir(customization):
    # user-defined model configuration
    customization.custom_config(model)

# ---- add components ----

viz_output = m.VizOutput(mode=m.VizMode.ASCII,
                         output_files_prefix='./viz_data/seed_' +
                         str(parameters.SEED).zfill(5) + '/Scene',
                         every_n_timesteps=1)
model.add_viz_output(viz_output)

count_Syk_CP = m.Count(
    expression=m.CountTerm(molecules_pattern=m.Complex('Syk@CP')),
    file_name='./react_data/seed_' + str(parameters.SEED).zfill(5) +
    '/Syk.dat',
    every_n_timesteps=1)
model.add_count(count_Syk_CP)

model.add_subsystem(subsystem.subsystem)
model.add_instantiation(instantiation.instantiation)

# ---- initialization and execution ----

if customization and 'custom_init_and_run' in dir(customization):
    customization.custom_init_and_run(model)
else:
    model.initialize()
Ejemplo n.º 24
0
import mcell as m

from parameters import *
from subsystem import *
from geometry import *

# ---- instantiation ----

# ---- release sites ----

rel_a = m.ReleaseSite(name='rel_a',
                      complex=m.Complex('a'),
                      shape=m.Shape.SPHERICAL,
                      location=(0, 0, 0),
                      site_diameter=0,
                      number_to_release=1000)

rel_b = m.ReleaseSite(name='rel_b',
                      complex=m.Complex('b'),
                      shape=m.Shape.SPHERICAL,
                      location=(5.0000000000000001e-03, 0, 0),
                      site_diameter=0,
                      number_to_release=1000)

# ---- surface classes assignment ----

# ---- compartments assignment ----

# ---- instantiation data ----

instantiation = m.Instantiation()
Ejemplo n.º 25
0
import mcell as m

from parameters import *
from bngl_molecule_types_info import *

# ---- subsystem ----

cclamp_left = m.SurfaceClass(
    name='cclamp_left',
    type=m.SurfacePropertyType.CONCENTRATION_CLAMP,
    affected_complex_pattern=m.Complex(
        'a', orientation=m.Orientation.DOWN
    ),  # DOWN means towards the center of the object 
    concentration=1e-5)

cclamp_right = m.SurfaceClass(name='cclamp_right',
                              type=m.SurfacePropertyType.CONCENTRATION_CLAMP,
                              affected_complex_pattern=m.Complex(
                                  'a', orientation=m.Orientation.DOWN),
                              concentration=1e-7)

subsystem = m.Subsystem()
subsystem.add_surface_class(cclamp_left)
subsystem.add_surface_class(cclamp_right)

# load subsystem information from bngl file
subsystem.load_bngl_molecule_types_and_reaction_rules('model.bngl')
# set additional information such as diffusion constants for loaded elementary molecule types
set_bngl_molecule_types_info(subsystem)
Ejemplo n.º 26
0
    sys.path.append(os.path.join(MCELL_PATH, 'lib'))
else:
    print(
        "Error: variable MCELL_PATH that is used to find the mcell library was not set."
    )
    sys.exit(1)

import mcell as m

# checking that .append and other modifications works
ct_u = m.ComponentType('u', states=['0'])

#print(type(ct_u.states))
assert len(ct_u.states) == 1
ct_u.states.append('1')
assert len(ct_u.states) == 2

ct_u.states[1] = '2'
assert ct_u.states[1] == '2'

rs = m.ReleaseSite(name='test',
                   complex=m.Complex('A'),
                   shape=m.Shape.SPHERICAL,
                   location=(1, 2, 3),
                   number_to_release=1000)

#print(type(rs.location))
#print(rs.location)
rs.location[0] = 2
#print(rs.location)
assert rs.location[0] == 2
Ejemplo n.º 27
0
# WARNING: This is an automatically generated file and will be overwritten
#          by CellBlender on the next model export.

import mcell as m

from parameters import *
from subsystem import *
from geometry import *

# ---- instantiation ----

# ---- release sites ----

rel_A = m.ReleaseSite(name='rel_A',
                      complex=m.Complex('A', orientation=m.Orientation.UP),
                      region=up,
                      number_to_release=100)

rel_B = m.ReleaseSite(name='rel_B',
                      complex=m.Complex('B', orientation=m.Orientation.UP),
                      region=bottom,
                      number_to_release=100)

# ---- surface classes assignment ----

# ---- compartments assignment ----

# ---- create instantiation object and add components ----

instantiation = m.Instantiation()
instantiation.add_geometry_object(up)
Ejemplo n.º 28
0
# WARNING: This is an automatically generated file and will be overwritten
#          by CellBlender on the next model export.

import mcell as m

from parameters import *
from subsystem import *
from geometry import *

# ---- instantiation ----

# ---- release sites ----

Release_of_Syk_ps_a_Y_l_Y_tSH2_pe_CP_at_CP = m.ReleaseSite(
    name='Release_of_Syk_ps_a_Y_l_Y_tSH2_pe_CP_at_CP',
    complex=m.Complex('Syk(a~Y,l~Y,tSH2)'),
    region=CP,
    number_to_release=20)

# ---- surface classes assignment ----

# ---- compartments assignment ----

default_compartment.is_bngl_compartment = True

EC.is_bngl_compartment = True

CP.is_bngl_compartment = True
CP.surface_compartment_name = 'PM'

# ---- create instantiation object and add components ----
Ejemplo n.º 29
0
model.config.partition_dimension = 2
model.config.subpartition_dimension = 0.2

model.initialize()


model.run_iterations(1)

num_AR = params['num_AR']
num_AS = params['num_AS']
num_BT = params['num_BT']
num_BU = params['num_BU']
num_ASBT = params['num_ASBT']
num_ARBU = params['num_ARBU']
        
ids_A = model.get_molecule_ids(pattern = m.Complex('A'))
ids_B = model.get_molecule_ids(pattern = m.Complex('B'))
ids_AR = model.get_molecule_ids(pattern = m.Complex('A(a~R)'))
ids_AS = model.get_molecule_ids(pattern = m.Complex('A(a~S)'))
ids_BT = model.get_molecule_ids(pattern = m.Complex('B(b~T)'))
ids_BU = model.get_molecule_ids(pattern = m.Complex('B(b~U)'))

ids_ASBT = model.get_molecule_ids(pattern = m.Complex('A(a~S,b!1).B(b~T,a!1)'))
ids_ARBU = model.get_molecule_ids(pattern = m.Complex('A(a~R,b!1).B(b~U,a!1)'))

ids_AB = model.get_molecule_ids(pattern = m.Complex('A(b!1).B(a!1)'))

assert len(ids_A) == num_AR + num_AS + num_ASBT + num_ARBU
assert len(ids_B) == num_BT + num_BU + num_ASBT + num_ARBU
assert len(ids_AR) == num_AR + num_ARBU
assert len(ids_AS) == num_AS + num_ASBT
Ejemplo n.º 30
0
# ---- observables ----

viz_output = m.VizOutput(mode=m.VizMode.ASCII,
                         output_files_prefix='./viz_data/seed_' +
                         str(get_seed()).zfill(5) + '/Scene',
                         every_n_timesteps=1)

# declaration of rxn rules defined in BNGL and used in counts
react_a_plus_b = subsystem.find_reaction_rule('react_a_plus_b')
assert react_a_plus_b, "Reaction rule 'react_a_plus_b' was not found"

react_b_plus_c = subsystem.find_reaction_rule('react_b_plus_c')
assert react_b_plus_c, "Reaction rule 'react_b_plus_c' was not found"

count_a_Cube1 = m.Count(
    expression=m.CountTerm(molecules_pattern=m.Complex('a'), region=Cube1),
    file_name='./react_data/seed_' + str(get_seed()).zfill(5) + '/a.Cube1.dat',
    every_n_timesteps=0  # used only manually
)

count_a_Cube2 = m.Count(
    expression=m.CountTerm(molecules_pattern=m.Complex('a'), region=Cube2),
    file_name='./react_data/seed_' + str(get_seed()).zfill(5) + '/a.Cube2.dat',
    every_n_timesteps=0  # used only manually
)

count_a_Cube3 = m.Count(
    expression=m.CountTerm(molecules_pattern=m.Complex('a'), region=Cube3),
    file_name='./react_data/seed_' + str(get_seed()).zfill(5) + '/a.Cube3.dat',
    every_n_timesteps=0  # used only manually
)