hansenlab / minfi

Devel repository for minfi
60 stars 70 forks source link

Issue with dmpFinder #163

Closed ralowe closed 6 years ago

ralowe commented 6 years ago

When using a numerical matrix as dat, dmpFinder fails with error

"Error in is(M, "DelayedMatrix") : object 'M' not found"

Looks like a bug? Should M in the below line be replaced with dat

else if (is(M, "DelayedMatrix"))

PeteHaitch commented 6 years ago

Thanks for the report, I'll look into this today.

PeteHaitch commented 6 years ago

I've fixed this in development branch and backported to the release branch. We have another bug to fix and will then release v1.26.1 (release) and v1.27.1 (devel), which will be available via BiocInstaller::biocLite() in the next few days.

To confirm/clarify, in v1.26.0/v1.27.0, dmpFinder() actually worked when dat was a numeric matrix (or MethylSet). However, if dat was a DelayedMatrix then there was a typo in the if-else logic which triggered a slightly obscure error message:

is.numeric(dat) is not TRUE

whereas in v1.26.1/v1.27.1 the error message is:

This function does not yet support DelayedArray objects

Thanks again, @ralowe

tjmuhans commented 6 years ago

In v1.27.1, When using a numerical matrix as dat, dmpFinder fails with error is.numeric(dat) is not TRUE how I can solve the issue? Thanks a lot

PeteHaitch commented 6 years ago

I'll take a look next week. Can you please provide a minimal reproducible example, as well as the output of BiocInstaller::biocValid()

PeteHaitch commented 6 years ago

@tjmuhans I can't reproduce what you describe. Using bsseq v1.27.1:

suppressPackageStartupMessages(library(minfiData))
grp <- pData(MsetEx)$Sample_Group
MsetExSmall <- MsetEx[1:1e4, ]
M <- getM(MsetExSmall, type = "beta", betaThreshold = 0.001)
# M is a numeric matrix
class(M)
#> [1] "matrix"
is.numeric(M)
#> [1] TRUE
dmp <- dmpFinder(M, pheno=grp, type="categorical")
head(dmp)
#>            intercept        f         pval       qval
#> cg13059719 -2.425568 585.0542 1.733111e-05 0.07724604
#> cg02448922 -2.446420 469.9740 2.678354e-05 0.07724604
#> cg01772149  4.346083 398.2071 3.721322e-05 0.07724604
#> cg02931001 -1.711274 392.9729 3.820270e-05 0.07724604
#> cg07155336 -4.527621 385.4337 3.969878e-05 0.07724604
#> cg07087919  3.019034 337.0105 5.179903e-05 0.07724604

Created on 2018-06-13 by the reprex package (v0.2.0).

If you have a reproducible example, please post as a new issue rather than to this issue to ensure it doesn't get lost.