The Binding of Symmetric Ligands to an Infinite Linear Lattice 
by Alan R. Wolfe

This Mathematica  notebook calculates and plots the Scatchard plot, neighbor-effect parameter, conditional probabilities, and cluster length distribution  for the symmetric ligand case.  It also permits comparison of an experimental Scatchard plot with the calculated theoretical data.  It can only be used after the appropriate initialization notebook has been evaluated.  To perform the calculations, simply set the input variables to the desired values and execute the "Kernel-> Evaluation-> Evaluate Notebook" command.  This may be repeated with different values for the input variables.  

The notebook may also be executed in sections.  To operate in this manner, the input parameters cell (as well as the experimental data cell, if desired) must be executed first.  Then, if you want to plot the Scatchard plot, neighbor-effect parameter, or any of the conditional probabilities, the cell immediately below the first "Calculate…" heading must be executed next, followed by the desired output.    In this case, it's easiest to start by simply selecting the right-most cell grouping bracket and executing everything from the input parameters to the Scatchard plot.  If you want any of the 3-D cluster length plots, after the input parameters cell skip directly to the cell immediately below the second "Calculate…" heading, followed by the desired 3-D plot.  If you want any of the 2-D cluster length plots, after the input parameters cell skip directly to the cell immediately below the third "Calculate…" heading, followed by the desired 2-D plot.  (Note - the "Iso" and "Ani" programs cannot be excuted in the same manner; they require that the first calculation cell always be excuted before the second or third.)  

The initial value of experimentalrLf (= experimental r/[free ligand]) must be positive, and experimentalData must be True, in order to perform the experimental vs. theoretical comparison.  If experimentalData is False, only theoretical data will be generated (over n = points equal intervals on the r axis).  If experimentalData is True, and the initial value of experimentalrLf is negative, again only theoretical data will be generated, but this time using the list of experimental r values provided (rExpArray).

INPUT VARIABLES:

points = 10; k = 2; n = 2; w = 3; experimentalData = True; 
(* variables for cluster length plots: *)
rCluster2D = 0.9; maxLength2D = 6; 
points3D = 10; maxLength3D = 5;

rCluster2D * rSat is the r value for which 2D cluster length distribution data will be displayed.  
points3D is the number of equally spaced r values greater than zero for which the cluster length distribution will be displayed in the 3D plots.  
maxLength is the maximum cluster length that will be considered.

Experimental Data (* disregarded if experimentalData is False *)

(* The number of points in the two arrays must be equal.  Also, neither array should have values corresponding to an empty or saturated lattice. *)

(* experimental r/[free ligand] values - y values of Scatchard plot.  These will be disregarded if the first value is negative *) 
experimentalrLf = {2.02, 2.2, 2.05, 2.0, 1.96, 1.37, 1.21, 0.6, 0.61} ;

