GithubHelp home page GithubHelp logo

Comments (5)

Japal avatar Japal commented on June 10, 2024

Thanks for reporting this. That's a generic R error message related to some internal operation that cannot be carried out from your particular data for some reason. It would be helpful to at least provide a reproducible script in order to be able to investigate the origin of the issue.

from zcompositions.

nick-youngblut avatar nick-youngblut commented on June 10, 2024

A reprex:

library(phyloseq)
library(rMIDAS)
library(zCompositions)

data('GlobalPatterns')
x = filter_taxa(GlobalPatterns, function(x) mean(x) > 2000, TRUE)
x = add_missingness(as.data.frame(otu_table(x)), prop=0.82)
x[is.na(x)] = 0
cmultRepl(x, output='p-counts')

The % of zeros is very high in this case, but for other tables, the % zeros could be lower and still generate the same error.

from zcompositions.

Japal avatar Japal commented on June 10, 2024

Dear Nick, the problem is that for some of the random data matrices generated using that script one/several columns and/or rows are nearly all zero. This causes numerical issues due to lack of information. When the default imputation method fails you might try another one. Note also that the add_missingness funcion you are using is generating missing data, and not count zero as we understand them (e.g. as censored values related to under-reporting, detection limits or similar).

Beyond the technical issue, it might be worth considering whether those nearly all-zero variables are actually providing any relevant information for the data analysis; and whether it is sensible to carry out any data imputation in these extreme cases. Essentially a large part of the data set will be "fabricated" based on poor observed information. It might be worth removing uninformative rows/columns or working at a lower taxonomic resolution.

Finally, you are probably working with zCompositions v1.3. You can install the development version 1.4 from this Github repository directly (although I have just submitted it to CRAN also and should be available very soon from there). This latest version includes some checks for all-zero columns/rows and also warnings when the proportion of zeros in variables exceeds a threshold set by the user (80% default). For example in your case some rows/columns contain > 90% zeros.

from zcompositions.

nick-youngblut avatar nick-youngblut commented on June 10, 2024

Thanks @Japal for the clear explanation!

Really, I'm running into this error because I'm assessing the accuracy of each zCompositions method for various conditions (e.g., % zeros). I guess that when such an error occurs, I can either just skip the imputation (accuracy = 0) or fall back to another imputation method.

For "real" data analyses, I definitely wouldn't try imputation if there is a high percentage of zeros, but here, I'd like to know how accuracy degrades depending on the % of zeros.

from zcompositions.

Japal avatar Japal commented on June 10, 2024

I see. That type of assessment has been in some way conducted in the original publications. If a method fails numerically for some simulated data sets because of special features of this, it would be more sensible to just not consider that iteration in the global calculations. Treating it as "accuracy=0" would provide a biased estimation as the method could not be really applied.

from zcompositions.

Related Issues (7)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.