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

PruneSingletons = TRUE removes all OTU #104

Closed afmbafmb closed 3 years ago

afmbafmb commented 3 years ago

Hi Kasper,

For this particular dataset that I'm working on, I have successfully loaded the data, but when I add the argument PruneSingletons = True, all of the OTUs were removed. If I proceed with amp_alphadiv without the PruneSingletons argument, I get the following warning:

'The data you have provided does not have any singletons. This is highly suspicious. Results of richness estimates (for example) are probably unreliable, or wrong...'

The resulting Chao1 and ACE values were the same as Observed OTUs. What do you think went wrong here? I used DADA2 pipeline for the sequencing results and I removed the chimeras.

Thanks for your time!

KasperSkytte commented 3 years ago

Hi

Hmm it's very suspicious that all of your OTU's are removed, so your whole dataset only contains singletons? The warning is just there to remind you that alpha diversity measures are incorrect if you remove singletons, so you shouldn't remove them before calculating alpha diversity metrics. Observed OTU's is the number of unique OTU's in each sample. Are they all 1?

afmbafmb commented 3 years ago

Hi Kasper,

This is an example of the first few ASVs for the first 10 samples. It's around this range across the samples and some of the ASVs are not detected in the samples (2nd snapshot).

image

image

Thank you!

KasperSkytte commented 3 years ago

It's all done by this one line, which I think is as concise as it gets https://github.com/MadsAlbertsen/ampvis2/blob/12ea48b16b92a264a769a2b4d14a08358f51cebc/R/amp_load.R#L189. This should not remove any of the above. You sure they are all removed? But again, you shouldn't remove them when doing alpha diversity analyses.

afmbafmb commented 3 years ago

Hi Kasper,

I was planning to use PruneSingletons for doing other analysis like heatmaps, etc. Understand that we shouldn't remove them for alpha diversity.

When I run d <- amp_load(otutable = myotutable2, metadata = mymetadata2), my data frame for d$abund had 1960 rows and 74 columns.

When I run d2 <- amp_load(otutable = myotutable2, metadata = mymetadata2, pruneSingletons = TRUE), I'm left with 0 rows and 74 columns for d$abund. I'm just left with the sample names and a message that "1960 singletons have been removed"

KasperSkytte commented 3 years ago

Can't reproduce. I will need your data or a subset. Can share here if you want or otherwise mail me