Example model files for Magrathea

From irefindex

The Magrathea Manual Contents

The Magrathea Manual: Coordinated Agent Modelling Explained

The Magrathea Manual: Coordinated Agent Modelling By Example

The Magrathea Manual: Building Coordinated Agent Models

Magrathea Installation and Use

Example model files for Magrathea


How to use these example files

See the section Magrathea Installation and Use


Example 1. Point coordinator representing an interaction


###########
#interaction.1.txt
#showing a coordinator used to model an interaction between two molecules
#
#last tested with breve 2.6.1 and magrathea.tz 1.40
###########


[simulation]
camera-at-from 10 10 0 0 1 30
light-source 0 20 20
movie-length 10
[/simulation]

[moleculeType]
id 1
label a
show-label 1
color .81 .60 .21
shape Sphere 1
show-neighbor-lines 1
neighborhood-size 1.0
dynamic-neighborhood-sizing 1
coordinator 1 3
instantiate 1 random spherical volume 10 10 0 1
[/moleculeType]

[moleculeType]
id 2        
label b
show-label 1
color 0.67 0.08 0.37
shape Sphere 1
show-neighbor-lines 1
neighborhood-size 1.0
dynamic-neighborhood-sizing 1
coordinator 1 3
instantiate 1 random spherical volume 15 10 10 1
[/moleculeType]

[coordinatorType]
id 3
label complex
shape Cube 1 1 1
neighborhood-size 1
molecule 1 1
molecule 2 1
[/coordinatorType]

#****************************************************************

EOF

Example 2. Point coordinator representing a complex


###########
#complex.1.txt
#showing a coordinator used to model a complex between three molecules
#complex stoichiometry is a,b,c (note one extra c molecule is left out)
#last tested with breve 2.6.1 and magrathea.tz 1.42
###########


[simulation]
camera-at-from 10 10 0 0 1 30
light-source 0 20 20
movie-length 10
[/simulation]

[moleculeType]
id 1
label a
show-label 1
color .81 .60 .21
shape Sphere 1
show-neighbor-lines 1
neighborhood-size 1.0
dynamic-neighborhood-sizing 1
coordinator 1 4
instantiate 1 random spherical volume 10 10 0 1
[/moleculeType]

[moleculeType]
id 2        
label b
show-label 1
color 0.67 0.08 0.37
shape Sphere 1
show-neighbor-lines 1
neighborhood-size 1.0
dynamic-neighborhood-sizing 1
coordinator 1 4
instantiate 1 random spherical volume 15 10 10 1
[/moleculeType]

[moleculeType]
id 3        
label c
show-label 1
color 0.47 0.11 0.37
shape Sphere 1
show-neighbor-lines 1
neighborhood-size 1.0
dynamic-neighborhood-sizing 1
coordinator 1 4
instantiate 2 random spherical volume 5 10 10 1
[/moleculeType]


[coordinatorType]
id 4
label complex
shape Cube 1 1 1
neighborhood-size 1
molecule 1 1
molecule 2 1
molecule 3 1
[/coordinatorType]

#****************************************************************

EOF


###########
#complex.2.txt
#showing a coordinator used to model a complex between four molecules
#stoichiometry of complex is a,b,2c
#last tested with breve 2.6.1 and magrathea.tz 1.42
###########


[simulation]
camera-at-from 10 10 0 0 1 30
light-source 0 20 20
movie-length 10
[/simulation]

[moleculeType]
id 1
label a
show-label 1
color .81 .60 .21
shape Sphere 1
show-neighbor-lines 1
neighborhood-size 1.0
dynamic-neighborhood-sizing 1
coordinator 1 4
instantiate 1 random spherical volume 10 10 0 1
[/moleculeType]

[moleculeType]
id 2        
label b
show-label 1
color 0.67 0.08 0.37
shape Sphere 1
show-neighbor-lines 1
neighborhood-size 1.0
dynamic-neighborhood-sizing 1
coordinator 1 4
instantiate 1 random spherical volume 15 10 10 1
[/moleculeType]

[moleculeType]
id 3        
label c
show-label 1
color 0.47 0.11 0.37
shape Sphere 1
show-neighbor-lines 1
neighborhood-size 1.0
dynamic-neighborhood-sizing 1
coordinator 1 4
instantiate 2 random spherical volume 5 10 10 1
[/moleculeType]


[coordinatorType]
id 4
label complex
shape Cube 1 1 1
neighborhood-size 1
molecule 1 1
molecule 2 1
molecule 3 2
[/coordinatorType]

#****************************************************************

EOF


Example 3. Point coordinator representing a compartment


###########
#compartment.1.txt
#showing a coordinator used to model a compartment with 20 
#closely packed "surface" molecules
#one coordinator type is used with one molecule type
#
#last tested with breve 2.6.1 and magrathea.tz 1.42
#at the time of testing, neighbor lines are only drawn if breve 2.5 is used
###########


[simulation]
camera-at-from 10 10 0 0 1 30
light-source 0 20 20
movie-length 10
[/simulation]

[moleculeType]
id 1
label a
show-label 0
color .81 .60 .21
shape Sphere 1
show-neighbor-lines 1
neighborhood-size 1.0
dynamic-neighborhood-sizing 1
coordinator 1 2
instantiate 20 random spherical volume 10 10 0 1
[/moleculeType]



