Package 'motoRneuron'

Title: Analyzing Paired Neuron Discharge Times for Time-Domain Synchronization
Description: The temporal relationship between motor neurons can offer explanations for neural strategies. We combined functions to reduce neuron action potential discharge data and analyze it for short-term, time-domain synchronization. Even more so, motoRneuron combines most available methods for the determining cross correlation histogram peaks and most available indices for calculating synchronization into simple functions. See Nordstrom, Fuglevand, and Enoka (1992) <doi:10.1113/jphysiol.1992.sp019244> for a more thorough introduction.
Authors: Andrew Tweedell [aut, cre], Matthew Tenan [aut]
Maintainer: Andrew Tweedell <[email protected]>
License: GPL-2
Version: 1.0.0
Built: 2025-02-24 03:48:26 UTC
Source: https://github.com/tweedell/motorneuron

Help Index


Bin Recurrence Times

Description

Discretizes recurrence times vector into a data frame according to specified binwidth parameter. A recurrence time of "0" indicates two events happening simultaneously. The "0" bin is treated as the center.

Usage

bin(recurrences, binwidth = 0.001)

Arguments

recurrences

Numeric vector representing recurrence times.

binwidth

Numeric. Default = 0.001 (0.001 second or 1 ms). This must have the same significant digits as the recurrences parameter.

Value

data frame containing frequency data.

Examples

x <- c(0.035, 0.115, 0.183, 0.250, 0.306, 0.377, 0.455, 0.512, 0.577,
  0.656, 0.739, 0.821, 0.866, 0.950, 1.014, 1.085, 1.153, 1.213, 1.279,
  1.355, 1.431, 1.482, 1.551, 1.631, 1.692, 1.749, 1.832, 1.897, 1.964,
  2.106, 2.149, 2.229, 2.302, 2.384, 2.420, 2.505, 2.592, 2.644, 2.722,
  2.801, 2.870, 2.926, 3.011, 3.098, 2.030, 3.183, 3.252, 3.319, 3.395,
  3.469, 3.560, 3.589, 3.666, 3.744, 3.828, 3.876, 3.943, 4.020, 4.104)
  x <- sort(x)
  y <- sort(jitter(x))
  y <- round(y, digits = 3)
  z <- recurrence_intervals(x, y, order = 1)
  a <- unlist(z[10])
  b <- bin(a, binwidth = 0.001)

Determination of Motor Unit Synchronization from Cross Correlation Histograms using the Cumulative Sum Method

Description

Calculates the time-domain synchronization indices CIS, k', k'-1, S, E, SI (detailed below) between the two input motor unit discharge trains based on the cumulative sum method. Peak boundaries are determined as the bins associated with 10 minimum) of the cumulative sum. The peak is considered significant if its mean bin count exceeds the sum of the mean and 1.96 * standard deviation of the baseline bins (<= -60 ms and >= 60 ms). If no significant peak is detected, a default +/- 5 ms peak is used.

Usage

cumsum_mu_synch(motor_unit_1, motor_unit_2, order = 1, binwidth =
  0.001, get_data = T, plot = F)

Arguments

motor_unit_1, motor_unit_2

Numeric vectors of strictly increasing numbers denoting sequential discharge times of a motor unit or neuron or any strictly increasing point process.

order

Numeric as a positive integer for the number of forward and backward orders for calculating recurrence times. Default = 1.

binwidth

Numeric as a positive for the bin allocation size for computational histogram. Default = 0.001 or 1 ms.

get_data

T/F logical for outputting motor unit data. Default is TRUE.

plot

T/F logical for outputting the cross correlation histogram. Default is FALSE.

Value

A list of lists containing motor unit data (the names of each discharge train used, number of discharges, the interspike intervals (ISI), mean ISI, and the recurrence times associated with each order) and synchronization indices. #' CIS = frequency of synchronized discharges. k' = ratio of total discharges in peak to expected discharges in peak. k'-1 = ratio of synchronized discharges to expected discharges in peak. S = ratio of synchronized discharges to total number of discharges of both motor units. E = ratio of synchronized discharges to non-synchronized discharges. SI = ratio of synchronized discharges to reference motor unit discharges.

References

Keen, D.A., Chou, L., Nordstrom, M.A., Fuglevand, A.J. (2012) Short-term Synchrony in Diverse Motor Nuclei Presumed to Receive Different Extents of Direct Cortical Input. Journal of Neurophysiology 108: 3264-3275

Examples

