User Defined
Below are steps to define your own test for CRaVe. A maximum of 5 user defined tests are allowed.
C function:
- Edit the function c1 in the file user_define.c. The function name, input arguments and return type CANNOT be modified.
- Issue the command "make clean" and then "make".
- To include this test in an anlaysis, set the option tests=c1,...
- For additional tests, modify the functions c2, c3, c4, c5 in the file user_defined.c.
R function:
- Write an R function with 4 input arguments, where argument 1 is the vector of delta values, argument 2 is the covariance matrix, argument 3 is the correlation matrix, and argument 4 is the inverse correlation matrix.
Example: fnc1 <- function(delta, cov, cor, invcor) { return(sum(delta*delta)) } - In the options list for the crave function, set the option user_func to the name of the function.
Example: crave(geno_file, pheno_file, out_file, op=list(user_func="fnc1")) - For additional tests, set the option user_func to be a vector of function names.