Coder Social home page Coder Social logo

Comments (3)

lakarstens avatar lakarstens commented on September 28, 2024

Thank you for pointing this out and the very detailed example! You are correct that the na's are dropped in the tax_glom function. We will work on making this more apparent to users and potentially disabling it.

In the meantime, the way around this issue is to perform all the functions that occur in prep_mdf independently rather than running the prep_mdf function (i.e. run tax_glom with NArm = FALSE, transform_sample_counts, and ps_melt).

Example

# perform custom mdf_prep
    mdf <- ps %>%

 # agglomerate at specified subgroup level (i.e. Genus)
    speedyseq::tax_glom(subgroup_level, NArm = FALSE) %>%

 # transform sample counts / normalize as desired
    phyloseq::transform_sample_counts(function(x) { x/sum(x) }) %>%

 # melt the phyloseq object
    speedyseq::psmelt()

 # Remove zeros
    mdf_prep <- mdf[mdf$Abundance > 0, ]

from microshades.

sterrettJD avatar sterrettJD commented on September 28, 2024

Thanks for looking into the solution and sending the new prep_mdf code!

from microshades.

KarstensLab avatar KarstensLab commented on September 28, 2024

Hi @sterrettJD,
The latest version of microshades now has the option to remove NAs and the default behavior is to NOT remove NAs. See this vignette for more details.

Thanks again for bringing this to our attention!
~Lisa

from microshades.

Related Issues (20)

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.