Forest disturbance increases functional diversity but decreases phylogenetic diversity of an arboreal tropical ant community

1. Tropical rainforest trees host a diverse arthropod fauna that can be character - ised by their functional diversity (FD) and phylogenetic diversity (PD). Human disturbance degrades tropical forests, often coinciding with

Secondary forests-which are forests regrown after a severe disturbance, mostly created by human activities-represent one the most common environments in the tropics (Asner et al., 2009;Hansen et al., 2013).Understanding the consequences of human disturbance altering tropical old-growth forests to secondary vegetation is paramount to the future of biodiversity (Gibson et al., 2011).However, substantial knowledge gaps persist, such as the limited investigation into the faunal susceptibility of the species-rich canopy and arboreal communities to these disturbances (Whitworth et al., 2016(Whitworth et al., , 2019)).
Detecting and quantifying the effects of disturbance on biodiversity is imperative both for conservation and for understanding community assembly (Cadotte et al., 2011;Kraft et al., 2015).In most tropical forest systems, secondary forests are impoverished in their species diversity and are often inhabited by invasive species (Didham et al., 2007;Dunn, 2004;Gibson et al., 2011), though factors relating to species diversity are numerous and secondary forests are also important reserves for species diversity (Chazdon et al., 2009).However, taxonomic diversity is limited in predicting important ecosystem properties and other components of biodiversity such as species' functional traits and their evolutionary history have been a promising addition to advance our understanding of disturbance effects on community assembly and ecosystem functioning (Cadotte et al., 2010(Cadotte et al., , 2011)).Functional traits link the performance of species to their environment, and the diversity of these traits (functional diversity, FD) can be related to ecosystem functioning (Cadotte et al., 2010;Diaz & Cabido, 2001).In addition, phylogenetic diversity (PD) captures the evolutionary history of a community and typically correlates with key ecosystem properties, such as stability and community productivity (Flynn et al., 2011;Srivastava et al., 2012;Tucker et al., 2018).Both FD and PD are multifaceted concepts that can be broken down into different components and measured at many scales, which ultimately affects their interpretation (Carmona et al., 2016;Skarbek et al., 2020).Still, a rich body of evidence suggests that FD and PD decreases under human disturbance among plants and animals (e.g., Bihn et al., 2010;Bu et al., 2014;Letcher et al., 2012;Liu et al., 2016;Matuoka et al., 2020;Whitfeld et al., 2012).However, at least some of the tropical fauna, such as birds, ants and beetles, have shown a relative resistance of FD and PD to human disturbance (Audino et al., 2014;Edwards et al., 2017;Hoenle et al., 2022).
FD and PD are usually correlated and potentially bear overlapping information, which is mediated through the phylogenetic legacy of traits (Cadotte et al., 2019).In theory, in a neutral scenario of community assembly, species in a phylogenetically more diverse assemblage are accumulating greater variation in the ecologically important traits as opposed to a phylogenetically more closely related assemblage (Prinzing et al., 2008;Webb et al., 2002).However, how much PD can predict FD has been a recurrent topic of debate and depends on the specific traits that have been chosen and their degree of phylogenetic conservatism; some studies even showed that if traits are phylogenetically conserved, maximising PD does not always lead to higher FD (Mazel et al., 2018;Owen et al., 2019;Tucker et al., 2018).A promising way forward is to combine and untangle the information from FD and PD through decoupling, which makes both measures independent and eases their interpretation (de Bello et al., 2017).
Comparing both FD and PD after disturbance can further provide insights into underlying community assembly processes (Cavender-Bares et al., 2009), but is not without caveats (Gerhold et al., 2015).For instance, if a community is clustered in its traits and phylogeny following disturbance, it potentially indicates nichebased habitat filtering, since only species with traits suitable to the environment are selected and thus more uniform than expected at random (Kraft et al., 2015; but see Gerhold et al., 2015;Wong et al., 2022).Overdispersion, on the other hand, can be an indicator for competitive exclusion, where communities are more dissimilar means often varied from nesters.Moreover, all community-weighted trait means changed after forest disturbance.5. Our finding of contradictory FD and PD patterns highlights the importance of integrative measures of diversity.Our results indicate that the tree community trait diversity is not negatively affected, but possibly even enhanced by disturbance.
Therefore, the functional diversity of arboreal ants is relatively robust when compared between old-growth and young trees.However, further study with higher plot-replication is necessary to solidify and generalise our findings.
Tropical forests are complex ecosystems with an enormous biodiversity that is structured across vertical space (Basset et al., 2015).This vertical stratification is a strong driver of arthropod diversity and abundance, with many species adapted to live in trees (Basset et al., 2015;Xing et al., 2023).Disturbance induces several structural and microclimatic changes on the trees.
Secondary forests experience higher and more variable microclimates especially in the canopy (Jucker et al., 2018).Properties relating to structural complexity such as biomass, gap frequency and canopy height are higher in primary forests ( de Almeida et al., 2021;Jucker et al., 2018).Furthermore, tree species composition, density and size are impoverished in secondary forests, directly affecting the taxonomic diversity of arboreal invertebrates (Klimes et al., 2012).For these reasons, we expect the treedwelling fauna to be highly sensitive to disturbance also in terms of its FD and PD.Yet, such research on tropical invertebrates of rainforest canopies is, to our best knowledge, lacking.
A suitable faunal group to study the impacts of disturbance on trees are ants, due to their central importance in ecosystem functioning and their enormous biomass (Lach et al., 2010;Schultheiss et al., 2022).In a tropical forest about half of the ant species are tree-dwellers that contribute to a significant proportion of tree invertebrates (Davidson et al., 2003;Floren et al., 2014).Ants display distinct lifestyles and morphology fitted to a life in trees (Almeida et al., 2023;Basset et al., 2015;Leponce et al., 2021).Further, they play a central role in biological invasions, with several ant species belonging to the worst known invasive species, causing species extinction and large economic costs (Angulo et al., 2022;Lach et al., 2010).
Unlike ground-dwelling ants (e.g., Bihn et al., 2010;Liu et al., 2016), we know little about how disturbance shapes the functional and phylogenetic structure of arboreal communities.This is particularly important, since ants interact with many other plant and animal species, and negative effects on their diversity could have devastating consequences for ecosystems functioning (Lach et al., 2010).
In this study, we report on the first investigation of the impact of human disturbance on both PD and FD of arboreal ants, using a diverse tropical lowland forest from Papua New Guinea as study system.Here, human disturbance through swidden agriculture led to drastic species composition changes and species richness declines of both trees and ants in a decade-old secondary forest, and likely facilitated the introduction of invasive species such as the yellow crazy ant Anoplolepis gracilipes (Klimes et al., 2012(Klimes et al., , 2015;;Whitfeld et al., 2012).However, the consequences of this disturbance regime on the PD and FD of tree-dwelling ants are unclear.We define disturbance in our study context as any changes that emerge between the former agriculture and a nearby primary forest, under the assumption that without the human clearcutting, this patch of secondary forest would be undistinguishable to the primary forest.
We predict that arboreal ants in the secondary forest will have lower FD and PD than in the primary forest partly mediated through invasive ant species that can negatively impact PD and FD (Loiola et al., 2018;Wong et al., 2020).Furthermore, since vegetation structure and nesting opportunities for ants in the secondary forest are less complex (Klimes, 2017;Mottl et al., 2019) and the microclimate tends to be more extreme (Jucker et al., 2018), we predict that ant ecomorphological traits will reflect the reduction in niche diversity and stronger microclimatic filters, leading to clustering in traits and phylogeny in secondary forest communities.In contrast, we predict neutral or competitive processes (i.e., overdispersion in traits and phylogeny) to be prevalent in primary forest due to dominant arboreal species excluding each other (Leponce et al., 2021;Mottl et al., 2021).Furthermore, habitat filtering and competitive interactions should lead to differences in several key ant functional traits between both forest types (Martello et al., 2018).For instance, undisturbed habitats are known to support a wider range of ant body sizes (Gibb et al., 2017).Further, we predict that visiting species that do not nest in the sampled tree but forage on it for food resources and thus boost its ant richness (see Klimes et al., 2015) will substantially contribute to increased functional and phylogenetic diversity in both forest types.

| Study site
Our study was based in a lowland rainforest near Wanang Conservation Area, Madang Province, Papua New Guinea (100-200 m a.s.l.; 05°14′ S 145°11′ E).The region experiences a mean annual rainfall of 3600 mm, a mean annual temperature of 26.5°C and a weak dry season from July to September (McAlpine et al., 1983).
As part of a larger study, 1-ha each of primary forest and secondary forest were felled in 2007 in collaboration with and permitted by local landowners while supporting conservation of the site (Klimes et al., 2012;Novotny, 2010;Whitfeld et al., 2012Whitfeld et al., , 2014)).
The research has been conducted according to the PNG law, and no ethics approval was required.Export permits for the collected insect samples from PNG to the Institute of Entomology of Biology Centre ASCR (Czech Republic) were provided by the Department of Environment and Conservation, Boroko, National Capital District, PNG (permit no: 070382).
The distance between the two vegetation plots was about 1000 m.We exhaustively sampled 0.4 ha (100 × 40 m) within each hectare plot for arboreal ants.The primary forest plot was an old growth forest stand of minimal 50 years without human disturbance, and the secondary forest plot had ~10 years of secondary regrowth after the abandonment of small-scale slash-and-burn agriculture.
Our data set is thus a spatially extended version of the data used in previously published studies on taxonomic diversity of ants from these felled plots (0.3 ha with dimensions 80 × 40 m in each forest; Klimes et al., 2012Klimes et al., , 2015)).
In the two plots, all trees with diameter above breast height (DBH) ≥ 5 cm were felled, measured and identified to species.We exhaustively sampled the arboreal ant communities by inspecting trees immediately after felling.From the tree base to the tree crown, we searched each tree for ants, dissecting bark, branches, trapped soil and litter and epiphytes to find the more cryptically nesting and foraging individuals.In each tree, we recorded whether ant species were collected from nests or were foraging from elsewhere (i.e., nesters and visitors-see below for definition).A full sampling protocol for vegetation and ants is available in Volf et al. (2019), and the details on vegetation characteristics of the two plots are available in Whitfeld et al. (2012).We hand collected ants of all castes available and representative specimens were stored in ethanol along with tree and nest identifiers.Only established nests with workers and worker foragers were considered in the analysis in this study.Singleton queens, and those with brood but without workers, were excluded as they did not have established colonies, and thus unlikely to have an important ecological impact in the community (Parr et al., 2017).

