KasperSkytte / ampvis2

Tools for visualising microbial community amplicon data
https://kasperskytte.github.io/ampvis2/
GNU General Public License v3.0
67 stars 23 forks source link

Normalization doesn't work well with zeros #82

Closed jamesfifer closed 4 years ago

jamesfifer commented 4 years ago

I found an issue with your normalization =TRUE if there is an ASV that looks like this across 7 samples in res[["abund"]] 0.00000000 0.00000000 10.676772499 0.000000000 0.000000000 0.000000000 0.000000000 filter(res$data, Frequency > 0, freq_A > 0) %>% select(OTU, Abundance, Phylum, Class, Genus, Species) %>% arrange(desc(Abundance)) will give Abundance for this ASV = 10.676772499 when it should be 10.676772499 / 7

KasperSkytte commented 4 years ago

Hi there. Can you please provide a minimal reproducible example? I have no idea which ampvis2 functions you used or your data. And it looks like you expect it to normalise per ASV/OTU (rows) which is not the intention. It's supposed to normalise the reads per sample (column) as amplicon data is inherently relative.