[R] Fastest way to do HWE.exact test on 100K SNP data?
    Anna Pluzhnikov 
    apluzhni at bsd.uchicago.edu
       
    Mon Jun  5 21:27:53 CEST 2006
    
    
  
Hi everyone,
I'm using the function 'HWE.exact' of 'genetics' package to compute p-values of
the HWE test. My data set consists of ~600 subjects (cases and controls) typed
at ~ 10K SNP markers; the test is applied separately to cases and controls. The
genotypes are stored in a list of 'genotype' objects, all.geno, and p-values are
calculated inside the loop over all SNP markers. 
I wish to repeat this procedure multiple times (~1000) permuting the cases and
controls (affection status). It seems straightforward to implement it like this:
#############################################
for (iter in 1:1000) {
  set.seed(iter)
# get the permuted affection status
  permut <- sample(affSt)
  for (j in 1:nSNPs) {
    test <- tapply(all.geno[[j]], permut, HWE.exact)
    pvalControls[j] <- test$"1"$p.value
    pvalCases[j] <- test$"2"$p.value
  }
}
##############################################
The problem is that it takes ~1 min/iteration (on AMD Opteron 252 processor
running Linux). 
Is there a faster/more efficient way to do this? 
Thanks,
-- 
Anna Pluzhnikov, PhD
Section of Genetic Medicine
Department of Medicine
The University of Chicago
-------------------------------------------------
This email is intended only for the use of the individual or...{{dropped}}
    
    
More information about the R-help
mailing list