Hey forum,
I am using the thetayc measure to give me a similarity matrix for all the samples I am interested in comparing.
This matrix, I then import into R for nmds and heatmaps.
So,
Question 1. Is there a way I can convert the column matrix (of similarity measures between samples) into a square matrix using mothur or R?
Question 2. Is it correct for me to use nmds with such a matrix?
R can do everything! but you dont need to do question 1 but for question 2
whenever you generate a similarity matrix, it is a triangular matrix as you compare every pair of samples… the diagonals being the comparison with a sample with itself, and the top triangle the same as the bottom triangle (e.g sample 1 vs sample 2 is in the bottom, but sample 2 vs sample 1 is in the top… they are the same comparison)
the nMDS algorithm requires such a triangular matrix to generate the ordination (graph). So whatever data you generate that tells you it is a similarity matrix should in most cases be a triangular matrix (unless you’ve opted somewhere to get a column format)
I’m wondering if many people recognize what an nMDS actually does to your data before it generates the ordination. It ranks all data in the matrix. Most similar =1, next most similar = 2…
… 1…2 …3
1
2… 0.89
3… 0.56 … 0.45
… 1… 2… 3
1
2 … 1 … >> this is the actual data the the nMDS is trying to show you! (it’s actually quite robust… eg against outliers)
3 … 2 … 3
Sorry my triangular matrix doesn’t come out so well. Hope you get the picture.
All the best
He is quite right - R can do anything. But… you have to figure out how to tell R how to do it first! FYI - mothur can do nmds as well using the nmds command. It’s pretty streamlined in mothur and has the same syntax as the pcoa/pca commands.
Hey,
Thanks for that little crash course on NMDS. I have another doubt regarding all this.
If I feed a distance matrix (constructed using mothur) that shows the distance between the samples I am studying.
I notice that most of the pairs of samples you would see as being similar (just by a glance at the matrix) do cluster close to each other in the NMDS, but occasionally the clustering does not seem to be faithful to the similarity in the input matrix. However, when I do a metric MDS, it is more faithful (but people criticize it for other reasons). Is it common to see some samples not clustering close together in the nmds ordination, while actually being close in the input matrix?
This is a very old thread! In the future it would be great if you could start a new one
There shouldn’t be much difference between the two methods. There is randomization involved so you won’t get the same result each time, but the orientation of the points to each other should be pretty consistent.