This function computes differences in rhythmicity between fitted curves for a given pair of conditions. Register a parallel backend to minimize runtime, e.g., using doParallel::registerDoParallel().

getDiffRhythmStats(fit, rhyStats, condLevels)

Arguments

fit

A limorhyde2 object containing data from multiple conditions.

rhyStats

A data.table of rhythmic statistics, as returned by getRhythmStats(), for fitted models in fit.

condLevels

A character vector indicating the two conditions to compare. Differences will be returned as the value for condLevels[2] minus the value for condLevels[1].

Value

A data.table containing the following differentially rhythmic statistics:

  • diff_mean_value

  • diff_peak_trough_amp

  • diff_rms_amp

  • diff_peak_phase: circular difference between -fit$period/2 and fit$period/2

  • diff_trough_phase: circular difference between -fit$period/2 and fit$period/2

  • rms_diff_rhy: root mean square difference in mean-centered fitted curves

The rows of the data.table depend on the 'fitType' attribute of rhyStats:

  • 'fitType' is 'posterior_mean' or 'raw': one row per feature.

  • 'fitType' is 'posterior_samples': one row per feature per posterior sample.

See also