Closed ZeyuanSong closed 2 years ago
Missing genotypes are imputed to the mean and monomorphic variants are removed before the test is run, so that is unlikely to be the cause of the error. Can you generate a reproducible example from your dataset that you can share?
Hi,
I had the same problem and identified the expit()
function in spa.R
as the culprit:
expit <- function(x){exp(x)/(1+exp(x))}
A large x
results in NaN
. I replaced
mu <- as.vector(expit(nullmod$fit$linear.predictor))
with
mu <- as.vector(plogis(nullmod$fit$linear.predictor))
in spa.R
, and test = "Score.SPA"
now works fine.
Thanks for the suggestion!
Hi, When running the association test with test="Score", it executed successfully. However, when switching to test="Score.SPA", an error message showed as: Error in if (abs(q - m1)/sqrt(var1) < Cutoff) { : missing value where TRUE/FALSE needed
I guess this happens because there are monomorphic SNPs or missing genotypes that leads to NA in the if statement. But I am not sure if it is due to other reasons and how can I bypass it. (I also tried the SPA test on a small set of SNPs where there are no missing genotypes and no monomorphic SNPs, it executed successfully)