| Ant identification and phylogeny
Ant individuals were sorted to genus and to species or morphospecies (species hereafter) using available taxonomic keys (Andersen, 2000;Bolton, 1994;Schmidt & Shattuck, 2014), collections at the Institute of Entomology (Biology Centre, Czech Academy of Science), the Museum of Comparative Zoology (MCZ) at Harvard University, online databases (http:// www.antweb.org) and the assistance of specialist taxonomists (see 'Acknowledgements'). Gene sequences were used to determine phylogenetic relationships.For each species, representative workers were sequenced for the mitochondrial gene fragment cytochrome c oxidase I (COI, 659 bp) and the nuclear gene fragment wingless (Wg, 409 bp).We gathered molecular data for all sampled species except one singleton (i.e., 127 species were included in our analyses in total).Specifically, we obtained new sequences for COI and Wg for 112 species.The COI and/or Wg sequences for further four species were taken from the Genbank database, while the remaining 11 species were represented by a single gene (6 COI, 5 Wg; 9% of species).Details on the extraction process and phylogenetic tree assembly can be found in Text S1, Supplement File S1 and a full species list with sequence codes is available in Table S1.

| Trait measurement
To assess ant functional trait variation, we followed the guidance of the Global Ants Database (Gibb et al., 2015;Parr et al., 2017).We selected a subset of ecomorphological traits, that is, traits that are assumed to be ecologically relevant functional traits, and most of which have been shown to be sensitive to disturbance previously (Table S2; see also Hoenle et al., 2023;Parr et al., 2017).We measured the following continuous traits: head length, head width, clypeus length, leg length (=hind femur + tibia length), eye size (approximated as area of an ellipse using eye length and width), eye position (=head width − interocular distance), spinosity (total number of spines on alitrunk and petiole), and mandible length.Traits were measured to the nearest 0.01 mm using an Olympus SZX7 stereomicroscope with magnification 18× to 126×, fitted with an ocular graticule.For each species, we further recorded a categorical trait, the degree of cuticular sculpturing (0-none, 1-shallow, 2-moderate, 3-deep).
Finally, we included a new ant trait which considers the degree of polymorphism, which is calculated as the maximum head length (a proxy for body size) of a species divided by the minimum head length (among all castes).Thus, species with no intraspecific variation have polymorphism values close to 1, while polymorphic species can have a value of up to 2.6 (e.g., in Pheidole species).Most studies of ant FD are based only on the traits of minor workers, because the common sampling methods do not reliably sample all castes.However, intraspecific variability of ants is important to consider (Wong & Carmona, 2021), and our whole forest destructive sampling method allowed us to collect all distinct size classes of almost all ant species present in the nests and foragers.Thus, we measured all available worker and soldier castes of 1-11 point-mounted individuals of each species (581 individuals, mean ± SD 4.5 ± 2.4 individuals per species).
Since all continuous measurement traits are highly correlated with body size, we calculated their relative measures by dividing their values by head length, as an appropriate surrogate for body size (Gibb et al., 2017; for size corrected correlations, see Figure S1).We then calculated the mean value of each trait for each species.To account for differences in the relative number of minor and major workers in strongly polymorphic species, we calculated a weighted mean for all size-related traits.We use a conservative weighing of a caste-ratio of 20% major and 80% minor workers (e.g., Tschinkel, 2005;Walker & Stamps, 1986).To measure overall functional diversity, including the multiple functional traits, we calculated the Gower distance of categorical and continuous traits combined, using the function gowdis in the statisical software R (version 4.2.3;R Core Team, 2021), from the package FD (Laliberté & Legendre, 2010).

| Statistical analyses
We analysed our data on two different scales, tree and plot scale.
The plot scale is the typical scale at which ecologists usually assess biodiversity.However, we are limited by having just two large plots.
The tree scale is of particular interest, since it is the scale at which ant colonies will mostly interact.Trees are like islands, connected to each other by twigs and lianas (Adams et al., 2019), and community assembly interactions will therefore mostly happen at this smaller scale.However, we acknowledge that the tree scale analyses are pseudoreplicated.This is a common problem for whole-ecosystem approaches with abundant insect taxa such as ants, where arguably the careful use of inferential statistics is recommended (Chaves, 2010;Oksanen, 2001).Importantly, both studied plots possess vegetation structure and tree species composition typical for primary and secondary forest in our studied site (Whitfeld et al., 2014).Most ant colonies forage in one or few trees at most (except for few supercolonial species).Therefore, statistically treating tree-level communities as independent replicates poses a minor problem, particularly considering our large plot size encompassing hundreds of trees and a high data quality through exhaustive sampling.
We used presence-absence of species in the sampled trees for all our analyses (i.e., species occurrences) rather than the actual numbers of sampled workers and nests found on trees.Thus, the tree scale analysis is based on the ant occurrences per tree, and it gives tree-level values for each functional and phylogenetic diversity index.The plot scale analysis is based on the summed-up occurrences across all trees in each forest plot, and hence includes a complete community.We were interested to compare both scales, and thus, most analyses were performed on both plot-and treescale, except for the community-weighted means (CWMs) of individual traits (only tree scale) and species composition overlap (only plot scale).
We calculated species overlap on plot scale between primary and secondary forests using the Bray-Curtis distance using the package 'vegan' (Oksanen et al., 2019).Based on either tree-or plot scale matrices, we calculated the Rao quadratic entropy diversity index (Rao Q) as indicator for PD and FD using the abundance-weighted function 'ses.mpd' from the package 'picante' (Kembel et al., 2010).
Note that the mpd and ses.mpd functions return values of Rao Q when using their abundance-weighted version, as the diagonal of the dissimilarity matrices is considered, even though we did not use true abundance values (de Bello et al., 2016).For tree level analyses, the communities with <2 species were excluded, as Rao Q is not defined for a single species community (for the number of trees included in the analysis see Table 1b).To investigate whether the functional diversity was driven by only a small subset of traits, we also ran the previous described Rao Q procedure on each trait separately.We choose Rao Q as diversity measure since it has the advantage that it can be applied in the same mathematical framework for PD and FD (including dispersion null models and a decoupling of FD from PD signal, see below).Further, Rao Q gives a comparatively intuitive measure of diversity: It quantifies the average dissimilarity between pairs of two species occurrences chosen at random from the tested community, which also reflects a multivariate expression of variance (de Bello et al., 2016).The species pool used in all analysis (for both tree and plot scale) was defined to include all species from both forest types, since they all constitute the theoretically available ant fauna due to the short distance between the two plots.For FD, we used a gower distance matrix based on the functional traits of the species pool.For PD, we used the square-root-transformed phylogenetic distance tree of the species pool (see above).
To assess whether our communities were phylogenetically clustered or overdispersed, we calculated the standardised effect sizes  1a; Götzenberger et al., 2016).Since the p-values obtained through the null-model are regarded as conservative, we further tested the distribution of SES against 0 with a Wilcoxon's signedrank test for the tree-scale data (Table 1b; Götzenberger et al., 2016;Hardy, 2008).If the distribution is significantly lower than 0, we regard it as evidence for clustering, if it is significantly higher than 0, we regard it as evidence for overdispersion.Note that observed values and SES obtained from the taxa-swap null model are highly correlated (de Bello, 2012;Götzenberger et al., 2016), which is also the case in our data.Therefore, for simplicity, we interpret both FD and PD patterns and their assembly mechanisms by statistically comparing and plotting the SES values, while we provide the observed FD and PD values only in the Table 1 and Table S3.
As previously mentioned, trees represent 'island' habitats and habitat size is related to species diversity (MacArthur & Wilson, 1967).Indeed, tree size (DBH) has been shown in our system to be one of the main vegetation structural parameters affecting arboreal ant taxonomic diversity, contributing to the loss of the species in the secondary forest (Klimes et al., 2012).Therefore, we investigated at first the correlation between tree size and PD and FD with a linear model respectively, which included the ln + 1 transformed DBH and forest type as predictors to account for possible DBH influences.
Since neither FD nor PD was significantly correlated with DBH (linear models, FD: R 2 = 0.10, F = 37.79, df = 659, p = 0.28; PD: R 2 = 0.04, F = 14.61, df = 659, p = 0.95), and including it or an interaction of forest type with DBH also did not improve our models, we did not consider this factor in the subsequent analyses.
PD and FD are expected to be closely related if traits are strongly phylogenetically conserved.Therefore, we tested the phylogenetic signal of each trait by using Blombergs K (Blomberg et al., 2003).
Next, to remove the shared information of FD and PD, we decoupled the signal of traits from the phylogeny by using the approach described in de Bello et al. (2017).In brief, this approach uses the phylogenetic and trait dissimilarity matrices and removes their covariance, and hence results in functional trait differences independent from phylogeny (decoupled FD) and phylogenetic differences independent from functional traits (decoupled PD).Further, for a detailed picture of the functional changes associated with human disturbance, we calculated CWMs of individual traits on tree scale using the package 'FD' (Laliberté & Legendre, 2010).Communityweighted means are traits weighted by the incidence of species and give insight into changes in average trait composition across our different habitats.They allow a fine-scale assessment of each trait, on an intuitive scale, for example, if the average eye size is larger or smaller under disturbance.On tree scale, we compared the SES of FD and PD, and the CWMs, between primary and secondary forests with Kruskal-Wallis tests (package 'ggpubr'; Kassambara, 2018).
A tree harbours two distinct ant communities in terms of their nesting patterns: There are ants which nest on the tree ('nesters'), and those which forage on the tree but either have their nest on neighbouring trees or on the not sampled shrubs and forest ground level ('visitors', i.e., equal to the 'F-N' foraging species in Klimes et al., 2015).Nesters use the trees both for nesting space and food resources, while visitors use only the latter  (Klimes, 2017).In the case of polydomous species where a colony can have multiple nests across multiple trees (e.g., Oecophylla smaragdina), we did not collect information about the extent of the colony, and therefore, the colony would be counted as independent nester for each tree in which there are any nests.Our analysis untangles the functional and phylogenetic contribution of each group by providing a separate analysis on nesters, visitors, and the whole community ('all').We use three separate community matrices, which all contain ant species occurrences in each tree: 'all', 'nesters' and 'visitors'.We calculated the visitor matrix community by subtracting the 'nester' matrix from the 'all' matrix.Hence, the 'visitor' matrix has no species overlap with the nesters, thus allowing to untangle the relative contribution of nesters and foragers to functional and phylogenetic structure of each tree.Note that an ant that nests on the tree does also forage there but is not included in the 'visitor' matrix.A visitor ant that belongs to the same species as a nesting ant is also disregarded in the visitor matrix, since conceptually, its functional and phylogenetic contribution is already accounted for.Since the community matrices are derived from each other and thus violate assumptions of independence, we do not assess statistical differences between nesters, visitors, and the whole community within the same forest, but instead focus our statistical comparison on the differences between primary and secondary forest.We also analysed the species overlap between nesters and visitors with the R-package 'vegan' (as Bray-Curtis distance; Oksanen et al., 2019).
Finally, we classified non-native species for PNG region based on the Global Ant Biodiversity Informatics (GABI) database (Guénard et al., 2017).To test their effect on the SES of PD and FD, and on CWMs measures, we excluded them from our occurrence data and applied the same analysis procedure as above.

