kbroman / qtl

R/qtl: A QTL mapping environment
https://rqtl.org
GNU General Public License v3.0
77 stars 45 forks source link

scanone perms with 4-way cross giving all 0's #89

Closed kbroman closed 11 months ago

kbroman commented 4 years ago

I have an example of 4-way cross data where scanone gives reasonable results, but scanone perms with perm.Xsp=TRUE gives all 0's on the X chromosome. If I permute the subjects' phenotypes, scanone gives 0's on X chromosome. So something seems messed up, with treatment of X.

kbroman commented 4 years ago

Ugh, the treatment of the X chromosome and covariates in scanone is such a mess. I can't really tell what's going on.

But it seems like the problem is that the LOD scores are coming out negative in the permutation test, which get replaced with 0s, because of the treatment of sex as covariate on X chromosome, under null or alternative. But I'm not entirely sure what it's doing. :(

The solution seems to be to use a stratified permutation test. This is necessary for the 4-way cross, because the males and females are coded differently on the X.

kbroman commented 4 years ago

Okay I think I get it. Sex is forced as a covariate under the null, because it's assumed that it will be implicit in the genotypes under the alternative. But when you permute the phenotypes vs genotypes, the genotypes no longer are separated by sex, and so you get a much better fit under the null than under the alternative.

kbroman commented 11 months ago

This doesn't seem to be a problem in the software so much as a need to use stratified permutations in this case. So I'm going to close the issue.