Finding the optimal coding of diallelic SNPs


Let Y be a response, X be a SNP, and r = Y|X be called the regression of Y on X. For a diallelic SNP (i.e. a SNP with 3 categories), it may be that the marginal likelihood of the regression, P(r) = P(Y|X), is higher when the SNP is recoded as binary. Using the coding that maximizes this marginal likelihood may increase the power. Trinary variables can be recoded as binary in three different ways (or can be left as is). The function recode_data finds the optimal coding for each diallelic SNP in a given data frame and returns a revised data frame in the same order as the original. SNPs that are not diallelic are inserted into the new data frame unchanged. A vector containing the dimension of each SNP in the revised data frame is also returned. The prior used in Bayesian computations is the generalized hyper Dirichelt of Massam et. al (2009).


recode_data (data, dimens, alpha = 1)









A list with a data frame and a vector:


The recoded dataset.


The revised dimension vector.


Matthew Friedlander, Adrian Dobra, Helene Massam, and Laurent Briollais






r <- recode_data (data, dimens = c(rep(3,25),2), alpha = 1) 
s <- mWindow (data = r$recoded_data, dimens = r$recoded_dimens, alpha = 1, windowSize = 2)
head (s, n = 5)


Please suggest features or report bugs with the GitHub issue tracker.
