基于Python
题目要求
In this assignment, you will analyse real data recorded from four hippocampal neurons while rat was running in a maze. The experiment is described in the following paper:
Matthew W. Jones & Matthew A. Wilson (2005) Theta rhythms coordinate hippocampal-prefrontal interactions in a spatial memory task. PLoS Biology, 3, 2187-2199.
It will be important for you to know the shape of the environment in which the rats were running, and it will be helpful to understand the task. Hence could please read at least the first paragraph of section 'Behaviour' on page 2188, and look at Figure 1.
The data describe the position of a rat and the firing times of the hippocampal neurons. The file contains the following matrices:
- time - time when the position of the rat was measured, in units 1/10000 second
- x and y - the position of the rat in the above moments of time
- neuron1, neuron2, neuron3 and neuron 4 - times when the four neurons fired spikes
简单说就是老鼠在迷宫里走,然后把海马前额叶的四个神经元每次Fire的时间都记录下来,每次Fire的空间位置也记录下来,然后对数据进行分析。文章链接和data根据要求我就不发在这里了,有想要进一步研究的同学可以私信我。
思路
现在已知的信息就是时间(单位:1/10000 sec),在这些时间点老鼠的位置,被测量的四个神经元的动作电位的时间。
时间的数据比较诡异,看来一下不是等间隔,不过没关系,一会再管他。这个是前几个时间点的例子。
Time (μs) |
---|
31977674 |
31978007 |
31979341 |
31978674 |
31979008 |
让我们先来plot出一下所有发生动作电位的位置,然后和paper中的maze对比一下。先读取数据。
# for loading x and y
fx = open("x.csv")
neuron_x = map( lambda x: float(x.strip()), fx.readlines() )
fy= open("y.csv")
neuron_y = map( lambda y: float(y.strip()), fy.readlines() )
这里使用了map(),注意,python 3.0中要在map前使用list()函数转换数据类型。
import matplotlib.pyplot as plt
# plot in 2D scattering plot.
plt.scatter(neuron_x, neuron_y,s=0.1, marker='o')
plt.xlabel('x')
plt.ylabel('y')
plt.title('Positions')
plt.show()
然后plot出散点图

这里可以看出老鼠的行动的大致轨迹,我们对比论文中的maza形状,可以知道这是正确的。

然后让我们回去看看问题。
- Generate plots showing positions in which each neuron fired.
- Plot auto-correlograms of neurons
- Plot cross-correlograms of pairs of neurons
- Calculate firing rates of each neuron (in each 1 second interval), and plot histograms of the firing rates
- *See how much information firing rates of individual neurons encode about being in a particular part of a maze, e.g. divide the maze in half, and calculate d' for each neuron
Please note that idea with * is difficult. Please do not limit yourself to these ideas - and feel free to try other analyses.
剩下的问题将在(二)中继续讨论。
网友评论