| Community structure and taxonomic and phylogenetic diversity
We sampled 852 trees, with a total of 128 ant species.Both forests were fundamentally different in their vegetation structure and ant assemblages (Figures 1 and 2).The arboreal ant communities were phylogenetically diverse, representing 39 genera from seven subfamilies (Figure 2).The secondary forest lacked dorylines and ectatommines, and ponerines were far rarer than in the primary forest (only a single occurrence; Figure 2).Thirty-one (24%) species occurred in both forests but had different abundances (Figure 2).Invasive ant species were found in both forests (10 species in total) but were much more common in secondary forest than in primary forest (28% and 1% of species occurrences, respectively; Figure 2; Table 1).The species overlap between nesters and visitors was higher in the primary forest (Bray-Curtis dissimilarity 0.55) than in the secondary (Bray-Curtis dissimilarity 0.70).However, specialised ground-nesting species that climbed the trees were scarce in both forests, with exception of one non-native species in the secondary forest (154 trees with visitors but only nine trees with nesters in A. gracilipes).Notably, the species not nesting on any of the sampled trees made up only 6% and 10% of the species occurrences in primary and secondary forest, respectively.Almost all these records were of arboreal species (Crematogaster, Polyrhachis and Tetraponera), likely foraging from trees that surrounded the plots.
In both plots, over 90% of trees contained ants, with a mean ± SD of 3.3 ± 2.4 species per tree, respectively.Primary forest had almost double the ant species richness at the plot level compared to secondary forest (Table 1a).On tree scale, richness was also higher in primary than secondary forest in all species and visitors, but was similar among nesters (Figure 3f; Table 1b).

