TimeCycle: Main TimeCycle Function

Description Usage Arguments Value References Examples

View source: R/TimeCycle.R

Description

Main function of the TimeCycle package used for detecting rhythmic signals in time-series gene expression sets. For additional help with parameter selection, see TimeCycle's vignette: vignette("TimeCycle").

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
TimeCycle(
  data,
  repLabel,
  resamplings = 10000,
  minLag = 2,
  maxLag = 5,
  period = 24,
  cores = parallel::detectCores() - 2,
  laplacian = T,
  linearTrend = F
)

Arguments

data

a data.frame of numeric gene expression over time (row = genes x col = ZT times).

repLabel

a vector defining the number of replicates at each time points.

resamplings

a numeric specifying the number of resamplings to use in the null-distribution. Default is 10000.

minLag

a numeric specifying the min lag to check in the 3-D embedding. Default is 2.

maxLag

a numeric specifying the max lag to check in the 3-D embedding. Default is 5.

period

a numeric specifying the period of interest in hours for rhythm detection. Default is 24.

cores

a numeric specifying the number of parallel cores to use. Default number of cores is parallel::detectedCores() - 2.

laplacian

a logical scalar. Should the Laplacian Eigenmaps be used for dimensionality reduction? Default TRUE

linearTrend

a logical scalar. Should TimeCycle Prioritize detecting linear trending signals? Default FALSE. Not recommended to change from default FALSE - will increases false positives rate. See vignette("TimeCycle") for more details.

Value

a tidy data.frame of processed results for each gene:

sampleName perScore pVals pVals.adj Period.in.Hours Amp Phase.In.Hours
the gene name the median persistence score across all lags (min to max) raw empirical p-value FDR adjusted p-value period (h) amplitude phase (h)

References

TDA Package References

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
# use built in zhang2014 data set sampled every
# 2 hours for 48 hours (i.e. 24 time points with 1 replicate each).
# Search for genes with period of 24 hours.

#set seed for reproducibility with random variables in example usage
#> set.seed(1234)

#> TimeCycleResults <- TimeCycle(data = zhang2014,
#>                               repLabel = rep(1,24),
#>                               period = 24)

# Check number of genes with FDR < 0.05 and period between 22 to 26 hours.
#> library(tidyverse)

#> TimeCycleResults %>%
#>    filter(22 < Period.in.Hours & Period.in.Hours < 26) %>%
#>    filter(pVals.adj < 0.05) %>%
#>    glimpse()

nesscoder/TimeCycle documentation built on June 29, 2021, 5:16 a.m.