xcrvfit - v0.9

Purpose: a graphical X-windows program for binding curve studies and NMR spectroscopic analysis.

  1. Introduction

  2. Preparations

  3. Running the program


The xcrvfit program tries to find the parameters of a function which best fits a given set of data. The user has a wide selection of functions which relate to binding curve studies and spectroscopic analysis.

The power of xcrvfit lies in its convenience to process multiple datasets of various formats, the ability to experiment with fitting parameter scenarios, and the ability to customize the graphics. The program runs quickly and on any platform supporting X-windows. Output from the program includes a graph of the function through the data (saved in postscript format), the rmse of the fit, a measure of the sensitivity of each fitting function parameter, and a table showing how each datapoint fits the function.

The xcrvfit program is a combination of 3 programs previously written in sunview: crvfit, jfit, and t1t2fit.

Main Screen Snapshot


Authors: Robert Boyko, Brian Sykes

Funding for this project has been provided by the Medical Research Council of Canada and the Protein Engineering Networks of Centres of Excellence (Canada).

Download and Installation

Executable versions of this program for suns or sgis are freely available at our ftp site. First you will need to download the software from our website:

Once you have downloaded the software, you then proceed by uncompressing and untarring the files:
	uncompress myfile.tar.Z
	tar xvf myfile.tar

You should then take a look at the README file to understand what files are being installed and the installation options you have. After this, type "Install" to put the files in the appropriate places.

The current version of this software comes with an expiry date. If your software has expired, check out the website above for further instructions or new versions.

Input Data Files

The xcrvfit program can read data files which are in one of the following formats:
  1. crvfit
  2. kay
  3. jfit
  4. fp
crvfit - Each line in the text file contains one point where the point is specified as either "x f(x)" or "x f(x) x2". Comments are prefixed by "!".
	! This is a crvfit data file
	! x     f(x)
	1.0    5.1
	2.2    12.0
	3.6    19.3
Multiple datasets can be placed in one file however an ID number must be found on the line preceding each data set.
Click here to see an example.

kay - In this format the x-values are placed on the first line and each subsequent line contains an identifier (likely the amino acid number) and the corresponding y-values. Click here to see an example.

jfit - jfit format refers to Varian's vnmr 'fitspec.data' file format. An example of this format follows below:

	100  (number of points)
	-20  (start of plot)
	30   (width of plot)
	1.00 (first y-value)
	1.05 (second y-value)

fp - fp format refers to Varian's vnmr 'fp.out' file format. Click here to see an example.

Basic Program Usage

  1. Start the program by typing 'xcrvfit'.

    If you do not get a graphical window, check with your system administrator to make sure the program has been installed and is accessible to you.

    The default fonts, colors, sizes of the xcrvfit gui are set in the $HOME/.xcrvfit file. Click here to see an example.

  2. Select the format of your data file.

    Simply click and hold the leftmost mouse button on the current entry in the DataFormat field. Hilite the appropriate selection and release the mouse button. For an explanation of the various formats see the Input Data Files section.

  3. Enter the name of your data file in the field below and press return.

    The program proceeds to read in the data and display the first data set. If the data is not drawn in the plotting window make sure you have selected the correct data format.

  4. (optional) Change how the data is displayed in the graph window.

    The program starts by reading the first dataset, but the user can select another. The user has the choice of changing the offset for the x data (this is particularly useful for the chemical shift functions). Finally, the user may want to change how the graph is displayed in the plotting window by clicking the "Set Graphics" button. Here the user can change variables such as xMax, number of tic marks, titles, colors, etc.

  5. Select the fitting function.

    This is done in the same manner as selecting the dataFormat. For a more detailed explanation of the functions see Fitting Functions .

    Once the function has been selected, the program displays the appropriate parameter fields.

  6. Input starting parameter values. Remember to press return after entering each parameter value.

    A graph of the fitting function is displayed (along with an rmse value) as soon as all parameters have been entered. If you do not see the fitting function try pressing return for each parameter or change the x/y scale to include a wider range of numbers.

  7. Press the iterate button to calculate the best fit function.

    Some functions will converge to the best fit function regardless of the starting parameters. Others are very sensitive and a close approximation is required first.

  8. Click Display Results button.

    Here you can see how every datapoint corresponds to the fitting function. Also, you can see how sensitive each fitting parameter is by looking at the stddev field.

  9. Click Next dataset.

    The program then reads in the next dataset. The previous starting parameters are not erased so that the user may be able to quickly process several datasets by alternating between "iterate" and "next dataset".

