Beispiel #1
0
        "Error: variable MCELL_PATH that is used to find the mcell library was not set."
    )
    sys.exit(1)

import mcell as m

model = m.Model()

a = m.Species('a', diffusion_constant_3d=1e-6)
model.add_species(a)
s1 = model.find_species('a')
assert s1 is not None and s1.name == 'a'
s2 = model.find_species('b')
assert s2 is None

r = m.ReactionRule('r', [a.inst()], [], 0)
model.add_reaction_rule(r)
r1 = model.find_reaction_rule('r')
assert r1 is not None and r1.name == 'r'
r2 = model.find_reaction_rule('s')
assert r2 is None

sc = m.SurfaceClass('sc',
                    type=m.SurfacePropertyType.TRANSPARENT,
                    affected_complex_pattern=a)
model.add_surface_class(sc)
sc1 = model.find_surface_class('sc')
assert sc1 is not None and sc1.name == 'sc'
sc2 = model.find_surface_class('scx')
assert sc2 is None
Beispiel #2
0
import mcell as m

from parameters import *

# ---- subsystem ----

b = m.Species(name='b', diffusion_constant_2d=5.00000000000000024e-05)

a = m.Species(name='a', diffusion_constant_3d=9.99999999999999955e-07)

c = m.Species(name='c', diffusion_constant_3d=9.99999999999999955e-07)

react_a_and_b = m.ReactionRule(name='react_a_and_b',
                               reactants=[
                                   a.inst(orientation=m.Orientation.DOWN),
                                   b.inst(orientation=m.Orientation.UP)
                               ],
                               products=[],
                               fwd_rate=1e+08)

subsystem = m.Subsystem()
subsystem.add_species(b)
subsystem.add_species(a)
subsystem.add_species(c)
subsystem.add_reaction_rule(react_a_and_b)
Beispiel #3
0
import mcell as m

from parameters import *

# ---- subsystem ----

b = m.Species(name='b', diffusion_constant_3d=4.99999999999999977e-07)

a = m.Species(name='a', diffusion_constant_3d=9.99999999999999955e-07)

c = m.Species(name='c', diffusion_constant_3d=9.99999999999999955e-07)

react_a_and_b = m.ReactionRule(name='react_a_and_b',
                               reactants=[a.inst(), b.inst()],
                               products=[],
                               fwd_rate=5e+08)

subsystem = m.Subsystem()
subsystem.add_species(b)
subsystem.add_species(a)
subsystem.add_species(c)
subsystem.add_reaction_rule(react_a_and_b)
Beispiel #4
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
Beispiel #5
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)

Beispiel #6
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:
    model.dump_internal_state()
Beispiel #7
0
rxn_rule = m.ReactionRule(
    name="sixth rxn",
    rev_name="sixth rxn rev",
    reactants=[
        m.Complex(elementary_molecules=[
            CaMKII.inst([
                l.inst(),
                r.inst(),
                Y286.inst('0'),
                cam.inst(bond=m.BOND_BOUND)
            ])
        ]),
        m.Complex(elementary_molecules=[
            CaMKII.inst([l.inst(
            ), r.inst(), cam.inst(bond=m.BOND_BOUND)])
        ])
    ],
    products=[
        m.Complex(elementary_molecules=[
            CaMKII.inst([
                l.inst(1, bond=1),
                r.inst(),
                Y286.inst('0'),
                cam.inst(bond=m.BOND_BOUND)
            ]),
            CaMKII.
            inst([l.inst(
            ), r.inst(
                bond=1), cam.inst(bond=m.BOND_BOUND)])
        ])
    ],
    fwd_rate=k_onCaMKII,
    rev_rate=k_offCaMKII)
Beispiel #8
0
import mcell as m

from parameters import *

# ---- subsystem ----

b = m.Species(name='b', diffusion_constant_3d=4.99999999999999977e-07)

a = m.Species(name='a', diffusion_constant_3d=9.99999999999999955e-07)

react_a_to_b = m.ReactionRule(name='react_a_to_b',
                              reactants=[a.inst()],
                              products=[b.inst()],
                              variable_rate=var_rate_react_a_to_b_1)

subsystem = m.Subsystem()
subsystem.add_species(b)
subsystem.add_species(a)
subsystem.add_reaction_rule(react_a_to_b)