Pathos, Ethos, Logos, Porthos, Athos, Aramis.


Title page of presentation

I gave a presentation yesterday to the Cardiac group here at Oxford about my summer project and my plans for my PhD. It was, quite frankly, terrifying, which is fairly typical of all the presentations to group meetings that I've ever given. Talking to people who are experts in your subject about what you're doing is quite a nerve-wracking experience, no matter how prepared you feel you are.

Nonetheless, it was a really good opportunity to get feedback and advice on my results and on my next steps. I have been a bit concerned that because my simulations involve changing ionic channel conductances to up to 50x their usual level, my results wouldn't be physiologically relevant. Blanca brought up the point that a healthy heart isn't likely to have an arrhythmia, so ion channels that aren't operating outside normal limits aren't particularly relevant to my research.

The next time I present my research plan (which will be in 2 weeks' time at my pre-PhD viva) I think I'll include a flow chart of the process, because most of the questions asked afterwards were along the lines of "Sorry, what?", which is non-optimal. I'm also determined to start using LaTeX for my slides - LibreOffice, while wonderful, refuses to display .eps images, for some reason. I'd like to be able to send data from my simulations straight through my Matlab scripts and into a presentation, without tedious faffing with the Gimp or ImageMagick and trying to avoid horrible pixellation.

I included appendices after the main presentation to answer questions that people might ask, which was an idea I stole off one of the students in the Computational Biology group. Nobody did ask the questions, in the end, but it was nice to have the extra information there just in case.

The one question I wasn't prepared for was "Why did you choose these particular models?" I chose them because they have been reported in the literature to show both DADs and EADs, but when I was asked the question I froze and stammered something about those models being the ones that didn't break my program (which is also true, but less relevant). That wouldn't have been appropriate for an appendix, but I'll make sure to write it on my cue cards the next time, so I have the information at my fingertips and don't have to rely on my memory — which is a notorious cad and bounder, and often deserts me at a moment's notice.

You can download my presentation from here if you are particularly interested.

...

Detecting afterdepolarisations - C++ version

I've spent the last few weeks (amongst other things) implementing my afterdepolarisations script in C++ within the Chaste framework. Here's some of my code broken down into sections and explained.

#include "DetectAfterDepolarisations.hpp"
#include <fstream>

bool DetectAfterDepolarisations::FindAD(std::vector<double> voltage, std::vector<double> simtimes,
    double end_time, double stim_start, double stim_period, double lowlimit, double highlimit)
{
This function takes as inputs: a vector containing the voltage trace for every time point, a vector of all the times, the end time of the simulation, the time at which the stimulus starts, the period of the stimulus, and the two boundary values for detection. It will output either "true", if there is an afterdepolarisation, or "false", if not.
    /* detect depolarisations*/
    std::vector<double> differences;
    std::vector<double> adtimes;
    for (unsigned int a=0; a < voltage.size()-1; a++)
    {
        /* list of voltage change at each time point*/
        differences.push_back(voltage[a+1]-voltage[a]);
        /* if the voltage is going up... */
        if (differences[a] > 0.1)
            /* store the time */
            adtimes.push_back(simtimes[a]);
    }

The way this works isn't desperately clever: it takes each point on the graph and subtracts it from the one after it, giving the gradient between each point. For all the positive changes in voltage (arbitrarily those over 0.1 mV), it keeps a note of the time.

    /* erase depolarisations provoked by stimulus */
    for (double e = stim_start; e < end_time; e=e+stim_period)
    {

        for (unsigned int f=0; f<adtimes.size(); f++)
        {

            if (adtimes[f] > e-lowlimit && adtimes[f] < e+highlimit)
            {

                adtimes.erase(adtimes.begin()+f);
                f--;
            }
        }

    }

These awkwardly nested loops check all of the depolarisation times and remove any that coincide with the stimulus. This means that the program finds only afterdepolarisations and not the ones we'd expect to be there. Lowlimit and highlimit can be changed for models with different lengths of action potential.


    /* find times when the AD starts */
    std::vector<double> diffadtimes;

    /* iterate through list of voltage upswing times*/

    if (adtimes.size()!=0)
    {
        for (unsigned int b=0; b < adtimes.size()-2; b++)
        {
            /* make a list of the differences */
            diffadtimes.push_back(adtimes[b+1]-adtimes[b]);
        }

    std::vector<double> adstarts;

    /* find minimum time difference */
    std::vector<double>::iterator step = std::min_element(diffadtimes.begin(),diffadtimes.end());
    double minsteps = *step;

    for (unsigned int d=0; d< diffadtimes.size(); d++)
    {

        /* find all points in diff(adtimes) that change more than the minimum*/
        if (diffadtimes[d] > minsteps + 0.0001 )
        {
            /* store times */
            adstarts.push_back(adtimes[d+2]);
            /*                std::cout << adtimes[d+2] << "\n";*/
        }
    }

This block of code is concerned with finding the start of each afterdepolarisation. Simply put, it looks for discontinuities in the list of times, and stores them.


    std::ofstream outputfile;
    outputfile.open("/auto/users/bethmc/Data/LatestADs.dat");
    outputfile << "Time(s) membrane_voltage(mV) AD\n";
    for (unsigned int d=0; d < voltage.size(); d++)
    {
        outputfile << simtimes[d] << " " << voltage[d] << " ";

        /*output 1 if AD, 0 if not */
        bool found = 0;
        for (unsigned int e=0; e < adtimes.size(); e++)
        {
            if (simtimes[d] == adtimes[e])
            {
                found = 1;
                break;
            }
        }
        outputfile << found;

        outputfile << "\n";
    }

The output file contains columns of the time, the voltage, and whether or not an afterdepolarisation has been detected at that point.


    if (adstarts.size()>0)
    {
        return 1;
    }
    }
    return 0;
}

This function is called by other programs and used to find thresholds for interventions that cause afterdepolarisations. Hopefully, this code will be useful for finding out whether a drug that affects a particular ion channel in the heart will cause an arrhythmia.

...

Drug induced pro-arrhythmic risk via afterdepolarisations

If you mess around with the ion currents in and out of a heart cell enough, you can perturb things so badly that you cause the cell membrane to depolarise again prematurely. These "afterdepolarisations" happen all the time in vivo, and aren't usually a big deal; unless a lot of cells do it all together, the effect is too diluted to cause an arrhythmia. However, if enough cells do it together, or if you combine afterdepolarisations with other heart problems, they can cause someone to drop down dead instantly.

There are two ways that these afterdepolarisations can present in a single cell. The cell can depolarise before it's finished repolarising, in which case it's termed an "early afterdepolarisation" and it looks like this:

Early afterdepolarisationThe EAD begins at around 0.3 seconds.

Or it can happen after the cell has repolarised - a "delayed afterdepolarisation". This is always accompanied by calcium release from the sarcoplasmic reticulum.

Delayed afterdepolarisationThe DAD begins at around 2 seconds. The sarcoplasmic reticulum calcium release current is labelled as .

Drugs that make either type of afterdepolarisation more likely could make arrhythmias more likely. For my project this summer I'm writing some code to combine information from drug tests on single ion channels with heart models to predict EADs and DADs. The hope is that this software could better predict cardiac side-effects from new drugs, and maybe even replace some tests that are currently done on animal tissue.

This week, I wrote a review of the literature around this topic, as well as a MATLAB program to take data from single cell models and detect afterdepolarisations. If you like, you can download the AD detection program, as well as my report and the LaTeX file that made it.

...