Beta-diversity Analysis with hagis

Austin McCoy

2023-09-06

Load Packages

These packages are necessary for this analysis to be conducted.

library("ape")
library("vegan")
library("dplyr")
library("hagis")
library("ggplot2")

Import the data to be used in analysis. These example data are included in {hagis} and so when loading {hagis} they become available in your R session.

head(P_sojae_survey) # survey sample data
##    Isolate         Line         Rps Total HR (1) Lesion (2)
## 1:       1     Williams susceptible    10      0          0
## 2:       1       Harlon      Rps 1a    10      4          0
## 3:       1 Harosoy 13xx      Rps 1b     8      0          0
## 4:       1     L75-3735      Rps 1c    10     10          0
## 5:       1    PI 103091      Rps 1d     9      2          0
## 6:       1  Williams 82      Rps 1k    10      0          0
##    Lesion to cotyledon (3) Dead (4) total.susc total.resis perc.susc perc.resis
## 1:                       0       10         10           0       100          0
## 2:                       0        6          6           4        60         40
## 3:                       0        8          8           0       100          0
## 4:                       0        0          0          10         0        100
## 5:                       1        6          7           2        78         22
## 6:                       0       10         10           0       100          0
head(sample_meta) # metatada about the sample collection locations
##   Sample   Locale
## 1      1 Michigan
## 2     10 Michigan
## 3     11 Michigan
## 4     12 Michigan
## 5     13 Michigan
## 6     14 Michigan

This removes the “MPS17_” from the isolates, so that they will be read as numeric instead of character. The next step removes the “Rps” from the gene names, so that they will be read as numeric instead of character.

P_sojae_survey$Isolate <-
  gsub(pattern = "MPS17_",
       replacement = "",
       x = P_sojae_survey$Isolate)
P_sojae_survey$Rps <-
  gsub(pattern = "Rps ",
       replacement = "",
       x = P_sojae_survey$Rps)

Set up the {hagis} arguments for analysis. Please see vignette("hagis") for more details on how to specify arguments for the functions in this package.

hagis_args <- list(
  x = P_sojae_survey,
  cutoff = 60,
  control = "susceptible",
  sample = "Isolate",
  gene = "Rps",
  perc_susc = "perc.susc"
)

Convert the Dataset to a Binary Data Matrix

Using create_binary_matrix() transforms the data so that it is in the correct format (binary data matrix) for PCOA analysis.

P_sojae_survey.matrix <- do.call(create_binary_matrix, hagis_args)

P_sojae_survey.matrix
##    1a 1b 1c 1d 1k 2 3a 3b 3c 4 5 6 7
## 1   1  1  0  1  1 1  1  1  0 0 1 1 1
## 10  1  0  1  0  0 0  0  1  0 0 1 0 1
## 11  1  0  1  0  0 0  0  1  0 0 1 1 1
## 12  1  1  1  1  1 1  0  0  0 0 0 1 1
## 13  1  1  1  1  1 0  0  1  0 0 0 0 1
## 14  1  1  1  0  1 0  0  1  0 0 1 1 1
## 15  1  1  1  1  1 1  0  1  0 1 1 1 1
## 16  1  1  1  0  1 0  0  1  0 0 1 0 1
## 17  1  1  1  1  1 1  0  1  0 1 1 0 1
## 18  1  1  1  1  1 0  1  1  0 0 1 1 1
## 19  1  1  1  1  1 1  1  1  1 0 0 1 1
## 2   1  1  1  0  1 1  0  1  1 1 0 1 1
## 20  1  1  1  1  1 1  1  1  1 0 1 0 1
## 21  1  1  1  1  1 1  1  1  1 1 1 1 1
## 3   1  1  1  1  1 1  0  1  0 1 0 1 1
## 4   1  0  1  1  1 1  0  1  0 0 1 0 1
## 5   1  0  1  1  1 1  0  1  0 0 0 1 1
## 6   1  0  1  1  1 1  0  1  0 0 1 0 1
## 7   1  1  1  1  1 1  0  1  0 0 0 0 1
## 8   1  1  1  1  1 1  0  1  0 0 0 0 1
## 9   1  0  1  1  0 0  0  1  0 0 1 0 1

The P_sojae_survey.matrix object contains the RPS genes numbered as rows and the columns are numbered isolates. A “1” indicates the isolate caused disease on the RPS gene, and a “0” means it did not.

Perform Principle Coordinates Analysis (PCOA)

The following code will transpose the P_sojae_survey.matrix and then calculate the Jaccard distances for each isolate. Jaccard distance calculations need to be used as pathotype data is presence/absence for virulence. Lastly, PCOA is performed to identify the variance explained by each principal coordinate. This will be used later to visualize and identify distance pathotype groupings by geographic location. In this example, Jaccard distances are used as this is presence/absence data.

P_sojae_survey.matrix.jaccard <-
  vegdist(P_sojae_survey.matrix, "jaccard", na.rm = TRUE)

After performing the principal coordinates analysis, we see that the scree plot says that about 70% of the variation in Jaccard distances are explained within the first two dimensions (i.e., axes). This is good. Usually a good rule of thumb is that if the second dimension is roughly half variation explained in the first dimension you don’t need to look further at the third or n+1 dimensions.

princoor.pathotype <- pcoa(P_sojae_survey.matrix.jaccard) 

barplot(princoor.pathotype$values$Relative_eig[1:10])

Now we can calculate the percentage of variation that each principal coordinate accounts for. Another way to calculate the percent variation is to look at the Relative_eig column.

# Dimension (i.e., Axis 1 (PCOA1))
Axis1.percent <-
  princoor.pathotype$values$Relative_eig[[1]] * 100

# Dimension (i.e., Axis 2 (PCOA2))
Axis2.percent <-
  princoor.pathotype$values$Relative_eig[[2]] * 100

Axis1.percent
## [1] 50.39109
Axis2.percent
## [1] 21.79118

Now we can make a data frame with the two principal coordinates that account for the most variation in the data. We will then add metadata to the data frame pca.data.

princoor.pathotype.data <-
  data.frame(
    Sample = as.integer(rownames(princoor.pathotype$vectors)),
    X = princoor.pathotype$vectors[, 1],
    Y = princoor.pathotype$vectors[, 2]
  )

