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

amp_rarefy is not exported #97

Closed nallward closed 3 years ago

nallward commented 4 years ago

Hi Mads/Kasper,

I've recently found this package and have really enjoyed it, so much more simple and straightforward for exploratory data analysis and producing plots than phyloseq!

I have ampvis2 version 2.6.4 installed and loaded, all functions that I have tried have worked great, except for amp_rarefy. It shows up as a listed function for this package and this version, but if I try to run it I get the following error:

Error in amp_rarefy(my_data, rarefy = some_number) : could not find function "amp_rarefy"

I am able to run the function correctly with:

ampvis2:::amp_rarefy(my_data, rarefy = some_number)

I am not an R expert, but we have one in our lab and he thought this error was likely because the function had not been exported. I couldnt find anything pointing to this specific issue on google or github so I thought I would let you know. Hopefully I have provided you with enough information (and that its a true bug and not just an issue on my end), if you require a more detailed reproducible example I can provide one.

KasperSkytte commented 4 years ago

Hi there

Glad you like it. But it's a design choice by me to not export it and only make it possible through amp_alphadiv() as an argument, so it's deliberate, but you still have the option if you really want to by accessing it with triple colon as you do. Many people have the habit of starting off by rarefying to even depth across samples before doing any analyses, and I don't believe this is good practice, you only really need to rarefy when comparing alpha diversity indices between samples, otherwise you just lose diversity and introduce yet another abundance bias. See this article discussing it https://journals.plos.org/ploscompbiol/article?id=10.1371/journal.pcbi.1003531