KasperSkytte / ampvis2

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

issues when generating plots using function amp_diffabund #124

Closed Xinming9606 closed 2 years ago

Xinming9606 commented 2 years ago

Hi, Thanks for developing such nice tool! I'm really new to R, when I tried the function amp_diffabund in the new released ampvis2extras, the error keeps pop out even when I run the examples on this web https://kasperskytte.github.io/ampvis2extras/reference/amp_diffabund.html

Error: Aesthetics must be either length 1 or the same as the data

I know it maybe the problem of ggplot2, but I don't know how to fix it. Thanks in advance!

KasperSkytte commented 2 years ago

Hi there

I'm not sure how to fix this quickly, but it occurs when tax_aggregate is set to a different tax level than OTU. But in the end, you should only do the analysis on OTU level to avoid introducing bias from the taxonomic database. You would only be analyzing those that could be reliably classified. So just keep tax_aggregate = "OTU" and it works fine. This function is rather old now and won't be extensively maintained. It's not the best way to do differential abundance on amplicon data.

KasperSkytte commented 2 years ago

The error is just caused by mismatching labels for the interactive plotly plot, so I have just removed those when tax_aggregate != "OTU". Reinstall if you still want to do the analysis on other tax levels.