compute.ns: Compute network spikes

View source: R/networkspikes.R

compute.nsR Documentation

Compute network spikes

Description

Compute the network spikes in an MEA recording, by averaging over all the electrodes in the array.

Usage

compute.ns(s, ns.T, ns.N, sur = 100, whichcells = NULL, plot = FALSE)

Arguments

s

MEA data structure

ns.T

Bin width (in seconds) for counting spikes.

ns.N

Threshold number of active electrodes required to make network spike.

sur

How many bins either side of peak to retain when computing the mean network spike (default 100 bins either side).

whichcells

An optional vector of electrode names.

plot

Set to TRUE to plot network spikes.

ns

A network spike data structure, returned by compute.ns

...

Other plot arguments to pass to show.ns

Details

To see the mean network spikes after they have computed, just look at the mean object.

If you wish to see the individual network spikes, try show.ns(ns, ...) where the remaining args are passed to the plot function.

Value

A list with the following elements:

counts

vector giving the number of active electrodes in each bin; this can be very long!

ns.N

The value of ns.N used.

ns.T

the value of ns.T used.

mean

The profile of the mean network spike (this is a time series object)

measures

If N network spikes were found, this is a matrix with N rows, one per network spike.

brief

A short vector summarizing the network spikes. n: number of spikes; peak.m, peak.sd: mean and sd of the peak height; durn.m, durn.sd: mean and sd of the duration of the network spike.

Author(s)

Stephen Eglen

References

Eytan and Marom (2006) J Neuroscience.

See Also

sanger.read.spikes

Examples

data.file <- system.file("examples", "TC89_DIV15_A.nexTimestamps",
                         package = "sjemea")
s <- sanger.read.spikes( data.file, beg=400, end=700)
s$ns <- compute.ns(s, ns.T=0.003, ns.N=10,sur=100)
plot(s$ns, ylab='Count', xlab='Time (s)')
plot(s$ns, xlim=c(450, 500),
     xlab='Time (s)', ylab='Count')

plot(s$ns$mean, xlab='Time (s)', ylab='Count', main='Mean NS')
summary(s$ns)
s$ns$brief
## show.ns(s$ns)  # This shows each network spike!  Can take a long time.

sje30/sjemea documentation built on May 21, 2024, 5:44 a.m.