Subfamilies
Tree scale: 0.1 On the plot scale, secondary forest communities had lower PD and were phylogenetically less dispersed than primary forests (except in nesters) but did not differ significantly from the null model expectation (Table 1).On tree scale, the PD of ants in the secondary forest was significantly clustered and in the primary forest significantly overdispersed (except in nesters; Figure 3b; Table 1b).These patterns were predominantly caused by the visitors, and not by nesters.The PD results were robust to the removal of non-native ants (Figure S2; Table S3).

| Functional diversity and trait differences
In contrast to PD patterns, FD was higher in secondary than in primary forests (Figure 3a).Notably, the increased FD in secondary compared to primary forest was consistent on both plot and tree scales (Table 1).On plot scale, the primary forest was more functionally clustered than the secondary forest, but neither forest showed significant clustering or overdispersion in comparison to the null model (Table 1a).On the tree scale, FD in primary forest was significantly clustered and in secondary forest overdispersed except for nesters and visitors (Table 1b; Figure 3a).The pattern of higher FD in the secondary forest was robust for the community subsets (Table 1b; Figure 3a) and remained if non-native species were removed from the data set (Figure S2A; Table S3).Moreover, the increased FD compared to primary forest was not driven by a single trait but by a culmination of all traits (all traits in the whole community either had higher dispersion in secondary forest than in primary forest or had no significant difference; Figure S3).Although  1.
FD and PD values were highly correlated with each other in both forest types (spearman rank correlation, p-value <0.001, ρ = 0.263), we found that intercept values were significantly higher in secondary forest (linear model intercept = 0.160 ± 0.041) than in primary (linear model intercept = −0.522± 0.041), with no significant interaction with forest type (linear model, p = 0.105, Figure 3c).
Phylogenetic signal was detected in all traits (Table S3).After decoupling the phylogeny from the traits, null model comparisons continued to indicate random dispersion for all forest types and whole-plot communities (Table 1a).However, at the tree level, the secondary forest showed a stronger overdispersion and increased FD, compared to primary forest that was significantly clustered (Figure 3d; Table 1b).The PD, on the other hand, was barely affected by decoupling and lead to overall smaller differences between primary and secondary forests (Figure 2e).The decoupled values overall aligned with previous patterns and showed for the most part significant deviation from zero distribution in almost all communities (except for the FD of secondary nesters and the PD of visitors; Figure 3d,e; Table 1b).Decoupled diversity results were for the most part stable to the exclusion of non-native ants in the whole community (Figure S2; Table S3).
Except for head length (a proxy of body size), CMWs differed between primary and secondary forests in whole tree communities (community matrix 'all').Primary forests ant communities were more polymorphic, had longer mandibles, higher eye positioning, larger clypeus, and broader heads, and more cuticular sculpturing.Secondary forest ant communities had higher spinosity, larger eyes and longer legs (Figure 4).Several traits differed between the two forests also in nesters and visitors, leading to a different contribution of each functional group to some of the above whole-communities' patterns (e.g., higher spinosity and longer legs in secondary forest were driven by visitors, Figure 4).Notably, head lengths (body size), of visitors were smaller but of nesters larger in primary than secondary forest, while in the whole community, this influence was masked, as there was no difference in body size in 'all' ants (Figure 4a).Overall, the difference between nesters and visitors tended to be larger within secondary than within primary forest in most traits (Figure 4).

