biobakery/MetaPhlAn

Tranformation of the abundance table into relative abundance.

JariKoot opened this issue · 1 comments

Hey there,

I have been working with the Humann2 pipeline and using this output together with the Phyloseq package to create a visualization of my data.
I've noticed some differences in the relative abundance table from the Humann2 pipeline compared to the relative abundance table I have made with Microbiome (converted the absolute counts OTU table from Humann2 with Microbiome (R-package) into relative abundance OTU table).
Down below you can see some plots I made with the 2 different relative abundance files.
image

I am curious how these differences are generated, I don't have experience in Phyton so I was hoping you guys could help me out. This is how the relative abundance is generated with Microbiome:

    if (transform == "compositional") {
    
            # Minor constant 1e-32 is compared to zero to avoid zero
            # division.  Essentially zero counts will then remain zero
            # and otherwise this wont have any effect.
        
            xt <- apply(x, 2, function(x) {
                x/max(sum(x), 1e-32)
            })

From: https://github.com/microbiome/microbiome/blob/master/R/transform.R

Basically the function to get the relative abundance is dividing every OTU count with the sum of all the OTU's together . Does this differ in any way compared to the method of MetaPhlAn?

Thank you for creating this issue.
We currently field issues through our bioBakery Discourse Support Forum.
If you would please post the issue to discourse we would be happy to sync up with you to get it resolved.