Since you calculate the normalization factors but you doesn't use them for 'normalize' the data your return(physeq) simply retrieves a physeq object with the previous counts + 1.
In order to change that, a calculus of the normalization counts has to be done. I have been writing something like that, but it needs to be checked out:
One little thing,
Since you calculate the normalization factors but you doesn't use them for 'normalize' the data your return(physeq) simply retrieves a physeq object with the previous counts + 1.
In order to change that, a calculus of the normalization counts has to be done. I have been writing something like that, but it needs to be checked out:
Substitute this:
counts <- t(z[[1]]) For this:
lib.size <- z$samples$lib.size lib.size <- lib.size * z$samples$norm.factors counts <- t(z[[1]] *100 / lib.size)