| Forest disturbance effects on functional and phylogenetic diversity of the communities
Disturbance results in profound changes in biological communities, usually diminishing animal species diversity accompanied with a simultaneous decrease in ecosystem functioning and functional diversity (Ewers et al., 2015;Naeem et al., 2012, but see Sreekar et al., 2021).Here, we show that the functional structure of an ecologically important group, arboreal ants, does not adhere to this pattern.In contrast to our initial expectation, FD was higher in the secondary forest recovering from swidden agriculture than in the primary forest.Still, the primary forest hosted a greater number of ant species, which were also more diverse in their evolutionary several animal groups, including ants, dung beetles and birds (Bihn et al., 2010;Frishkoff et al., 2014;Gómez-Cifuentes et al., 2017;Liu et al., 2016;Matuoka et al., 2020).Notably, only a few previous studies showed functional overdispersion in more disturbed habitats for animal communities, for instance in recovering bird communities (Sreekar et al., 2021) and in island ants (Agavekar et al., 2019).
However, our results come with the important caveat of having no plot level replication and potential spatial autocorrelation of the tree communities.We think in our study system this poses a minor problem, as we choose representative forest plots of large size, but we want to stress that our results need to be carefully interpreted, especially where it contradicts previous work.
The decrease in taxonomic diversity in secondary forests was previously well-explained by changes in forest vegetation structure (Klimes et al., 2012).We therefore expected that the less variable microclimate and less complex secondary vegetation (e.g., lack of epiphytes and hollow live branches, see Klimes, 2017) would select for ant communities of similar (i.e., clustered) traits.We did not find support for this hypothesis.Instead, we hypothesize that competitive interactions between species in secondary forest led to the co-occurrence of morphologically dissimilar species (i.e., overdispersion).The trait overdispersion was particularly strong among related species evidenced by the decoupled functional diversity patterns, where even after accounting for phylogenetic non-independence the primary forest communities were morphologically more clustered than the secondary forest communities.This may suggest a stronger role of environmental filtering for community assembly in primary forest.Furthermore, our results suggest that most of the increased trait divergence among closely related secondary forest species occurs at the level of co-foraging species from surrounding trees (visitors), but much less so in the nesters.
With null models, we found random community pattern for functional as well as phylogenetic structure at the plot scale, but also found significant deviations from zero at tree scale.This discrepancy is not surprising because taxa swap null models are much more conservative than testing against zero (Götzenberger et al., 2016;Hardy, 2008).To reconcile these results, we conclude that secondary forest ant communities are more overdispersed in FD and clustered in PD in comparison to primary forest communities, but they do not necessarily reflect a strongly clustered or dispersed community per-se.
The interpretation of functional and phylogenetic dispersion patterns is not straightforward, since mechanisms other than environmental filtering can lead to clustering (e.g., colonisation or asymmetric competition; Li et al., 2015).In the case of arboreal ants, there is strong prior evidence that competition plays an important role in community assembly, as highly competitive ant species are known to control large territories and tend to exclude each other (Camarota et al., 2020;Mottl et al., 2021).Therefore, under the assumption that competition increases through disturbance (Fayle et al., 2013), our observations are consistent with the hypothesis that competition lead to trait overdispersion in secondary forests.Our results may be explained by the Interaction Hypothesis outlined by Prinzing et al. (2008), which predicts that competition is stronger among closely related species since traits are more likely to be used for similar resources, and thus a phylogenetically more related assemblage can lead to (either through evolutionary time or ecological interactions) higher functional diversity.