Print [ "    initial slope = ", initialSlope //N ] ;

(* Calculate the NE parameter and Scatchard plot *)  scroll = 1

(* Choose expression for neighbor-effect parameter and determine value of rSat *) 
ne ; 
rSatDetermine ; 

(* Initialize output arrays *)
If [ experimentalrLf[[1]]<0, useData=False, useData=True ] ; 
If [ experimentalData==False, 
     points2 = points ; 
     xAxisInterval = rSat/(points2) ; 
     abscissa = Range [0, points2-1] ; abscissa2 = {} ; 
     points4 = points2 ; 
     AppendTo [ abscissa2, points4 - 1/2] ; points2 = points2+1 ;
     AppendTo [ abscissa2, points4 - 1/4] ; points2 = points2+1 ;
     abscissa = xAxisInterval Join [ abscissa, abscissa2 ] ] ; 
If [ experimentalData==True, 
     abscissa = Prepend [ rExpArray, 0 ] ; 
     points2 = Length [ abscissa ] ; 
     Do [  
          If [ abscissa[[i]] >= rSat, abscissa = Drop [ abscissa, {i,i} ] ], 
          {i, points2, 1, -1} ] ; 
     points2 = Length [ abscissa ] ; 
     experimentalrLf = Take [ experimentalrLf, points2-1 ] ] ; 
     
(* Evaluate the neighbor-effect parameter *)
ordinate = Map [ Function [ zz, r = zz ; x = r/(1 - n r) ; 
     {rLf, e, x, ff} ], abscissa ] ; 
AppendTo [ abscissa, rSat ] ; 
AppendTo [ ordinate, {0, w, 0, 0} ] ;

(* Display the Scatchard plot *)  scroll = 1

If [ experimentalData && useData, 
     makePlot2 , 
     makePlot [ 1, 0, "r/Lf", "Scatchard plot" ] ]

If [ experimentalData && useData, 
     theoreticalrLf = Table [ ordinate[[i,1]], {i,2,points2} ] ; 
     Print [ "correlation coefficient (R) = ", 
          corrCoeff [ experimentalrLf, theoreticalrLf ] ] ; 
     makeResidualsPlot [ experimentalrLf, theoreticalrLf ] ]

If [ experimentalData && useData, 
     makeResidualsPlot2 [ experimentalrLf, theoreticalrLf ] ] ;

(* Plot the neighbor-effect parameter *)  scroll = 1

makePlot [ 2, 1, "e", "neighbor-effect" ]

(* Plot the conditional probabilities *)  scroll = 1

(* ff *)

makePlot [ 4, 0, "ff", "" ]

(* bf *)

makeCPplot [ bf, "   bf" ]

(* fb *)

makeCPplot [ fb, "   fb" ]

(* bb *)

makeCPplot [  bb, "   bb" ]

(* Calculate, print and plot 3D cluster length data *) scroll = 1

ne ; rSatDetermine ; 
maxLength = maxLength3D ; 
clusterArray = Table [ 0, {maxLength} ] ; 
ligandArray = clusterArray ; 
clusterArray3D = Table [ clusterArray, {points3D+1} ] ; 
ligandArray3D = clusterArray3D ; 
clusterLengthArray = Range [1, maxLength ] ; 
printHeadings ; 
Do [ rCluster = (ij/points3D) ; clusterDistribution ; 
     clusterArray3D[[ij+1]] = clusterArray ; 
     ligandArray3D[[ij+1]] = ligandArray , 
{ ij, 0, points3D} ] ; 
chooseTicks ;

(* plot fraction of clusters, left view *)

threeDplot [ 2.2, -2.4, 1.0, "length         ", "          r/rSat", 
     "f clus.", clusterArray3D, tickArray1 ] ;

(* plot fraction of clusters, right view *)

threeDplot [ 2.2, 2.4, 1.0, "         length", "r/rSat          ", 
     "f clus.", clusterArray3D, tickArray0 ] ;

(* plot fraction of clusters, center view *)

threeDplot [ 2.2, -0.001, 1.0, "     length", "r/rSat", 
     "f clus.", clusterArray3D, tickArray ] ;

(* plot fraction of ligands, left view *)

threeDplot [ 2.2, -2.4, 1.0, "length         ", "          r/rSat", 
     "f lig.", ligandArray3D, tickArray1 ] ;

(* plot fraction of ligands, right view *)

threeDplot [ 2.2, 2.4, 1.0, "         length", "r/rSat          ", 
     "f lig.", ligandArray3D, tickArray0 ] ;

(* plot fraction of ligands, center view *)

threeDplot [ 2.2, -0.001, 1.0, "     length", "r/rSat", 
     "f lig.", ligandArray3D, tickArray ] ;

(* Calculate, print and plot 2D cluster length data *) scroll = 1

ne ; rSatDetermine ; 
rCluster = rCluster2D ; 
maxLength = maxLength2D ; 
clusterArray = Table [ 0, {maxLength} ] ; 
ligandArray = clusterArray ; 
clusterLengthArray = Range [1, maxLength ] ; 
printHeadings ; 
clusterDistribution ; 
Print [ " " ] ; 
Print [ "r = ", r, "; average cluster length = " , averageClusterLength ] ; 
Print [ "bb = ", bbCLUSTER, "; bf = ", bfCluster ] ; 
Print [ "rCluster2D = ", rCluster2D,  
     "; maxLength2D = ", maxLength2D ] ;

(* Plot 2D cluster length data *) scroll = 1

twoDplot [ "fraction clusters", maxClusters, clusterArray ] ;

twoDplot [ "fraction ligands", maxLigands, ligandArray ] ;

rCluster2D = 0.99; maxLength2D = 7;

Note - if the values of rCluster2D (= r/rSat) and/or maxLength2D are changed and the cell assigning these values is executed, the cluster length distribution can be recalculated for the new value(s) by selecting and executing the group of cells above this group.  (The selection is executed by hitting the "shift-return" keys or the "enter" key.)