(*^ ::[ Information = "This is a Mathematica Notebook file. It contains ASCII text, and can be transferred by email, ftp, or other text-file transfer utility. It should be read or edited using a copy of Mathematica or MathReader. If you received this as email, use your mail application or copy/paste to save everything from the line containing (*^ down to the line containing ^*) into a plain text file. On some systems you may have to give the file a name ending with ".ma" to allow Mathematica to recognize it as a Notebook. The line below identifies what version of Mathematica created this file, but it can be opened using any other version as well."; FrontEndVersion = "Macintosh Mathematica Notebook Front End Version 2.2"; MacintoshStandardFontEncoding; fontset = title, nohscroll, center, bold, L3, 24, "Chicago"; fontset = subtitle, nohscroll, center, bold, L2, 18, "Chicago"; fontset = subsubtitle, nohscroll, center, bold, L2, 14, "Chicago"; fontset = section, nohscroll, grayBox, bold, L2, 14, "Chicago"; fontset = subsection, nohscroll, blackBox, bold, L2, 12, "Chicago"; fontset = subsubsection, nohscroll, whiteBox, bold, L2, 10, "Chicago"; fontset = text, L2, 12, "Chicago"; fontset = smalltext, L2, 10, "Chicago"; fontset = input, nowordwrap, bold, L2, 12, "Chicago"; fontset = output, nowordwrap, L2, 12, "Courier"; fontset = message, nowordwrap, bold, R32768, L2, 12, "Courier"; fontset = print, nowordwrap, L2, 12, "Courier"; fontset = info, nowordwrap, B32768, L2, 12, "Courier"; fontset = postscript, nowordwrap, L2, 12, "Chicago"; fontset = name, nohscroll, italic, B32768, L2, 10, "Geneva"; fontset = header, L2, 10, "Chicago"; fontset = leftheader, inactive, L2, 12, "Times"; fontset = footer, center, L2, 12, "Chicago"; fontset = leftfooter, inactive, L2, 12, "Times"; fontset = help, L2, 10, "Geneva"; fontset = clipboard, L2, 12, "Chicago"; fontset = completions, L2, 12, "Chicago"; fontset = special1, L2, 12, "Chicago"; fontset = special2, center, L2, 12, "Chicago"; fontset = special3, right, L2, 12, "Chicago"; fontset = special4, L2, 12, "Chicago"; fontset = special5, L2, 12, "Chicago"; paletteColors = 128; currentKernel; ] :[font = title; inactive; locked; startGroup] Binding of Symmetric Ligands to an Infinite Linear Lattice by Alan R. Wolfe ;[s] 3:0,1;59,0;60,2;77,-1; 3:1,29,21,New York,1,24,0,0,0;1,25,18,New York,1,20,0,0,0;1,18,12,Chicago,2,12,0,0,0; :[font = text; inactive; locked; preserveAspect; endGroup] This is the initialization notebook for the symmetic ligand case. It needs to be evaluated only once at the beginning of a Mathematica session. After opening this notebook, a dialog box should appear asking whether you want to automatically evaluate all the initialization cells; click Yes (otherwise, execute the Action-Evaluate Initialization command). The need to respond to the dialog box can be avoided by selecting the "Always" option for "On opening a Notebook, load initialization cells:" at the bottom of the Action Preferences box under the Edit menu. After evaluation, close this notebook (without quitting Mathematica ) and open the output notebook. You should quit Mathematica and start a new session when switching to a different case. ;[s] 7:0,1;124,2;135,1;623,2;635,1;683,2;694,1;759,-1; 3:0,17,12,Chicago,0,12,0,0,0;4,17,12,Geneva,0,12,0,0,65535;3,17,12,Geneva,2, 12,0,0,65535; :[font = subsection; inactive; locked; startGroup] Establish Mathematica version number ;[s] 3:0,0;10,1;21,0;37,-1; 2:2,17,12,Geneva,1,12,0,0,65535;1,17,12,Geneva,3,12,0,0,65535; :[font = input; locked; initialization; endGroup] *) versionIsLessThan2 = True ; If [ $VersionNumber >= 2, versionIsLessThan2 = False ] ; (* :[font = subsection; inactive; locked; startGroup] Choose whether output is to be saved ;[s] 1:0,0;37,-1; 1:1,17,12,Geneva,1,12,0,0,65535; :[font = input; locked; initialization; endGroup] *) saveOutput = False ; (* :[font = subsection; inactive; locked; startGroup] Definitions ;[s] 2:0,0;11,1;13,-1; 2:1,17,12,Geneva,1,12,0,0,65535;1,17,12,Chicago,1,12,65535,0,65535; :[font = input; locked; initialization] *) points::usage = "points is the number of values to be calculated for each of the parameters displayed in the output. Since the values at r = 0 are not calculated, it equals the number of intervals on the x-axis of the plots." ; k::usage = "k is the binding constant for ligand-lattice interactions." ; n::usage = "n is the number of lattice residues occupied per bound ligand." ; w::usage = "w is the cooperativity parameter for interactions between symmetric ligands bound to a lattice." ; r::usage = "r is the ratio of bound ligands to lattice residues (plotted on the abscissa of a Scatchard plot)." ; x::usage = "x is r/f, where f = 1 - n r is the fraction of lattice residues that are free." ; rLf::usage = "rLf is r divided by the free ligand concentration (plotted on the ordinate of a Scatchard plot)." ; e::usage = "e is the neighbor-effect parameter for free binding sites." ; rSat::usage = "rSat is the limiting value of r, i.e., the ratio of ligands to lattice residues when the lattice is saturated." ; (* ;[s] 19:0,0;17,1;225,0;242,1;300,0;317,1;379,0;396,1;491,0;508,1;606,0;623,1;701, 0;720,1;816,0;833,1;891,0;911,1;1021,0;1026,-1; 2:10,17,12,Chicago,1,12,0,0,0;9,17,12,Geneva,1,12,0,0,65535; :[font = input; locked; initialization; endGroup] *) rLf := k (1 - n r) (1 + x/e )^(1-n) e^2 ; (* :[font = subsection; inactive; locked; startGroup] Expressions for the neighbor-effect parameter when r is below its maximum value ;[s] 1:0,0;81,-1; 1:1,17,12,Geneva,1,12,0,0,65535; :[font = input; locked; initialization; endGroup] *) ne::usage = "ne gives the value of the neighbor-effect parameter when r is below its maximum value." ; ne := If [ w==1, (* THEN *) e = 1, (* ELSE *) e := ( 1 - x + ( (1 - x)^2 + 4 x w )^0.5 )/2 ] ; (* ;[s] 7:0,0;13,1;99,0;122,1;132,0;150,1;160,0;211,-1; 2:4,17,12,Chicago,1,12,0,0,0;3,17,12,Geneva,1,12,0,0,65535; :[font = subsection; inactive; locked; startGroup] Determination of the maximum value of r ;[s] 1:0,0;40,-1; 1:1,17,12,Geneva,1,12,0,0,65535; :[font = input; locked; initialization; endGroup] *) rSatDetermine::usage = "A routine to determine the ratio of bound ligands to lattice residues and the values of the conditional probabilities at at saturation." ; rSatDetermine := { If [ w==0, (* THEN *) rSat = 1/(n + 1); CP2, (* ELSE *) rSat = 1/n; CP1 ] } ; (* ;[s] 9:0,0;24,1;159,0;183,1;189,0;200,1;210,0;245,1;255,0;280,-1; 2:5,17,12,Chicago,1,12,0,0,0;4,17,12,Geneva,1,12,0,0,65535; :[font = subsection; inactive; locked; startGroup] Expressions for conditional probabilities when r is below its maximum value ;[s] 1:0,0;77,-1; 1:1,17,12,Geneva,1,12,0,0,65535; :[font = input; locked; initialization] *) ff::usage = "ff is the probability that a randomly chosen free lattice residue is bordered on a given side by another free residue." ; bf::usage = "bf is the probability that a randomly chosen bound ligand end is bordered by a free lattice residue." ; fb::usage = "fb is the probability that a randomly chosen free lattice residue is bordered on a given side by a bound ligand end." ; bb::usage = "bb is the probability that a randomly chosen bound ligand end is bordered by another bound ligand end." ; (* ;[s] 9:0,0;13,1;131,0;149,1;249,0;267,1;383,0;401,1;503,0;508,-1; 2:5,17,12,Chicago,1,12,0,0,0;4,17,12,Geneva,1,12,0,0,65535; :[font = input; locked; initialization; endGroup] *) ff := 1 / (1 + x/e ) ; bf [h_] := h[[4]]/h[[2]] /; h[[1]] > 0 ; (* = ff/e *) bf [h_] := bfSat /; h[[1]]==0 ; fb [h_] := h[[3]] h[[4]]/h[[2]] /; h[[1]] > 0 ; (* = x ff/e *) fb [h_] := 1 /; h[[1]]==0 ; bb [h_] := h[[3]] w h[[4]]/h[[2]]^2 /; h[[1]] > 0 ; (* = x w ff/e^2 *) bb [h_] := bbSAT /; h[[1]]==0 ; (* ;[s] 7:0,0;65,1;79,0;160,1;176,0;257,1;277,0;310,-1; 2:4,17,12,Chicago,1,12,0,0,0;3,17,12,Geneva,1,12,0,0,65535; :[font = subsection; inactive; locked; startGroup] Values of conditional probabilities when r is at its limit ;[s] 1:0,0;60,-1; 1:1,17,12,Geneva,1,12,0,0,65535; :[font = input; locked; initialization] *) bfSat::usage = "bfSat is the value of bf when the lattice is saturated." ; bbSAT::usage = "bbSAT is the value of bb when the lattice is saturated." ; (* ;[s] 5:0,0;16,1;71,0;92,1;147,0;152,-1; 2:3,17,12,Chicago,1,12,0,0,0;2,17,12,Geneva,1,12,0,0,65535; :[font = input; locked; initialization] *) CP1::usage = "CP1 gives conditional probability values when r = rSat = 1/n." ; CP1 := { bfSat = 0 ; bbSAT = 1 } ; (* ;[s] 3:0,0;14,1;76,0;118,-1; 2:2,17,12,Chicago,1,12,0,0,0;1,17,12,Geneva,1,12,0,0,65535; :[font = input; locked; initialization; endGroup] *) CP2::usage = "CP2 gives conditional probability values when r = rSat = 1/(n+1), i.e., when w = zero and the lattice is saturated." ; CP2 := { bfSat = 1 ; bbSAT = 0 } ; (* ;[s] 5:0,0;14,1;130,0;134,1;135,0;172,-1; 2:3,17,12,Chicago,1,12,0,0,0;2,17,12,Geneva,1,12,0,0,65535; :[font = subsection; inactive; locked; startGroup] Calculation of average cluster length ;[s] 1:0,0;39,-1; 1:1,17,12,Geneva,1,12,0,0,65535; :[font = input; locked; initialization; endGroup] *) averageClusterLength::usage = "averageClusterLength is the average length (in ligands) of a cluster of bound ligands." ; averageClusterLength := "infinite" /; bfCluster == 0 ; averageClusterLength := 1/bfCluster /; bfCluster > 0 ; (* ;[s] 3:0,0;31,1;117,0;236,-1; 2:2,17,12,Chicago,1,12,0,0,0;1,17,12,Geneva,1,12,0,0,65535; :[font = subsection; inactive; locked; startGroup] Calculation of the initial slope ;[s] 1:0,0;34,-1; 1:1,17,12,Geneva,1,12,0,0,65535; :[font = input; locked; initialization; endGroup] *) initialSlope := k (2 w - 2 n - 1) ; (* :[font = subsection; inactive; locked; startGroup] Define plotting routines ;[s] 1:0,0;26,-1; 1:1,17,12,Geneva,1,12,0,0,65535; :[font = input; locked; initialization] *) makePlot::usage = "makePlot is a neighbor-effect parameter plotting routine." ; makePlot [ j_, yOrigin_, yLabel_, graphLabel_ ] := { If [ saveOutput==False, Unprotect [ Out ] ; Clear [ Out ] ; Protect [ Out ] ] ; plotTable = Table [ {abscissa[[i]], ordinate[[i,j]]}, {i,points+1} ] ; curvePlot = ListPlot [ plotTable, PlotJoined->True, AxesLabel->{" r",yLabel}, PlotLabel->graphLabel, DisplayFunction->Identity, PlotRange->All ] ; pointPlot = ListPlot [ plotTable, PlotStyle->PointSize[0.015], DisplayFunction->Identity, PlotRange->All ] ; Show [ curvePlot, pointPlot, DisplayFunction->$DisplayFunction, If [ versionIsLessThan2, Axes->{0,yOrigin}, AxesOrigin->{0,yOrigin} ] ] ; N [ plotTable ] } (* ;[s] 3:0,0;19,1;76,0;804,-1; 2:2,17,12,Chicago,1,12,0,0,0;1,17,12,Geneva,1,12,0,0,65535; :[font = input; locked; initialization] *) makeCPplot::usage = "makeCPplot is a plotting routine for conditional probabilities." ; makeCPplot [ cpFunction_, label_ ] := { cpTable = Map [ cpFunction , ordinate ] ; If [ saveOutput==False, Unprotect [ Out ] ; Clear [ Out ] ; Protect [ Out ] ] ; plotTable = Table [ {abscissa[[j]], cpTable[[j]]}, { j, points+1} ] ; curvePlot := ListPlot [ plotTable, PlotJoined->True, AxesLabel->{" r", label}, DisplayFunction->Identity, PlotRange->{-0.025,1.025} ] ; pointPlot := ListPlot [ plotTable, PlotStyle->PointSize[0.015], DisplayFunction->Identity, PlotRange->{-0.025,1.025} ] ; Show [ curvePlot, pointPlot, DisplayFunction->$DisplayFunction] ; N [ plotTable ] } (* ;[s] 3:0,0;21,1;83,0;749,-1; 2:2,17,12,Chicago,1,12,0,0,0;1,17,12,Geneva,1,12,0,0,65535; :[font = input; locked; initialization; preserveAspect] *) rCluster::usage = "rCluster is a number between zero and one, the fractional saturation of the lattice for which the calculations will be performed." ; maxLength::usage = "maxLength is the maximum cluster length to be considered." ; (* ;[s] 5:0,0;19,1;150,0;175,1;233,0;239,-1; 2:3,17,12,Chicago,1,12,0,0,0;2,17,12,Geneva,1,12,0,0,65535; :[font = input; locked; initialization; preserveAspect] *) twoDplot::usage = "twoDplot is a routine for plotting the fractions of clusters of different lengths, or the fractions of bound ligands in clusters of different lengths, at a given value of r." ; twoDplot [ yLabel_, maxY_, twoDarray_ ] := { If [ saveOutput==False, Unprotect [ Out ] ; Clear [ Out ] ; Protect [ Out ] ] ; twoDTable = Table [ {j, twoDarray[[j]]}, {j, maxLength} ] ; curvePlot = ListPlot [ twoDTable, PlotJoined->True, DisplayFunction->Identity, AxesLabel->{" length", yLabel}, PlotRange->{ {1-0.025 (maxLength-1), maxLength+0.025 (maxLength-1)}, {-0.025 maxY, 1.025 maxY}} ] ; pointPlot = ListPlot [ twoDTable, PlotStyle->PointSize[0.015], DisplayFunction->Identity, PlotRange->{ {1-0.025 (maxLength-1), maxLength+0.025 (maxLength-1)}, {-0.025 maxY, 1.025 maxY}} ] ; Show [ curvePlot, pointPlot, DisplayFunction->$DisplayFunction ] } ; (* ;[s] 3:0,0;19,1;192,0;1009,-1; 2:2,17,12,Chicago,1,12,0,0,0;1,17,12,Geneva,1,12,0,0,65535; :[font = input; locked; initialization] *) printHeadings::usage = "printHeadings prints the column headings for the cluster length distribution data." ; printHeadings := { Print[ "r/ Cluster Fraction (f) Running Fraction (f) Running"] ; Print[ "rSat Length Clusters Sum Ligands Sum"] ; Print[ " "] } ; (* ;[s] 9:0,0;24,2;106,0;144,1;206,0;225,1;285,0;312,3;313,0;317,-1; 4:5,17,12,Chicago,1,12,0,0,0;2,14,10,Courier,0,12,0,0,0;1,17,12,Geneva,1,12, 0,0,65535;1,14,10,Courier,1,12,0,0,0; :[font = input; locked; initialization] *) clusterDistribution := { (* Calculate the conditional probabilities for r = rCluster rSat *) r = rCluster rSat ; If [ r < rSat, x = r/(1 - n r) ; {bfCluster, bbCLUSTER} = {ff/e, x w ff/e^2}, {bfCluster, bbCLUSTER} = {bfSat,bbSAT} ] ; totalClusters = 0 ; maxClusters = 0 ; totalLigands = 0 ; maxLigands = 0 ; clusterLength =. ; Map [ Function [ clusterLength, If [ bbCLUSTER==0 && clusterLength==1, fracClusters = 1, fracClusters = bbCLUSTER^(clusterLength-1) bfCluster ] ; clusterArray[[clusterLength]] = fracClusters ; If [ fracClusters >maxClusters, maxClusters = fracClusters ] ; totalClusters = totalClusters + fracClusters ; fracLigands = clusterLength fracClusters bfCluster ; ligandArray[[clusterLength]] = fracLigands ; If [ fracLigands >maxLigands, maxLigands = fracLigands ] ; totalLigands = totalLigands + fracLigands ; Print [ rCluster//N, " ", clusterLength, " ", NumberForm [ fracClusters//N, 6], " ", totalClusters//N," ", NumberForm [ fracLigands//N, 6 ], " ", totalLigands//N ] ], clusterLengthArray ] } ; (* ;[s] 13:0,0;31,1;109,0;1051,2;1055,0;1090,2;1096,0;1150,2;1155,0;1192,2;1197,0;12 51,2;1255,0;1327,-1; 3:7,17,12,Chicago,1,12,0,0,0;1,17,12,Geneva,1,12,0,0,65535;5,14,10,Courier,1 ,12,0,0,0; :[font = input; locked; initialization] *) chooseTicks::usage = "chooseTicks is a routine for selecting the number and position of the tick marks in the lattice saturation axis (r/rSat) in the 3 dimensional plots of cluster length distribution." ; chooseTicks := { If [ points3D==1, tickChoice = 1, If [ points3D==2, tickChoice = 2, If [ Mod[points3D,5]==0, tickChoice = 5 ; tickStep = points3D/5, If [ Mod[points3D,4]==0, tickChoice = 4 ; tickStep = points3D/4, If [ Mod[points3D,3]==0, tickChoice = 3 ; tickStep = points3D/3, tickChoice = 6 ] ] ] ] ] ; If [ tickChoice==1, tickArray = {{1,0},{2,1}} ; tickArray0 = {{1,0}} ; tickArray1 = {{2,1}} ] ; If [ tickChoice==2, tickArray = {{1,0},{2,0.5},{3,1}} ; tickArray0 = {{1,0},{2,0.5}} ; tickArray1 = {{2,0.5},{3,1}} ] ; If [ tickChoice==3, tickArray = {{1,0},{1+tickStep,0.33},{1+2 tickStep,0.67}, {1+3 tickStep,1}} ; tickArray0 = {{1,0},{1+tickStep,0.33},{1+2 tickStep,0.67}} ; tickArray1 = {{1+tickStep,0.33},{1+2 tickStep,0.67}, {1+3 tickStep,1}} ] ; If [ tickChoice==4, tickArray = {{1,0},{1+tickStep,0.25},{1+2 tickStep,0.5}, {1+3 tickStep,0.75},{1+4 tickStep,1}} ; tickArray0 = {{1,0},{1+tickStep,0.25},{1+2 tickStep,0.5}, {1+3 tickStep,0.75}} ; tickArray1 = {{1+tickStep,0.25},{1+2 tickStep,0.5}, {1+3 tickStep,0.75},{1+4 tickStep,1}} ] ; If [ tickChoice==5, tickArray = {{1,0},{1+tickStep,0.2},{1+2 tickStep,0.4}, {1+3 tickStep,0.6},{1+4 tickStep,0.8},{1+5 tickStep,1}} ; tickArray0 = {{1,0},{1+tickStep,0.2},{1+2 tickStep,0.4}, {1+3 tickStep,0.6},{1+4 tickStep,0.8}} ; tickArray1 = {{1+tickStep,0.2},{1+2 tickStep,0.4}, {1+3 tickStep,0.6},{1+4 tickStep,0.8},{1+5 tickStep,1}} ] ; If [ tickChoice==6, num = 1 ; While [ num/points3D < 0.1, num = num+1 ] ; num2 = points3D-num ; While [ !Mod[num2,3]==0 && !Mod[num2,4]==0, num2 = num2-1 ] ; If [ Mod[num2,4]==0, tickChoice2 = 4 ; tickStep = num2/4, If [ Mod[num2,3]==0, tickChoice2 = 3 ; tickStep = num2/3 ] ] ; tickValue = tickStep/points3D ; If [ tickChoice2==3, tickArray = {{1,0}, {1+tickStep, N [ Round [ 100 tickValue]/100 ] }, {1+2 tickStep, N [ Round [ 200 tickValue]/100 ] }, {1+3 tickStep, N [ Round [ 300 tickValue]/100 ] }, {points3D+1, 1}} ; tickArray2 = { {1+tickStep, N [ Round [ 100 tickValue]/100 ] }, {1+2 tickStep, N [ Round [ 200 tickValue]/100 ] }, {1+3 tickStep, N [ Round [ 300 tickValue]/100 ] }} ; tickArray3 = {{points3D+1-3 tickStep, N [ Round [ 100 (1-3 tickValue)]/100 ] }, {points3D+1-2 tickStep, N [ Round [ 100 (1-2 tickValue)]/100 ] }, {points3D+1-tickStep, N [ Round [ 100 (1-tickValue)]/100 ] }} ; If [ tickStep > (points3D-3 tickStep), tickArray0 = tickArray2 ; tickArray1 = tickArray3, tickArray0 = tickArray3 ; tickArray1 = tickArray2 ] ] ; If [ tickChoice2==4, tickArray = {{1,0}, {1+tickStep, N [ Round [ 100 tickValue]/100 ] }, {1+2 tickStep, N [ Round [ 200 tickValue]/100 ] }, {1+3 tickStep, N [ Round [ 300 tickValue]/100 ] }, {1+4 tickStep, N [ Round [ 400 tickValue]/100 ] }, {points3D+1, 1}} ; tickArray2 = { {1+tickStep, N [ Round [ 100 tickValue]/100 ] }, {1+2 tickStep, N [ Round [ 200 tickValue]/100 ] }, {1+3 tickStep, N [ Round [ 300 tickValue]/100 ] }, {1+4 tickStep, N [ Round [ 400 tickValue]/100 ] }} ; tickArray3 = {{points3D+1-4 tickStep, N [ Round [ 100 (1-4 tickValue)]/100 ] }, {points3D+1-3 tickStep, N [ Round [ 100 (1-3 tickValue)]/100 ] }, {points3D+1-2 tickStep, N [ Round [ 100 (1-2 tickValue)]/100 ] }, {points3D+1-tickStep, N [ Round [ 100 (1-tickValue)]/100 ] }} ; If [ tickStep > (points3D-4 tickStep), tickArray0 = tickArray2 ; tickArray1 = tickArray3, tickArray0 = tickArray3 ; tickArray1 = tickArray2 ] ] ; PrependTo [ tickArray0, {1,0} ] ; AppendTo [ tickArray1, {points3D+1, 1} ] ] } ; (* ;[s] 3:0,0;22,1;201,0;5250,-1; 2:2,17,12,Chicago,1,12,0,0,0;1,17,12,Geneva,1,12,0,0,65535; :[font = input; locked; initialization; preserveAspect; endGroup] *) threeDplot::usage = "threeDplot is a routine for plotting the fractions of clusters of different lengths, or the fractions of bound ligands in clusters of different lengths, as a function of r." ; threeDplot [ xView_, yView_, zView_, xLabel_, yLabel_, zLabel_, threeDarray_, tickArray_ ] := { If [ saveOutput==False, Unprotect [ Out ] ; Clear [ Out ] ; Protect [ Out ] ] ; ListPlot3D [ threeDarray, PlotRange->{0,1}, BoxRatios->{1,1,1}, Lighting -> True, Ticks->{Automatic,tickArray,Automatic}, LightSources -> {{{1,0,1},RGBColor[1,0,0]}, {{1,1,1},RGBColor[0,1,0]}, {{0,1,1},RGBColor[0,0,1]}}, ViewPoint -> {xView, yView, zView}, AxesLabel->{xLabel, yLabel, zLabel} ] } ; (* ;[s] 3:0,0;21,1;193,0;775,-1; 2:2,17,12,Chicago,1,12,0,0,0;1,17,12,Geneva,1,12,0,0,65535; ^*)