| Forest disturbance effects on traits of the communities
The impacts of forest disturbance on ant morphology were ubiquitous in our system: When we considered the mean functional traits, all differed between primary and secondary forest, except for body size.Thermal tolerance, competitive interactions, and diet likely play important roles in structuring ant communities in arboreal habitats (Blüthgen et al., 2003;Kaspari et al., 2015).Our findings largely support these assembly mechanisms.The changes are most evident in functional traits associated with diet: Traits associated with predatory behaviour were more prevalent in primary forest (e.g., relatively broader heads, longer mandibles, higher eye positioning, smaller eye size; Gibb et al., 2015;Parr et al., 2017).However, the clypeus, a structure involved in sucking ability and indicative of a low trophic level diet of sugar resources (Davidson et al., 2004), was also longer in the primary forest.Intraspecific polymorphism, which is associated with larger colony sizes and division of labour, was higher in primary forest: This could be an indication of higher competition in primary forest, which contrasts with the finding of more functional clustering among traits.Similarly, cuticular sculpturing was more common in primary forests, making species more robust to microclimatic changes or predation (Buxton et al., 2021).In contrast, the spinosity, a defensive trait, was higher in secondary forests, potentially indicating higher levels of vertebrate predation and/or higher competition between the ants in the disturbed system (Blanchard et al., 2020).
To our knowledge, our study is the first that examined the functional and phylogenetic contribution of visiting and nesting (resident) species in tree canopies for any animal group.In secondary forests, the trees are not as large and do not provide as many nesting resources as in primary forests (Klimes, 2017), which could explain the smaller overlap of nesting vs. foraging species.Trees are thus more shared between arboreal nesters and foragers that either nest mostly on the ground (the case of non-native Anoplolepis gracilipes), or forage from other trees (most of the other visitors).However, the functional diversity of secondary forests is higher even when visitors were disregarded, hence the contribution of visiting species to overall FD and PD was negligible.
The differences between visitors and nesters became more evident when considering individual traits.For instance, the lon-

