Biometris / statgenGWAS

See https://biometris.github.io/statgenGWAS for a full description
https://biometris.github.io/statgenGWAS/
12 stars 3 forks source link

False Discovery Rate threshold computation fails silently #4

Closed ne1s0n closed 3 years ago

ne1s0n commented 3 years ago

As per title, when selecting fdr as threshold type the computation fails and the threshold is set to NA silently (I noticed the absence of threshold in Manhattan plot).

This can be reproduced from the very base example in the package home. If I change the invocation of runSingleTraitGwas to:

GWASDrops <- runSingleTraitGwas(gData = gDataDropsDedup,
                                trials = "Mur13W",
                                traits = c("grain.yield", "anthesis"), thrType = 'fdr')

the threshold is not computed (note the thrType = 'fdr' extra param). This is verified taking a look at the thr field:

> GWASDrops$thr
$Mur13W
grain.yield    anthesis 
         NA          NA 

And obviously no line shows up in the plot.

If it's not a bug it should at least warn the user.

BartJanvanRossum commented 3 years ago

This is not a bug. Because of how the fdr method works it is possible that a snp is marked as significant whereas a snp with a higher -10logp value is not significant (e.g. because it is close to a peak). Because of this no fixed value can be computed for the threshold and it cannot be shown in the plot either. I agree that it would be good to make this more clear in the documentation. I will add that to the to do list for the next release of the package

BartJanvanRossum commented 3 years ago

In the latest release of the package the documentation has been updated to clarify the reason for a NA value for the threshold when using "fdf".