Alpha and beta diversity
All statistical analyses were performed using R v.4.1.0. We examined rarefaction curves to assess if sampling depth was adequate and all samples plateaued (Supplementary Figure S2). Alpha diversity was quantified using Chao1 as an estimate of species richness, and Shannon diversity which also accounts for evenness of ASVs in a sample. To determine if host species, tissue type, their interactions, or sex and foraging type significantly affect diversity, a linear mixed effect model was constructed using lmer (Bates et al. 2011), with separate models for Chao1 and Shannon diversity. In both models, individual bee was included as a random effect and p-values were calculated using the lmerTest package (Kuznetsova et al. 2017).
To examine drivers of species composition among samples, we first examined if predictor variables, including species, tissue, geographic location, or sex contributed significantly to differences in species composition, using permutational ANOVA (PERMANOVA) using adonis2and assessed variation in dispersion among groups usingbetadisper (Oksanen et al. 2012). We present results using Bray-Curtis dissimilarities in the main text, but results are nearly identical to those based on weighted Unifrac dissimilarities (both presented in Supplementary Table S1). Differences between GI tract tissues were confirmed using PERMANOVA on a subset of the data containing only bees from which both the crop and gut sequenced successfully.
Because not all species of bee were sampled at each site, we conducted additional analyses to validate detected species and geographic effects in our dataset using stratified PERMANOVA. First, we subset the dataset to only samples collected in Davis, where both bee species were sampled and examined effects of bee species. Second, we examined the effect of sampling location separately for each bee species. In both cases, we used PERMANOVA implemented in adonis2 .
Additionally, to examine if bees caught foraging or nesting differed in bacterial diversity or composition, we repeated all alpha and beta diversity analyses on only X. sonorina samples, the only bee species for which we had nesting and foraging individuals. Models included sampling location, tissue, behavior and sex.