Oshlack / missMethyl

Bioconductor package for analysis of methylation data from Illumina's Infinium HumanMethylation arrays.
10 stars 4 forks source link

Bug in version 1.21.3 #3

Closed tiagochst closed 4 years ago

tiagochst commented 4 years ago

Hello,

We are running the following function

meta_go <- gometh(
    sig.cpg = meta_sig_probes,
    all.cpg = meta_all_probes,
    collection = "GO"
)

And it seems the following line is giving a negative value

    pw.white <- sum(pwf[!InSet]) / (Nuniverse - results[i,
                                                            "N"])

Which results in the following error.

Error in BiasedUrn::pWNCHypergeo(results[i, "DE"], results[i, "N"], Nuniverse -  : 
  Invalid value for odds

This did not happend in the version 1.21.1. Data is in this rda file https://drive.google.com/open?id=1PBEeKKCYtnCaqaUWbooNeN4teBKIer1P

JovMaksimovic commented 4 years ago

Hi, Thanks for the bug report and the test data! This seems to be quite an obscure one that was actually being masked by another bug that we just fixed in 1.21.3 (which is why you didn't come across it in the previous version). Basically, since you had filtered down your universe to just over 200k CpGs, it triggered the scenario where for the very large molecular_function GO category there were more genes (~17000) in the collection than in the universe (~16000), which resulted in a negative value for pw.white. We have now modified the code to filter out genes from collections that do not have mapped CpGs so that a collection can no longer be larger than the universe. Gometh 1.21.4 now works with your test data and produces a similar result to when you use all array CpGs as the universe.