Biochemistry-Adair Equation

Hey all,

I am trying to fit some biochemical data and I will need to use the Adair equation which describes multiple binding equilibria. In order to do that, I have to generate a user-defined function that will contain all the Adair equation's unknowns and parameters. Has anybody ever done that?
Do you expect a fixed number / upper bound of ligand binding sites?

The fitfunction itself is simple. However, the interface to the fitting dialogue could be a mess for an unknown amount of sites. Command line / function call will be ok.

HJ
Thanks a lot for your reply! Yes, I am going to have a fixed number of 2 binding sites. Have you ever fit your data using the Adair Eq. in Igor? Did you use a user-defined function?
This should do what you need.
Function Adair_Equation(w,X) : FitFunc
    Wave w
    Variable X

    //CurveFitDialog/ These comments were created by the Curve Fitting dialog. Altering them will
    //CurveFitDialog/ make the function less convenient to work with in the Curve Fitting dialog.
    //CurveFitDialog/ Equation:
    //CurveFitDialog/ f(X) = (1/4)*(K1*X + 2*K2*X^2)/(1 + K1*X + K2*X^2)
    //CurveFitDialog/ End of Equation
    //CurveFitDialog/ Independent Variables 1
    //CurveFitDialog/ X
    //CurveFitDialog/ Coefficients 2
    //CurveFitDialog/ w[0] = K1
    //CurveFitDialog/ w[1] = K2

    return (1/2)*(w[0]*X + 2*w[1]*X^2)/(1 + w[0]*X + w[1]*X^2)
End
EDIT: Fixed mistake to use TWO binding sites. -- J. J. Weimer Chemistry / Chemical & Materials Engineering, UAH
I never used Adair. However, I am using user fit functions extensively. My solution would have been a carbon copy of JJWeimer's function, he was faster. In case you will need more binding sites, you can easily modify the fitfunction by adding the higher order terms using Analysis->Curve Fit -> #Select fit function# -> Edit Fit Function. HJ
Here is a general purpose function that should do n binding sites. You will have to do the fit "by hand" (this will not appear in the Curve Fit menu options). This does no error checking, for example whether n > 0.
Function Adair_Equation(ww,xx) : FitFunc
    Wave ww
    Variable xx
   
    // ww - coefficients
    // ww[0] is number of binding sites
    // ww[n] are K factors for each n site
 
    variable nrtn=0, drtn=1, ic
   
    for (ic=1;ic<=ww[0];ic+1)
        nrtn += ic*ww[ic]*xx^ic
    endfor
    for (ic=1;ic<ww[0];ic+1)
        drtn += ic*ww[ic]*xx^(ic-1)
    endfor
   
    return ((1/ww[0])*nrtn/drtn)
End
This also may inadvertently allow n to vary as non-integer. The approach might therefore be to test the model with fixed values of n (i.e. use a HOLD wave). -- J. J. Weimer Chemistry / Chemical & Materials Engineering, UAH
Thanks a lot guys! You have been very helpful...I will try to run these scripts and see what comes out....! Best Christos