SCARVAsnp 
2/21/13

SCARVAsnp is designed to detect rare variants in a given region that are associated with a phenotype.  This code is maintained by Guanjie Chen (chengu@mail.nih.gov). 

History: 
	8/16/12 	First version created 	-> SCARVAsnp0
	1/4/13		Correction to statistical significance adjustment for common variants
						-> SCARVAsnp0.1

1. Download instructions: NEED TO FILL THIS IN WHEN HAVE THE CODE READY TO DISTRIBUTE
2. Input Files: 
   a: readin.par  
      This is a text file containing one row with 4 numbers: the number of individuals, the number of covariates, the number of common variants, and the number of rare variants.  The file should be named "readin.par". 
      Example (for 4000 individuals, with 3 covariates, 4 CVs, and 5 RVs): 
             4000 3 4 5    
 
   b: readin.ped 
      A matrix containing the following columns: id, covariates, phenotype, common variants, and rare variants. This file should not contain missing values (a future version will allow missing values), variants with counts less than 5, or variants that are in linkage disequilibrium.  Genotypes should be coded as 0/1/2 for the number of copies of the minor allele. All common variants should be included before any rare variants (the user should assign whether the variant is rare or common according to their own threshold). The ID variable should be numeric.  The file should be named "readin.ped". 
     Example (There should be no header in the .ped file, but a sample one is given below for illustration):   

       id cov1 cov2 cov3 y cv1 cv2 cv3 cv4 rv1 rv2 rv3 rv4 rv5           

       1 30 1 27.89 4.8978 0 0 2 0 1 0 0 0 0                     
       2 30 2 21.03 4.4188 0 1 1 0 0 0 0 0 0                    
       3 50 1 24.96 4.2767 0 1 0 1 0 0 0 0 0                    
       4 39 2 28.15 4.7095 0 2 0 1 0 0 0 0 0                    
       5 28 1 26.99 3.91     2 0 0 2 0 2 1 0 1                   
       
3. Running SCARVAsnp: The program is designed to be used in a UNIX environment. 
   To run the program, put the program file in your working directory and run the following code: 
   chmod 755 SCARVAsnp  #Only needs to be run the first time use SCARVAsnp.
  ./SCARVAsnp > out 

4. Output file: A single output file (out) will be produced in the present working directory. The output has three sections:
     a. Common Variant (CV) Analysis Report, which gives the results for individual regression models for each CV (models are adjusted for covariates). The adjusted p-value is the p-value multiplied by the number of CVs tested in that region. 
     b. Rare Variant (RV) Analysis Report.  First, results are given for the log-likelihood of a regression model with a collapsed term for all of the RVs together and a beta for that collapsed term.  Next, the same output is given for models with a collapsed term that includes all but the first RV, along with the difference in the log-likelihood, the ratio, and the difference in betas compared to the full model.  Variants with a ratio larger than 1.25 will be included in the final combined model. All models in this stage are adjusted for covariates and any statistically significant CVs). 
     c. Final Combined Model Report, which gives the results from a final model that includes all covariates, any statistically significant CVs, a collapsed term for any positively-associated RVs, and a collapsed term for any negatively-associated RVs.  The summary statement above this output gives the terms that were included in this specific analysis and each line of output corresponds to these terms, in this order.
 

Documentation: Please see the following publications for further details.  When using SCARVAsnp, please cite the second reference below (Chen G et al, 2012)

Yuan A, Chen G, Zhou Y, Bentley A, Rotimi C; A novel approach for the simultaneous analysis of common and rare variants in complex traits: Bioinformatics and Biology insight 2012;6:1-9 pubmed: 2234634

Chen G, Yuan A, Zhou Y, Bentley AR, Zhou J, Chen W, Shriner D, Adeyemo A, Rotimi C; Simultaneous Analysis of Common and Rare Variants in Complex Traits: Application to SNPs (SCARVAsnp). Bioinformatics and Biology insights 2012:6 177-185