[coordinatorType]
id 2
label compartment
shape Sphere 0.1
opacity 0.5
geometricType point
neighborhood-size 5
#
isSizeDynamic 1
#
molecule 1 20
[/coordinatorType]

#****************************************************************

EOF


###########
#compartment.2.txt
#showing a coordinator used to model a compartment with 20 
#surface marker molecules
#the actual diameter of these marker molecules is larger than what is 
#rendered using the line
#shape Sphere 1 2
#one coordinator type is used with one molecule type

#last tested with breve 2.6.1 and magrathea.tz 1.42
#at the time of testing, neighbor lines are only drawn if breve 2.5 is used
###########


[simulation]
camera-at-from 10 10 0 0 1 30
light-source 0 20 20
movie-length 10
[/simulation]

[moleculeType]
id 1
label a
show-label 0
color .81 .60 .21
#
shape Sphere 1 2
#
show-neighbor-lines 1
neighborhood-size 1.0
dynamic-neighborhood-sizing 1
coordinator 1 2
instantiate 20 random spherical volume 10 10 0 1
[/moleculeType]



[coordinatorType]
id 2
label compartment
shape Sphere 0.1
opacity 0.5
geometricType point
neighborhood-size 5
isSizeDynamic 1
molecule 1 20
[/coordinatorType]

#****************************************************************

EOF

Example 4. Plane coordinator representing a membrane section.


###########
#membrane.1.txt
#showing a coordinator used to model a membrane section 
#20 member molecules are moved to the surface of the plane and 
#their random movement is constrained to the surface of this plane
#!although molecules venturing to the edge of the plane are allowed to slip off
#
#last tested with breve 2.6.1 and magrathea.tz 1.42
#at the time of testing, neighbor lines are only drawn if breve 2.5 is used
###########


[simulation]
camera-at-from 10 10 0 0 1 50
light-source 0 20 20
movie-length 15
[/simulation]

[moleculeType]
id 1
label a
show-label 0
color .81 .60 .21
shape Sphere 1
show-neighbor-lines 1
neighborhood-size 1.0
dynamic-neighborhood-sizing 1
coordinator 1 2
instantiate 20 random spherical volume 10 10 0 5
[/moleculeType]



[coordinatorType]
id 2
label membrane
color .383 .466 .561
opacity 0.5
shape Cube 30 .2 30
geometricType plane
neighborhood-size 5
#
isCreationDynamic 0
isMobile 0
isSizeDynamic 1
#
molecule 1 20
#orientation vertex 0 1 0 pointing-at 0 1 0
#orientation vertex 0 1 0 pointing-at 1 0 0
#orientation vertex 0 1 0 pointing-at 0 0 1
instantiate 1 determined point - 10 5 10
[/coordinatorType]

#****************************************************************

EOF


###########
#membrane.2.txt
#showing a coordinator used to model a membrane section 
#20 member molecules are moved to the surface of the plane and 
#their random movement is constrained to the surface of this plane
#non-membrane molecules (molecule type 2) will collide and be reprelled
#by the surface of this planar coordinator
#!some of these molecules may eventually become trapped in the 
#surface of the plane
#
#last tested with breve 2.6.1 and magrathea.tz 1.44
#at the time of testing, neighbor lines are only drawn if breve 2.5 is used
###########


[simulation]
camera-at-from 10 10 0 0 1 50
light-source 0 20 20
movie-length 15
[/simulation]

[moleculeType]
id 1
label compartment_marker
show-label 0
color .81 .60 .21
shape Sphere .5 2
show-neighbor-lines 1
neighborhood-size 1.0
dynamic-neighborhood-sizing 1
coordinator 1 3
instantiate 20 random spherical volume 10 10 10 5
[/moleculeType]

[moleculeType]
id 2
label non_membrane_molecule
show-label 0
color .37 .51 .26
shape Sphere 1
show-neighbor-lines 1
neighborhood-size 1.0
dynamic-neighborhood-sizing 1
instantiate 20 random spherical volume 10 15 10 5
instantiate 20 random spherical volume 10 5 10 5
[/moleculeType]


[coordinatorType]
id 3
label membrane
color .383 .466 .561
opacity 0.5
shape Cube 30 .2 30
geometricType plane
neighborhood-size 5
isCreationDynamic 0
isMobile 0
isSizeDynamic 1
molecule 1 20
#orientation vertex 0 1 0 pointing-at 0 1 0
#orientation vertex 0 1 0 pointing-at 1 0 0
#orientation vertex 0 1 0 pointing-at 0 0 1
instantiate 1 determined point - 10 10 10
[/coordinatorType]

#****************************************************************

EOF

Example 5. Line coordinator representing a microtubule.


###########
#microtubule.1.txt
#showing a linear coordinator used to model a microtubule or some
#other linear macromolecular structure 
#20 member molecules are moved to the line coordinator and 
#their random movement is constrained to this line
#the line coordinator is dynamically sized so it grows in length 
#as molecules join it
#the molecules have an effective radius of 2 (versus the rendered 1 unit)
#so the molecules appear spaced out along the line
#
#last tested with breve 2.6.1 and magrathea.tz 1.44
#at the time of testing, neighbor lines are only drawn if breve 2.5 is used
###########


[simulation]
camera-at-from 20 10 0 1 1 70
light-source 0 20 20
movie-length 40
[/simulation]

