Hodgkin and Huxley's giant squid axon model

I deeply regret that I must begin this post by informing you that the entity in question is a giant axon from a squid, and not an axon from a giant squid. I can only imagine your disappointment on learning this fact - I recall that mine was considerable.

The models of heart cells that I'm working on at the moment are all based off a mathematical model from way back in 1952, created by Alan Hodgkin and Andrew Huxley. They described the electrical signal that passes down the axon of a squid's nerve cell when it is excited. The axon that controls the water jet propulsion system of a squid is particularly large, and easy to use in experiments.

The basis of this mathematical model is an understanding of the cellular features as components in an electrical circuit.* Just like in heart cells, the electrical signal is caused by the movement of charged particles, called ions, across the cell's outer membrane. The membrane of a neural cell acts like a capacitor, which means that ions accumulate on one side of the membrane, allowing it to store charge. This makes one side of the membrane more positive than the other side, leading to a voltage across the membrane.

This graph shows how the voltage across the membrane changes when the cell is stimulated.

An electrical impulse in an axon

The flow of ions across the membrane acts as an electrical current. Three types of ionic current are considered in this model: the sodium () ions that flow into the cell and cause depolarisation of the membrane, the potassium () ions that flow out to repolarise the membrane, and the "leak" current (a mixture of ions, including chloride ions), which flows in both directions.

Circuit description of nerve cell

The electrochemical gradients that power the flow of each type of ion are modelled as batteries, and the ion channels that permit ions to pass are represented by variable resistors.

is the stimulus current that the cell receives from outside.
and are the sodium, potassium and leak currents, respectively.
is the capacitance of the membrane (i.e. its ability to store charge)
is the membrane voltage
and are the resistance of the membrane to letting each type of ion through
and are the membrane potentials at which the flow of sodium, potassium or leak ions (respectively) through the membrane is zero.

Since the current across the capacitor depends on the change in voltage over time and on the capacitance (), and the four components of the current (that are wired in parallel) all add up to the stimulus current (), a unifying differential equation can be created.

Where , i.e. the difference between the current membrane voltage and the usual, or "resting" voltage.

The next part of the paper deals with the gating mechanisms for the ion flows. My plan is to tackle that next week!

The original paper is available free from PubMed Central here. There's also a very good description of its content on Wikipedia, and an illustrated XML version of the model at the CellML model repository.

I put together some MATLAB code to solve the equations described in the paper - you can download and view or run the source code here.

One of the most interesting features of this paper are its descriptions of a possible mechanistic basis for the permeability of the cell membrane to ions. This paper was written long before ion channels were discovered and characterised in mammalian cells, so it's amazing how accurately it describes the action of the nerve cell. (A very readable account of the history of ion channels is available on Montana State University's webpage here, incidentally).

* which I'm sure is a helpful explanatory device for people who have the foggiest concept of how electricity works. I am not one of these people. I've relied on some A-level revision websites and my various physicist chums/siblings for that.

...

HP Deskjet F380 + Debian Linux

Scanned image

Linux printing is supposed to be difficult, right? This took about 10 minutes total. I almost feel cheated.

These two terminal commands:

$> sudo aptitude install cups cups-client simple-scan hplip system-config-printer
$> hp-setup

Literally all it took. The printer appeared in LibreOffice and worked a treat, and the scanner scanned without so much as a peep.

I have to admit, it took me significantly longer to work out how to put the paper in.

...

Installing & Tweaking CyanogenMod 7 on a Samsung Galaxy Ace from Debian

Or: How I Broke My Phone And Then Fixed It Again

I will preface this by saying that I did a terrible job backing up my contacts, text messages, apps and phone settings before I tried to re-flash my phone. Don't do that. It's a pain.

I have a shiny phone, called a Samsung Galaxy Ace, and it runs a well-known version of Linux called Android (please stop me if I'm patronising you). I feel very lucky to carry around such a fancy little computer in my pocket all the time. My favourite free apps that I've found are MIUI music player, Dolphin internet browser, and F-droid, which is a repository of free and open source software for Android phones. The only app I have actually paid money for is Cogs, which is a completely amazing steampunk puzzle game.

The version of Android that my phone came installed with was some bizarre combination of what Samsung and Orange thought that I would enjoy, which disabled quite a few of the phone's more interesting features. The nice thing about these phones, however, is that you can install different operating systems on them. I chose CyanogenMod mainly because I had heard of it. Here is a walkthrough of CyanogenMod 7 if you are curious about what it looks like.

I followed the phone-specific instructions on this website for installation. Before following the instructions, please remember to back up anything important using your phone's native features and also in a second way. I used Titanium Backup, which didn't work well at all for me. Pick something else.

In brief, the version of CyanogenMod for the Galaxy Ace is codenamed "cooper". You can read about it on the CyanogenMod wiki, and download it from here. Incidentally, installing it on your phone is terrifying and I really don't recommend doing it while hung over on December 29th.

I, rather cleverly, managed to lose all my contacts thanks to my aforementioned failure to back them up properly. Fortunately, Orange kept a backup for me (if you are with Orange, yours are downloadable from here). It's an odd list of old and new contacts, which you can export in comma separated value (csv) format. I went through and pruned out a couple of ex-boyfriends and all the empty columns. I ended up with a csv file that looked like this:

Other Phone,Mobile Phone,First Name,Last Name
01xxxxxxxxx, 07xxxxxxxxx, Joe, Bloggs

There's probably an easier way to put them back onto your phone via an app, but I decided to try and convert them to VCard format so I could import them directly. I wrote a python program to do this that you can download: csvtovcard.py. If you put the program in the same folder as a csv file (formatted as above) called "Contacts.csv" and run the program, it should output a file called Contacts.vcf which contains all your contacts. The main thing I learned from this is that putting spaces at the end of lines really, really breaks VCards.

So, I had my contacts back. I also tried restoring all my apps from Titanium Backup. Don't do that. I ended up in a situation whereby I had CyanogenMod installed, with several bits broken (including wifi and email), and I needed to re-install to see if I could fix it. I didn't get around to this until 3 months after installation, by which point I had lots of text messages from my loved ones that I wanted to keep hold of.

It turns out all text messages are kept on an SQLite database on the phone. It's in a protected area that isn't mounted when you connect your phone by to your computer via USB. You can find out where it's kept by typing the following commands in a terminal emulator on a rooted phone:

su
find | grep -i mmssms

When you find mmssms.db, you can copy it over to your computer using the USB android debug bridge (ADB). It's available for various operating systems, but you can download it for Debian as a package from here. After installing ADB, type:

abd pull /path/to/file ./

There are probably all kinds of clever things you can do to restore your text messages, but I just wanted to look at them, so I installed sqlitebrowser from the repositories and open up the file occasionally to remind myself how funny and lovely all my friends are.

The moral of this story is: try not to break things - and if you do, try to fix them afterwards.

...