Skip to main content
An official website of the United States government

User Defined

Below are steps to define your own test for CRaVe. A maximum of 5 user defined tests are allowed.

C function:

  1. Edit the function c1 in the file user_define.c. The function name, input arguments and return type CANNOT be modified.
  2. Issue the command "make clean" and then "make".
  3. To include this test in an anlaysis, set the option tests=c1,...
  4. For additional tests, modify the functions c2, c3, c4, c5 in the file user_defined.c.

 

R function:

  1. 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)) }
  2. 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"))
  3. For additional tests, set the option user_func to be a vector of function names.
Email