Add Metadata to your PCOA Data

You will need to add information on the sample collection location or other data to help identify different pathotype groupings based on geographic location or other factors. We will use left_join() from {dplyr} to combine the princoor.pathotype.data with the metadata that we’ve already loaded, sample_meta that contains a geographic location (state name).

princoor.pathotype.data <-
  left_join(princoor.pathotype.data, sample_meta, by = "Sample")

princoor.pathotype.data
##    Sample            X           Y   Locale
## 1       1  0.127655783  0.08704548 Michigan
## 2      10 -0.441075005  0.01573886 Michigan
## 3      11 -0.336826428  0.21804192 Michigan
## 4      12  0.217071376 -0.03795693 Michigan
## 5      13 -0.003862869 -0.14942952 Michigan
## 6      14 -0.108034781  0.18124849 Michigan
## 7      15  0.082862290  0.06501932 Michigan
## 8      16 -0.182559838  0.01610323 Michigan
## 9      17  0.043684771 -0.07086878 Michigan
## 10     18 -0.007048533  0.11629976 Michigan
## 11     19  0.224528803  0.06847162 Michigan
## 12      2  0.190565779  0.16984304 Michigan
## 13     20  0.081014587 -0.01986841 Michigan
## 14     21  0.156490576  0.15103874 Michigan
## 15      3  0.187665103  0.01477482 Michigan
## 16      4 -0.088772478 -0.14970662 Michigan
## 17      5  0.069295886 -0.06198926 Michigan
## 18      6 -0.088772478 -0.14970662 Michigan
## 19      7  0.102108599 -0.17330058 Michigan
## 20      8  0.102108599 -0.17330058 Michigan
## 21      9 -0.328099742 -0.11749798 Michigan

Now we will plot the PCA data using {ggplot2} and color the points based on location, Locale, and identify the 95% confidence interval of those groups using the stat_ellipse() function.

ggplot(data = princoor.pathotype.data, aes(x = X, y = Y)) +
  geom_point(aes(colour = Locale)) +
  xlab(paste("PCOA1 - ", round(Axis1.percent, 2), "%", sep = "")) +
  ylab(paste("PCOA2 - ", round(Axis2.percent, 2), "%", sep = "")) +
  theme_bw() +
  theme(
    axis.title.x = element_text(face = "bold", size = 15),
    axis.title.y = element_text(face = "bold", size = 15),
    axis.text = element_text(face = "bold", size = 10),
    legend.title = element_text(face = "bold", size = 10),
    legend.text = element_text(face = "bold", size = 10),
    legend.key.size = unit(1, 'lines')
  ) +
  stat_ellipse(data = princoor.pathotype.data, aes(x = X, y = Y),
               level = 0.95) +
  ggtitle("Pathotype Jaccard Distances PCOA")

Statistical Tests for Beta Diversity

When using two or more pathotype datasets for comparisons, you can use beta-diversity tests to identify if there are significant differences between their sampled pathotype compositions. These code are presented as an example for further downstream analysis that can be used when comparing two or more populations’ pathotype composition.

In these examples we will artificially split the dataset into two, so that these analyses can be shown. When performing your own analyses you will likely have two geographic locations to compare already. Make sure you can differentiate these populations with the metadata file used previously (i.e., column in the dataset that specifies where the isolate came from; USA, Brazil, China, Australia, etc.).

Permutation Based Analysis of Variance (PERMANOVA) and Beta-dispersion Analyses

Beta-Dispersion

Beta-dispersion tests if the dispersion, variance, of two or more groups are significantly different or not. First, an item named “groups” must be made that contains lists of the location and number of isolates from that location used in the analysis. We will then check to make sure the lists in “groups” adds up to the number of isolated used in analysis.

First, make a list of the locations for each pathotype. Note that when you are using two or more locations you will need to make a list for each location with a length of isolates used.

groups <- factor(c(rep("Michigan_1", 11), rep("Michigan_2", 10)))

# this number shows how many isolates are in all "groups" lists combined
length(groups)
## [1] 21
# this shows the number of isolates within your data set, these numbers should
# match for downstream analyses to work!! 
length(unique(P_sojae_survey$Isolate))
## [1] 21

Next, beta-dispersion will be calculated using the Jaccard distance matrix made previously. An ANOVA is then performed to identify significance within the dataset. Post-hoc tests can be used to identify significant interactions between specific locations within the dataset. This can then be plotted to visualize how the beta-dispersion is different between groups.

 # calculates the beta-dispersion for each group, when comparing 2 or more
pathotype.disp <-
  betadisper(P_sojae_survey.matrix.jaccard, groups)

# tests if centroid distances are significantly different from each other
pathotype.disp.anova <- anova(pathotype.disp) 
pathotype.disp.anova
## Analysis of Variance Table
## 
## Response: Distances
##           Df   Sum Sq   Mean Sq F value Pr(>F)
## Groups     1 0.008375 0.0083752  0.9672 0.3377
## Residuals 19 0.164523 0.0086591
# test significance between each group
pathotype.disp.TukeyHSD <- TukeyHSD(pathotype.disp)
pathotype.disp.TukeyHSD
##   Tukey multiple comparisons of means
##     95% family-wise confidence level
## 
## Fit: aov(formula = distances ~ group, data = df)
## 
## $group
##                              diff        lwr        upr     p adj
## Michigan_2-Michigan_1 -0.03998626 -0.1250853 0.04511275 0.3377355
# plot showing the dispersion for each group
plot(pathotype.disp, hull = FALSE, ellipse = TRUE)

The ANOVA identified no significant differences between groups dispersion (p = 0.3377355). This means that the groups dispersion, or variance, is not significantly different from each other and the groups dispersion is likely homogeneous between groups. At this point, a Tukey HSD test is not warranted, but we use it as an example here. Again, a p-value of 0.3377355 is reported from the Tukey HSD tests and we reject the hypothesis that these groups may have different dispersion. We can plot the dispersion for each group using the plot() function. As expected, since we have identified no significant differences, the two groups dispersion overlap a great deal and are not distinct from each other. Again this shows that pathotype dispersion between the groups is homogeneous and not different in this instance.