Understanding the Output

  • The log file "xcrvfit.log" contains a record of each convergence achieved through pressing the iterate button. This is particularly useful for stepping through a number of T2 fits.

    Click here to see an example results file.

    Fitting Functions

    1. Line
      • Data: 2 column (x, f(x))
      • Function:
        	f(x) = A0*x + A1

    2. Quadratic
      • Data: 2 column (x, f(x))
      • Function:
        	f(x) = A0*x^2 + A1*x + A2

    3. Cubic
      • Data: 2 column (x, f(x))
      • Function:
        	f(x) = A0*x^3 + A1*x^2 + A2*x + A3

    4. Exponential
      • Data: 2 column (x, f(x))
      • Function:
        	f(x) = A0 * exp(A1 * x) + A2 

    5. T2 Relaxation
      • Data: 2 column (x, f(x))
      • Function:
        	f(x) = A0 * exp(-x / A1)

    6. T1 Relaxation
      • Data: 2 column (x, f(x))
      • Function:
        	f(x) = A0 * (1.0 - A1 * exp(-x / A2))

    7. Sum of Two Exponentials
      • Data: 2 column (x, f(x))
      • Function:
        	f(x) = (A0 * exp(-x / A1)) + (A2 * exp(-x / A3))
      Note that in this particular function one or more variables should be held constant.

    8. pH Titration
      • Data: 2 column (x, f(x))
      • Function:
        	b = 10^((-x)*A3)
        	c = 10^((-A0)*A3)
        	f(x) = A1 + (b / (b + c)) * (A2 - A1)

    9. Sinusoidal
      • Data: 2 column (x, f(x))
      • Function:
        	f(x) = (A0 * cos(x)^2) - (A1 * cos(x)) + A2 

    10. Sum of Two Lorentzian Curves
      • Data: 2 column (x, f(x))
      • Function:
        	b = 4 * PI * PI
        	c = T1(1) / (1 + b*(x-Vo(1))*(x-Vo(1)) * (T1(1)*T1(1))
        	d = T1(2) / (1 + b*(x-Vo(2))*(x-Vo(2)) * (T1(2)*T1(2))
        	f(x) = Mo * (c + F*d)
      • Notes:
        Vo(1), Vo(2) are the maximum values of the Lorentzians.
        T1(1), T1(2) are measures of line width of the Lorentzians.
        F measures relative intensity of Lorentzian 1 to Lorentzian 2.
        Mo is a scaling factor.

    11. Sigmoidal
      • Data: 2 column (x, f(x))
      • Function:
        	f(x) = A0 + A1 / (1 + exp(-(x - A2) / A3)))	

    12. UC-Dimer
      • Data: 2 column (x, f(x))
      • Function:
        	c = A0 * exp(A1 * A2 * (x - A3));
        	d = A0 * A0 * A4 * exp(A1 * A2 * 2.0 * (x - A3));
        	f(x) = c + d;

    13. Melting Curve 3
      • Data: 2 column (x, f(x))
      • Function:
        	b = x + 273.15
        	c = b *((A4 / A6) + A5 * log(b / A6))
        	d = A4 + A5 * (b - A6)
        	e = (d - c) / 0.001987
        	f = exp((-e) / b)
        	g = f / (1 + f)
        	f(x) = (1 - g) * (A0 - A1 * x) + g * (A2 - A3 * x)

    14. Chemical Shift XY1
      • Description: X+Y <=> XY; obs X; vary Y
      • Data: 3 column (x, f(x), x2)
      • Function:
        	b = x + x2 + A1
        	f(x) = A0 * (b - sqrt(b*b - 4*x*x2)) / (2.0 * x2)

    15. Chemical Shift XY2
      • Description: X+Y <=> XY; XY+Y <=> XY2; obs X;
      • Data: 3 column (x, f(x), x2)
      • Function:
        	b = A3 - 4 * A1
        	c = A3 * A3
        	d = (c - (4*A1*A3) - (2*x2*A3)) / b
        	e = ((x * A3 * (2*x2 - x)) - (c * (x2 + A1 + x))) / b
        	f = -(2*d*d*d - 9*d*e + (27 * ((x*x2*c) / b))) / 54.0
        	g = (3*e - d*d) / 3.0
        	w = f / sqrt(-(g*g*g) / 27.0)
        	h = 180.0 / PI * acos(w)
        	x3 = (2 * sqrt(-g/3.0) * cos(((h/3.0)+240)*TO_RAD) - (d/3.0))
        	f(x) = ((A0*x3) + (A2*x3*(x-x3)/(2*x3+A3))) / x2
      Note this function does not converge very well if the KD2 parameter is not held constant.

    Last modified: Jan 6, 1997

    Robert Boyko - robert.boyko@ualberta.ca