joey711 / phyloseq

phyloseq is a set of classes, wrappers, and tools (in R) to make it easier to import, store, and analyze phylogenetic sequencing data; and to reproducibly share that data and analysis with others. See the phyloseq front page:
http://joey711.github.io/phyloseq/
584 stars 187 forks source link

se=TRUE has been unavailable in vegan::fisher.alpha since 2013 #1581

Open jarioksa opened 2 years ago

jarioksa commented 2 years ago

SE was removed from vegan::fisher.alpha in CRAN release 2.0-10 of December, 2013 (and for a reason). However, you still expect it in phyloseq::estimate_richness. This does not cause problems in phyloseq itself, because you explicitly avoid calling vegan::fisher.alpha in your examples and tests. However, it breaks microbial package, and that in turn blocks vegan submission in CRAN.

Here the traceback CRAN mailed to me:

### Name: plotalpha
### Title: plot alpha diversity
### Aliases: plotalpha

### ** Examples

{
 + data("Physeq")
 + plotalpha(physeq,group="SampleType")
 + }
 Warning in value[[3L]](cond) :
   phyloseq::estimate_richness: Warning in fisher.alpha(). See `?fisher.fit` or ?`fisher.alpha`. Treat fisher results with caution
 Error in fisher.alpha(OTU, se = TRUE)[, c("alpha", "se")] : 
   incorrect number of dimensions
 Calls: plotalpha ... tryCatch -> tryCatchList -> tryCatchOne -> <Anonymous>
 Execution halted

Package: microbial
Check: re-building of vignette outputs
New result: ERROR
 Error(s) in re-building vignettes:
   ...
 --- re-building ‘microbial.Rmd’ using knitr
 Normalization using relative method 
 Quitting from lines 74-75 (microbial.Rmd) 
 Error: processing vignette ‘microbial.Rmd’ failed with diagnostics:
 incorrect number of dimensions
 --- failed re-building ‘microbial.Rmd’

 SUMMARY: processing the following file failed:
   ‘microbial.Rmd’

 Error: Vignette re-building failed.
 Execution halted

And here the in phyloseq with the same data set from microbial and with default arguments that do not skip fisher.alpha:

> phyloseq::estimate_richness(physeq)
Error in fisher.alpha(OTU, se = TRUE)[, c("alpha", "se")] : 
  incorrect number of dimensions
In addition: Warning message:
In value[[3L]](cond) :
  phyloseq::estimate_richness: Warning in fisher.alpha(). See `?fisher.fit` or ?`fisher.alpha`. Treat fisher results with caution
> traceback()
7: withCallingHandlers(expr, warning = function(w) if (inherits(w, 
       classes)) tryInvokeRestart("muffleWarning"))
6: suppressWarnings(fisher.alpha(OTU, se = TRUE)[, c("alpha", "se")])
5: value[[3L]](cond)
4: tryCatchOne(expr, names, parentenv, handlers[[1L]])
3: tryCatchList(expr, classes, parentenv, handlers)
2: tryCatch(fisher.alpha(OTU, se = TRUE), warning = function(w) {
       warning("phyloseq::estimate_richness: Warning in fisher.alpha(). See `?fisher.fit` or ?`fisher.alpha`. Treat fisher results with caution")
       suppressWarnings(fisher.alpha(OTU, se = TRUE)[, c("alpha", 
           "se")])
   })
1: phyloseq::estimate_richness(physeq)

You are relying on something that has not been available since December 2013, and I suggest you fix this.

jarioksa commented 2 years ago

It seems that I can fix the immediate problem within vegan, and from that point of view this not an urgent problem. However, the SEs have not been there for 8+ years, so please remove the option.

Christoph-Ammer commented 1 year ago

Hello everybody,

I have the same problem with the fisher in estimate_richness. rich.wf.r = estimate_richness(phy.bd.r) #calculating alpha div for each sample Error in fisher.alpha(OTU, se = TRUE)[, c("alpha", "se")] : incorrect number of dimensions In addition: Warning message: In value[[3L]](cond) : phyloseq::estimate_richness: Warning in fisher.alpha(). See?fisher.fitor ?fisher.alpha. Treat fisher results with caution

If I mute the fisher option by selecting all the other measures it works.

rich.wf.r = estimate_richness(phy.bd.r, measures = c("Observed", "Chao1", "ACE", "Shannon", "Simpson", "InvSimpson"))

I estimate the richness with several phyloseq objects before and simply cannot understand why I run in this issue with this random phyloseq object.

Thank you for some clarifying words.

Best

Christ