[moleculeType]
id 1
label line_coordinator_component_1
show-label 0
color .81 .60 .21
shape Sphere 1 2
show-neighbor-lines 1
neighborhood-size 1
dynamic-neighborhood-sizing 1
coordinator 1 2
instantiate 20 random cylindrical volume 10 15 10 0 1 0 0 35
[/moleculeType]



[coordinatorType]
id 2
label line_coordinator
color .383 .466 .561
opacity 1
shape Cube .2 .2 .2
geometricType line
neighborhood-size 5
isCreationDynamic 0
isMobile 0
isSizeDynamic 1
molecule 1 20

#various orientations to try
#remove the # sign in front of one of these lines
#orientation vertex 1 0 0 pointing-at 0 1 0
#orientation vertex 1 0 0 pointing-at 1 0 0
#orientation vertex 1 0 0 pointing-at 0 0 1
#
#orientation vertex 1 0 0 pointing-at 1 1 0
#orientation vertex 1 0 0 pointing-at 1 0 1
#orientation vertex 1 0 0 pointing-at 0 1 1
#orientation vertex 1 0 0 pointing-at 1 1 1
instantiate 1 determined point - 30 10 10
[/coordinatorType]

#****************************************************************

EOF


Example 6. Coordinators and rules.

Example 6.1 - simple state change

###########

#rules.1.txt
#a simple demonstration of the use of rules by coordinators
#this example shows a substrate (molecule 1) that undergoes 
#a state-change (phosphorylation) upon interaction with a 
#kinase (molecule 2) 
#the substrate changes from yellow to green upon changing state
#and then dissociates from the kinase
#
#last tested with breve 2.6.1 and magrathea.tz 1.44
#at the time of testing, neighbor lines are only drawn if breve 2.5 is used
###########





[simulation]
produce-visual-output 1
camera-at-from 10 15 10 100 1 30
light-source 20 20 20
movie-length 40
[/simulation]







[moleculeType]
id 1
label substrate
show-label 1
color .81 .60 .21
shape Sphere 1
show-neighbor-lines 1
neighborhood-size 1
dynamic-neighborhood-sizing 1



###
#the following line is read as: 
#there is some feature with an identifier of 234
#and this feature is given the label of "Tyr234"
###
feature 234 Tyr234

#-----------------------------------------------------------------
#the following line is read as: 
#there is some feature with an identifier of 234
#and this feature may have the value of 0
#and this feature-value pair is given the label "unphosphorylated"
#see the "Making Models" section of the Magrathea manual
#for more a more detailed explanation
#-----------------------------------------------------------------

feature-state 234 0 unphosphorylated



#-----------------------------------------------------------------
#the following line is read as: 
#there is some feature with an identifier of 234
#and this feature may have the value of 1
#and this feature-value pair is given the label "phosphorylated"
#see the "Making Models" section of the Magrathea manual
#for more a more detailed explanation
#-----------------------------------------------------------------

feature-state 234 1 phosphorylated



coordinator 1 3
instantiate 1 determined point - 10 10 10
#this works too
#instantiate 1 determined point - 10 10 10 - - - - - 234.0
#but this does not because of the assembly rule 1 for coordinator 3
#instantiate 1 determined point - 10 10 10 - - - - - 234.1

[/moleculeType]





[moleculeType]
id 2
label kinase
show-label 1
color .92 .32 .1
shape Sphere 1
show-neighbor-lines 1
neighborhood-size 1
dynamic-neighborhood-sizing 1
coordinator 1 3
instantiate 1 determined point - 10 20 10
[/moleculeType]





[coordinatorType]
id 3
label complex_with_rules
color 1 1 1
shape Cube 1 1 1
neighborhood-size 10
#-----------------------------------------------------------------
#the following lines state that this coordinator can coordinate 
#molecules of type 1 and of type 2 (first position after "molecule")
#with a stoichiometry of 1 for each (second position) and that these molecules
#cannot (0) become part of the coordinator without first
#satisfying some state consitions
#-----------------------------------------------------------------

molecule 1 1 0
molecule 2 1 0

[rule]
#-----------------------------------------------------------------
#this following rule describes the complex formation
#the first two "if" lines specify
#which molecules must be present for the rule to be executed
#the "then" line specifies what happens if the rule is executed and
#the "parameters" line specifies a probability that
#the rule will be executed should the conditions be met 
#see the "Making Models" section of the Magrathea manual
#for more a more detailed explanation
#-----------------------------------------------------------------

id 1

#-----------------------------------------------------------------
#the following line is read (from left to right)
#if present a "tag" of 1 will be used to refer to 
#molecule of type 1 (where 1 instance is present)
#that is not (0) assembled with this coordinator
#and does not (0) have a feature-state pair of 234.1
#i.e. feature 234 in state 1 
#see the "Making Models" section of the Magrathea manual
#for more a more detailed explanation
#-----------------------------------------------------------------

if 1.1.1.0.0.234.1
if 2.2.1.0

#-----------------------------------------------------------------
#the following line is read
#molecule(s) assigned with tag 1 (see if lines above)
#are allowed to begin asembly with the coordinator
#see the "Making Models" section of the Magrathea manual
#for more a more detailed explanation
#-----------------------------------------------------------------

then 1 begins-assembly
then 2 begins-assembly

