=================================================================

Title: README for TREX (truncated exact test)

=================================================================
Brief Description:
=================================================================
trex is a package that calculates a truncated exact test for two-stage
case-control studies for rare genetic variants.  The first stage is
for screening rare variants in only cases. If the number of
case-carriers of any rare variants exceeds a user-specified threshold,
then additional cases and controls are genotyped for the detected 
variants and carrier status of these variants are compared for all 
cases and controls in the second stage. The package distributed for R
also contains a function to calculate an optimal 2-stage design.


=================================================================
Installation procedures:
=================================================================

The trex package is developed for both R and a stand-alone C program,
using the same driver function in C, with entry points from both R and C.
Intallation procedures in this file are for installing to a 'local library' for R,
and as a compiled C binary executable. If a large group of R users 
plan to use the same package, then install on a system-wide 'library' 
location designated by a system administrator.

-------------------------------------------------------------
R Installation (unix-like systems)
-------------------------------------------------------------

For local installation, execute the following commands with /YOUR/RLIB/
representing a system directory to install the package

R CMD INSTALL -l /YOUR/RLIB trex_x.y_R.tar.gz

Then in R, the package can be loaded with:

  library(trex, lib.loc="/YOUR/RLIB")


Installation instructions for different use may be found on the R project 
website (http://www.r-project.org).

------------------------------------------------------------
C stand-alone installation (unix-like systems)
------------------------------------------------------------

1) unzip and un-tar the package source.
     gunzip trex_c_0.1.tar.gz
     tar -xvf trex_c_0.1.tar

2) In the trex_c/src directory, run make
     cd trex_c/src
     make

3) The executable exists in both trex_c/src and trex_c/bin, but can be
copied elsewhere.


===================================================================
USER DOCUMENTATION:
===================================================================

Help information on the trex function in R can be found by typing
help(trex) or help(optimalDesign), and a set of examples for trex can 
be run in R with example(trex) or example(optimalDesign).  

For the stand-alone program, a help menu is available with "trex -h".
More descriptive examples are available in trex_c/doc/manualTREX.txt and in 
the trex_c/examples/example.trex script. Please direct questions, bugs, and
suggestions for future develepment to sinnwell[at]mayo.edu. 


===================================================================
REFERENCE
===================================================================

Schaid DJ, Sinnwell JP, "Two-Stage Case-Control Designs for Rare Genetic 
Variants".  Hum Genetics. Published online, 30 Mar 2010.