x <- c(0.035, 0.115, 0.183, 0.250, 0.306, 0.377, 0.455, 0.512, 0.577,
  0.656, 0.739, 0.821, 0.866, 0.950, 1.014, 1.085, 1.153, 1.213, 1.279,
  1.355, 1.431, 1.482, 1.551, 1.631, 1.692, 1.749, 1.832, 1.897, 1.964,
  2.106, 2.149, 2.229, 2.302, 2.384, 2.420, 2.505, 2.592, 2.644, 2.722,
  2.801, 2.870, 2.926, 3.011, 3.098, 2.030, 3.183, 3.252, 3.319, 3.395,
  3.469, 3.560, 3.589, 3.666, 3.744, 3.828, 3.876, 3.943, 4.020, 4.104)
  x <- sort(x)
  y <- sort(jitter(x))
  y <- round(y, digits = 3)
  cumsum_mu_synch(x, y, order = 1, binwidth = 0.001, get_data = TRUE,
  plot = FALSE)

Motor unit time series

Description

Example time series of 2 motor units' discharges for the calculation of synchronization.

Usage

data(motor_unit_data)

Format

Data frame with 30,000 rows and 3 columns

Time

time in seconds

motor_unit_1

Binary indicator of discharge (1) or not (0)

motor_unit_2

Binary indicator of discharge (1) or not (0)


motoRneuron: A package for computing motor unit analyses

Description

The motoRneuron package provides functions for time-domain analyses of motor units.

About

The motoRneuron package was developed at the United States Army Research Laboratory.

Details

The motoRneuron package provides functions to compute time-domain synchronization between the two motor unit discharge trains. MotoRneuron's primary functions configure and assess the cross correlation histogram between motor unit discharge trains for a "peak". Peaks indicate more synchronized firing at that latency than would be expected due to chance. The magnitude of the peak is also thought to indicate the strength of common input between the motor units and is characterized by synchronization "indices", listed below. Three methods are available for assessing the peak in the histogram. Details of specific methods are documented in their respective help files. Motor unit characteristic data and interspike intervals are automatically output.

'Recurrence_intervals', 'bin', and 'plot_bins' are support functions used within the core functions, but can also be called separately for individual use. Recurrence_intervals() calculates recurrence intervals between two motor unit discharge trains. Bin() discretizes the recurrence intervals into user-specified bins. Plot_bins() leverages ggplot2 to plot the resulting histogram.

Methods for Peak Determination

Visual method - subjective analysis of normalized cumulative sum graph to determine peak location. (Nordstrom, Fuglevand, and Enoka, 1992)

Z-score method - a random uniform distribution is used to calculate a mean + 1.96 standard deviation threshold for the experimental cross correlation histogram. Any bins of the experimental histogram within +/- 10 ms of 0 that crossed the threshold are considered to be significantly greater than expected due to chance and subsequently used for analysis. (Defreitas, Beck, Xin, and Stock, 2013)

Cumulative Sum (cumsum) method - the cumulative sum of the bin count of the histogram is calculated. The peak boundaries are calculated as 10 the range (maximum minus minimum) of the cumulative sum. The peak is considered significant if its mean bin count exceeds the sum of the mean and 1.96 * standard deviation of the baseline bins (<= -60 ms and >= 60 ms). If no significant peak is detected, a default +/- 5 ms peak is used. (Keen, D.A., Chou, L., Nordstrom, M.A., Fuglevand, A.J., 2012)

Synchronization Indices

CIS = frequency of synchronized discharges. (Nordstrom, Fuglevand, and Enoka, 1992)

k' = ratio of synchronized discharges to expected discharges in peak. (Kamen & Roy, 2000)

k'-1 = ratio of extra synchronized discharges to expected discharges in peak. (Kamen & Roy, 2000)

S = ratio of synchronized discharges to total number of discharges of both motor units. (Nordstrom, Fuglevand, and Enoka, 1992)

E = ratio of synchronized discharges to non-synchronized discharges. (Datta & Stephens 1990)

SI = ratio of synchronized discharges to reference motor unit discharges. (Defreitas, Beck, Xin, and Stock, 2013)

Authors

Andrew Tweedell and Matthew Tenan, maintainer: Andrew Tweedell ([email protected])

References

Datta, A.K., & Stephens, J.A. (1990) Synchronization of Motor Unit Activity During Voluntary Contraction in Man. Journal of Physiology 422: 397-419

DeFreitas, J.M., Beck, T.W., Xin, Y., Stock, M.S. (2013) Synchronization of Low- and High-Threshold Motor Units. Muscle & Nerve DOI 10.1002/mus.23978

