330.0
500
330
500.0
1050.0
36
61.0
false
14.0
179.0
138.0
125.0
false
47.0
189.0
204.0
131.0
false
48.0
189.0
2.0
filename
11.mml
date
1225670866000
url
http://mw2.concord.org/public/part2/diffat/11.mml
size
69257
codebase
/public/part2/diffat
define %waitingForCaBinding 1;
define %waitingForATPBinding 0;
define %waitingForATPSettling 0;
define %waitingForClearCavity 0;
define %waitingForProteinTransition 0;
define %waitingForCaSettling 0;
define %waitingForATPPocketFormation 0;
define %waitingForCaRelease 0;
define %waitingForFlashTransition 0;
define %waitingForProteinReset 0;
define %waitingForCaText 0;
define %formingATPSiteText 1;
define %waitingForATPText 2;
define %waitingForReactionText 3;
define %messagesOn 1;
define %topBlockerInPlace 1;
define %bottomBlockerInPlace 1;
define %topParticleIndex -1;
define %bottomParticleIndex -1;
define %caToCapture -1;
define %caToCaptureFar -1;
define %caToCaptureNear -1;
define %restraintSet 0;
define %caLeft 0;
define %caRight 0;
define %proteinX 17.2;
define %proteinY 11.3;
define %proteinImage 0;
define %endTransitionTime 0;
define %thisAtom 0;
define %atp1toCapture 0;
define %atp2toCapture 0;
define %bondToRemove 0;
define %partOfMolecule -1;
define %leftConc 0;
define %rightConc 0;
define %totalChemicalEnergy %number_of_molecules;
define %chemicalEnergy 0;
define %voltage 0;
define %leftConc 0;
define %rightConc 0;
define %i 0;
define %atpConc -1;
define %caConc -1;
define %leftWidth 18.6;
define %rightWidth %width-%leftWidth;
define %flashX 23.1;
define %flashY 20.7;
define %atpAtomX 24.9;
define %atpAtomY 20.8;
define %pocket1x 25;
define %pocket1y 19.9
define %pocket2x 25.9;
define %pocket2y 20.4
define %pocket3x 24.9;
define %pocket3y 20.9
define %pocket4x 24.5;
define %pocket4y 21.9;
define %rsurface1x 24;
define %rsurface1y 19.6;
define %rsurface2x 22.9;
define %rsurface2y 19.3;
define %rsurface3x 21.8;
define %rsurface3y 18.9;
define %rsurface4x 20.8;
define %rsurface4y 18.5;
define %rsurface5x 19.9;
define %rsurface5y 17.9;
define %rsurface6x 19.8;
define %rsurface6y 15.3;
define %rsurface7x 20.7;
define %rsurface7y 14.7;
define %rsurface8x 21.9;
define %rsurface8y 14.7;
define %rsurface9x 23;
define %rsurface9y 14.5;
define %rsurface10x 24;
define %rsurface10y 14.2;
define %nonATPsurfaceX 25;
define %nonATPsurfaceY 12.8;
define %lsurface1x 18.4;
define %lsurface1y 12.5;
define %lsurface2x 18.2;
define %lsurface2y 13.8;
define %lsurface3x 19.2;
define %lsurface3y 14.3;
define %lsurface4x 20.5;
define %lsurface4y 14.6;
define %lsurface5x 21.7;
define %lsurface5y 15.1;
define %lsurface6x 22.9;
define %lsurface6y 15.6;
define %lsurface7x 25.8;
define %lsurface7y 15.1;
define %lsurface8x 25.8;
define %lsurface8y 16.2;
define %lsurface9x 23;
define %lsurface9y 18.4;
define %lsurface10x 21.8;
define %lsurface10y 18.9;
define %lsurface11x 20.4;
define %lsurface11y 19.3;
define %lsurface12x 19;
define %lsurface12y 19.5;
define %lsurface13x 17.8;
define %lsurface13y 20.2;
define %lsurface14x 18.3;
define %lsurface14y 21.5;
define %flashImage 0;
define %obsLeftX 17.9;
define %obsRightX 23.6;
define %obsY 13.8;
define %obsWidth 1.4;
define %obsHeight 6.1;
define %leftObs 0;
define %rightObs 0;
define %rightObs2 0;
define %obsRight2x 25.3;
define %obsRight2y 14.6;
define %obsRight2width 0.8;
define %obsRight2height 2.2;
define %proteinAreaX 16;
define %proteinAreaY 12.7;
define %proteinAreaW 11.8;
define %proteinAreaH 8.2;
define %caCount 0;
define %atpCount 0;
define %atomsInProtein 0;
define %pAnchorX 26.6;
define %pAnchorY 18;
define %atpAnchor1x 26.4;
define %atpAnchor1y 22.2;
define %atpAnchor2x 25.4;
define %atpAnchor2y 25;
define %atpRestraintDeltaX 0.02;
define %atpRestraintDeltaY -0.42;
define %caRestraintX 21.1;
define %caRestraintY 16.3;
define %caRestraintDeltaX -0.08;
define %caRestraintDeltaY -0.01;
define %waitingForCa 0;
define %formingATP 1;
define %waitingForATP 2;
define %releasingATP 3;
define %watingForCaRelease 4;
define %restoringProtein 5;
define %waitingForCaText 0;
define %formingATPSiteText 1;
define %waitingForATP 2;
define %waitingForReaction 3;
capture ca ion
200
1 capture Ca
if (%waitingForCaBinding);
set %caToCaptureFar nearest(2,%caRestraintX,%caRestraintY,30);
set %caToCaptureNear nearest(2,%caRestraintX,%caRestraintY,1);
set %caToCapture %caToCaptureFar;
if ((%caToCaptureFar != -1) and (%atom[%caToCaptureFar].rx > %leftWidth));
if ((%caToCaptureNear != -1) and (%restraintSet) and (%caToCaptureNear == %caToCaptureFar));
set atom[%caToCapture].restraint 1000;
set atom[%caToCapture].restraint.x %caRestraintX;
set atom[%caToCapture].restraint.y %caRestraintY;
set atom[%caToCapture].friction 1;
set %waitingForCaBinding 0;
set %waitingForCaSettling 1;
set %restraintSet 0;
set %endTransitionTime "%model_time+400";
else;
if (%restraintSet == 0);
set %restraintSet 1;
set atom[%caToCapture].restraint 1;
set atom[%caToCapture].restraint.x %caRestraintX;
set atom[%caToCapture].restraint.y %caRestraintY;
endif;
endif;
endif;
endif;
wait for Ca to settle down then load next animation
100
2 settle Ca ion
If ((%waitingForCaSettling) and (%model_time > %endTransitionTime));
set %waitingForCaSettling 0;
set image[%formingATP].frame 1;
set image[%formingATP].loop 1;
set image[%formingATP].visible on;
set image[%waitingForCa].visible off;
set %thisAtom nearest(1, %atpAtomX, %atpAtomY);
select atom %thisAtom;
remove;
add atom 0 (%pocket1x, %pocket1y); select atom "%number_of_atoms-1"; set movable off;
add atom 0 (%pocket2x, %pocket2y); select atom "%number_of_atoms-1"; set movable off;
add atom 0 (%pocket3x, %pocket3y); select atom "%number_of_atoms-1"; set movable off;
add atom 0 (%pocket4x, %pocket4y); select atom "%number_of_atoms-1"; set movable off;
set movable off;
set %waitingForATPPocketFormation 1;
set %endTransitionTime "%model_time+2200";
endif;
waitng for atp pocket formation
100
3 waiting for ATP pocket
If ((%waitingForATPPocketFormation) and (%model_time > %endTransitionTime));
set %waitingForATPPocketFormation 0;
set %waitingForATPBinding 1;
endif;
wait for ATP capture
100
4 capture ATP
if (%waitingForATPBinding);
set %atpToCaptureFar nearestMolecule(%atpAnchor1x,%atpAnchor1y,20);
set %atpToCaptureNear nearestMolecule(%atpAnchor1x,%atpAnchor1y,2);
if (%atpToCaptureFar != -1);
set %atp1toCapture atomofmolecule(%atpToCaptureFar,0);
set %atp2toCapture atomofmolecule(%atpToCaptureFar,1);
if (%atom[%atp1toCapture].charge < 0);
set %atp1toCapture atomofmolecule(%atpToCaptureFar,1);
set %atp2toCapture atomofmolecule(%atpToCaptureFar,0);
endif;
if (%atpToCaptureNear != -1);
set atom[%atp1toCapture].restraint 20;
set atom[%atp1toCapture].restraint.x %atpAnchor1x;
set atom[%atp1toCapture].restraint.y %atpAnchor1y;
set atom[%atp1toCapture].friction 1;
set atom[%atp2toCapture].restraint 20;
set atom[%atp2toCapture].restraint.x %atpAnchor2x;
set atom[%atp2toCapture].restraint.y %atpAnchor2y;
set atom[%atp2toCapture].friction 1;
set %restraintSet 0;
set %waitingForATPBinding 0;
set %waitingForATPSettling 1;
set %endTransitionTime "%model_time+1600";
else;
if (%restraintSet == 0);
set %restraintSet 1;
set atom[%atp1toCapture].restraint 1;
set atom[%atp1toCapture].restraint.x %atpAnchor1x;
set atom[%atp1toCapture].restraint.y %atpAnchor1y;
set atom[%atp2toCapture].restraint 1;
set atom[%atp2toCapture].restraint.x %atpAnchor2x;
set atom[%atp2toCapture].restraint.y %atpAnchor2y;
endif;
endif;
endif;
endif;
wait for ATP to settle in place then initiate reaction
100
5 wait for ATP settling
If ((%waitingForATPSettling) and (%model_time > %endTransitionTime));
set %waitingForATPSettling 0;
set %waitingForClearCavity 1;
endif;
waitng for only one Ca in protein
50
6 waiting for clear cavity
If (%waitingForClearCavity);
set %caCount count(2,%proteinAreaX,%proteinAreaY,%proteinAreaW,%proteinAreaH);
set %atpCount count(3,%proteinAreaX,%proteinAreaY,%proteinAreaW,%proteinAreaH);
set %atomsInProtein "%caCount+%atpCount";
if (%atomsInProtein == 1);
set %waitingForClearCavity 0;
select element 0-1;
remove;
add obstacle (%obsRightX, %obsY, %obsWidth, %obsHeight);
set %rightObs "%number_of_obstacles-1";
set obstacle[%rightObs].visible off;
add obstacle (%obsRight2x, %obsRight2y, %obsRight2width, %obsRight2height);
set %rightObs2 "%number_of_obstacles-1";
set obstacle[%rightObs2].visible off;
set %waitingForFlashTransition 1;
set %endTransitionTime "%model_time+500";
add image flash.gif (%flashX,%flashY);
set %i 0;
endif;
endif;
open protein to release calcium
100
8 transition protein
If (%waitingForProteinTransition);
if (%model_time > %endTransitionTime);
set %waitingForProteinTransition 0;
select obstacle %leftObs;
remove;
set %rightObs %rightObs-1;
set %rightObs2 %rightObs2-1;
add atom 0 (%lsurface1x,%lsurface1y);
add atom 0 (%lsurface2x,%lsurface2y);
add atom 0 (%lsurface3x,%lsurface3y);
add atom 0 (%lsurface4x,%lsurface4y);
add atom 0 (%lsurface5x,%lsurface5y);
add atom 0 (%lsurface6x,%lsurface6y);
add atom 0 (%lsurface9x,%lsurface9y);
add atom 0 (%lsurface10x,%lsurface10y);
add atom 0 (%lsurface11x,%lsurface11y);
add atom 0 (%lsurface12x,%lsurface12y);
add atom 0 (%lsurface13x,%lsurface13y);
add atom 0 (%lsurface14x,%lsurface14y);
select element 0;
set movable off;
set atom[%caToCapture].restraint 0;
set atom[%caToCapture].friction 0;
set %waitingForCaRelease 1;
else;
%i++;
set atom[%caToCapture].restraint.x "%caRestraintX+%i*%caRestraintDeltaX";
set atom[%caToCapture].restraint.y "%caRestraintY+%i*%caRestraintDeltaY";
set atom[%atp1toCapture].restraint.x "%atpAnchor1x+%i*%atpRestraintDeltaX";
set atom[%atp1toCapture].restraint.y "%atpAnchor1y+%i*%atpRestraintDeltaY";
set atom[%atp1toCapture].rx "%atpAnchor1x+%i*%atpRestraintDeltaX";
set atom[%atp1toCapture].ry "%atpAnchor1y+%i*%atpRestraintDeltaY";
endif;
endif;
waiting for flash to finish
7 waiting for flash
If ((%waitingForFlashTransition) and (%model_time > %endTransitionTime));
set %waitingForFlashTransition 0;
set image[%releasingATP].frame 1;
set image[%releasingATP].loop 1;
set image[%releasingATP].visible on;
set image[%formingATP].visible off;
set %caToCapture nearest(2,%caRestraintX,%caRestraintY,2);
set %atp1toCapture nearest(3,%atpAnchor1x,%atpAnchor1y,2);
set %atp2toCapture nearesttoatom(3,%atp1toCapture,10,2);
set atom[%atp2toCapture].restraint 0;
set atom[%atp2toCapture].friction 0;
set %atpBond whichrbond(%atp1toCapture,%atp2toCapture);
select rbond %atpBond;
remove;
set %flashImage %number_of_images-1;
select image %flashImage;
remove;
add image adp.gif atomno=%atp2toCapture;
add image p.gif atomno=%atp1toCapture;
set %endTransitionTime "%model_time+1000";
set %waitingForProteinTransition 1;
endif;
waiting for ca release and clear protein
100
9 wating for ca release
If (%waitingForCaRelease);
set %atomsInProtein count(2,%proteinAreaX,%proteinAreaY,%proteinAreaW,%proteinAreaH);
if (%atomsInProtein == 0);
set %waitingForCaRelease 0;
select element 0;
remove;
add obstacle (%obsLeftX, %obsY, %obsWidth, %obsHeight);
set %leftObs "%number_of_obstacles-1";
set obstacle[%leftObs].visible off;
set image[%restoringProtein].frame 1;
set image[%restoringProtein].loop 1;
set image[%restoringProtein].visible on;
set image[%releasingATP].visible off;
set %atp1toCapture nearest(3,%pAnchorX,%pAnchorY);
set atom[%atp1toCapture].restraint 0;
set atom[%atp1toCapture].friction 0;
set atom[%atp1toCapture].vx 300;
set %waitingForProteinReset 1;
set %endTransitionTime "%model_time+1000";
endif;
endif;
revert to original shape
100
10 reset protein
If ((%waitingForProteinReset) and (%model_time > %endTransitionTime));
set %waitingForProteinReset 0;
set image[%waitingForCa].visible on;
set image[%restoringProtein].visible off;
select obstacle %rightObs2;
remove;
select obstacle %rightObs;
remove;
set %leftObs %leftObs-2;
add atom 0 (%rsurface1x,%rsurface1y);
add atom 0 (%rsurface2x,%rsurface2y);
add atom 0 (%rsurface3x,%rsurface3y);
add atom 0 (%rsurface4x,%rsurface4y);
add atom 0 (%rsurface5x,%rsurface5y);
add atom 0 (%rsurface6x,%rsurface6y);
add atom 0 (%rsurface7x,%rsurface7y);
add atom 0 (%rsurface8x,%rsurface8y);
add atom 0 (%rsurface9x,%rsurface9y);
add atom 0 (%rsurface10x,%rsurface10y);
select element 0;
set movable off;
set %topBlockerInPlace 0;
set %bottomBlockerInPlace 0;
set %waitingForCaBinding 1;
set %caToCapture -1;
endif;
add atom to block top of protein
100
add top blocker
if (%topBlockerInPlace != 1);
add atom 1 (%nonATPsurfaceX,%nonATPsurfaceY);
set %topParticleIndex nearest(1,%nonATPsurfaceX,%nonATPsurfaceY,1);
if (%topParticleIndex != -1);
set %topBlockerInPlace 1;
set atom[%topParticleIndex].movable off;
endif;
endif;
add bottom blocker
100
add bottom blocker
if (%bottomBlockerInPlace != 1);
add atom 1 (%atpAtomX,%atpAtomY);
set %bottomParticleIndex nearest(1,%atpAtomX,%atpAtomY,1);
if (%bottomParticleIndex != -1);
set %bottomBlockerInPlace 1;
set atom[%bottomParticleIndex].movable off;
endif;
endif;
update the graphs
100
update graphs
set %leftConc count(2,0,0,%leftWidth, %height);
set %leftConc %leftConc/(%leftWidth*%height);
set %rightConc count(2,%leftWidth,0,%rightWidth,%height);
set %rightConc %rightConc/(%rightWidth*%height);
set %chemicalEnergy %number_of_molecules;
set %voltage %totalChemicalEnergy-%chemicalEnergy;
store 1 %leftConc;
store 0 %rightConc;
store 2 %chemicalEnergy;
store 3 %voltage;
display messages
200
message handler
if (%messagesOn);
select textbox all;
set visible off;
select textbox none;
if (%waitingForCaBinding);
set textbox[%waitingForCaText].visible on;
endif;
if (%waitingForATPPocketFormation);
set textbox[%formingATPSiteText].visible on;
endif;
if (%waitingForATPBinding);
set textbox[%waitingForATPText].visible on;
endif;
if (%waitingForClearCavity);
set textbox[%waitingForReactionText].visible on;
endif;
endif;
1.0
None
-7179849
membraneBkgLarge.png
255
0
255
255
waitingForCa.gif
1
172.0
113.0
CaAtpaseFormATPSite.gif
1
1
false
172.0
113.0
waitingForATP.gif
1
2
false
172.0
113.0
CaAtpaseReleaseCa.gif
1
3
false
172.0
113.0
waitingForCaRelease.gif
1
4
false
172.0
113.0
CaAtpaseRestore.gif
1
5
false
172.0
113.0
atp.gif
0.3845015
2
class org.concord.mw2d.models.RadialBond
1
6
251.0
280.0
atp.gif
0.61332756
1
class org.concord.mw2d.models.RadialBond
1
7
429.0
20.5
atp.gif
-0.14399642
class org.concord.mw2d.models.RadialBond
1
8
418.0
261.0
caIon.png
13
class org.concord.mw2d.models.Atom
1
9
452.0
91.0
caIon.png
15
class org.concord.mw2d.models.Atom
1
10
310.0
64.0
caIon.png
12
class org.concord.mw2d.models.Atom
1
11
276.0
22.0
caIon.png
16
class org.concord.mw2d.models.Atom
1
12
286.0
161.0
caIon.png
14
class org.concord.mw2d.models.Atom
1
13
368.0
241.0
caIon.png
17
class org.concord.mw2d.models.Atom
1
14
273.0
206.0
atp.gif
-0.31204212
3
class org.concord.mw2d.models.RadialBond
1
15
335.0
130.0
caIon.png
28
class org.concord.mw2d.models.Atom
1
16
450.0
193.0
caIon.png
26
class org.concord.mw2d.models.Atom
1
17
394.5
14.5
caIon.png
29
class org.concord.mw2d.models.Atom
1
18
415.0
123.0
caIon.png
27
class org.concord.mw2d.models.Atom
1
19
350.0
69.0
caIon.png
33
class org.concord.mw2d.models.Atom
1
20
139.5
27.5
caIon.png
34
class org.concord.mw2d.models.Atom
1
21
74.5
16.5
caIon.png
30
class org.concord.mw2d.models.Atom
1
22
137.5
272.5
caIon.png
35
class org.concord.mw2d.models.Atom
1
23
105.5
204.5
caIon.png
31
class org.concord.mw2d.models.Atom
1
24
21.5
108.5
caIon.png
32
class org.concord.mw2d.models.Atom
1
25
26.5
277.5
0
0
255
255
24
false
2
true
203
149
255
255
255
255
1
26
2
Waiting for binding
of calcium ion.
false
96.0
72.0
2
true
252
211
1
27
2
Forming ATP
binding site.
false
89.0
201.0
2
true
255
211
1
28
2
Waiting for binding
of ATP.
false
112.0
228.0
2
true
247
234
1
29
2
Waiting for reaction of
ATP with transport protein.
false
54.0
208.0
1
false
249.0
208.0
1
false
250.0
128.0
false
240.0
142.0
false
230.0
145.0
false
219.0
147.0
false
207.0
147.0
false
198.0
153.0
false
199.0
179.0
false
208.0
185.0
false
218.0
189.0
false
229.0
193.0
false
240.0
196.0
2
0.10000000149011612
286.5
32.5
0.08737702484928415
-0.14150957819733662
2
0.10000000149011612
462.5
101.5
-0.09937149586824033
-0.037817949161041836
2
0.10000000149011612
378.5
251.5
0.007017980878251309
1.1195233693390753E-4
2
0.10000000149011612
320.5
74.5
0.044983597546603006
-0.07202813254761473
2
0.10000000149011612
296.5
171.5
-0.08695701313415259
0.055706319901570836
2
0.10000000149011612
283.5
216.5
-0.027040060014715053
2.9978414644187305E-4
3
false
463.85510583819257
274.4910096534621
3
-0.01
false
436.14489416180743
278.5089903465379
3
false
472.4483210598302
44.05828424114263
3
-0.01
false
449.5516789401698
27.941715758857363
3
false
295.97779754053107
300.75135896668536
3
-0.01
false
270.02220245946893
290.24864103331464
3
false
380.3239206486477
141.20196108108138
3
-0.01
false
353.67607935135226
149.79803891891862
2
0.10000000149011612
false
405.0
25.0
-0.023829885450159384
-0.040155220477062964
2
0.10000000149011612
false
360.5
79.5
0.04460118007731076
0.013821718700673662
2
0.10000000149011612
460.5
203.5
-0.010192327833463482
0.04556776959062688
2
0.10000000149011612
425.5
133.5
-0.04127606247910921
0.0218309834489866
2
0.10000000149011612
false
148.0
283.0
-0.05435043824158781
0.028746044230788713
2
0.10000000149011612
false
32.0
119.0
-0.06078250678035906
0.04985771857224821
2
0.10000000149011612
false
37.0
288.0
-0.005742129266577357
-0.07840493086037265
2
0.10000000149011612
false
150.0
38.0
-0.05435043824158781
0.028746044230788713
2
0.10000000149011612
false
85.0
27.0
-0.06484001033564056
0.034293997718070075
2
0.10000000149011612
false
116.0
215.0
-0.06484001033564056
0.034293997718070075
4
18
19
28.0
0.2
20
21
28.0
0.2
22
23
28.0
0.2
24
25
28.0
0.2