If we were working with a data set that had groups with significantly different dispersion we would expect to see a significant ANOVA p-value (p < 0.05) as well as significance when using the Tukey HSD test. Lastly, the plotted dispersion will form distinct, separate, groups which can be observed.

Differences in beta-dispersion may indicate separate pathotype groups which should be further investigated with Permutation Based Analysis of Variance (PERMANOVA) and Analysis of Similarity (ANOSIM) analysis. Groups which have similar dispersion may still be significantly different in regards to their centroids, which will be tested using a PERMANOVA.

Permutation Based Analysis of Variance (PERMANOVA)

PERMANOVA tests if the centroids, similar to means, of each group are significantly different from each other. Likewise, an \(R^2\) statistic is calculated, showing the percentage of the variance explained by the groups.

pathotype.adonis <- adonis(P_sojae_survey.matrix.jaccard ~ groups)
## 'adonis' will be deprecated: use 'adonis2' instead
pathotype.adonis
## $aov.tab
## Permutation: free
## Number of permutations: 999
## 
## Terms added sequentially (first to last)
## 
##           Df SumsOfSqs  MeanSqs F.Model      R2 Pr(>F)
## groups     1   0.11358 0.113583  1.6229 0.07869  0.164
## Residuals 19   1.32976 0.069988         0.92131       
## Total     20   1.44335                  1.00000       
## 
## $call
## adonis(formula = P_sojae_survey.matrix.jaccard ~ groups)
## 
## $coefficients
## NULL
## 
## $coef.sites
##                     [,1]        [,2]        [,3]       [,4]       [,5]
## (Intercept)  0.356206294  0.47247525  0.45504258 0.36111093 0.33087421
## groups1     -0.007721445 -0.02921472 -0.04813257 0.01795243 0.01040219
##                    [,6]       [,7]        [,8]       [,9]       [,10]
## (Intercept)  0.33955905 0.27518277  0.35412523 0.28774687  0.31463605
## groups1     -0.05774087 0.01311983 -0.04013468 0.03179116 -0.03474624
##                  [,11]      [,12]      [,13]      [,14]      [,15]      [,16]
## (Intercept) 0.33437434 0.38567493 0.32215777 0.32867133 0.30119623 0.29928127
## groups1     0.02883821 0.03019708 0.03363795 0.02097902 0.03420322 0.05551671
##                  [,17]      [,18]      [,19]      [,20]       [,21]
## (Intercept) 0.32090891 0.29928127 0.28518807 0.28518807 0.412384837
## groups1     0.05108374 0.05551671 0.05197906 0.05197906 0.008538684
## 
## $f.perms
##                 [,1]
##    [1,]  1.115881259
##    [2,]  1.375408603
##    [3,]  0.428322266
##    [4,]  1.151755227
##    [5,]  0.284580119
##    [6,]  5.687296719
##    [7,]  0.045113872
##    [8,]  0.716526336
##    [9,]  0.558652247
##   [10,]  1.532282083
##   [11,]  0.451960012
##   [12,]  1.203060453
##   [13,]  0.277439670
##   [14,]  2.630094495
##   [15,] -0.004378867
##   [16,]  0.602161850
##   [17,]  1.849983477
##   [18,]  0.222863249
##   [19,]  0.645192271
##   [20,]  0.318422382
##   [21,]  1.625937224
##   [22,]  1.241485416
##   [23,]  0.916585357
##   [24,]  1.931245340
##   [25,]  0.419521388
##   [26,]  0.621068864
##   [27,]  1.060760137
##   [28,]  0.399892994
##   [29,]  1.521042483
##   [30,]  0.350338151
##   [31,]  0.925468153
##   [32,]  0.960578838
##   [33,]  0.959640878
##   [34,]  0.122005654
##   [35,]  0.726098800
##   [36,]  0.675050436
##   [37,]  0.525716229
##   [38,]  0.998204754
##   [39,]  1.772525319
##   [40,]  0.841329245
##   [41,]  0.619334030
##   [42,]  0.746316395
##   [43,]  0.307574306
##   [44,] -0.013439959
##   [45,]  1.635743333
##   [46,]  0.670125278
##   [47,]  0.879769308
##   [48,]  0.547318293
##   [49,]  0.162168794
##   [50,]  0.712992841
##   [51,]  1.705250573
##   [52,]  1.357739220
##   [53,]  1.033761670
##   [54,]  0.778395423
##   [55,]  0.953826982
##   [56,]  0.315001731
##   [57,]  0.895314653
##   [58,]  1.129145570
##   [59,]  1.209231318
##   [60,]  0.566648390
##   [61,]  0.518574652
##   [62,]  1.220309372
##   [63,]  1.852238027
##   [64,]  1.344679024
##   [65,]  0.205155668
##   [66,]  1.426167159
##   [67,]  0.634617789
##   [68,]  1.014816927
##   [69,]  3.257757100
##   [70,]  0.606211789
##   [71,]  0.817116218
##   [72,]  0.323830098
##   [73,]  0.237686636
##   [74,]  1.322380223
##   [75,]  0.811816240
##   [76,]  0.347077055
##   [77,]  0.339806510
##   [78,]  0.542182997
##   [79,]  1.067289480
##   [80,]  0.663468474
##   [81,]  0.014308005
##   [82,]  0.105369634
##   [83,]  0.736691416
##   [84,]  1.932472015
##   [85,] -0.008998066
##   [86,]  0.446971242
##   [87,]  0.357653746
##   [88,]  2.341824264
##   [89,]  1.581739231
##   [90,]  0.386018690
##   [91,]  0.499152234
##   [92,]  0.389337483
##   [93,]  0.545478240
##   [94,]  0.264849770
##   [95,]  0.613702288
##   [96,]  1.572464928
##   [97,]  1.741311089
##   [98,]  0.270042300
##   [99,]  0.801599668
##  [100,]  1.804891652
##  [101,]  0.060149455
##  [102,] -0.058230741
##  [103,]  0.777374535
##  [104,]  0.101289718
##  [105,]  1.014906367
##  [106,]  0.814652158
##  [107,]  1.238936923
##  [108,]  2.962571278
##  [109,]  0.501943614
##  [110,]  0.473231631
##  [111,]  3.177739573
##  [112,] -0.177386724
##  [113,]  0.148081332
##  [114,]  0.579355014
##  [115,]  0.183131078
##  [116,]  0.370438624
##  [117,]  0.499098610
##  [118,]  0.876974738
##  [119,]  0.678743646
##  [120,]  0.222064564
##  [121,]  0.286253331
##  [122,]  0.377276405
##  [123,]  1.451432914
##  [124,]  1.281794254
##  [125,]  0.112706663
##  [126,] -0.094993235
##  [127,]  0.979167377
##  [128,]  1.380056142
##  [129,]  0.176242862
##  [130,]  1.909991577
##  [131,]  0.835994680
##  [132,]  0.646179449
##  [133,]  2.355957019
##  [134,]  0.715069553
##  [135,] -0.000504821
##  [136,]  0.466634805
##  [137,]  0.744769637
##  [138,]  0.429949663
##  [139,]  0.228628099
##  [140,]  1.117549644
##  [141,]  1.842684122
##  [142,]  0.338335147
##  [143,]  0.005991964
##  [144,]  1.202700918
##  [145,]  0.940357655
##  [146,]  1.005994157
##  [147,]  1.360201739
##  [148,]  1.135514660
##  [149,]  0.447633125
##  [150,]  2.907553066
##  [151,]  0.575859197
##  [152,]  1.017984083
##  [153,]  0.192942237
##  [154,]  0.262114714
##  [155,]  0.595186816
##  [156,]  0.600831635
##  [157,]  0.499557920
##  [158,]  0.820927949
##  [159,]  2.971904874
##  [160,]  0.581654827
##  [161,]  1.741410359
##  [162,]  2.076319386
##  [163,]  0.318930672
##  [164,]  0.060312160
##  [165,]  0.340733823
##  [166,]  0.849391068
##  [167,]  1.039653158
##  [168,]  0.082568545
##  [169,]  0.601260514
##  [170,]  0.417222405
##  [171,]  0.860241179
##  [172,]  2.234556856
##  [173,]  0.720014387
##  [174,]  1.200661001
##  [175,]  0.396735339
##  [176,]  0.710069298
##  [177,]  2.034845756
##  [178,]  0.720788531
##  [179,]  0.541674314
##  [180,]  0.837562439
##  [181,]  1.798069512
##  [182,]  1.781470941
##  [183,]  0.445784025
##  [184,]  0.853029717
##  [185,]  2.614901678
##  [186,]  0.600388582
##  [187,]  1.521643793
##  [188,]  3.078914075
##  [189,]  0.606986304
##  [190,]  0.569552301
##  [191,]  1.182912578
##  [192,]  3.810498089
##  [193,]  1.932177503
##  [194,]  0.304078274
##  [195,]  0.808905547
##  [196,]  1.490772756
##  [197,]  0.468264528
##  [198,]  0.697822011
##  [199,]  0.627276296
##  [200,]  0.217939873
##  [201,]  0.553134074
##  [202,]  1.497161807
##  [203,]  0.508887025
##  [204,] -0.128614931
##  [205,]  0.628819801
##  [206,]  0.673919762
##  [207,]  2.519086457
##  [208,]  2.436565925
##  [209,]  1.109136267
##  [210,]  3.710893801
##  [211,]  0.920544247
##  [212,]  2.278422650
##  [213,]  1.777162136
##  [214,]  0.475143942
##  [215,]  0.822677274
##  [216,]  0.009816975
##  [217,]  1.105775867
##  [218,]  0.742872731
##  [219,]  0.559031421
##  [220,]  2.549892072
##  [221,]  1.147866864
##  [222,]  1.769090412
##  [223,]  3.047635499
##  [224,]  3.204938478
##  [225,]  2.058330423
##  [226,]  0.361690884
##  [227,]  1.496332245
##  [228,]  1.577472436
##  [229,]  1.595266795
##  [230,]  0.292130156
##  [231,]  0.198261171
##  [232,]  1.708562799
##  [233,]  1.628174907
##  [234,]  0.717805971
##  [235,]  1.640193201
##  [236,]  0.537827277
##  [237,]  0.335025665
##  [238,]  1.143824888
##  [239,]  1.714643999
##  [240,]  0.733832230
##  [241,]  1.461687202
##  [242,]  0.362891580
##  [243,]  1.294508572
##  [244,]  0.642028293
##  [245,]  0.924539131
##  [246,]  1.126142741
##  [247,]  0.623140841
##  [248,]  0.940044088
##  [249,]  3.010450116
##  [250,]  0.420097056
##  [251,]  0.626719761
##  [252,]  0.356747069
##  [253,]  1.839868659
##  [254,]  0.171838980
##  [255,]  0.317062943
##  [256,]  0.648950416
##  [257,]  2.272781086
##  [258,]  0.200666320
##  [259,]  0.324488809
##  [260,]  1.678437959
##  [261,]  0.375140973
##  [262,]  1.323013257
##  [263,]  1.913724509
##  [264,]  0.800217574
##  [265,]  2.802447432
##  [266,]  1.473989353
##  [267,]  0.112481445
##  [268,]  1.654490705
##  [269,]  2.002470040
##  [270,]  0.660457619
##  [271,]  0.864890945
##  [272,]  1.751057545
##  [273,]  0.961809774
##  [274,]  1.411762697
##  [275,]  0.393684068
##  [276,]  0.600880633
##  [277,]  1.085848191
##  [278,]  0.912747137
##  [279,]  3.225978519
##  [280,]  0.468536045
##  [281,]  1.035614667
##  [282,]  0.523563914
##  [283,]  2.206223604
##  [284,]  0.413714286
##  [285,]  0.670618483
##  [286,]  0.708796090
##  [287,]  0.319746954
##  [288,]  2.663581747
##  [289,]  0.532744387
##  [290,]  0.465652931
##  [291,]  0.022618486
##  [292,] -0.210864029
##  [293,]  0.368020690
##  [294,]  1.682235941
##  [295,]  0.047926513
##  [296,]  1.687772895
##  [297,]  1.022761537
##  [298,]  0.427904262
##  [299,]  0.892464179
##  [300,]  0.697286685
##  [301,]  0.684078943
##  [302,]  0.917290535
##  [303,]  2.278231154
##  [304,]  0.400909000
##  [305,]  0.566200942
##  [306,]  0.663986682
##  [307,]  0.727613175
##  [308,]  2.206192991
##  [309,]  1.091821629
##  [310,]  1.505870756
##  [311,]  0.588468579
##  [312,]  0.250545185
##  [313,]  0.219098770
##  [314,]  0.440965247
##  [315,]  0.369780445
##  [316,] -0.005589925
##  [317,]  0.826498192
##  [318,]  0.225339161
##  [319,]  0.347782284
##  [320,]  1.012536812
##  [321,]  0.460760587
##  [322,]  0.885453385
##  [323,]  1.082345355
##  [324,]  2.314154552
##  [325,]  0.151736247
##  [326,]  2.500447169
##  [327,]  1.011095574
##  [328,]  1.553744527
##  [329,]  0.784618841
##  [330,]  0.812212991
##  [331,]  0.424452248
##  [332,]  0.845155515
##  [333,]  1.607391308
##  [334,]  0.255972780
##  [335,]  1.580653090
##  [336,]  1.139112934
##  [337,]  0.300064084
##  [338,]  2.444383084
##  [339,]  2.213080658
##  [340,]  0.200890677
##  [341,]  1.140953455
##  [342,]  0.746178636
##  [343,] -0.184105226
##  [344,] -0.004324692
##  [345,]  1.035167277
##  [346,]  1.177195081
##  [347,]  0.447628482
##  [348,]  0.603908839
##  [349,]  2.123569396
##  [350,] -0.043419035
##  [351,]  0.490327572
##  [352,]  0.133143762
##  [353,]  0.164330812
##  [354,]  1.099862200
##  [355,]  0.604461026
##  [356,]  0.114203879
##  [357,]  2.351274270
##  [358,]  0.444426978
##  [359,]  1.361139722
##  [360,]  1.381400861
##  [361,]  0.629190769
##  [362,]  0.953200518
##  [363,]  3.489667339
##  [364,]  1.607587210
##  [365,]  0.768000073
##  [366,]  0.527312820
##  [367,]  1.240990076
##  [368,]  0.604955035
##  [369,]  2.412689469
##  [370,]  1.186955954
##  [371,] -0.154446827
##  [372,]  0.243598471
##  [373,]  2.579347243
##  [374,]  0.871611150
##  [375,]  0.937621471
##  [376,]  0.518155564
##  [377,]  1.378246112
##  [378,]  0.473735356
##  [379,]  0.792344310
##  [380,]  1.347539512
##  [381,]  0.816621028
##  [382,] -0.081339351
##  [383,]  1.199200380
##  [384,]  1.026990888
##  [385,]  1.273869142
##  [386,]  0.116550689
##  [387,]  0.395840679
##  [388,]  0.556048360
##  [389,]  1.093214412
##  [390,]  0.391391414
##  [391,]  1.153805973
##  [392,]  1.264321355
##  [393,]  0.805585530
##  [394,]  4.820840583
##  [395,]  2.167975932
##  [396,]  0.820697427
##  [397,]  0.383113584
##  [398,]  0.417611952
##  [399,]  0.880207361
##  [400,]  2.115439431
##  [401,]  0.982396885
##  [402,]  0.591923296
##  [403,]  2.313478293
##  [404,]  1.976837403
##  [405,]  0.318412078
##  [406,]  1.942136266
##  [407,]  0.370625769
##  [408,]  0.913551126
##  [409,]  1.562478823
##  [410,]  0.478164177
##  [411,]  1.573242101
##  [412,]  2.507241705
##  [413,]  1.145217592
##  [414,]  1.628300595
##  [415,]  0.369367174
##  [416,]  2.940635971
##  [417,]  0.855031726
##  [418,]  1.201088691
##  [419,]  0.977164561
##  [420,]  0.490902742
##  [421,]  1.231336640
##  [422,]  0.288935627
##  [423,]  2.159625887
##  [424,]  0.622331307
##  [425,]  0.975953706
##  [426,]  0.512386703
##  [427,]  0.287522729
##  [428,]  2.762805112
##  [429,]  0.749447214
##  [430,]  1.444967043
##  [431,]  2.745517536
##  [432,]  1.234139587
##  [433,]  0.400603138
##  [434,]  0.354841699
##  [435,] -0.071896666
##  [436,]  0.742268115
##  [437,]  1.016179546
##  [438,]  0.348741024
##  [439,]  1.128510941
##  [440,]  0.491733659
##  [441,]  0.133990014
##  [442,]  2.930150203
##  [443,]  0.758134740
##  [444,]  2.907098916
##  [445,]  0.272765116
##  [446,]  0.453678487
##  [447,]  0.676017445
##  [448,]  1.154512002
##  [449,]  1.429460434
##  [450,]  0.175570538
##  [451,]  0.966317096
##  [452,]  1.586527757
##  [453,]  1.091245422
##  [454,]  1.395964868
##  [455,]  0.468880791
##  [456,]  1.608100810
##  [457,]  0.098198602
##  [458,]  1.057889911
##  [459,]  0.914883233
##  [460,]  1.227951038
##  [461,]  1.870709583
##  [462,]  0.653986983
##  [463,]  1.532034011
##  [464,]  0.711996732
##  [465,]  2.902372287
##  [466,]  0.079695101
##  [467,]  0.824097013
##  [468,]  0.694945070
##  [469,]  0.129142723
##  [470,]  0.868653121
##  [471,]  0.588692549
##  [472,]  1.547166141
##  [473,]  0.098413109
##  [474,]  1.701453919
##  [475,]  0.482086603
##  [476,]  1.210930250
##  [477,]  0.292718582
##  [478,]  0.248179472
##  [479,]  1.500635678
##  [480,]  0.659569818
##  [481,]  0.535532508
##  [482,]  1.991486211
##  [483,]  0.454175149
##  [484,]  0.279870035
##  [485,]  0.009816975
##  [486,]  0.525474577
##  [487,]  1.077567053
##  [488,]  2.016754714
##  [489,]  1.022050397
##  [490,]  2.278709559
##  [491,]  0.360777164
##  [492,]  0.599345839
##  [493,]  0.634354911
##  [494,]  1.714150039
##  [495,]  0.170440907
##  [496,]  0.083033306
##  [497,]  0.534841285
##  [498,] -0.113516554
##  [499,]  0.535532508
##  [500,]  0.485411846
##  [501,]  1.150462092
##  [502,]  0.283634988
##  [503,]  0.635613849
##  [504,]  1.345041069
##  [505,]  1.181796568
##  [506,]  0.905798615
##  [507,]  1.375599937
##  [508,]  2.485059637
##  [509,]  1.143707981
##  [510,]  0.036192799
##  [511,]  0.593897283
##  [512,]  0.967239415
##  [513,]  0.544957277
##  [514,]  0.697465693
##  [515,]  0.964172587
##  [516,]  2.073071780
##  [517,]  0.016999485
##  [518,]  0.556084771
##  [519,]  1.261369165
##  [520,]  0.865073797
##  [521,]  0.253681794
##  [522,]  0.777776705
##  [523,]  0.446689895
##  [524,]  1.529333734
##  [525,]  0.566407748
##  [526,]  0.816740366
##  [527,]  0.127357059
##  [528,]  1.373461420
##  [529,]  0.146602748
##  [530,]  0.607717502
##  [531,]  0.509853158
##  [532,]  0.139846764
##  [533,]  0.595327214
##  [534,]  1.138096695
##  [535,]  2.388183632
##  [536,]  0.296084966
##  [537,]  0.737335471
##  [538,]  0.731081865
##  [539,]  1.667153079
##  [540,]  1.314452917
##  [541,]  0.226336951
##  [542,]  1.579128831
##  [543,] -0.053604401
##  [544,]  0.223401615
##  [545,]  0.066026142
##  [546,]  0.544951799
##  [547,]  1.221485766
##  [548,]  3.768660449
##  [549,]  1.880825005
##  [550,]  0.465542115
##  [551,]  1.274146138
##  [552,]  0.588937600
##  [553,]  0.343083187
##  [554,]  1.419307038
##  [555,]  0.801662979
##  [556,]  0.661933834
##  [557,]  0.259206139
##  [558,]  0.144127465
##  [559,]  0.989127215
##  [560,]  0.287185419
##  [561,]  0.448717035
##  [562,]  0.700435024
##  [563,]  0.316887055
##  [564,]  0.921651535
##  [565,]  1.272901755
##  [566,]  0.822213748
##  [567,]  2.571238469
##  [568,]  0.408281189
##  [569,]  0.159066532
##  [570,]  0.629867275
##  [571,]  1.085243300
##  [572,]  0.300792168
##  [573,]  1.170249274
##  [574,]  0.517727092
##  [575,]  0.446172418
##  [576,]  2.570088045
##  [577,]  0.189611155
##  [578,]  1.383866182
##  [579,]  1.054012178
##  [580,]  1.421257868
##  [581,]  2.399909906
##  [582,]  1.220020920
##  [583,]  1.057208412
##  [584,]  0.343803046
##  [585,]  0.909606398
##  [586,]  1.247329516
##  [587,]  0.783989087
##  [588,]  0.411873077
##  [589,]  0.707706116
##  [590,]  0.133629213
##  [591,]  0.405270618
##  [592,]  1.001052763
##  [593,]  1.014552604
##  [594,]  0.908033169
##  [595,]  0.491360750
##  [596,]  0.977883989
##  [597,]  1.221551860
##  [598,]  0.500387706
##  [599,]  0.328067467
##  [600,]  0.711030981
##  [601,]  0.280885837
##  [602,]  1.267266445
##  [603,]  0.859931069
##  [604,]  0.376441565
##  [605,]  1.097317256
##  [606,]  0.479883380
##  [607,]  0.203696574
##  [608,]  0.217698386
##  [609,]  0.212271252
##  [610,] -0.014261994
##  [611,]  1.007965119
##  [612,]  1.228448377
##  [613,]  0.278747955
##  [614,]  0.573414358
##  [615,]  0.673581822
##  [616,]  0.573012875
##  [617,]  2.377483247
##  [618,]  0.227045237
##  [619,]  0.850024100
##  [620,]  0.234037965
##  [621,]  1.060711631
##  [622,]  0.320916945
##  [623,]  0.662395606
##  [624,] -0.101747037
##  [625,]  1.835148474
##  [626,]  0.422833454
##  [627,]  2.317963484
##  [628,]  0.315213510
##  [629,]  0.232024846
##  [630,]  0.596585702
##  [631,]  1.250488654
##  [632,]  0.387026980
##  [633,]  3.122967380
##  [634,]  0.386073891
##  [635,]  0.441990651
##  [636,]  0.352073540
##  [637,]  0.033701941
##  [638,]  0.464160060
##  [639,]  0.576453102
##  [640,]  1.122317275
##  [641,]  0.381614219
##  [642,]  0.561564706
##  [643,]  0.388864018
##  [644,]  1.192956581
##  [645,]  0.698958924
##  [646,]  0.498985207
##  [647,]  1.854630342
##  [648,]  0.524577439
##  [649,]  1.288056809
##  [650,] -0.071988210
##  [651,]  1.527703855
##  [652,]  1.157373814
##  [653,]  0.818800328
##  [654,]  0.447812238
##  [655,]  1.128541994
##  [656,]  2.598601755
##  [657,]  1.482704588
##  [658,]  0.708078209
##  [659,]  0.798988185
##  [660,]  1.434459381
##  [661,]  1.053871903
##  [662,]  0.068402991
##  [663,]  2.057908269
##  [664,]  0.735667288
##  [665,]  0.199184651
##  [666,]  0.934465727
##  [667,]  1.014070741
##  [668,]  1.094787284
##  [669,]  1.118702134
##  [670,]  0.598492321
##  [671,]  1.838764032
##  [672,]  0.320456475
##  [673,]  1.274039964
##  [674,]  0.608276812
##  [675,]  0.997608766
##  [676,]  1.007343761
##  [677,]  0.325674093
##  [678,]  1.820605245
##  [679,]  1.001994819
##  [680,]  0.991817992
##  [681,]  2.325851666
##  [682,]  0.686764796
##  [683,]  1.669557202
##  [684,]  0.943477775
##  [685,]  0.054734885
##  [686,]  0.256684593
##  [687,]  1.571075844
##  [688,] -0.037743767
##  [689,]  2.360428327
##  [690,]  1.011730052
##  [691,]  0.399743405
##  [692,]  3.419366541
##  [693,]  0.636347091
##  [694,]  1.483261725
##  [695,]  0.837539294
##  [696,]  0.741380690
##  [697,]  0.392159508
##  [698,]  0.145814694
##  [699,]  0.432340061
##  [700,]  1.340153587
##  [701,]  0.483764778
##  [702,]  0.544060388
##  [703,]  1.150006897
##  [704,]  3.084711379
##  [705,]  0.804561897
##  [706,]  0.874733981
##  [707,]  0.283285354
##  [708,]  0.584017490
##  [709,]  2.044111719
##  [710,]  1.561465065
##  [711,]  0.590706965
##  [712,]  1.655032291
##  [713,]  0.180552769
##  [714,]  0.167199021
##  [715,]  1.266813216
##  [716,]  0.452334659
##  [717,]  0.762605811
##  [718,]  2.064021088
##  [719,] -0.126127012
##  [720,]  1.327845501
##  [721,]  0.139866942
##  [722,]  1.881757476
##  [723,]  0.997072978
##  [724,]  1.022472722
##  [725,]  0.994690241
##  [726,]  0.977734523
##  [727,]  1.925635118
##  [728,]  1.061475401
##  [729,]  1.864901477
##  [730,]  0.586399479
##  [731,]  0.512062731
##  [732,]  0.663311213
##  [733,]  0.479311471
##  [734,]  1.534273086
##  [735,]  1.363652866
##  [736,]  1.090447070
##  [737,] -0.075787283
##  [738,]  0.657104018
##  [739,]  0.333129305
##  [740,]  0.215983217
##  [741,] -0.121262061
##  [742,]  3.222305297
##  [743,]  0.487303727
##  [744,]  0.656172961
##  [745,]  0.527406436
##  [746,]  0.733124713
##  [747,]  0.358353782
##  [748,]  1.196233323
##  [749,]  0.422305158
##  [750,]  2.027515212
##  [751,]  0.725439278
##  [752,]  0.033372370
##  [753,]  1.096455894
##  [754,]  0.555383405
##  [755,]  0.006021646
##  [756,]  0.270611891
##  [757,]  0.524924002
##  [758,]  0.164532711
##  [759,]  0.541099676
##  [760,]  1.294948235
##  [761,]  1.005759413
##  [762,]  1.515045121
##  [763,]  2.046107714
##  [764,]  0.931043729
##  [765,]  0.542390163
##  [766,]  0.901293578
##  [767,]  0.499089218
##  [768,]  0.740806342
##  [769,]  0.736994121
##  [770,]  1.832142412
##  [771,]  0.871806369
##  [772,]  0.050714981
##  [773,]  1.812723081
##  [774,]  1.240959184
##  [775,]  1.744758976
##  [776,]  1.010683883
##  [777,]  1.386483940
##  [778,]  0.432943649
##  [779,]  0.582451344
##  [780,]  0.295817365
##  [781,]  0.111682751
##  [782,]  0.588964203
##  [783,]  0.660776718
##  [784,]  1.626558940
##  [785,]  0.308809799
##  [786,]  3.703411973
##  [787,]  2.209235327
##  [788,]  0.761478659
##  [789,]  0.978305652
##  [790,]  0.513098934
##  [791,]  0.327048499
##  [792,]  0.027400475
##  [793,]  2.859604645
##  [794,]  0.394532090
##  [795,]  1.758496062
##  [796,]  1.304974817
##  [797,]  1.164011723
##  [798,]  1.947248842
##  [799,]  0.690705611
##  [800,]  1.086930150
##  [801,]  0.235963599
##  [802,]  2.116316679
##  [803,]  5.742636984
##  [804,]  1.472050136
##  [805,]  1.637450004
##  [806,]  1.166032142
##  [807,]  0.611615522
##  [808,]  1.304433118
##  [809,]  0.565551356
##  [810,]  2.996001254
##  [811,]  2.105723433
##  [812,]  1.118635313
##  [813,]  1.364736920
##  [814,]  0.514604028
##  [815,]  0.573770980
##  [816,]  0.734168260
##  [817,]  0.697938194
##  [818,]  1.198502127
##  [819,]  0.520062026
##  [820,]  0.937293999
##  [821,]  0.581512730
##  [822,]  1.505243662
##  [823,]  1.300639786
##  [824,]  2.094507013
##  [825,]  0.448136226
##  [826,]  1.151490920
##  [827,]  0.102945862
##  [828,] -0.130623091
##  [829,]  1.327999153
##  [830,]  1.859359566
##  [831,]  2.112566732
##  [832,]  0.177827958
##  [833,]  0.744769637
##  [834,]  0.198970261
##  [835,]  1.314836217
##  [836,]  1.133361860
##  [837,]  1.497378246
##  [838,]  2.001137416
##  [839,]  0.275272717
##  [840,]  0.220717040
##  [841,]  0.702543940
##  [842,]  0.064680117
##  [843,]  0.281335276
##  [844,]  0.716283466
##  [845,]  0.733832230
##  [846,]  0.499522975
##  [847,]  0.630875436
##  [848,]  1.260408066
##  [849,]  0.448185075
##  [850,]  3.530409545
##  [851,]  0.856008844
##  [852,]  0.782844626
##  [853,]  1.253369938
##  [854,]  0.421012856
##  [855,]  1.276689551
##  [856,]  0.234798765
##  [857,]  0.368228335
##  [858,]  1.636921025
##  [859,]  0.859699538
##  [860,]  0.544301495
##  [861,]  0.536564317
##  [862,]  0.274760352
##  [863,]  2.656555103
##  [864,]  0.073818030
##  [865,]  1.596844673
##  [866,]  0.039997881
##  [867,]  1.083614517
##  [868,]  0.832325490
##  [869,]  0.868339779
##  [870,]  0.506203509
##  [871,]  0.595642431
##  [872,]  1.103108728
##  [873,]  0.329543544
##  [874,]  2.875945180
##  [875,]  0.445326853
##  [876,]  1.668201511
##  [877,]  0.604614256
##  [878,]  0.796772715
##  [879,]  0.264277830
##  [880,]  0.887471443
##  [881,]  1.668079822
##  [882,]  1.706326858
##  [883,]  1.049923386
##  [884,]  0.674923217
##  [885,]  1.749518345
##  [886,]  0.320215639
##  [887,]  0.443343075
##  [888,]  0.271556290
##  [889,]  1.881493375
##  [890,]  1.941097164
##  [891,]  0.651960634
##  [892,]  2.824587706
##  [893,]  0.707494246
##  [894,]  0.114640463
##  [895,]  0.963984848
##  [896,]  0.329174305
##  [897,]  0.504641020
##  [898,]  1.347164510
##  [899,]  0.647017568
##  [900,]  0.700038421
##  [901,]  1.116152481
##  [902,]  0.965901188
##  [903,]  0.723927340
##  [904,]  1.559095292
##  [905,]  0.286947597
##  [906,]  0.051812052
##  [907,]  0.490767356
##  [908,]  1.498078095
##  [909,]  0.249995458
##  [910,]  0.238971805
##  [911,]  1.107566508
##  [912,]  0.333920096
##  [913,]  0.498365688
##  [914,]  1.193472997
##  [915,]  0.081207636
##  [916,]  0.785017928
##  [917,]  1.704926881
##  [918,]  0.920667879
##  [919,]  0.128242065
##  [920,]  0.231988252
##  [921,]  3.114965996
##  [922,]  0.538033547
##  [923,]  1.399491696
##  [924,]  0.908787549
##  [925,]  0.744409734
##  [926,]  0.884735724
##  [927,]  1.291414227
##  [928,]  0.189611155
##  [929,]  0.387237851
##  [930,]  0.581728143
##  [931,]  0.390388227
##  [932,]  0.551508242
##  [933,]  0.696963608
##  [934,]  0.539611057
##  [935,]  0.467257582
##  [936,]  0.566734019
##  [937,]  1.077345770
##  [938,]  0.859970590
##  [939,]  0.342192859
##  [940,]  0.932407106
##  [941,]  0.124485132
##  [942,]  0.366562249
##  [943,]  1.973895871
##  [944,]  0.477727267
##  [945,]  1.060739895
##  [946,]  0.149732787
##  [947,]  0.513136776
##  [948,]  0.368497949
##  [949,]  1.785865865
##  [950,]  1.428659542
##  [951,]  0.860756666
##  [952,]  3.598184265
##  [953,]  0.490747526
##  [954,]  1.705884310
##  [955,]  1.292450053
##  [956,]  1.175740153
##  [957,]  1.088151376
##  [958,]  1.385905131
##  [959,]  0.147540076
##  [960,]  0.758221814
##  [961,]  1.314848952
##  [962,]  0.597540538
##  [963,]  2.386506919
##  [964,]  0.955931203
##  [965,]  1.801391668
##  [966,]  0.086477833
##  [967,]  2.162689560
##  [968,]  1.346143159
##  [969,]  1.151322117
##  [970,]  0.436971864
##  [971,]  0.753920514
##  [972,]  0.727652330
##  [973,]  1.323436869
##  [974,]  0.705176630
##  [975,]  1.317301930
##  [976,]  1.743601047
##  [977,]  0.930534090
##  [978,]  0.598598497
##  [979,]  0.648716101
##  [980,]  0.316107749
##  [981,]  0.825681835
##  [982,]  1.457757950
##  [983,]  0.472454027
##  [984,]  0.334302606
##  [985,]  0.292607921
##  [986,]  1.251985137
##  [987,]  0.526175347
##  [988,]  2.413021052
##  [989,]  1.365977621
##  [990,]  0.052881569
##  [991,]  0.610906888
##  [992,]  0.166501146
##  [993,]  0.875601595
##  [994,]  0.140538998
##  [995,]  0.710374134
##  [996,]  1.619420056
##  [997,]  1.452505599
##  [998,]  1.612820530
##  [999,]  0.075144862
## 
## $model.matrix
##    (Intercept) groups1
## 1            1       1
## 2            1       1
## 3            1       1
## 4            1       1
## 5            1       1
## 6            1       1
## 7            1       1
## 8            1       1
## 9            1       1
## 10           1       1
## 11           1       1
## 12           1      -1
## 13           1      -1
## 14           1      -1
## 15           1      -1
## 16           1      -1
## 17           1      -1
## 18           1      -1
## 19           1      -1
## 20           1      -1
## 21           1      -1
## 
## $terms
## P_sojae_survey.matrix.jaccard ~ groups
## attr(,"variables")
## list(P_sojae_survey.matrix.jaccard, groups)
## attr(,"factors")
##                               groups
## P_sojae_survey.matrix.jaccard      0
## groups                             1
## attr(,"term.labels")
## [1] "groups"
## attr(,"order")
## [1] 1
## attr(,"intercept")
## [1] 1
## attr(,"response")
## [1] 1
## attr(,".Environment")
## <environment: R_GlobalEnv>
## 
## attr(,"class")
## [1] "adonis"