#-----------------------------------------------------------------
#the following line indicates that the event 
#described by the "then" lines above
#will be executed with a probability of 1
#if the conditions specified in the "if"
#lines above are met
#see the "Making Models" section of the Magrathea manual
#for more a more detailed explanation
#-----------------------------------------------------------------

parameters p 1
[/rule]





[rule]
#-----------------------------------------------------------------
#this rule describes a state change of the substrate (molecule 1)
#generated by the presence of the kinase (molecule 2)
#the state change is visualized by a change of colour of 
#the substrate molecule
#see the "Making Models" section of the Magrathea manual
#for more a more detailed explanation
#-----------------------------------------------------------------

id 2
if 1.1.1.1.0.234.1 
if 2.2.1.1

#-----------------------------------------------------------------
#the following line is read as:
#the molecule with the tag of 1 (see first "if" line above)
#changes state such that
#feature 234 assumes state 1
#see the "Making Models" section of the Magrathea manual
#for more a more detailed explanation
#-----------------------------------------------------------------

then 1 changes-state-to 234.1
then 1 changes-colour-to .1:.32:.11
parameters p 1
[/rule]



[rule]
#-----------------------------------------------------------------
#this rule describes the idea that the substrate (molecule 1) 
#leaves the coordinator once it has been phosphorylated
#i.e. feature 234 has a state value of 1
#see the "Making Models" section of the Magrathea manual
#for more a more detailed explanation
#-----------------------------------------------------------------

#unbinding
id 3
if 1.1.1.1.1.234.1
if 2.2.1.1
then 1 leaves-coordinator
then 2 leaves-coordinator
parameters p 1
[/rule]

[/coordinatorType] 


#****************************************************************



EOF

Example 6.2 - lateral signalling


###########
#rules.2.txt
#This demonstration shows a somewhat more complex use of rules to 
#demonstrate the process of lateral signalling.
#In this example, a ligand molecule binds to a membrane-bound receptor.  
#On binding, the receptor changes state (becomes activated) as indicated by 
#a colour change.  The receptor in this new state also gains the ability to 
#bind to and activate other membrane bound receptors.
#
#No new concepts are introduced in this model compared to the rules.1.txt
#example so there are few comments in the file.
#See the "Making Models" section of the Magrathea manual for more details
#on the syntax of each line
# 
#after a molecule x changes state, molecule x and all molecule types that might be coordinated 
#in some coordinator with molecule x have there neighborhood size reset
#turn on #show-neighbor-lines 1# to see how this happens
#
#last tested with breve 2.6.1 and magrathea.tz 1.44
#at the time of testing, neighbor lines are only drawn if breve 2.5 is used
###########


[simulation]
camera-at-from 10 15 10 0 10 30
light-source 0 20 20
movie-length 20
[/simulation]


[moleculeType]
id 1
label receptor
show-label 1
color .81 .60 .21
shape Sphere 1
neighborhood-size 1
show-neighbor-lines 1
dynamic-neighborhood-sizing 1
feature 234 Tyr234
feature-state 2 0 unphosphorylated
feature-state 2 63 phosphorylated
coordinator 1 5
coordinator 2 4
coordinator 3 3
instantiate 20 random planar - 10 15 10 20 0 1 0
[/moleculeType]

[moleculeType]
id 2        
label ligand
show-label 1
color .92 .32 .11
shape Sphere .7
neighborhood-size 1
dynamic-neighborhood-sizing 1
coordinator 1 5
instantiate 1 determined point - 10 20 10 1
[/moleculeType]


[coordinatorType]
id 3
label membrane
color .383 .466 .561
opacity 0.3
geometricType plane
shape Cube 30 .2 30
neighborhood-size 10
molecule 1 20
isCreationDynamic 0
isMobile 0
orientation vertex 0 1 0 pointing-at 0 1 0
instantiate 1 determined point - 10 15 10
[/coordinatorType]


[coordinatorType]
id 4
label receptor-receptor-complex
color 1 1 1
shape Cube 1 1 1
neighborhood-size 10
molecule 1 2 0
[rule]
#formation
id 1
if 1.1.1.0.1.2.63
if 2.1.1.0.0.2.63
then 1 begins-assembly
then 2 begins-assembly
parameters p1 1
[/rule]
[rule]
#lateral activation
id 2
if 1.1.1.1.1.2.63
if 2.1.1.1.0.2.63
then 2 changes-state-to 2.63
then 2 changes-colour-to .1:.32:.11
parameters p1 1
[/rule]
[rule]
#unbinding
id 3
if 1.1.1.1.1.2.63
if 2.1.1.1.1.2.63
then 1 leaves-coordinator
then 2 leaves-coordinator
#parameters p3 0.15
parameters p1 1
[/rule]
[/coordinatorType]

[coordinatorType]
id 5
label receptor-ligand-complex
color 1 1 1
shape Cube 1 1 1
neighborhood-size 10
molecule 1 1 0
molecule 2 1 0
[rule]
#formation
id 1
if 1.1.1.0.0.2.63
if 2.2.1.0
then 1 begins-assembly
then 2 begins-assembly
parameters p4 0.2
[/rule]
[rule]
#ligand activation
id 2
if 1.1.1.1.0.2.63 
if 2.2.1.1
then 1 changes-state-to 2.63
then 1 changes-colour-to .1:.32:.11
parameters p5 1
[/rule]
[rule]
#unbinding
#id 3
if 1.1.1.1.1.2.63
if 2.2.1.1
then 1 leaves-coordinator
then 2 leaves-coordinator
parameters p6 0.2
[/rule]
[/coordinatorType]


