mixedcirc_compare: Compares circadian rhythm

mixedcirc_compareR Documentation

Compares circadian rhythm

Usage

mixedcirc_compare(
  x,
  y,
  cor_type = c("standard", "crosscorrelation")[2],
  type = c("original", "fitted", "simulate")[1],
  merge_groups = FALSE,
  period = 24,
  lag.max = NULL,
  level = 0.95,
  B = 1000,
  xlab = "x",
  ylab = "y",
  min_time = NULL,
  max_time = NULL
)

Arguments

x

A class of mixedcirc_fit

y

A class of mixedcirc_fit

cor_type

It can be one of "standard" or "crosscorrelation". Default:crosscorrelation See details.

type

It can be one of "original", "fitted", "simulate". original: original data will used. fitted values will be used. simulate: data will be simulated based on the models and will be used to do cross correlation. Default: original

merge_groups

If TRUE, for multi-group experiments, groups are NOT correlated separately. Default: FALSE

period

The rhythm period. Default: 24

lag.max

maximum lag at which to calculate the cross-correlation. Will be automatically limited as in ccf. Default: NULL

level

confidence level, from 0 to 1. Default is 0.95, that is, 95

\item

min_timeMinimum time span to do the prediction. If NULL, it will be taken from the fit. Default: NULL

\item

max_timeMaximum time span to do the prediction. If NULL, it will be taken from the fit. Default: NULL

\item

numberof bootstrap simulations to obtain empirical critical values. Default is 1000.

A list containing: A ggplot object. A statistical components of standard and cross correlation. This functions compare two circadian rhythm fitted using mixedcirc_detect function using standard or cross-correlation. cor_type

One can doe standard and cross correlation between two series. In standard mode, we fit a model of y~x and calculate r-squared (marginal r-squared in case of repeated measures). The correlation is then simply assumed to be sign of coeffect of X * sqrt(r-squared)

This is a typical cross-correlation. In case of repeated measures specially the p-values cannot be trusted.

In case of RRBS, the data is assumed to be log2. The M-values are calculated as Mathylated-Unmethylated. In any case, the data in x and y will be matched using all the columns in the exp_design (except the measurement) data("circa_data")

results<-mixedcirc_detect(data_input = circa_data$data_matrix, time = circa_data$time,group = circa_data$group,id = circa_data$id,period = 24,verbose = TRUE) mixedcirc_compare(results[1],results[2])


PayamEmami/mixedcirc documentation built on Jan. 15, 2025, 5:36 p.m.