Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error in calculateDiffMeth with dispersion=MN #265

Open
alynn1993 opened this issue Aug 30, 2022 · 1 comment
Open

Error in calculateDiffMeth with dispersion=MN #265

alynn1993 opened this issue Aug 30, 2022 · 1 comment

Comments

@alynn1993
Copy link

alynn1993 commented Aug 30, 2022

Hi, I am able to run calculateDiffMeth on my dataset when dispersion='none', but get the following error when dispersion='MN':
two groups detected:
will calculate methylation difference as the difference of
treatment (group: 1) - control (group: 0)
Error in if (is.na(p.value)) { : argument is of length zero
Calls: calculateDiffMeth ... .calculateDiffMeth -> simplify2array -> mclapply -> lapply -> FUN

Based on the calculateDiffMeth source code perhaps adding isTRUE to the if(is.na(p.value))) in the following could help:

do F-test when overdispersion >1 given
test=ifelse(test=="F" & phi>1,"F","Chisq")

p.value=switch(test,
F={
pf(deviance/phi, ddf, (length(w)-nprm), lower.tail = FALSE)
},
Chisq={
pchisq(deviance/phi, 1, lower.tail = FALSE)
})
if(is.na(p.value)) {
warning("Replacing NaN with 1.")
p.value <- 1
}

@alexg9010
Copy link
Collaborator

Hi @alynn1993,

Thanks for reporting this error.
Could you please send a minimal reproducible example to help us debug the problem?

Best,
Alex

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants