[R] Fastest way to do HWE.exact test on 100K SNP data?

From: Anna Pluzhnikov <apluzhni_at_bsd.uchicago.edu>
Date: Tue 06 Jun 2006 - 05:27:53 EST


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}}

______________________________________________
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Received on Tue Jun 06 05:30:49 2006

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Wed 07 Jun 2006 - 06:10:24 EST.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.