| Effects of non-native ant species
Non-native species can replace native species and perform key ecosystem functions worse (Gallardo et al., 2016;Goodenough, 2010;Sanders et al., 2003;Wong et al., 2020Wong et al., , 2021)).Disturbance facilitates the spread of non-native species, and in our case, nonnative species reached high abundances in the secondary forest.
However, despite this strong impact by numbers alone, neither FD nor PD was sensitive to the exclusion of non-native ants from the analysis.Some minor patterns emerged (e.g., species richness decreased at the tree scale, and phylogenetic clustering in secondary forest increased).However, these changes are expected, if a large proportion of the community is excluded.The robustness of the PD and FD to non-native ant exclusion suggests a surprising resistance of the local ecosystem to the non-native species, contrasting other findings with invasive fire ants which reduced FD (Wong et al., 2020(Wong et al., , 2022)).In Madagascar, swidden agriculture is also associated with influxes of invasive species, but these have limited negative impact on native species (Finch et al., 2022).In our case, however, manipulative experiments or time series are needed to clearly disentangle the effects of non-native species from forest disturbance.

| Correlation of phylogenetic and functional diversity
Despite having a lower overall FD but higher PD in primary forests, community level PD and FD were still positively correlated in both forest types.The pattern is consistent with most correlations reported in the literature (Cadotte et al., 2019), since many ecologically relevant traits display a phylogenetic signal (Gerhold et al., 2015), as was the case in our study.In a review of PD and FD correlation, Cadotte et al. (2019) reported that roughly half of the ecological studies found incongruent patterns of FD and PD.
In our case study, the secondary forest hosts functionally richer but phylogenetically poorer ant communities.It is unclear whether either the FD or the PD provide a more accurate picture of the arboreal ants' contribution to ecosystem functioning.Although the investigated morphological traits relate to various ecological roles (Parr et al., 2017), we are still far away from a comprehensive functional perspective.Hence, we cannot exclude the possibility that other physiological and behavioural traits that we did not measure (such as colony size) may be more important in these communities and may distort our results.Finally, PD may convey only weak ecological signals, since the ants of New Guinea likely are the result of an evolutionarily recent and fast population differentiation and species radiation (5-10 mya; e.g., Janda et al., 2016), similar to other insects in the region (Toussaint et al., 2014).In fact, there is only one endemic ant genus known from the island (Ancyridris-not present in our study), while both forests we studied shared abundant arboreal lineages which showed recent diversification (e.g., species of Camponotus and Polyrhachis).Thus, closely related species of ants might show stronger morphological and ecological separation than is typical for other areas, potentially lowering the sensitivity of our PD index.