#****************************************************************

EOF

Example 6.3

###########
#rules.3.txt
#This demonstration shows two coordinator and their rules that control translocation
#into and out of a spherical compartment represented by a third coordinator.
#
#In this example, blue molecules (ligand) bind to a surface receptor (black) and are 
#translocated INTO the compartment where they change color to yellow.  A state change in 
#the ligand molecules then allows them to bind a second receptor (grey) that translocates 
#them OUT OF the compartment.
#
#See the "Making Models" section of the Magrathea manual for more details
#on the syntax of each line
# 
#last tested with breve 2.6.1 and magrathea.tz 1.44
#at the time of testing, neighbor lines are only drawn if breve 2.5 is used
###########


[simulation]
camera-at-from 30 20 30 7 6 15
light-source 50 50 50
movie-length 40
[/simulation]


[moleculeType]
id 1
label compartment_marker
color .81 .60 .21
#----------------------------------------------------
#The following line causes comparment markers to be
#drawn as points in order to simplify the 
#visualization.
#See the "Making Models" section of the Magrathea
#manual for more details.
#----------------------------------------------------
draw-as-point 1
shape Sphere .2 1
neighborhood-size 5
coordinator 1 3
instantiate 30 random spherical surface 30 20 30 3
[/moleculeType]


[moleculeType]
id 2
label pump_in
show-label 1
color .11 .00 .21
shape Sphere .2
neighborhood-size 1
dynamic-neighborhood-sizing 1
coordinator 1 3
coordinator 2 7
instantiate 2 random spherical surface 30 22 30 1
[/moleculeType]

[moleculeType]
id 5
label pump_out
show-label 1
color .51 .50 .51
shape Sphere .2
neighborhood-size 1
dynamic-neighborhood-sizing 1
coordinator 1 3
coordinator 2 8
instantiate 2 random spherical surface 30 20 32 1
[/moleculeType]


[moleculeType]
id 4
label ligand
color .12 .12 .91
show-neighbor-lines 0
shape Sphere .2 
neighborhood-size 1
dynamic-neighborhood-sizing 1
resident-compartment-type 0
coordinator 1 7
coordinator 1 8
instantiate 6 random spherical volume 30 24 30 1
[/moleculeType]


[coordinatorType]
id 3
label compartment
color .92 .32 .11
#----------------------------------------------------
#The following line can be changed to
#opacity 0.2
#in order to visualize molecules inside the
#compartment. 
#See the "Making Models" section of the Magrathea
#manual for more details.
#----------------------------------------------------
opacity 1
shape Sphere 0.1
isCompartment 1
neighborhood-size 20
isCreationDynamic 1
isMobile 0
isSizeDynamic 1
molecule 1 30
molecule 2 2
molecule 5 2
instantiate 1 determined point - 30 20 30 
[/coordinatorType]


[coordinatorType]
id 7
label pump_in_complex
shape Cube .2 .2 .2
molecule 4 1 0
molecule 2 1 0

[rule]
id 1
#-----------------------------------------------------------------
#load pump
#ligand will enter the compartment if it has not been there before
#The following line is read as:
#If present, a tag of 34 is assigned to molecule type 4 (ligand) 
#(1 instance) that is not assembled with the this pump_in coordinator (0)
#and it is not a resident of the compartment coordinator (0.99999.3)
#and it does not have feature 2 in state 65 (0.2.65).
#The next line is read as:
#If present, a tag of 35 is assigned to molecule type 2 (pump_in) 
#(1 instance) if it is not assembled with this pump_in coordinator (0)
#and if it is assembled as a component of the compartment (1.99999.3).
#See the "Making Models" section of the Magrathea manual for more
#details on the syntax of these rule lines.
#-----------------------------------------------------------------  
if 34.4.1.0.0.99999.3.0.2.65
if 35.2.1.0.1.99999.3
then 34 begins-assembly
then 35 begins-assembly
parameters p 1.0
[/rule]

[rule]
id 2
#-----------------------------------------------------------------
#translocation
#This rule handles the translocation of the ligand molecule
#once it has assembled with the pump_in molecule.
#
#A feature-state of the ligand is changed to indicate that the
#ligand molecule has entered the comparment using the line
#"then 34 changes-state-to 2.65".
#This state-change prevents the ligand from 
#re-entering the compartment after it has been pumped out
#(see the pump_out_complex coordinator and rule 1 of this 
#coordinator.
#
#Upon translocation, the ligand has its feature 99999 set to 3 
#(the id of the compartment coordinator) by the line
#"then 34 translocates-into-compartment-of-molecule 35".
#This feature-state change then allows the ligand molecule
#to assemble with the pump_out molecule as specified by the 
#condition line "if 34.4.1.0.1.99999.3"
#in rule 1 of the pump_out_comlex coordinator below.
#See the "Making Models" section of the Magrathea manual for more
#details on the syntax of these rule lines.
#-----------------------------------------------------------------
if 34.4.1.1.0.99999.3
if 35.2.1.1.1.99999.3 
then 34 changes-state-to 2.65
then 34 changes-colour-to 1:1:0
then 34 translocates-into-compartment-of-molecule 35
then 34 leaves-coordinator
parameters p 1.0
[/rule]
[/coordinatorType]

