What is this blog about?
Well, its basically a collection of links to useful or interesting content I find on the web as well as some original content of my own. Most of the content can be broadly categorized as science and technology related. I'm a structural biochemist, organic/biological, and physical chemist, depending on what project I've currently got my hands dirty in at the moment (call me Jack). So a lot will focus on (bio)chemistry-related topics (NMR, crystallography, MD, computational chem, mass spectrometry, molecular biology). That said, there will also be posts pertaining to topics such as: programming, linux, WINE (Wine Is Not an Emulator), mechanical machines, engineering, statistics, hacks and DIY, electronics, virtualbox, scripting, astronomy, microscopy, flight, DOS, and perhaps some gaming and photography.
I've created this blog more as a repository for my own, but figure others might find something of interest and so decided to share.
Frankly, I'm not a big fan of how blogs organize content. This is why I've made this list of all posts on my blog, organized by title for easy tracking. This is done so that you can find whatever you might find interesting rather than searching through the entire blog randomly.
This post ("All posts listed by title") will always be the first in my blog, even though content will be updated on an ongoing basis.
Best,
GNUPLOT TUTORIAL: Fitting Michaelis-Menten Equation to raw data
Free NMR Processing Software
Chemicals in cosmetics
commandlinefu.com
Programming: Processing and Processing.js
Lazarus IDE (Pascal Programming): Cross-platform VisualBasic-like Programming platform
Excel Unusual: Engineering and Modeling in Excel
Nitinol and Nitinol Engines
Software Carpentry: TEACHING LAB SKILLS FOR SCIENTIFIC COMPUTING
Software: Mass Spectrometry
Software: Predicting Solvent Accessibility of Amino Acid residues in proteins
How the first transistor worked!
Mechanical Fourier Transform Instrument
PyMOL and POVRay Tutorial
Fun with the Protein Data Bank and Statistics
Sunday, 25 January 2015
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:
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:
Thursday, 15 January 2015
Free NMR Processing Software
Haven't posted in a while as I was busy finishing up my thesis but thought I'd take the time to highlight software for NMR processing. Here are some free and "free for academic use" options for processing 1D and 2D NMR spectra.
Free:
Spinworks (University of Manitoba): http://home.cc.umanitoba.ca/~wolowiec/spinworks/
GSim: http://sourceforge.net/projects/gsim/
NMRPipe (Most powerful NMR processing software around IMO): http://spin.niddk.nih.gov/NMRPipe/
CcpNmr: http://www.ccpn.ac.uk/software/analysis
GSim and Spinworks are quite intuitive whereas NMRPipe has quite a learning curve. That said, NMRPipe is very flexible and powerful in the hands of an experienced user.
Free for Academic/Non-commercial use:
ACD NMR Processor: http://www.acdlabs.com/resources/freeware/nmr_proc/
All of the above are very good free alternatives to commercial NMR software (Mestre/MestreNova, Topspin, Felix, NUTS)
Happy processing!
-S
Free:
Spinworks (University of Manitoba): http://home.cc.umanitoba.ca/~wolowiec/spinworks/
GSim: http://sourceforge.net/projects/gsim/
NMRPipe (Most powerful NMR processing software around IMO): http://spin.niddk.nih.gov/NMRPipe/
CcpNmr: http://www.ccpn.ac.uk/software/analysis
GSim and Spinworks are quite intuitive whereas NMRPipe has quite a learning curve. That said, NMRPipe is very flexible and powerful in the hands of an experienced user.
Free for Academic/Non-commercial use:
ACD NMR Processor: http://www.acdlabs.com/resources/freeware/nmr_proc/
All of the above are very good free alternatives to commercial NMR software (Mestre/MestreNova, Topspin, Felix, NUTS)
Happy processing!
-S
Friday, 5 December 2014
Chemicals in cosmetics
How toxic are common cosmetic products?
Ever wonder how toxic those ingredients are in your everyday shampoo? How about that scented bar of soap or body scrub?
Go over to toxnet (http://toxnet.nlm.nih.gov) and run a search against those ingredient names. I'm sure some of them will surprise you...
Chemists typically look at MSDS sheets (Materials Safety Data Sheets) to get an idea of the dangers associated with chemicals they need to use. MSDS also provides info on physical properties of the chemical, handling and disposal procedures, and carcinogenicity, among other things.
Many websites (often chemical suppliers) provide MSDS search.
Again, go ahead and run those cosmetic ingredients through the msds search. :)
Just to get things clear, I'm not against the cosmetics industry. After all, the world would be a lot stinkier were it not for the aid of cosmetic products. What I am against, however, is the use of certain additives that contribute negligible benefit or that are outright toxic, bioaccumulative, or hazardous to the environment.
Don't get me started with those microbeads... http://www.beatthemicrobead.org/en/
Certainly with all that money being pumped into the industry, we could afford to develop products that are safe, yet effective.
Then again, you can't charge consumers loads of money for a soap made of the basic ingredients (fat treated with lye (or a base such as NaOH, KOH)) can you?
Notable mention
The EWG (environmental working group) cosmetics database has a site that lists common cosmetic products according to their "hazard" level (which they define according to the chemicals contained within).
http://www.ewg.org/skindeep/
Ever wonder how toxic those ingredients are in your everyday shampoo? How about that scented bar of soap or body scrub?
Go over to toxnet (http://toxnet.nlm.nih.gov) and run a search against those ingredient names. I'm sure some of them will surprise you...
Chemists typically look at MSDS sheets (Materials Safety Data Sheets) to get an idea of the dangers associated with chemicals they need to use. MSDS also provides info on physical properties of the chemical, handling and disposal procedures, and carcinogenicity, among other things.
Many websites (often chemical suppliers) provide MSDS search.
Again, go ahead and run those cosmetic ingredients through the msds search. :)
Just to get things clear, I'm not against the cosmetics industry. After all, the world would be a lot stinkier were it not for the aid of cosmetic products. What I am against, however, is the use of certain additives that contribute negligible benefit or that are outright toxic, bioaccumulative, or hazardous to the environment.
Don't get me started with those microbeads... http://www.beatthemicrobead.org/en/
Certainly with all that money being pumped into the industry, we could afford to develop products that are safe, yet effective.
Then again, you can't charge consumers loads of money for a soap made of the basic ingredients (fat treated with lye (or a base such as NaOH, KOH)) can you?
Notable mention
The EWG (environmental working group) cosmetics database has a site that lists common cosmetic products according to their "hazard" level (which they define according to the chemicals contained within).
http://www.ewg.org/skindeep/
Saturday, 22 November 2014
commandlinefu.com
Oh, the beauty that is the one-liner:
"commandlinefu.com is the place to record those command-line gems that you return to again and again.
Delete that bloated snippets file you've been using and share your personal repository with the world. That way others can gain from your CLI wisdom and you from theirs too. All commands can be commented on, discussed and voted up or down."
"commandlinefu.com is the place to record those command-line gems that you return to again and again.
Delete that bloated snippets file you've been using and share your personal repository with the world. That way others can gain from your CLI wisdom and you from theirs too. All commands can be commented on, discussed and voted up or down."
Programming: Processing and Processing.js
Processing.js (Port of the Processing programming language to javascript). Excerpt taken from the website:
"Processing.js is the sister project of the popular Processing visual programming language, designed for the web. Processing.js makes your data visualizations, digital art, interactive animations, educational graphs, video games, etc. work using web standards and without any plug-ins. You write code using the Processing language, include it in your web page, and Processing.js does the rest. It's not magic, but almost."
http://processingjs.org/
http://processingjs.org/exhibition/
Processing Programming Language:
Cross-platform, open-source
https://www.processing.org/
Lazarus IDE (Pascal Programming): Cross-platform VisualBasic-like Programming platform
I'll admit, most of the programming I do involves small bash, awk, or python scripts. Though I do remember writing full programs with ease in VB5/6 in high school. After transitioning over to linux, I sought a VB-like platform that could simplify the production of GUIs and that would work across Windows, OSX, and linux OSes.
Free Pascal programming in the Lazarus IDE seems to satisfy all of the above requirements.
http://wiki.lazarus.freepascal.org/Screenshots
Free Pascal programming in the Lazarus IDE seems to satisfy all of the above requirements.
http://wiki.lazarus.freepascal.org/Screenshots
Subscribe to:
Posts (Atom)