Learn R Programming

kronos (version 1.0.0)

fw_kronos: Fit a cosinor model and extract relevant parameters on a feature table.

Description

This wrapper applies kronos(), the main workhorse function in the 'kronos' package. It manages the individual functionalities of 'kronos', including rhythmicity analysis and differential rhythmicity.

Usage

fw_kronos(
  x,
  formula,
  metadata,
  time = NULL,
  period = 24,
  verbose = FALSE,
  pairwise = FALSE
)

Value

A list of kronosOut S4 objects containing coefficients and all operations.

Arguments

x

Input data. A table with rows being features and columns being samples

formula

A formula. Use the time function to designate which variable represents time. Leave the left-hand side of the formula empty as it will be sequentially replaced by every feature in the table.

metadata

A metadata table, with rows being samples and columns being metadata entries

time

A string. Should be the column name containing the time values.

period

A numeric. The length of a period, in the same format as the time parameter.

verbose

A boolean. Toggles whether to print diagnostic information while running. Useful for debugging errors on large datasets.

pairwise

A boolean. Toggles whether to perform pairwise ANOVAs as a TukeyHSD-like post-hoc.

Examples

Run this code
#Load prepared data stored in 'kronos' library
data("kronos_demo")
output <- kronos(formula = Variable_1 ~ time(Timepoint), 
data = onevariable, period = 24, verbose = TRUE, pairwise = FALSE)

#Extracting data from the output object:
getKronos_fit(output)
getKronos_trace(output)
getKronos_groupwise(output)

#Plotting:
gg_kronos_circle(output)
gg_kronos_sinusoid(output)

#For high-dimensional data, use fw_kronos:
out_list = fw_kronos(x = bigdata[1:50,], formula = ~ Group + time(Timepoint), 
metadata = bigmeta, period = 24, verbose = FALSE, pairwise = TRUE) 

#Extracting data from the output object: 
kronosListToTable(out_list)


#Plotting:
gg_kronos_acrogram(out_list)

Run the code above in your browser using DataLab