htbGetHis: Creator for htbHis object

View source: R/htbGetHis.R

htbGetHisR Documentation

Creator for htbHis object

Description

Creates htbHis object from htbRas objects.

Usage

htbGetHis(ras, xlim = NULL, bin = 200, sep = 10)

Arguments

ras

An htbRas object of spike type. You can provide a list of htbRas objects simultaneously, each of whose element is then used for histogram creation. In this case, htbGetHis() returns a list of htbHis objects (instead of an htbHis object).

xlim

A pair of numerics. The range c(from, to) of time to calculate histograms. When omitted (default), the range of the original htbRas object (used in splicing spike sequence during alignment by htbGetRas()) was inherited.

bin

A numeric. The temporal width of the sliding window to calculate a histogram.

sep

A numeric. The width of a step of the sliding window.

Details

In examining neural activities, creating a histogram is one of the most elementary starting points. A histogram visualizes the transition of instantaneous firing rates of a neuron, calculated by sequential averaging of number of spikes with a sliding window of arbitrary width and steps. For this, you need multiple lines of spike sequence (normaly the trials in the task) aligned at a time of certain external event. Therefore, the source of a histogram is naturally the data used to create a rastergram, i.e., htbRas object in htb package. htbGetHis() does this transformation for a set of spike sequences packed as an htbRas object. Result is returned as a specialized list named htbHis object, containing a series of temporally smoothed firing rates composed of the same set of task conditions with the source htbRas object.

The major parameter of a histogram is the width and steps of the sliding window for averaging. These parameters are designated by bin and sep arguments, respectively. If you use the same value (e.g., 100) for both bin and sep, it means that averaging windows adjoin each other without overlaps. This is suitable for traditional histograms that look like a lined skyscraper of buildings. If you use small sep compared with bin, it means that the sliding window moves in a smaller stride. The windows overlap each other, but multiple usage (counting) of the same spikes by neighboring windows does not matter since the spike counts are anyway divided by the time width of the window. Thus, this setting simply results in a smoothed version of traditional histogram. If you set larger value for sep than bin, the windows get spaces in between. This result in ignoring your precious spikes falled into these spaces, and thus is normally no use.

Value

An htbHis object.

Examples

alignment <- list(CUEON_L = c(-1500, 2000), CUEON_R = c(-1500, 2000))
incld <- list(TRIALSTART = c(-2000, 0), TRIALEND = c(0, 2000))
excld <- list(ERROR = c(0, 2000))

## Not run: 
db_sp <- htbGetDb("spike.htb")
db_ev <- htbGetDb("event.htb")
ras <- htbGetRas(db_sp, db_ev, alignment,
  incld = incld, excld = excld)
his <- htbGetHis(ras)

## End(Not run)


keimochizuki/htb documentation built on June 9, 2025, 10:03 p.m.