Running CAT Population-Mean Cosinor (PMC)
Examples of calling PMC can be found on the Vignettes page, and associated instructions.
Instructions for Calling the Chronomics Analysis Toolkit (CATkit) Cosinor
After installing R and RStudio:
1. Download the Installing CATkit pdf
2. Open Installing CAT from tar with a text editor (or R)
3. Following the directions, open Vignette.r and modify it to run a vignette
4. To run the vignette, double click on Vignette.r;
or, if you have Vignette.r open in R or RStudio, you can run it by selecting shift-cmd-S; or from the Menu, select Code-->Source
5. After the program completes running, it will give you the name of the output file (in the same folder as the input was found).
Instructions for Calling the Chronomics Analysis Toolkit (CATkit) Cosinor
After installing R and RStudio:
1. Download the Installing CATkit pdf
2. Open Installing CAT from tar with a text editor (or R)
3. Following the directions, open Vignette.r and modify it to run a vignette
4. To run the vignette, double click on Vignette.r;
or, if you have Vignette.r open in R or RStudio, you can run it by selecting shift-cmd-S; or from the Menu, select Code-->Source
5. After the program completes running, it will give you the name of the output file (in the same folder as the input was found).
Parameterization
Each parameter has default values that will be used if not explicitly set. The call to Population-Mean Cosinor (PMC), with defaults is:
CATpmc(data, fileName, colNames, VarID=NA, GrpID = NA, alpha = 0.05, header=FALSE, sep="\t", Output=list(Doc=TRUE), functionName="", title="")
Examples:
Ex1: Call when using parameter fileName without headers:
filePath<-"/Users/user/Documents/Testing"
fileName<-file.path(filePath,'cos02.csv')
cosdat<-c("PR","MESOR","Amp","phi","AgeGrp","Subject","Age","Lipids","Gender","Diet","Smoking"," ")
CATpmc(fileName=fileName, colNames=cosdat, VarID=8,GrpID=c(5,9),header=FALSE,sep=",",functionName="data file", title="data file and multiple GrpIDs")
Ex2: Call when using parameter data (array of data) without headers:
X <- read.table("/Users/user/Documents/ChronobiologyLab/CATkitCharles/catkitpmcupdate/fort10",sep=",") # has no header
colnames(X) <- c("PR", "MESOR", "Amp", "Phi", "group") # adds a header
CATpmc(data=X, GrpID="group", sep=",",functionName="data", title="Using data frame, not File")
CATpmc(data, fileName, colNames, VarID=NA, GrpID = NA, alpha = 0.05, header=FALSE, sep="\t", Output=list(Doc=TRUE), functionName="", title="")
Examples:
Ex1: Call when using parameter fileName without headers:
filePath<-"/Users/user/Documents/Testing"
fileName<-file.path(filePath,'cos02.csv')
cosdat<-c("PR","MESOR","Amp","phi","AgeGrp","Subject","Age","Lipids","Gender","Diet","Smoking"," ")
CATpmc(fileName=fileName, colNames=cosdat, VarID=8,GrpID=c(5,9),header=FALSE,sep=",",functionName="data file", title="data file and multiple GrpIDs")
Ex2: Call when using parameter data (array of data) without headers:
X <- read.table("/Users/user/Documents/ChronobiologyLab/CATkitCharles/catkitpmcupdate/fort10",sep=",") # has no header
colnames(X) <- c("PR", "MESOR", "Amp", "Phi", "group") # adds a header
CATpmc(data=X, GrpID="group", sep=",",functionName="data", title="Using data frame, not File")
fileName: (optional) A data file with path; either a data frame (cosinor parameters) or fileName must be provided. "/" is used on Macs in
the file pathname; "/" changes to "\\" on PCs.
data: (optional) An array of data; either a data frame object or a fileName must be provided
colNames: Specific column names are required by the program: PR, MESOR, Amp, Phi (case insensitive). Must be specified if column
headers are absent, or if you wish to rename columns.
GrpID: (optional) a vector of column names (or numbers) referring to factors to be used for grouping populations by levels in each factor
(group identifiers). A PMC is performed on the full population, and on each sub-population grouped by factor level, for each
GrpID specified; if multiple GrpIDs are specified, corresponding to multiple factors, PMC is also performed on all
combinations across all factor levels. If no GrpIDs are specified, only the full population PMC is performed.
VarID: (optional) a single column can be included as a Variable. Each population identified by variable name (value) in the VarID column
is compared with each population comparison defined under GrpID. A column would be specified as a VarID if it makes no
sense to combine multiple levels (values) for PMC -- such as combining temperature with blood pressure, or rhythm
parameters related to different trial periods.
alpha: significance level (p) for testing (default = .05)
header: does the file have a header? (default = FALSE); column headers are used as column names unless colNames is used
sep: is the file tab delimited ("\t") or comma delimited (",") (default = "\t")
Output: Doc=TRUE will output an RTF file; Doc=FALSE will not. Output is always sent to the console
functionName: a short descriptor, this will be used as a part of the file name for use in identifying output
title: A longer text descriptor. This is printed out in the header of the result file as a Title.
the file pathname; "/" changes to "\\" on PCs.
data: (optional) An array of data; either a data frame object or a fileName must be provided
colNames: Specific column names are required by the program: PR, MESOR, Amp, Phi (case insensitive). Must be specified if column
headers are absent, or if you wish to rename columns.
GrpID: (optional) a vector of column names (or numbers) referring to factors to be used for grouping populations by levels in each factor
(group identifiers). A PMC is performed on the full population, and on each sub-population grouped by factor level, for each
GrpID specified; if multiple GrpIDs are specified, corresponding to multiple factors, PMC is also performed on all
combinations across all factor levels. If no GrpIDs are specified, only the full population PMC is performed.
VarID: (optional) a single column can be included as a Variable. Each population identified by variable name (value) in the VarID column
is compared with each population comparison defined under GrpID. A column would be specified as a VarID if it makes no
sense to combine multiple levels (values) for PMC -- such as combining temperature with blood pressure, or rhythm
parameters related to different trial periods.
alpha: significance level (p) for testing (default = .05)
header: does the file have a header? (default = FALSE); column headers are used as column names unless colNames is used
sep: is the file tab delimited ("\t") or comma delimited (",") (default = "\t")
Output: Doc=TRUE will output an RTF file; Doc=FALSE will not. Output is always sent to the console
functionName: a short descriptor, this will be used as a part of the file name for use in identifying output
title: A longer text descriptor. This is printed out in the header of the result file as a Title.
Input Data:
The PMC uses the parameters resulting from a single- or multiple-component single cosinor as input.
Data format: Comma or tab delimited file. There are four required column headers, one optional VarID (variable) column, and any number of (optional) GrpID (factor) columns:
PR, MESOR, Amp, Phi, variable, factor1, factor2, ....
Data format: Comma or tab delimited file. There are four required column headers, one optional VarID (variable) column, and any number of (optional) GrpID (factor) columns:
PR, MESOR, Amp, Phi, variable, factor1, factor2, ....
Output:
Data Format: An .rtf data file is written to the same filepath where the data file is found.
Returned: An output data frame is returned from the function call, and printed to the console.
Returned: An output data frame is returned from the function call, and printed to the console.