rtay.io/rat graphing

For my final computing assignment in year 11 (2016) we were given a handful of datasets and told to create tools to visualise them.

I think some of the datasets were related to sleep patterns, but I chose the dataset on neuronal activity in rat brains, specifically related to the sensory neurons associated with whiskers.

This visualisation tool was created to assist certain research projects done by the Department of Physiology at Monash University. I'm not sure if I can link to the notes since some of the research is still ongoing, but I'm happy to fully explain everything as I go.

The visually appealing image above is a map of the neuron activity which occurs after the whiskers of a rodent are stimulated. Since the whiskers are their primary sensory modality and we can easily trace each whiskers' sensory signal back to a specific layer and column in the cortex, it makes sense to use this to better understand the neuronal responses to sensory stimuli. There's some in-depth slides at the bottom of the page.

That's as much as I understand behind the core concept, I wouldn't be surprised if there are a few mistakes in there. Also, sorry if I lost anybody for a moment there. Basically, they're looking at how the rat brains respond to the whiskers being moved, and using that to further understand how senses work in brains.

The horizontal axis of the graph is time (ms), and the vertical axis is the amplitude - which is pretty much how far/fast the whsikers were moved. Each row is a set of many tests, and has its own amplitude.

The black dots are neuron responses (every time a signal is sent from a neuron it makes a little pop) which occur at specific times after the whisker is stimulated, which is what detemines their horizontal position from 0 to 50 milliseconds.

Oh and the colourful clouds behind the dots just represent a heatmap of the dots themselves. I figure it's useful for representing density and quickly demonstrates the general shape and any patterns in the data. The colourmap is from Matplotlib.

So this tool which I've made allows you to input any of these very specifically structured data files (trust me it's bad in there), extracts the useful information, performs lots of processing to make the sequences of numbers useful, and then spits out a graph for each dataset.

I'm doing the majority of the processing using python and numpy, and then plotting it with bokeh. I felt a bit restricted with matplotlib, and initially moved to plotly because it seemed to fit all of my needs. Unfortunately, I was unable to layer the scatter plot and heatmap plot over eachother using plotly. I also had issues with the plots getting very laggy when displaying a large dataset, which is why I moved over to bokeh.

Different tools can be used for different purposes, and I found that plotly was geared more towards businesses and analytics rather than datascience or big data, which is why I made the move.

From here, I wanted to make this python tool as easy and quick as possible to use, so I created a website which allows you to upload the data files and processes them for you. It's a little bit black box, sure, but it really makes the whole thing a lot easier for the researchers.

Any number of files can be uploaded (within reason), and it plots them out nicely in a table, making it easy to deal with all the data in a dataset at once.

And while I can't link to the site itself, I've uploaded some examples to this site which I created as I was making this tool. They're a little bit outdated compared to the most recent versions, and perhaps even a bit broken, but should give you a good idea of the sort of interactability that the researchers have once they've processed the data.


So that about sums up the work I did for these guys. I'd love to go into more detail about what exactly the data is being used for or the sort of information they're getting from analysing it. Unfortunately, this is just a tool I made to assist in the research they're performing at Monash. If I ever get around to analysing some crazy datasets myself though, I'll be sure to write about those.

I've linked below some of the things I mentioned in this post in case you want to go back and have a look at them. Oh and there's also some slides which briefly discuss some of the more sciencey things I mentioned here if you'd like to look at them. They're fairly useless without a thorough understanding of rat physiology and neuroscience, and also because they're missing the context of speech to assist with the slides. Might be interesting to some of you out there though.

If you've made it this far, congratulations. I hope you have an awesome day!

Important links:

Switch to dark mode

A neurotic visualisation by @rtaylz