So with Teds help, I've got a lovely interneuron network making 40Hz oscillations. Now I'm planning on doing cruel things to it, and seeing what that does to the quality of the oscillations. I'm only used to the slice arena, where you'd use a spike triggered averaged from cell 1 to cell 2 to measure how strong the oscillation is.
However, in a large scale network, there must be a better way to measure synchrony. Does anyone know of one?
--EDIT--
This is one I came up with. It varies from -1 for a completely random network, to 1, for a completely synchronous (all cells fire within 1ms of eachother) network. I'd love to know if people thought this was a robust metric or not. It would require some slight modification if you were dealing with networks of hetrogenous cells, but otherwise it seems quite good.
Code: Select all
// Assume you have a network of cells ncells long
// You the data for when cell i fires it jth action potential in the 2D array AP_cell_num[i][j]
// You have the number of action potentials cell j fires during the simulation in the vector forcellAPnum.x(j)
// For ever action potential, you compare it to the temporally nearest action potential in every other cell
// If the action potential you compare to is within 1ms you add 1 to the system score
// if the compared action potential is not within 1ms you subtract 1 from the system score
// (you exclude the 1st and last action potential from each cell because you can not know whether the other action potentials are the nearest
// without an action potential before and after each event to compare it to)
// You divide the system score by the number of spikes in the network (-2 because you loose the first and last events)
// Finally you devide that by (ncells*ncells-ncells) as I believe this is the number of possible comparisons (you never compare a cell to itself).
systemScore=0
for n=0, ncells-1 {
for i=0, forcellAPnum.x(n)-1 {
for m=0, ncells-1 {
for j=0, forcellAPnum.x(m)-1 {
if (n!=m) {
matchingAP=AP_cell_num[n][i]
previousAP=AP_cell_num[m][j-1]
thisAP=AP_cell_num[m][j]
nextAP=AP_cell_num[m][j+1]
lagtopreviousAP=abs(matchingAP-previousAP)
lagtothisAP=abs(matchingAP-thisAP)
lagtonextAP=abs(matchingAP-nextAP)
if(j-1>=0 && nextAP!=0) { //ignore the first and last events
if(lagtopreviousAP>lagtothisAP && lagtonextAP>lagtothisAP) { //if the event in the other cell is the closest to this one
if(matchingAP-thisAP>-1 && matchingAP-thisAP<=0) { //is it within 1msec of the matchingAP
systemScore+=1
} else {
systemScore-=1
}
j = forcellAPnum.x(m)-1 // once the nearest AP is compared, skip to next AP
}
}
}
}
}
}
}
APpercells=0
for i = 0, ncells-1 {
APpercells += forcellAPnum.x(i)
}
APpercells/=ncells
print "Average action potentials per cell = ", APpercells
print "Synch score = ", (systemScore/(APpercells-2))/(ncells*ncells-ncells)