microbiome / mia

Microbiome analysis
https://microbiome.github.io/mia/
Artistic License 2.0
46 stars 25 forks source link

could not find function "DmmParam" #459

Closed AroArz closed 9 months ago

AroArz commented 9 months ago

Describe the bug There seems to be some incompatibilities between the latest version of mia and bluster, as it is unable to find DmmParam when performing DMM clustering.

To Reproduce Following standard tutorial

Section 10.3: https://microbiome.github.io/OMA/clustering.html#dirichlet-multinomial-mixtures-dmm

mia: 1.9.18 bluster: 1.11.4 vegan: 2.6.4

# Get the data
data("GlobalPatterns", package = "mia")
tse <- GlobalPatterns

# Agglomerate by rank
tse <- mergeFeaturesByRank(tse, rank = "Phylum", agglomerateTree = TRUE)

# Run the model and calculates the most likely number of clusters from 1 to 7
tse_dmm <- cluster(tse, name = "DMM", DmmParam(k = 1:7, type = "laplace"), 
                   MARGIN = "samples", full = TRUE)

Returns

Error in h(simpleError(msg, call)): error in evaluating the argument 'BLUSPARAM' in selecting a method for function 'clusterRows': could not find function "DmmParam"
Traceback:

1. cluster(tse, name = "DMM", DmmParam(k = 1:7, type = "laplace"), 
 .     MARGIN = "samples", full = TRUE)
2. cluster(tse, name = "DMM", DmmParam(k = 1:7, type = "laplace"), 
 .     MARGIN = "samples", full = TRUE)
3. clusterRows(mat, BLUSPARAM, full)
4. .handleSimpleError(function (cond) 
 . .Internal(C_tryCatchHelper(addr, 1L, cond)), "could not find function \"DmmParam\"", 
 .     base::quote(DmmParam(k = 1:7, type = "laplace")))
5. h(simpleError(msg, call))

Expected behavior A clear and concise description of what you expected to happen.

Additional context Add any other context about the problem here.

AroArz commented 9 months ago

A good old restart after installing new packages did the trick...

Although loading the freshly installed libraries (ontop of the previous installation) as

library("mia"); packageVersion("mia")
library("bluster"); packageVersion("bluster")

returned

[1] ‘1.9.18’
[1] ‘1.11.4’

it seems that was a lie, but I guess its fair to assume I have to unload the past installation

unloadNamespace("miaTime")
unloadNamespace("miaViz")
unloadNamespace("mia")
unloadNamespace("bluster")

and reloading them did the trick.

Feel free to close this issue and sorry I didn't notice OMA had their own github.

ake123 commented 9 months ago

I am glad you figured it out yourself. Since we are continuously updating the package remember to always use the GitHub version!