Pages

Monday, 19 January 2015

GNUPLOT TUTORIAL: Fitting Michaelis-Menten Equation to raw data

This is the first tutorial involving use of my favorite go-to programs for routine fitting of experimental data, namely GNUPLOT.

It may be just my opinion, but I do think gnuplot should be introduced to all students at the high-school level (if it isn't already part of the science curriculum).

When I first discovered gnuplot, it seemed like a door was opened which allowed better understanding of how to connect ideas/models to experiments.
Before knowing how to "fit data", it was always unsatisfying to me that science curricula force-fed equations and theorems without showing where these theories came from or how well they modeled raw experimental data. Though I had many good teachers at the time, I was never shown how to fit data in high school. :(
Even some STEM undergraduate programs fail to introduce such tools (exceptions are physics, biostatistics/stats, engineering or mathematics programs).
My first exposure came in 2nd year biostatistics using the R software package. While powerful and diverse, I find gnuplot is beautifully simple and intuitive. I do like R quite a bit, yet don't particularly like its syntax/structure. That's just me though. 

Anyways...

A simple, yet effective demonstration of fitting a model to experimental data is to use gnuplot for Michaelis-Menten kinetics.
 If you don't know what an enzyme is, this might be a good time to scan the wikipedia page.

For the initiated, Michaelis-Menten enzyme kinetics is one of the most common modules of biochemistry lab courses.

A little intro:
In the biochemistry course for which I TA, we demonstrate extraction of an enzyme from heart tissue. The crude extract is assayed for enzyme activity (reaction vs time) for various concentrations of substrate. The crude extract is then purified via salt fractionation and ion exchange chromatography to increase its specific activity.
Note the difference between "enzyme activity" and "specific activity"

The raw data:
By assaying the enzyme activity as a function of substrate concentration ([substrate]), we get:
[S] (M)    rate (M/sec)
.25         .2005
.5          .3139
1           .5085
2           .749
3           .7016
4           .906
9           .944
.25         .2005
.5          .3139
1           .5085
2           .749
3           .7016
4           .906
9           .944

Note that the data is not organized from lowest [substrate] to highest. It is best to do so but will not matter for the demonstration or gnuplot fitting.

Save the data in a text file named: gnuplot-input.txt
Make sure only to take the data and not the column headers (so don't copy the line with: [S] (M)   rate (M/sec)  ).
 
Hopefully, you have installed gnuplot on your computer. It is available for all major platforms.

Open a terminal / command prompt and go into the folder where you saved the "data.txt" file and type: gnuplot
You should see the prompt: gnuplot>

gnuplot> plot './gnuplot-input.txt'
This will plot the data in a new window. Make note of where the data points level off (around 1.0). This will be Vmax (variable "a" in the following equation).


gnuplot> f(x)=(a*x)/(x+b)
This is the Michaelis-Menten equation. It is more typically defined as:
v=(Vmax*[S])/([S]+Km) where Vmax is the maximum rate of reaction, [S] is the substrate concentration, and Km is the substrate concentration at which v=(1/2)*Vmax.

We estimate Vmax by assigning the variable "a" visually from where the plot levels off.
gnuplot> a=1

We can also estimate Km
gnuplot> b=0.5

This next line will try to fit our equation to the experimental data using the initial guesses for Vmax (a) and Km (b) that we provided. 
gnuplot> fit f(x) './gnuplot-input.txt' via a, b

The terminal window will output the results of the fit. You will see that a and b will be different from our initial guesses. This is because gnuplot was able to get better agreement to the experimental data using these new values and are therefore more accurate than our initial guesses for Vmax and Km. Note that the standard error in these values is also reported (3.9% for Vmax and 12.7% for Km), indicating how confident we can be that the model accurately describes the data.

Now you can plot your final equation (fit) to the experimental data via:
gnuplot> plot f(x) via lines, './gnuplot-input.txt'



This should show a curve (the fit) matching well to the experimental data (points) in the plot.

You have now completed this tutorial. Note that our final equation describing the data is:

v=(1.078*[S])/([S]+1.109)

Another screenshot:




No comments:

Post a Comment