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

Problem with amp_ordinate NMDS #78

Closed vbalanus closed 4 years ago

vbalanus commented 4 years ago

Dear Developer, I tried to create an NMDS-plot for my dataset. I've run the following code: amp_ordinate(AalborgWWTPs, type = "NMDS",distmeasure = "bray", transform = "none") With the AalborgWWTPs dataset I have no problem, and I've got the NMDS-plot. AalborgWWTPs_NMDS But when I used my own dataset with the following OTU-table: BF Toxin 2018 Ampvis Bact OTU.txt I've got the following error-message: # Warning message: In vegan::metaMDS(inputmatrix, trace = FALSE, ...) : stress is (nearly) zero: you may have insufficient data and this ordination: BF_toxin_NMDS

I've checked metaMDS in vegan package, and I could create correct ordination for AalborgWWTPs dataset and not useable for my BF toxin dataset. I've compared the two dataset, and I couldn't find any relevant differences. If I used the Past program it could create NMDS ordination from both dataset. Any suggestions, what can be the problem? Thanks is advance!

vbalanus commented 4 years ago

Meanwhile I've find the solution, but I do not really understand the situation: 2 of my samples are far away from the others if using Bray-Curtis distances for NMDS. If I omit that samples, I get the correct ordination. If using Euclidean distances, there is no problem. But still, if I use Past program it could create NMDS ordination with Bray-Curtis distances for the whole dataset. Do others have similar experiences?

KasperSkytte commented 4 years ago

Hi there

When you have a few samples that are just very different from every other sample, their distances will just dominate the first axis. The result is not incorrect. Even when just inspecting the abundance table manually, it's clear that TTF0D and TTF0R are just very different. But I don't know about the Past software, so I cannot say why it creates different results. There are different implementations of the nMDS algorithm, maybe it prefilters or applies some transformation, I don't know. But euclidean distance is very different from Bray-Curtis or others, and it's generally not suited for community data without transformation.