Kamen, G. & Roy, A. (2000) Motor Unit Synchronization in Young and Elderly Adults. European Journal of Applied Physiology. 81: 403-410

Keen, D.A., Chou, L., Nordstrom, M.A., Fuglevand, A.J. (2012) Short-term Synchrony in Diverse Motor Nuclei Presumed to Receive Different Extents of Direct Cortical Input. Journal of Neurophysiology 108: 3264-3275

Nordstrom, M.A., Fuglevand, A.J., Enoka, R.M. (1992) Estimating the Strength of Common Input to Human Motoneurons from the Cross-Correlogram. Journal of Physiology 453, pp. 547-574


Determination of Motor Unit Synchronization by Various Methods of Cross Correlation Histogram Examination

Description

Calculates the time-domain synchronization indices CIS, k', k'-1, S, E, SI (detailed below) between the two input motor unit discharge trains. One or more methods of peak determination can be chosen ("Visual", "Zscore", or "Cumsum"). Chosen method functions are called individually and detailed descriptions are documented in their respective help files. Motor unit characteristic data and interspike intervals are automatically output with mu_synch.

Usage

mu_synch(motor_unit_1, motor_unit_2, method = "Visual", order = 1,
  binwidth = 0.001, plot = F)

Arguments

motor_unit_1

Numeric vectors of strictly increasing numbers denoting sequential discharge times of a motor unit or neuron or any strictly increasing point process.

motor_unit_2

Numeric vectors of strictly increasing numbers denoting sequential discharge times of a motor unit or neuron or any strictly increasing point process.

method

Character vector indicating which methods of peak detection to use when quantifying synchronization. "Visual", "Zscore", and "Cumsum" are the options. Default is Visual.

order

Numeric as a positive integer for the number of forward and backward orders for calculating recurrence times. Default = 1.

binwidth

Numeric as a positive for the bin allocation size for histogram computation. Default = 0.001 or 1 ms.

plot

T/F logical for outputting the cross correlation histogram. Default is FALSE.

Value

A list of lists containing motor unit data (the names of each discharge train used, number of discharges, the interspike intervals (ISI), mean ISI, and the recurrence times associated with each order) and synchronization indices associated with chosen methods. CIS = frequency of synchronized discharges. k' = ratio of total discharges in peak to expected discharges in peak. k'-1 = ratio of synchronized discharges to expected discharges in peak. S = ratio of synchronized discharges to total number of discharges of both motor units. E = ratio of synchronized discharges to non-synchronized discharges. SI = ratio of synchronized discharges to reference motor unit discharges.

References

Keen, D.A., Chou, L., Nordstrom, M.A., Fuglevand, A.J. (2012) Short-term Synchrony in Diverse Motor Nuclei Presumed to Receive Different Extents of Direct Cortical Input. Journal of Neurophysiology 108: 3264-3275

Nordstrom, M.A., Fuglevand, A.J., Enoka, R.M. (1992) Estimating the Strength of Common Input to Human Motoneurons from the Cross-Correlogram. Journal of Physiology 453, pp. 547-574

DeFreitas, J.M., Beck, T.W., Xin, Y., Stock, M.S. (2013) Synchronization of Low- and High-Threshold Motor Units. Muscle & Nerve DOI 10.1002/mus.23978

See Also

visual_mu_synch, zscore_mu_synch, cumsum_mu_synch

Examples

x <- c(0.035, 0.115, 0.183, 0.250, 0.306, 0.377, 0.455, 0.512, 0.577,
  0.656, 0.739, 0.821, 0.866, 0.950, 1.014, 1.085, 1.153, 1.213, 1.279,
  1.355, 1.431, 1.482, 1.551, 1.631, 1.692, 1.749, 1.832, 1.897, 1.964,
  2.106, 2.149, 2.229, 2.302, 2.384, 2.420, 2.505, 2.592, 2.644, 2.722,
  2.801, 2.870, 2.926, 3.011, 3.098, 2.030, 3.183, 3.252, 3.319, 3.395,
  3.469, 3.560, 3.589, 3.666, 3.744, 3.828, 3.876, 3.943, 4.020, 4.104)
  x <- sort(x)
  y <- sort(jitter(x))
  y <- round(y, digits = 3)
  mu_synch(x, y, method = c("visual", "Zscore", "Cumsum"), order = 1,
  binwidth = 0.001, plot = FALSE)

Plot binned recurrence times as a histogram

Description

Takes data frame containing bins labels and frequency data to produce histogram.

Usage

plot_bins(binned_data)

Arguments

binned_data

data frame containing frequency data produced by bin().

Examples