[coordinatorType]
id 8
#-----------------------------------------------------------------
#Rules encoded by this coordinator handle assembly with the pump_out
#molecule and the translocation out of the compartment represented by
#coordinator 3
#The rules are similar to those in coordinator 7 but effect the 
#reverse process.
#See the "Making Models" section of the Magrathea manual for more
#details on the syntax of these rule lines.
#-----------------------------------------------------------------
label pump_out_complex
shape Cube .2 .2 .2
molecule 4 1 0
molecule 5 1 0
[rule]
#load pump
id 1
if 34.4.1.0.1.99999.3
if 35.5.1.0.1.99999.3
then 34 begins-assembly
then 35 begins-assembly
parameters p 1.0
[/rule]
[rule]
#translocation
id 2
if 34.4.1.1.1.99999.3
if 35.5.1.1.1.99999.3
then 34 translocates-outof-compartment-of-molecule 35
then 34 leaves-coordinator
parameters p 1.0
[/rule]
[/coordinatorType]


[coordinatorType]
id 10
#-----------------------------------------------------------------
#This coordinator shows an example of using plane coordinators 
#in different orientations that act as bounding walls for the 
#simulation.
#See the "Making Models" section of the Magrathea manual for more
#details on the syntax of these rule lines.
#-----------------------------------------------------------------
label simulation-container
color .383 .466 .561
opacity 0.1
geometricType plane
shape Cube 100 .2 100
neighborhood-size 10
isCreationDynamic 0 
isMobile 0
#west wall
orientation vertex 0 1 0 pointing-at 1 0 0
instantiate 1 determined point  - 0 50 50
#east wall
orientation vertex 0 1 0 pointing-at -1 0 0
instantiate 1 determined point  - 100 50 50
#north wall
orientation vertex 0 1 0 pointing-at 0 0 1
instantiate 1 determined point  - 50 50 0
#south wall
orientation vertex 0 1 0 pointing-at 0 0 -1
instantiate 1 determined point  - 50 50 100
#sky wall
#ground wall
[/coordinatorType]


EOF

Example 6.4

###########
#rules.4.txt
#
#translocation demonstration
#In this example, a blue particle (ligand) binds to a surface receptor and is translocated past the
#membrane (mediated by the black receptor) where it changes color to yellow.  
#Once on the other side of the membrane, the particle may then bind a second
#receptor (grey) that translocates it back to the top of the membrane
#Use of the two different receptors for translocation "in and out" is controlled by
#a feature-state pair.
#Planar coordinators are not compartments in the sense that molecules can move in and out of them.
#Instead, they represent barriers within a compartment (in this case the simulation)
#that molecules can move past with the help of a mediator molecule (the black and grey receptors).
#
#See the "Making Models" section of the Magrathea manual for more details
#on the syntax of each line
# 
#last tested with breve 2.6.1 and magrathea.tz 1.44
#at the time of testing, neighbor lines are only drawn if breve 2.5 is used
###########


[simulation]

camera-at-from 30 20 30 2 13 15


light-source 50 50 50
movie-length 40
[/simulation]


[moleculeType]
id 1
label compartment_marker
color .81 .60 .21
draw-as-point 1
shape Sphere .2 1
neighborhood-size 5
coordinator 1 3
instantiate 30 random spherical surface 30 21 30 1
[/moleculeType]


[moleculeType]
id 2
label pump_in
color .11 .00 .21
shape Sphere .2
neighborhood-size 1
dynamic-neighborhood-sizing 1
coordinator 1 3
coordinator 2 7
instantiate 1 random spherical surface 30 21 30 1
[/moleculeType]

[moleculeType]
id 5
label pump_out
color .51 .50 .51
shape Sphere .2
neighborhood-size 1
dynamic-neighborhood-sizing 1
coordinator 1 3
coordinator 2 8
instantiate 1 random spherical surface 30 20 30 1
[/moleculeType]

[moleculeType]
id 4
label ligand
color .12 .12 .91
show-neighbor-lines 0
shape Sphere .2 
neighborhood-size 1
dynamic-neighborhood-sizing 1
resident-compartment-type 0
coordinator 1 7
coordinator 1 8
instantiate 6 random spherical volume 33 25 30 5
[/moleculeType]


[coordinatorType]
id 3
label membrane_section
color .92 .32 .11
opacity 0.2
geometricType plane
shape Cube 99 .02 100
isCompartment 1
neighborhood-size 20
isCreationDynamic 0
isMobile 0
isSizeDynamic 0
molecule 1 30
molecule 2 2
molecule 5 2
orientation vertex 0 1 0 pointing-at 1 0 0
instantiate 1 determined point - 30 20 30
[/coordinatorType]


[coordinatorType]
id 7
label pump_in_complex
shape Cube .2 .2 .2
molecule 4 1 0
molecule 2 1 0

