Dear Karl, I am going over qtl2 functions to understand all the steps that are taken in the analysis. I am a little lost in the correction for the kinship and how model comparison is done.
In general, from what I gathered, the steps are:
1 - do the eigen decomposition of the kinship
2 - premultiply trait matrix, genetic array and covariate matrix by the eigen vectors (or their transposed?)
3 - run, for each marker, a simple linear model with the "corrected" trait as a response variable and the "corrected" covariates plus "corrected" genotype array as independent variables. Get the residual sum of squares (RSS) for this fit
4 - Compare the RSS fromm #3 to a RSS obtained from a null model.
Am I correct in these general steps?
While reading the qtl2 functions I got lost in how to get the null. It is not simply dropping the genotype 3d array from the model and then comparing the two models, right? While trying to understand how to do this, I was looking into calc_nullLL_clean() and had two dificulties:
a) There is a comment saying to premultiply traits and geno by the transpose of eigenvectors, but the code shows a premultiplication using the eigenvectors (not the transposed)
b) I want's able to find the function Rcpp_calcLL_mat() that is called inside calc_nullLL_clean().
I tried reading the inner functions themselves to understand how the kinship correction and significance testing are done.
Thank you for your attention