| CON CLUS IONS
We quantified the response of functional and phylogenetic diversity in a tropical rainforest of rarely studied arboreal ants, an insect guild of a high ecological importance and biomass (Davidson et al., 2003).In contrast to our expectation, we showed that a lowland rainforest´ disturbance has led to more functionally diverse, but a phylogenetically and taxonomically less diverse arboreal fauna.We conclude that more dispersed species traits in the secondary forest, an ecosystem that consists of smaller trees (Klimes, 2017;Mottl et al., 2019) and hence less foraging and nesting space compared to primary forest, are most likely be attributed to increased competition among the ant species for limited resources and space.Our study highlights that the interpretation of phylogenetic and functional data alone may be insufficient for a clear picture of community assembly processes, and potentially leads to contradicting evidence.Although our study sampled complete ant communities from two large forest plots and hundreds of trees, a larger sampling effort spanning more areas is needed to generalise our findings.Additional manipulative experiments designed to untangle community assembly patterns are necessary to reach confident conclusions.
The New Guinea lowlands contains one of the most diverse rainforests in the world (Novotny et al., 2010), and our research adds to the evidence that forest disturbance in the form of swidden agriculture may not be as detrimental to biodiversity as previously assumed (Ziegler et al., 2011).Swidden agriculture has been practised since about 7000 years in Papua New Guinea (Denham, 2011), with the important difference that there are now more non-native species than ever.Interestingly, we found that the introduction of non-native species did not result in a reduction of the ants' functional diversity in the trees.While we did not assess any measure of ecosystem functioning directly, this will be of paramount importance for future investigation.Overall, our results agree with meta-analyses that highlighted the importance of the logged and secondary forests for the biodiversity and ecosystem-functioning when compared to more severely modified habitats, such as plantations and pastures (Chazdon et al., 2009;Edwards et al., 2014).

(
SES).For plot-scale, p values of observed Rao Q were obtained from null model comparison based on taxa-labels (shuffled distance matrix labels across all taxa included in the whole distance matrix; R function 'ses.mpd' from 'picante'; 999 runs).Negative SES values and low quantiles (p < 0.05) indicate phylogenetic clustering, and positive SES values and high quantiles (p > 0.95) indicate overdispersion (Table

TA B L E 1
Characteristics of arboreal ant communities sampled in 0.4 ha of primary and 0.4 ha of secondary lowland rainforest in Papua New Guinea, and of their taxonomic, functional (FD) and phylogenetic (PD) diversity.(a) Values on plot scale and (b) values on tree scale (852 trees sampled in total).

F
Arboreal ant functional diversity (a), phylogenetic diversity (b), the correlation between functional and phylogenetic diversity (c), the decoupled functional (d) and phylogenetic diversity (e) and the species richness (f) on tree scale.Box-plots show median values per a tree with 25%-75% quartiles and with whiskers representing 1.5 interquartile ranges for all species combined (All), for foraging species not nesting in a focal tree (Visitors) and nesting species (Nesters).Both forest types are shown in different colours (primary forest-green; secondary forest-orange) or symbols (in (c): triangles denote secondary forest, circles primary forest).The values for individual ant communities are compared between the two forest types with a KruskallWallis test, where stars indicate statistically significant differences (***p < 0.001, **p < 0.01, *p < 0.05, ns p > 0.05).Note that standardised effect sizes (i.e., Rao Q SES) are compared in (a), (b), (d), and (e) where the dash horizontal line at 0 indicates random communities, while positive SES values indicate community overdispersion and negative values clustering.For mean observed and SES values and for tests of statistical significance of the SES against null distribution, see Table history.Our finding contrasts with several studies, which documented a decrease in both FD and PD under human disturbance of F I G U R E 4 (a-j) Community weighted means of all used ant traits (tree scale).Box-plots show median values per a tree with 25%-75% quartiles and with whiskers representing 1.5 interquartile ranges for all ant species occurrences (All), for ant occurrences that were foraging but not nesting in a focal tree (Visitors) and for only nesting ant occurrences for each tree (Nesters).Both forest types are shown in different colours (primary forest-green; secondary forest-orange) and the values for individual ant communities are compared between the two forest types with a Kruskall-Wallis test.Stars indicate statistically significant differences (***p < 0.001, **p < 0.01, *p < 0.05, ns p > 0.05).

(a) Plot scale Primary all Secondary all Primary visitors Secondary visitors Primary nesters Secondary nesters
Note: Positive Standardised effect sizes from null models (Rao Q SES) indicate community overdispersion (cells in light blue) and negative SES indicate clustering (cells in light orange).On plot scale, we give the p-values in comparison to the taxa-swap null model, while for the tree scale we test the distribution of all SES values against 0 with a Wilcoxon's signed-rank test.Significant clustering and overdispersion values and their respective pvalues are highlighted in bold (alpha = 0.05).
Bayesian phylogeny of arboreal ant communities sampled in 0.4 ha of primary and 0.4 ha of secondary lowland rainforest in Papua New Guinea (127 ant species across both forest types), and their relative abundance in each forest community.Outgroup species are denoted in grey, and non-native species are in red.Clades are colour coded by subfamily.Open circles scaled by size indicate the relative abundance of the species in each forest (i.e., number of occupied trees), on a log scale: green circles = primary forest vegetation plot (101 species), pink circles = secondary forest plot (57 species).Although 31 species occur in both forests, only one, Crematogaster sp. 7, was similarly abundant.
that nest on the ground and only forage on trees.Note the strong differences of functional traits just between these two most species: Anoplolepis gracilipes has longer legs and antenna, as well as much larger body and eye size, and no spines.Pictures: (a) and (b) by Petr Klimes.(c) and (d) by Philipp Hoenle.F I G U R E 2