[rule]
id 1
#-----------------------------------------------------------------
#load pump
#ligand will enter the compartment if it has not been there before
#note that we only test for the compartment of the receptor the 
#ligand will never become a part of this "compartment" since a 
#planar coordinator does not define a compartment
#but a barrier within a compartment that can be traversed
#-----------------------------------------------------------------
if 34.4.1.0.0.2.65
if 35.2.1.0.1.99999.3
then 34 begins-assembly
then 35 begins-assembly
parameters p 1.0
[/rule]

[rule]
id 2
#-----------------------------------------------------------------
#translocation
#change a feature state of the ligand so we know it has entered 
#the comparment
#-----------------------------------------------------------------
if 34.4.1.1
if 35.2.1.1.1.99999.3
then 34 changes-state-to 2.65
then 34 changes-colour-to 1:1:0
then 34 translocates-past-molecule 35
then 34 leaves-coordinator
parameters p 1.0
[/rule]
[/coordinatorType]


[coordinatorType]
id 8
label pump_out_complex
shape Cube .2 .2 .2
molecule 4 1 0
molecule 5 1 0
[rule]
#load pump
id 1
if 34.4.1.0.1.2.65
if 35.5.1.0.1.99999.3
then 34 begins-assembly
then 35 begins-assembly
parameters p1 0.15
[/rule]
[rule]
#translocation
id 2
if 34.4.1.1
if 35.5.1.1.1.99999.3
then 34 changes-state-to 2.0
then 34 translocates-past-molecule 35
then 34 changes-colour-to .12:.12:.91
then 34 leaves-coordinator
parameters p1 0.15
[/rule]
[/coordinatorType]


[coordinatorType]
id 10
label simulation-container
color .383 .466 .561
opacity 0.1
geometricType plane
shape Cube 100 .2 100
neighborhood-size 10
isCreationDynamic 0 
isMobile 0
#west wall
orientation vertex 0 1 0 pointing-at 1 0 0
instantiate 1 determined point  - 0 50 50
#east wall
orientation vertex 0 1 0 pointing-at -1 0 0
instantiate 1 determined point  - 100 50 50
#north wall
orientation vertex 0 1 0 pointing-at 0 0 1
instantiate 1 determined point  - 50 50 0
#south wall
orientation vertex 0 1 0 pointing-at 0 0 -1
instantiate 1 determined point  - 50 50 100
#sky wall
#ground wall
[/coordinatorType]


EOF

Example 6.5

###########
#rules.5.txt
#
#Specifying molecule rules
#This very simple example demonstrates the syntax for specifying rules
#for molecules.  The syntax is slightly different from that of rules for
#coordinators in that if lines do not begin with a tag id; instead they 
#begin with an identifier for the molecule type that they apply to. 
#
#In this example, a molecule may be created or destroyed at each time-step 
#of the simulation with some probability.
#
#See the "Making Models" section of the Magrathea manual for more details
#on the syntax of each line
# 
#last tested with breve 2.6.1 and magrathea.tz 1.44
#at the time of testing, neighbor lines are only drawn if breve 2.5 is used
###########


[simulation]

#camera-at-from 30 20 30 14 13 30
camera-at-from 30 20 30 7 6 15

light-source 0 20 20
movie-length 40
[/simulation]

[moleculeType]
id 1
label inputSignal
color 1 0 0
shape Sphere 1
neighborhood-size 1
dynamic-neighborhood-sizing 1
[rule]
# signal creation
id 1
if 1
competitive-with 2
then 1 is-created-at-location-of 1
#parameters p1 0.00005
parameters p1 0.005
[/rule]
[rule]
# signal destruction
id 2
if 1
competitive-with 1
then 1 is-destroyed
parameters p2 0.009
[/rule]
instantiate 4 random spherical volume 10 15 10 10
[/moleculeType]



EOF



Example 6.6

###########
#rules.6.txt
#
#Specifying molecule rules
#This example builds on rules.5.txt
#In this example, a molecule may be created or destroyed at each time-step 
#of the simulation with some probability, but, before doing so, the molecule
#must be in some pre-creation or pre-destruction state.
#
#See the "Making Models" section of the Magrathea manual for more details
#on the syntax of each line
# 
#last tested with breve 2.6.1 and magrathea.tz 1.44
#at the time of testing, neighbor lines are only drawn if breve 2.5 is used
###########


[simulation]

#camera-at-from 30 20 30 14 13 30
camera-at-from 30 20 30 7 6 15

light-source 0 20 20
movie-length 40
[/simulation]

[moleculeType]
id 1
label inputSignal
color 1 0 0
shape Sphere 1
neighborhood-size 1
dynamic-neighborhood-sizing 1

[rule]
#state change to pre-creation
id 1
if 1.1.0
competitive-with 4
then 1 changes-state-to 1.1
then 1 changes-colour-to .1:.32:.11
parameters p1 0.005
[/rule]

[rule]
#state change to pre-destruction
id 2
if 1.1.1
competitive-with 3
then 1 changes-state-to 1.0
then 1 changes-colour-to .1:.32:.11
parameters p1 0.005
[/rule]

[rule]
#creation
id 3
if 1.1.1
competitive-with 2
then 1 is-created-at-location-of 1
parameters p1 0.005
[/rule]

[rule]
#destruction
id 4
if 1.1.0
competitive-with 1
then 1 is-destroyed
parameters p2 0.009
[/rule]
instantiate 6 random spherical volume 10 15 10 10
[/moleculeType]


EOF


Example 6.7

