joey711 / phyloseq

phyloseq is a set of classes, wrappers, and tools (in R) to make it easier to import, store, and analyze phylogenetic sequencing data; and to reproducibly share that data and analysis with others. See the phyloseq front page:
http://joey711.github.io/phyloseq/
582 stars 187 forks source link

How to get the explained variance form ordinate #1668

Open theo-allnutt-bioinformatics opened 1 year ago

theo-allnutt-bioinformatics commented 1 year ago

As the title says.. using PCoA, I cannot see an explained variance variable or an explanation of the 'trace' variable.

Thanks.

spholmes commented 1 year ago

Hi Theo, It depends which type of ordination you are doing, NMDS for instance doesn't have such a diagnostic and you need to use a stressplot to see how well it is representing the data, on the other hand for a standard MDS the output with contain the eigenvalues which are the explained variances. The example at the end of the this tutorial shows the percentage variance is plotted: https://joey711.github.io/phyloseq/plot_ordination-examples.html

The tricky part is if your data are non Euclidean some of the eigenvalues are negative so the functions usually add the negative one to start with and the computes the explained variance, see for instance: https://stackoverflow.com/questions/54863687/pcoa-function-pcoa-extract-vectors-percentage-of-variance-explained

Hope this helps, Susan

On Tue, Mar 21, 2023 at 5:38 AM Theo Allnutt Bioinformatics < @.***> wrote:

As the title says.. using PCoA, I cannot see an explained variance variable or an explanation of the 'trace' variable.

Thanks.

— Reply to this email directly, view it on GitHub https://github.com/joey711/phyloseq/issues/1668, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAJFZPIHU2TFJF4XEOKHCS3W5E5EBANCNFSM6AAAAAAWB7BOI4 . You are receiving this because you are subscribed to this thread.Message ID: @.***>

-- Susan Holmes

theo-allnutt-bioinformatics commented 1 year ago

Thanks, that is clearer now. Although, still do not know what the 'trace' variable is.

theo-allnutt-bioinformatics commented 1 year ago

Also - I cannot see a plot of the percentage variance in that tutorial.