x <- c(0.035, 0.115, 0.183, 0.250, 0.306, 0.377, 0.455, 0.512, 0.577,
  0.656, 0.739, 0.821, 0.866, 0.950, 1.014, 1.085, 1.153, 1.213, 1.279,
  1.355, 1.431, 1.482, 1.551, 1.631, 1.692, 1.749, 1.832, 1.897, 1.964,
  2.106, 2.149, 2.229, 2.302, 2.384, 2.420, 2.505, 2.592, 2.644, 2.722,
  2.801, 2.870, 2.926, 3.011, 3.098, 2.030, 3.183, 3.252, 3.319, 3.395,
  3.469, 3.560, 3.589, 3.666, 3.744, 3.828, 3.876, 3.943, 4.020, 4.104)
  x <- sort(x)
  y <- sort(jitter(x))
  y <- round(y, digits = 3)
  z <- recurrence_intervals(x, y, order = 1)
  a <- unlist(z[10])
  b <- bin(a, binwidth = 0.001)
  plot_bins(b)

Calculate Recurrence Intervals Between Motor Units or Neuron Discharge Trains

Description

Take two vectors representing time points of motor unit or neuron discharges and calculate multi-order recurrence times between them. This function will return recurrence times in whatever unit is input but will only accept numeric vectors (e.g. 0.01 sec, 25 ms, or 17.5 minutes).

Usage

recurrence_intervals(motor_unit_1, motor_unit_2, order = 1)

Arguments

motor_unit_1, motor_unit_2

Numeric vectors of strictly increasing numbers denoting sequential discharge times of a motor unit or neuron or any strictly increasing point process.

order

Numeric as a positive integer for the number of forward and backward orders for calculating recurrence times. Default = 1.

Value

A list of lists containing the names of each discharge train used, number of discharges, the interspike intervals (ISI), mean ISI, and the recurrence times associated with each order.

Examples

x <- c(0.035, 0.115, 0.183, 0.250, 0.306, 0.377, 0.455, 0.512, 0.577,
  0.656, 0.739, 0.821, 0.866, 0.950, 1.014, 1.085, 1.153, 1.213, 1.279,
  1.355, 1.431, 1.482, 1.551, 1.631, 1.692, 1.749, 1.832, 1.897, 1.964,
  2.106, 2.149, 2.229, 2.302, 2.384, 2.420, 2.505, 2.592, 2.644, 2.722,
  2.801, 2.870, 2.926, 3.011, 3.098, 2.030, 3.183, 3.252, 3.319, 3.395,
  3.469, 3.560, 3.589, 3.666, 3.744, 3.828, 3.876, 3.943, 4.020, 4.104)
  x <- sort(x)
  y <- sort(jitter(x))
  y <- round(y, digits = 3)
  z <- recurrence_intervals(x, y, order = 1)

Determination of Motor Unit Synchronization by Visual Inspection of Cross Correlation Histogram

Description

Calculates the time-domain synchronization indices CIS, k', k'-1, S, E, SI (detailed below) between two motor unit discharge trains based on a visual determination of peaks in the cumulative sum graph configured from the cross correlation histogram. Function calls dygraphs (allows zooming) to present the normalized cumulative sum. User is prompted to input the left and right boundaries (time points in seconds) of peak seen as a dramatic slope increase in the cumulative sum graph around 0. If no peak is detected, a default +/- 5 ms is used.

Dygraphs package is leveraged in this function to plot the cumulative sum graph in Rstudio's viewer. This allows for interactions within the graph, specifically zoom and unzoom.

Usage

visual_mu_synch(motor_unit_1, motor_unit_2, order = 1, binwidth =
 0.001, get_data = T, plot = F)

Arguments

motor_unit_1, motor_unit_2

Numeric vectors of strictly increasing numbers denoting sequential discharge times (in seconds) of a motor unit or neuron or any strictly increasing point process.

order

Numeric as a positive integer for the number of forward and backward orders for calculating recurrence times. Default = 1.

binwidth

Numeric as a positive for the bin allocation size for computational histogram. Default = 0.001 sec or 1 ms.

get_data

T/F logical for outputting motor unit data. Default is TRUE.

plot

T/F logical for outputting the cross correlation histogram. Default is FALSE.

Value

A list of lists containing motor unit data (the names of each discharge train used, number of discharges, the interspike intervals (ISI), mean ISI, and the recurrence times associated with each order) and synchronization indices. CIS = frequency of synchronized discharges. k' = ratio of total discharges in peak to expected discharges in peak. k'-1 = ratio of synchronized discharges to expected discharges in peak. S = ratio of synchronized discharges to total number of discharges of both motor units. E = ratio of synchronized discharges to non-synchronized discharges. SI = ratio of synchronized discharges to reference motor unit discharges.