The PERMANOVA identified no significant differences between the groups centroids, or means (p = 0.164). In addition to identifying significance between group centroids, the PERMANOVA also calculates how much of the variance can be explained by the specified groups (see the \(R^2\) column in the PERMANOVA output). In this case, the \(R^2\) is 0.164, so 16.4% of the variance is explained by the groups used in analysis. Based on the PERMANOVA results we can conclude that these two groups are not different from each other and likely have similar pathotypes to each other.

Analysis of Similarity (ANOSIM)

ANOSIM statistic (R) ranges from between -1 and 1. Positive numbers suggest that there is more similarity within groups than there is between groups. Values close to zero indicate no difference between groups (i.e., similarities are the same between groups).

pathotype.anosim <- anosim(P_sojae_survey.matrix.jaccard, groups)

pathotype.anosim
## 
## Call:
## anosim(x = P_sojae_survey.matrix.jaccard, grouping = groups) 
## Dissimilarity: jaccard 
## 
## ANOSIM statistic R: 0.06882 
##       Significance: 0.165 
## 
## Permutation: free
## Number of permutations: 999

ANOSIM statistic (R) was 0.0688182, so there are more similarities between groups than there are within groups. This is evidence that the groups are not different from one another. Likewise the significance is >0.05 so there is no significant difference between groups’ similarities.