###########
#rules.7.txt
#showing a linear coordinator and two point coordinators
#to model a crude motor that moves cargo from one end of the 
#'microtubule' to the other
#somewhat embarrassing but makes the point of rule use
###########


[simulation]
camera-at-from 20 10 0 1 1 70
light-source 0 20 20
movie-length 80
[/simulation]

[moleculeType]
id 1
label line_coordinator_component_1
show-label 0
color .81 .60 .21
shape Sphere 1
draw-as-point 0
show-neighbor-lines 1
neighborhood-size 1
dynamic-neighborhood-sizing 1
feature 67 bindable-by-microtubule
feature-state 67 1 bindable-yes
feature-state 67 0 bindable-no
coordinator 1 4
coordinator 2 6
#instantiate 40 random cylindrical volume 10 15 10 0 1 0 0 105 67.1
instantiate 1 determined point - 10 15 10 - - - - - 67.1
instantiate 1 determined point - 12 15 10 - - - - - 67.1
instantiate 1 determined point - 14 15 10 - - - - - 67.1
instantiate 1 determined point - 16 15 10 - - - - - 67.1
instantiate 1 determined point - 18 15 10 - - - - - 67.1
instantiate 1 determined point - 20 15 10 - - - - - 67.1
instantiate 1 determined point - 22 15 10 - - - - - 67.1
instantiate 1 determined point - 24 15 10 - - - - - 67.1
instantiate 1 determined point - 26 15 10 - - - - - 67.1
instantiate 1 determined point - 28 15 10 - - - - - 67.1
instantiate 1 determined point - 30 15 10 - - - - - 67.1
instantiate 1 determined point - 32 15 10 - - - - - 67.1
instantiate 1 determined point - 34 15 10 - - - - - 67.1
instantiate 1 determined point - 36 15 10 - - - - - 67.1
instantiate 1 determined point - 38 15 10 - - - - - 67.1
instantiate 1 determined point - 40 15 10 - - - - - 67.1
instantiate 1 determined point - 42 15 10 - - - - - 67.1
instantiate 1 determined point - 44 15 10 - - - - - 67.1
instantiate 1 determined point - 46 15 10 - - - - - 67.1
instantiate 1 determined point - 48 15 10 - - - - - 67.1
instantiate 1 determined point - 50 15 10 - - - - - 67.1


[/moleculeType]


[moleculeType]
id 2
label motor_component
show-label 0
color .81 .80 .21
shape Sphere 1
show-neighbor-lines 1
neighborhood-size 1
dynamic-neighborhood-sizing 1
coordinator 1 5
coordinator 2 6
instantiate 1 determined point - 1 17 10 - - - - - 1.0
instantiate 1 determined point - 1 17 10 - - - - - 1.1
[/moleculeType]



[coordinatorType]
id 4
label line_coordinator
color .383 .466 .561
opacity 1
shape Cube .2 .2 .2
geometricType line
neighborhood-size 5
isCreationDynamic 0
isMobile 0
isSizeDynamic 1
molecule 1 40
orientation vertex 1 0 0 pointing-at 1 0 0
instantiate 1 determined point - 30 15 10
[/coordinatorType]


[coordinatorType]
id 5
label motor_coordinator
color .383 .466 .561
opacity 1
shape Cube 1 1 1
geometricType point
neighborhood-size 5
isCreationDynamic 1
isMobile 1
isSizeDynamic 0
molecule 2 2
instantiate 0 determined point - 30 15 10
[rule]
id 1
if 34.2.1.1.1.1.1
then 34 changes-colour-to 1:0:0
parameters p 1.0
[/rule]

[rule]
#switch binding activated
id 3
if 34.2.1.1.1.1.2
if 35.2.1.1.1.1.0
then 34 changes-state-to 1.3
then 34 changes-colour-to .81:.80:.21
then 35 changes-state-to 1.1
then 35 changes-colour-to 1:0:0
parameters p 1.0
[/rule]

[rule]
#switch binding activated
id 4
if 34.2.1.1.1.1.2
if 35.2.1.1.1.1.3
then 34 changes-state-to 1.3
then 34 changes-colour-to .81:.80:.21
then 35 changes-state-to 1.4
parameters p 1.0
[/rule]
[/coordinatorType]

[coordinatorType]
id 6
label motor_tubule
color .483 .566 .461
opacity 1
shape Cube 1 1 1
geometricType point
neighborhood-size 1
isCreationDynamic 1
isMobile 1
isSizeDynamic 0
molecule 1 1 0
molecule 2 1 0

[rule]
id 1
#begin assembly with motor
if 34.2.1.0.1.1.1
if 35.1.1.0.1.67.1
then 34 begins-assembly
then 35 begins-assembly
parameters p 1.0
[/rule]

[rule]
id 2
#signal
if 34.2.1.1.1.1.1
if 35.1.1.1.1.67.1
then 34 changes-state-to 1.2
then 35 changes-state-to 67.2
then 35 changes-colour-to 1:1:1
parameters p 1.0
[/rule]

[rule]
id 3
#leave
if 34.2.1.1.1.1.4
if 35.1.1.1.1.67.2
then 34 changes-state-to 1.1
then 34 leaves-coordinator
then 35 leaves-coordinator
parameters p 1.0
[/rule]

instantiate 0 determined point - 30 15 10
[/coordinatorType]

#****************************************************************

EOF