References

Nordstrom, M.A., Fuglevand, A.J., Enoka, R.M. (1992) Estimating the Strength of Common Input to Human Motoneurons from the Cross-Correlogram. Journal of Physiology 453, pp. 547-574

Examples

x <- c(0.035, 0.115, 0.183, 0.250, 0.306, 0.377, 0.455, 0.512, 0.577,
  0.656, 0.739, 0.821, 0.866, 0.950, 1.014, 1.085, 1.153, 1.213, 1.279,
  1.355, 1.431, 1.482, 1.551, 1.631, 1.692, 1.749, 1.832, 1.897, 1.964,
  2.106, 2.149, 2.229, 2.302, 2.384, 2.420, 2.505, 2.592, 2.644, 2.722,
  2.801, 2.870, 2.926, 3.011, 3.098, 2.030, 3.183, 3.252, 3.319, 3.395,
  3.469, 3.560, 3.589, 3.666, 3.744, 3.828, 3.876, 3.943, 4.020, 4.104)
  x <- sort(x)
  y <- sort(jitter(x))
  y <- round(y, digits = 3)
  visual_mu_synch(x, y, order = 1, binwidth = 0.001, get_data = TRUE,
  plot = FALSE)

Determination of Motor Unit Synchronization from Cross Correlation Histograms using the Z-score Method

Description

Calculates the time-domain synchronization indices CIS, k', k'-1, S, E, SI (detailed below) between the two input motor unit discharge trains based on the z-score method. First, a random uniform distribution is used to calculate a mean + 1.96 * standard deviation threshold for the experimental cross correlation histogram. Any bins within +/- 10 ms of 0 that crosses the threshold are considered to be significantly greater than expected due to chance and subsequently used for analysis. If no peaks are detected, synchronization indices of 0 are returned. Because the z-score method tests each bin individually, peak bins are not necessarily adjacent. Therefore, peak duration and peak center are returned as NA.

Usage

zscore_mu_synch(motor_unit_1, motor_unit_2, order = 1, binwidth =
  0.001, get_data = T, plot = F)

Arguments

motor_unit_1, motor_unit_2

Numeric vectors of strictly increasing numbers denoting sequential discharge times of a motor unit or neuron or any strictly increasing point process.

order

Numeric as a positive integer for the number of forward and backward orders for calculating recurrence times. Default = 1.

binwidth

Numeric as a positive for the bin allocation size for computational histogram. Default = 0.001 or 1 ms.

get_data

T/F logical for outputting motor unit data. Default is TRUE.

plot

T/F logical for outputting the cross correlation histogram. Default is FALSE.

Value

A list of lists containing motor unit data (the names of each discharge train used, number of discharges, the interspike intervals (ISI), mean ISI, and the recurrence times associated with each order) and synchronization indices. CIS = frequency of synchronized discharges. k' = ratio of total discharges in peak to expected discharges in peak. k'-1 = ratio of synchronized discharges to expected discharges in peak. S = ratio of synchronized discharges to total number of discharges of both motor units. E = ratio of synchronized discharges to non-synchronized discharges. SI = ratio of synchronized discharges to reference motor unit discharges.

References

DeFreitas, J.M., Beck, T.W., Xin, Y., Stock, M.S. (2013) Synchronization of Low- and High-Threshold Motor Units. Muscle & Nerve DOI 10.1002/mus.23978

Examples

x <- c(0.035, 0.115, 0.183, 0.250, 0.306, 0.377, 0.455, 0.512, 0.577,
  0.656, 0.739, 0.821, 0.866, 0.950, 1.014, 1.085, 1.153, 1.213, 1.279,
  1.355, 1.431, 1.482, 1.551, 1.631, 1.692, 1.749, 1.832, 1.897, 1.964,
  2.106, 2.149, 2.229, 2.302, 2.384, 2.420, 2.505, 2.592, 2.644, 2.722,
  2.801, 2.870, 2.926, 3.011, 3.098, 2.030, 3.183, 3.252, 3.319, 3.395,
  3.469, 3.560, 3.589, 3.666, 3.744, 3.828, 3.876, 3.943, 4.020, 4.104)
  x <- sort(x)
  y <- sort(jitter(x))
  y <- round(y, digits = 3)
  zscore_mu_synch(x, y, order = 1, binwidth = 0.001, get_data = TRUE,
  plot = FALSE)