In R, install the package "devtools" if you haven't already, and use install_github
to get this package.
install.packages("devtools")
library("devtools")
install_github("jfukuyama/phyloseqGraphTest")
This package is meant to be used with phyloseq, so suppose that you have a phyloseq object called ps. The sample data in the phyloseq object has a column corresponding to the groups you want to test, called testVar. This should be given as a character string. If applicable, you can also specify a stratification variable (like the strata argument in adonis) either by its name or as a vector with the same number of entries as samples in ps. So for example, to perform the test you would use
gt = graph_perm_test(ps, sampletype = "testVar", grouping = "stratVar",
distance = "jaccard", type = "mst")
Then the p-value is stored in gt$pval
, and you can plot the network constructed and the permutation distribution (with the observed test statistic marked in red) with the functions plot_test_network
and plot_permutations
.
plot_test_network(gt)
plot_permutations(gt)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.