Foraging shifts and visual preadaptation in ecologically diverse bats

Changes in behaviour may initiate shifts to new adaptive zones, with physical adaptations for novel environments evolving later. While new mutations are commonly considered engines of adaptive change, sensory evolution enabling access to new resources might also arise from standing genetic diversity, and even gene loss. We examine the relative contribution of molecular adaptations, measured by positive and relaxed selection, acting on eye‐expressed genes associated with shifts to new adaptive zones in ecologically diverse bats from the superfamily Noctilionoidea. Collectively, noctilionoids display remarkable ecological breadth, from highly divergent echolocation to flight strategies linked to specialized insectivory, the parallel evolution of diverse plant‐based diets (e.g., nectar, pollen and fruit) from ancestral insectivory, and—unusually for echolocating bats—often have large, well‐developed eyes. We report contrasting levels of positive selection in genes associated with the development, maintenance and scope of visual function, tracing back to the origins of noctilionoids and Phyllostomidae (the bat family with most dietary diversity), instead of during shifts to novel diets. Generalized plant visiting was not associated with exceptional molecular adaptation, and exploration of these novel niches took place in an ancestral phyllostomid genetic background. In contrast, evidence for positive selection in vision genes was found at subsequent shifts to either nectarivory or frugivory. Thus, neotropical noctilionoids that use visual cues for identifying food and roosts, as well as for orientation, were effectively preadapted, with subsequent molecular adaptations in nectar‐feeding lineages and the subfamily Stenodermatinae of fig‐eating bats fine‐tuning pre‐existing visual adaptations for specialized purposes.


| INTRODUC TI ON
Changes in behaviour are often thought to initiate shifts to new adaptive zones by exposing organisms to novel selection pressures, which can then lead to rapid diversification and the evolution of associated mechanical and physical adaptations (Duckworth, 2009;Mayr, 1963;Wyles, Kunkel, & Wilson, 1983). Certain behaviours, such as those associated with habitat and food selection (e.g., foraging behaviour), are thought to be particularly important in facilitating such shifts, with examples documented in diverse species from doves and pigeons to drosophilid fruit flies (Goldman-Huertas et al., 2015;Karageorgi et al., 2017;Lapiedra, Sol, Carranza, & Beaulieu, 2013). However, in order to detect and locate food, animals must use a combination of foraging behaviour and sensory perception, with changes in behaviour sometimes also being mediated by remodelling of sensory systems (Goldman-Huertas et al., 2015;Karageorgi et al., 2017). Aside from locating food, vertebrates also use their senses for a range of diverse purposes, such as detection of predators, orientation, navigation and conspecific recognition, all of which may exert contrasting selection pressures on the principal senses. While many studies have focused on new mutations as engines of adaptive radiation, sensory evolution from standing genetic diversity and even gene losses may also provide access to new resources (Daane et al., 2019;Goldman-Huertas et al., 2015;Malinsky et al., 2018;Marques, Meier, & Seehausen, 2019;Prost et al., 2019).
Catching airborne insects represents a very different foraging task compared to gleaning stationary insects resting on foliage (Denzinger & Schnitzler, 2013), with each foraging mode creating contrasting pressures on the auditory, visual and motor systems of the predator. Behavioural studies suggest that gleaning phyllostomids, such as Macrotus californicus, use visual cues to locate insect prey, and have better visual acuity and sensitivity compared to aerial foraging species (Bell & Fenton, 1986). Additionally, mobile arthropod prey emits contrasting sensory cues compared to stationary items of plants, such as flowers and fruit, which may emit olfactory and visual signals (Belwood & Morris, 1987;Gonzalez-Terrazas et al., 2016;Korine & Kalko, 2005). Noctilionoid eye size exhibits striking phenotypic variation that appears to correlate with diet, with the eyes of the insectivorous Mormoopidae being much smaller and less prominent than those of frugivorous phyllostomid species such as Chiroderma spp. (commonly known as big-eyed bats) (Eklöf, 2003;Thiagavel et al., 2018). Despite this, molecular ecology studies of noctilionoid vision have thus far been limited to visual opsins (OPN1SW,OPN1LW and RHO), and traced adaptations therein to changes in roosting habits, echolocation and diets (Kries et al., 2018; represent only a minute fraction of the genes expressed in the eye, including those that convert light into electrical signals via the phototransduction pathway and structural proteins involved in the refraction of light Mustafi et al., 2016;Wistow et al., 2008). Therefore, much remains to be learnt concerning how the visual systems of noctilionoid bats have adapted in response to changes in both foraging and diet throughout their evolution.
To test whether episodic positive selection is associated with changes in the foraging ecology of bats, we obtained transcriptomes of whole eyes from a sample of diverse bat species and performed the following tests. First, we used codon models of adaptive molecular evolution to assess whether shifts in foraging or diet are correlated with bursts of positive selection in eye-expressed genes (i.e., any gene expressed in adult eyes). To address this, we tested two classes of branches in the noctilionoid tree that correspond to key evolutionary transitions: (i) switches in foraging strategy (e.g., from ancestral aerial insectivory to foliage gleaning) and (ii) shifts in diet (e.g., insect feeders vs. plant feeders). Second, we used models of episodic positive selection to assess the correlation of lineage-specific diets and foraging strategy with molecular adaptation in vision genes (i.e., loci with documented roles in eye structure/vision).
Finally, we used models of molecular evolution allowing for changes in selection intensity (i.e., purifying and relaxed selection) to test predictions concerning the functional conservation of vision genes in clades with contrasting diets and foraging strategies.

| Sample collection
Single adult individuals from 39 ecologically diverse bat species were collected under permit as part of a series of studies of genomics and multi-tissue gene expression (Table S1). To minimize effects on populations, males were preferentially sampled. Bats were killed using isoflurane, and excised eyes were incubated overnight in RNAlater at 4°C and then stored at ≤ −80°C, following Sadier et al., (2018) and Yohe et al., (2019) (see Supporting Information). All bats were handled and killed in accordance with Stony Brook University protocols (2014-2090-NF-1.20.17-Bat for the Dominican Republic, and 2014-2119-NF-Bat-6.16.17 for Peru) and site-specific research permits. These individuals were originally collected for a previous study concerning opsin gene expression (Sadier et al., 2018), and from each specimen up to 20 other tissues were collected and stored appropriately to maximize their future research value (Yohe et al., 2019).

| RNA extraction, library preparation and sequencing
Frozen eyes, placed in Buffer RLT, were homogenized with a TissueLyser, and total RNA extracted using Qiagen RNeasy Mini kits following the manufacturer's protocol. RNA integrity and concentration were assessed using an Agilent 2100 Bioanalyzer and Qubit Fluorometer. Library preparation was performed using Illumina TruSeq RNA Sample Preparation version 2, with 500 ng of total RNA, as previously described in Sadier et al., (2018). Pooled libraries were sequenced with NextSeq 500 to give 75-bp paired-end (PE) reads at Bart's and the London Genome Centre, Queen Mary University of London.

| Protein-coding gene orthologue annotation and alignment construction
Protein-coding gene coding sequences (CDSs) were identified with best hit reciprocal blast (blast+/2.2.29) against the longest representative sequences of 22,285 human proteins (Ensembl 86), applying an e-value cut-off <1e −6 . Candidate CDSs were extracted using blast coordinates with a custom Perl script, to give a total of 17,123 genes present in one or more species. Genes containing extracted CDSs >150 bp and present in more than six species were retained for further analyses (see Supporting Information Methods for additional information). Multi-fasta files representing the CDSs of each gene were then used to generate multiple sequence alignments with guidance version 2.02 (Sela, Ashkenazy, Katoh, & Pupko, 2015) using the prank version 170427 (Löytynoja & Goldman, 2008) algorithm, 10 bootstrap replicates (due to computational limits of run-time) and codons enforced. For 10 genes encoding proteins of ≥5,000 amino acids, alignments were constructed with mafft version 7.310 instead of prank, due to computational limits of run-time. Low confidence sites (below default score of 0.93) and/or low-quality sequences (below default score of 0.6) were removed. Genes for which low-quality sequences were detected were re-aligned with these removed. All alignment sites containing >50% gaps and sequences <50 codons were removed using a Perl script which kept codons intact. Alignments were retained if they contained >100 codons and at least six species, with at least one of these being a focal species (i.e., a noctilionoid). These steps resulted in a total of 13,375 aligned nuclear genes for downstream analyses. We used bat-human homology information (Ensembl 86) to assess the likely orthology of genes across bats, and to identify high-confidence single copy one-toone orthologues (see Supporting Information).

| Branch-site models of positive selection in eye-expressed genes along key noctilionoid branches
To assess whether changes in either (i) foraging strategy or (ii) diet in noctilionoid bats were associated with bursts of adaptive evolution in eye-expressed genes, we applied branch-site mod-  Figure 1; Rojas et al., 2011;Schnitzler & Kalko, 2001;Tschapka, Gonzalez-Terrazas, & Knörnschild, 2015).
We categorize branches A-C as those corresponding principally to shifts in foraging strategy, and branches D-H as representing mainly shifts in diets (see Figure 1 and Supporting Information).
Lonchophyllinae is represented by the single taxon (Lionycteris spurrelli), and therefore the branch tested was a tip.
We ran Model A in the codeml package of paml version 4.8 (Yang, 2007) to test for positive selection acting on each locus expressed in the eye (eye-expressed genes), as inferred by ω (dN/ dS -the ratio of the number of nonsynonymous substitutions per nonsynonymous site to the number of synonymous substitutions per synonymous site) values greater than one. Under Model A, one branch is designated as the foreground branch of interest and sitewise estimates of ω are estimated separately for this focal branch as well as across the remaining background branches in the species tree. Each branch-site model estimates a total of four site-classes (termed ω 0 , ω 1 , ω 2a and ω 2b ) from the data; constrained (0 < ω 0 < 1), ω 1 = 1, ω 2a can exceed 1 along the foreground but is constrained to purifying selection along the background, and ω 2b can exceed 1 along the foreground but not along the background. Alternative and null Model A fit was compared with likelihood ratio tests (LRTs) and significance assessed with a chi-squared test with one degree of freedom (Zhang, Nielsen, & Yang, 2005). For each gene alignment, branches A-H were sequentially set as the foreground branch with the remaining branches as the background, using the published species tree topology (Rojas et al., 2016;Teeling et al., 2005). We visualized intersections across the eight positively selected gene (PSG) sets using upsetr (Conway, Lex, & Gehlenborg, 2017;Lex, Gehlenborg, Strobelt, Vuillemot, & Pfister, 2014). Each gene was tested for positive selection in up to eight branches, so for completeness, we applied a false discovery rate (FDR) adjustment to the calculated p-values using the R function p.adjust, with adjusted p-values ≤.05 taken to be significant after correction (Benjamini & Hochberg, 1995).

| Gene Ontology enrichment and functional categorization of PSGs
Eyes are highly specialized organs, and as such express a specific set of genes. Therefore, we employed Gene Ontology (GO) enrichment analyses to highlight shared functions of PSGs rather than to identify strict enrichment. For each of the eight branches tested (A-H), we used the complete set of positively selected eye-expressed genes identified above by the nominal p-value (i.e., uncorrected p < .05), to facilitate this (numbers of PSGs are shown in Table 1). GO term accession codes and domains were downloaded from Ensembl 86, with the background for each branch based on the total number of genes tested for that branch (see Table 1). Fisher's exact test was performed using topgo (Alexa & Rahnenfuhrer, 2010) in r version 3.4.0 (R Development Core Team, 2012) to identify significantly over-represented gene sets in combination with the "elim" algorithm (p < .05). The "elim" algorithm takes the GO topology into account so tests are not independent, and therefore we do not apply F I G U R E 1 Graphical view of bat species, and their ecological traits, sampled for selection analyses. Species topology follows Rojas et al. (2016) and Teeling et al. (2005), and foreground branches of interest (A-H) are indicated by dashed lines. Lonchophyllinae is represented by the single taxon (Lionycteris spurrelli), and therefore the branch tested was a tip; remaining focal branches were ancestral apart from in cases of incomplete taxonomic representation. Echolocation and foraging data were obtained from Schnitzler and Kalko (2001) and citations therein. Echolocation call types are indicated as follows: constant frequency, dark purple; narrowband multiharmonic, red; and short, broadband multiharmonic, orange. Foraging modes are indicated as follows: aerial, blue; gleaning, green; and trawling, yellow. S-cones are indicated as follows: present, purple; absent, white, following Sadier et al. (2018). Species' diets are indicated by coloured heat-maps, with increasing colour intensity indicating greater reliance on a given product (0%, <40%, >60% and 100%), and colours correspond to the following diets: arthropods, grey; blood, red; vertebrates, purple; fish, blue; leaves, turquoise; pollen and nectar, orange; fruits, green, and follow Rojas et al. (2018). Sampled bat families are represented by vertical lines; grey lines (left to right) are the following insectivorous outgroup families: Rhinolophidae: n = 1; Emballonuridae: n = 2; Natalidae: n = 1; Vespertilionidae: n = 1; and Molossidae: n = 2; black lines (left to right) from Noctilionoidea are Noctilionidae: n = 1; Mormoopidae: n = 3; and AmiGO queried with "eye" and "phototransduction" (Carbon et al., 2009;Emerling & Springer, 2014;Lamb et al., 2016;Wistow et al., 2008). We screened the above eye-expressed PSGs, identified by branch-site models, for these vision genes, and categorized each identified by representative eye components based on gene function or known disease phenotype (Rappaport et al., 2017;Safran et al., 2010;Wistow et al., 2008). The following eye parts were used: blood supply to retina, cornea, whole eye (e.g., intraocular changes), feature external to eye (e.g., eye muscles, facial features, occipital lobe), intraocular pressure, lens, optic nerve and retina.

| Adaptive branch-site REL (aBSREL) test for episodic diversifying selection in vision genes
We used a naive approach (i.e., without specifying branch classes) to detect changes in selection pressure as measured by ω in candidate vision genes. The advantage of positive selection inferences using this method is that it allows for detection of adaptive selection in all lineages with highly specialized diets during the same analysis (e.g., obligate blood-feeding common vampire bat or piscivorous fishing bat). It also allows an unbiased detection of selection in the focal clades explicitly tested above using branch-site models. We used the data set of candidate vision genes (compiled from publications, NEIBank and GO terms) to first test the prediction that taxa with lineage-specific diets (e.g., blood, fish) would show the highest levels of diversifying selection across loci. Second, we predicted differing levels of diversifying selection across focal clades. Specifically, we expected little diversifying selection among Stenodermatinae, members of which are all highly specialized frugivores, exhibit exceptional bite force and all retain putatively functional S-opsins (Dumont et al., 2012;Sadier et al., 2018). In contrast, we expected diversifying selection would be present within Glossophaginae and Mormoopidae due to differential retention of S-opsins and contrasting reliance on nectar in the former, and the presence of HDC echolocation in some members of the latter (Sadier et al., 2018;Smotherman & Guillen-Servent, 2008).
We searched our transcriptomes for the above 806 vision genes and recovered a total of 697 such genes for downstream analyses.
Of these, 306 had sequences for all 39 species. We used absrel , from the hyphy 2.3.6 package, in exploratory mode to capture episodic diversification across all branches in the tree (rather than just the ancestral branches examined with paml). To improve the statistical power associated with this model when run in exploratory mode across many species, we subsampled alignments for 15 species representing the diversity of diets across noctilionoids (see Supporting Information). For the vision genes, this resulted in a total of 620 suitable genes with ≥10 taxa, and of these 376 genes had all 15 taxa. Identical absrel analyses were performed on a "control" set of 697 genes randomly drawn from all alignments (n = 13,375) using r version 3.4.0, and as vision genes make up ~5% of the genes in the total data set, this control set of genes contained 39 vision genes. For the control gene set, a total of 597 genes contained ≥10 taxa (376 with all 15 species) and were run for the reduced taxonomic sampling data set. As absrel analyses can be highly sensitive to alignment errors, all genes in which significant positive selection was calculated were checked by eye, and all results potentially due to low-confidence alignments were removed. All branches in the phylogeny are tested per gene when absrel is run in exploratory mode, so p-values are FDR-adjusted for the multiple tests performed on each gene.

| Selection intensity on vision genes associated with shifts in foraging and diet
Evolutionary innovation can be driven by either positive (ω > 1) or relaxed (ω ~ 1) selection. Relaxation of selection may also indicate that a trait is in the process of being lost and is no longer functionally significant, whereas intensification of selection can indicate the functional importance, and conservation, of a trait. We defined two predictions using the species tree to test for differences in relative selection intensity relating to diet and foraging in noctilionoid bats ( Figure S3)

| Species representation and transcriptome assemblies
We generated whole eye transcriptomes from 39 ecologically diverse bat species representing eight families. Focal taxa encompassed the full range of diets in Noctilionoidea (arthropods, fish, pollen and nectar, fruit, and blood) (Figure 1). Cleaned shortread data for each sample (range: 13-45 million; mean: 25 million paired-reads) were assembled, screened for chimeric sequences, assessed for completeness and annotated using a reciprocal blast approach (see Figures S4-S6).

| Positive selection in eye-expressed genes at eight key stages of noctilionoid evolution
We used branch-site models to test for positive selection in eye-

| Functional categorization of PSGs for roles in vision
We filtered each of the above eight sets of eye-expressed PSGs (uncorrected p ≤ .05) for candidate vision genes (known function in eye structure/vision, identified by NEIBank, AmiGO and research papers). Beginning with PSGs found along the branches associated with foraging shifts (A-C), we found the most evidence of positive selection in genes with diverse visual functions, such as cornea, lens and intraocular pressure genes, along the ancestral noctilionoid branch (A) (see Figure 3a; Table S5 for additional information regarding gene function and significance following FDR adjustment). These include 13 PSGs with documented roles in the retina (e.g., CDH3 and SEMA4A), and six genes with corneal and lens-related roles (e.g., HSF4 and PPP2R3A). However, little evidence of adaptive evolution in vision genes was detected along the ancestral mormoopid (B), apart from CYP4V2 and DLL4, both associated with retina function, and GJA8, associated with cataract formation (Safran, et al., 2010).
Positively selected vision genes along (C) the ancestral phyllostomid include at least nine loci linked to the retina, or its blood supply, such as ATF6, a gene associated with achromatopsia and loss of colour vision (Safran, et al., 2010).

| Enriched and clustered "Biological Process" GO terms
To further evaluate how vision-associated functions are represented among the positively selected eye-expressed genes in noctilionoid bats, we performed GO enrichment analyses of each set of PSGs against a background of the eye-expressed genes tested for each branch (Table S6). as "retina homeostasis" and "response to salt stress," with the latter term putatively relating to solute and water balance in the eye (see Section 4), with the most significant terms relating to immunity. The majority of (B) ancestral mormoopid and (C) ancestral phyllostomid terms also relate to immunity and ubiquitous processes such as metabolism. Of branches relating to dietary shifts, no visual terms were found for either (D) the ancestor of Phyllostominae, although "auditory receptor cell stereocilium organization" was found, or (E) the ancestor of plant-feeding bats. For nectar-feeding branches, (F) the ancestor of Glossophaginae contained "lens fibre cell differentiation" and (G) L. spurrelli contained "detection of stimulus." Finally, within (H) the ancestor of Stenodermatinae, "phototransduction, visible light" was ranked highest, with the related terms "hyperosmotic response" and "response to salt stress" also within the top 10 terms.
We then examined significantly enriched GO terms (p < .05), and the genes driving these enrichments in the context of sensory and ecological adaptations (Figure 4), by first reducing redundancy in dispensable terms by clustering, and then tagging with representative terms in revigo (Supek et al., 2011) (Table 1; Table S7).

| Sensory processes
Beginning with branches linked to foraging shifts, along (A) the ancestral noctilionoid we found representative enriched BP terms such as "sensory perception of light stimulus" and "neuromuscular process controlling balance." In contrast, we found little evidence of GO enrichment clearly associated with sensation in (B) the ancestral mormoopid or (C) the ancestral phyllostomid.
Within Phyllostomidae, we tested for GO enrichment along five branches linked to shifts in diet (D-H). Along (D) the ancestor of Phyllostominae, we found enriched terms relating to the widest range of stimuli, such as "auditory receptor cell stereocilium organization" and "response to temperature stimulus," but only the single visual term "retina homeostasis" (clustered within "tissue homeostasis") was found. Along (E) the ancestor of plant-feeding bats, we found some evidence of enrichment relating to sensory perception (e.g., "sensory perception," and "regulation of response to external stimulus"). However, the only vision-related BP term, "detection of light stimulus involved in visual perception," was due to positive selection on the single gene SEMA5B-which plays a role in the regulation of retinal neurite outgrowth (Matsuoka et al., 2011). Along (F) the ancestor of Glossophaginae, representative enriched terms include "lens fibre cell differentiation," "retina homeostasis" and F I G U R E 4 Enriched Biological Process GO terms, and the associated genes mapped onto the noctilionoid phylogeny, for (a) sensoryrelated terms and (b) nonsensory-related terms. Noctilionoid bat clades are coloured according to main diet: brown, arthropods; yellow, pollen and nectar; and green, fruit, and non-noctilionoid outgroups are coloured in black. For all GO terms, the representative term is shown and the total number of related terms are shown in parentheses. Associated positively selected genes are shown beneath, and genes remaining significant after FDR adjustment are indicated by bold font [Colour figure can be viewed at wileyonlinelibrary.com] "response to mechanical stimulus." Along the Lonchophyllinae (G) only more general GO terms were enriched, such as "detection of stimulus," "cellular response to stimulus" and "retinoid metabolic process." Finally, along (H) the ancestor of Stenodermatinae, significant enrichment was found in vision-related terms such as "visual perception" and "phototransduction, visible light," the latter of which represented more specific terms relating to the Rhodopsinmediated signalling pathway.
Additional evidence for molecular adaptations in the sensory systems of noctilionoid bats relating to dietary shifts was shown by enriched MF and CC terms, with "stereocilium bundle" found to be enriched in (D) the ancestor of Phyllostominae, "structural constituent of eye lens" in (F) the ancestor of Glossophaginae, and "photoreceptor disc membrane" in (H) the ancestor of Stenodermatinae ( Figure S8).

| Morphology and metabolism
Aside from the above sensory-associated BP terms, enrichment was also found in GO terms that may relate to the foraging, morphological and dietary diversity of noctilionoids ( Figure 4b, and Supplementary Information). For example, across all branches tested, with the exception of (B) the ancestral mormoopid, terms relating to either the renal system (e.g., "nephron development") or salt/water balance (e.g., "response to osmotic stress") were enriched (Table S7). We also found enrichment in terms relating to "cranial skeletal system development," and putatively to the high-sugar diets of the two nectarfeeding lineages (G and F).

| aBSREL tests for episodic diversifying selection across species
We performed tests for episodic positive selection across all branches in the noctilionoid tree on 697 vision (i.e., loci with documented roles in eye structure/vision) and control genes.   showed similar patterns to those of the complete taxa set, with a similar proportion of genes under episodic selection in the visual and control genes (55 vs. 43), as fewer genes were analysed in the control set ( Figure S9 and Table S8). Again, more vision genes, compared to control genes, were under positive selection in the common vampire bat, and equal numbers in N. leporinus.

| Selection intensity on vision genes associated with shifts in foraging and diet
Firstly, we tested for differences in relaxed or intensified selection (i.e., positive or purifying selection) acting on vision genes using relax models and a partitioned phylogenetic tree labelled  F I G U R E 6 (a) Vision genes under significant intensified or relaxed selection in (i) aerial insectivores vs. gleanings bats, and (ii) bats feeding on prey items vs. plant material, visualized as protein-protein interaction networks. Nodes (proteins) are coloured yellow for relaxation, and green for intensified selection in the test branches relative to the reference. Thickness of connections between nodes is proportional to the combined interaction score. (b) UpSet plot of intersections of vision genes identified as being under relaxed, intensified and similar selective constraint in (i) and (ii) above. Bars are coloured yellow for relaxation, and green for intensified selection, while grey are not significant in the test branches relative to the reference. Abbreviations: R, relaxed; I, intensification; ns, not significant [Colour figure can be viewed at wileyonlinelibrary.com] RHO) and 50 were under relaxation (k < 1) (e.g., COL4A5, GJA8 and RBP4) in gleaning bats compared to aerial insectivores. Thus, supporting our prediction that in relation to the reference branches of aerial insectivores, gleaning bats would exhibit increased levels of intensified selection in visual genes. The identity of the 183 genes under either significant relaxed or intensified selection are visualized as a network of protein-protein interactions (PPIs) ( Figure 6). In comparison, analyses performed on 689 control genes (that could be analysed with the above branch partitions) returned similar proportions of genes under intensified or relaxed selection. However, compared to the vision genes, fewer control genes (112 genes) were found to be under significant intensification and slightly more control genes (53 genes) showed significant relaxation between test and reference branches (see Table S8F).
Secondly, we tested for differences in selection intensity in vision genes in species feeding on either moving prey (reference) or stationary plant items (test). Of the 697 vision genes tested, 191 differed significantly in selection intensity and 506 did not differ between test and reference branches (Table S8). Of these 191 significant genes, the majority (136) were under significant intensification (e.g., CNGA1, CNGB1 and IQCB1), and 55 vision genes were under significant relaxation (e.g., OPN1SW, RHO and UNC45B) in the plant-visiting bat test branches compared to the reference (uncorrected p ≤ .05, Table S8). Thus, our prediction that in species feeding on stationary plants, compared to those feeding on prey, vision genes would be under intensified selection was supported.
The PPI network between the proteins encoded by the significant genes highlights that the majority of proteins are under intensified selection and that proteins under relaxation are located throughout the network (i.e., do not appear to be clustered) ( Figure 6). In comparison, of the 697 control genes tested, 158 differed significantly in selection intensity, and of these, 110 genes were under significant intensification, and 48 under relaxation on the test branches vs. the reference in the control genes (uncorrected p ≤ .05, Table S8H). In Comparing results of the two tests performed in vision genes might provide information on which visual components were under molecular adaptation at early and later stages of noctilionoid evolution (Figure 6). In total, 52 genes were under intensified selection (i.e., purifying or positive) in gleaning bats compared to aerial insectivores, but did not differ in selection pressure between bats feeding on plants vs. prey. Within these genes, at least six (BFSP1, CRYBA4, CRYBB1, CRYBB3, HSPB6 and MIP) are structural proteins found in the lens, and three (BBS1, BBS4 and BBS5) are associated with Bardet-Biedl Syndrome (Safran, et al., 2010). Conversely, 57 vision genes under significant intensified selection between bats feeding on plants vs. prey did not differ in selection intensity between aerial insectivores and gleaning bats.
These genes included at least seven (CACNA1F, CDHR1, CEP290, CNGB1, GUCA1B, RPGR and PDE6A) associated with photoreceptor structure or function (Safran, et al., 2010). In total, 17 genes showed consistent relaxation in both test groups compared to the reference branches (e.g., OPN1SW, RBP4 and TENM3). A total of 74 genes were under intensified selection in both tests (e.g., CRYA1), and 424 vision genes did not differ in selection intensity (e.g., OPN1LW) between test and reference taxa in either comparison performed (Figure 6). See the Supporting Information for results of clade models of divergent selection (Supporting Information and Table S8).

| Molecular ecology of sensory genes, foraging and diet
Starting from their putative insectivorous ancestor, noctilionoid bats evolved into a diverse range of phytophagous and carnivorous species, thus filling dietary niches arguably unparalleled among other mammalian families (Freeman, 2000;Rojas et al., 2011). Behavioural and physiological data show noctilionoids use many different sensory cues to find food (Bell, 1985;Gonzalez-Terrazas et al., 2016;Gracheva et al., 2011;Gutierrez, Pessoa, Aguiar, & Pessoa, 2014;Tuttle & Ryan, 1981;Vater et al., 2003;Winter et al., 2003), and recently, the molecular ecology of vision in noctilionoids, and its links to trait evolution, has become the focus of attention. By analysing the molecular evolution of thousands of protein-coding genes across dozens of species, we uncovered evidence of adaptation in hundreds of eye-expressed and vision genes, concentrated along branches associated with transitions in foraging modes, and well before the evolution of novel, specialized diets that characterize this clade.
Although seldom explored before, the evolution of novel foraging strategies characterizes noctilionoids, and may correspond to the first and most intense period of adaptation in vision and eye-expressed genes detected in our data. Gleaning behaviour may be widespread across the entire noctilionoid superfamily; for example, bats within Mystacinidae evolved a new foraging strategy combining aerial and ground-based insectivory (Arkins, Winnington, Anderson, & Clout, 1999;Dechmann, Safi, & Vonhof, 2006;Hand et al., 2009;Riskin, Parsons, Schutt, Carter, & Hermanson, 2006).
Adaptations at the origin of Noctilionoidea may have preadapted many of its descendants for exploratory omnivory, as extant Mystacina is omnivorous, and related Miocene fossils trace the morphology linked to a plant-inclusive diet to ~18 million years ago (Hand et al., 2018). Furthermore, trait mapping among the sampled extant species reveals a pattern of high variance in foraging strategy within noctilionoids with subsequent flexibility of the diet, in contrast to non-noctilionoid outgroups; for example, Noctilio leporinus evolved flexible foraging including trawling, while insectivorous phyllostomids share a foraging strategy of gleaning (Schnitzler & Kalko, 2001). Having entered into contact with both plants and vertebrates as gleaning insectivores, the first few branches to diverge among phyllostomids show an explosion of diets unusual for batsfrom blood to small birds and other bats (Figure 1). Contrary to our expectations, the branch corresponding to the putative origin of plant visiting (E) had the fewest eye-expressed PSGs of those tested. We therefore propose adaptations, including many molecular changes in vision genes, may have first evolved in the noctilionoid ancestor along with more flexible foraging strategies, and then in the phyllostomid ancestor in tandem with the emergence of gleaning insectivory. Therefore, our analyses suggest the genetic machinery for vision in ancestral noctilionoids and phyllostomids allowed for the exploration of the novel plant niche without major modifications. Descendant phyllostomid lineages specializing on plant products (i.e., nectar or fruit other than figs) then underwent adaptation in limited additional vision genes as they were effectively preadapted to this new diet.
Despite the proposed association between phyllostomids and plants beginning at node E, dietary studies of phyllostomids highlight variation and flexibility in dietary niche breadth across certain species; for example, Phyllostominae have flexible diets that, to various degrees, include plant products (Clare et al., 2014;Oelbaum, Fenton, Simmons, & Broders, 2019;Rojas et al., 2018). Bayesian ancestral character reconstructions have previously been used to propose that predominant phytophagy (e.g., frugivory and nectarivory) evolved directly from insectivory in parallel lineages during the Mioceneplacing them at later evolutionary time points than branch E (Rojas et al., 2011). However, this conclusion was based on a genus-level data matrix, and whether the common ancestor of phyllostomids was also phytophagous remained ambiguous (Freeman, 2000;Rojas et al., 2011). Our data therefore lend support to the hypothesis that visual adaptations allowing the evolution of plant visiting may have preceded the exploration of plant diets.
Besides the two early bursts of adaptive evolution (detected by branch-site models of positive selection) at the origins of noctilionoids and of phyllostomids, there is evidence for adaptation in genes associated with vision, as well as other traits, in both of the two independent lineages of nectarivores and the ancestor of the subfamily Stenodermatinae. While the numbers of shared and independent PSGs are not large, the function and localization of the genes identified suggests the fine-tuning of dietary adaptations on a preadapted genetic background. In support of this interpretation, Palynephyllum, a ~12 million year old fossil relative of Lonchophyllinae, was able to locate nectar and probably also included insects in its diet (Yohe et al., 2015). Nectar feeding evolved in three phyllostomid clades, but parallel adaptations in the skull, teeth, tongue, flight ability and metabolism are most apparent between the subfamilies Glossophaginae and Lonchophyllinae (Griffiths, 1982;Harper, Swartz, & Brainerd, 2013;Rojas et al., 2011;Voigt & Speakman, 2007). Based on the results of branch-site models, we detected six shared PSGs (ARHGEF12, DDX58, FASN, HSF4, NOD1 and RHNO1) between the Glossophaginae and Lonchophyllinae nectar-feeding lineages. While the number of shared PSGs is not large, especially given the anatomical and metabolic adaptations in both lineages, there is currently no consensus regarding expected levels of molecular convergence across taxa (e.g., Davies, Bennett, Faulkes, & Rossiter, 2018;Foote et al., 2015). Furthermore, aside from positive selection acting on protein-coding genes, many other forms of convergent molecular evolution may occur (e.g., Sackton et al., 2019). Of the shared PSGs, two putatively relate to visual adaptations: ARHGEF12 (involved in intraocular pressure-see below) and HSF4 (associated with cataracts in dogs, and also under positive selection in the noctilionoid ancestor; Mellersh, Pettitt, Forman, Vaudin, & Barnett, 2006;Springelkamp et al., 2015). In addition to the six common PSGs, we also found positive selection in lens-related genes in each nectar-feeding lineage; for example, three PSGs localized to the lens were found along the ancestral branch of Glossophaginae (Figure 3a).
Experimental evidence suggests that in Glossophaga soricina, corneal and lens transmittance allows UV light to pass through (Muller et al., 2009). Although the adaptive significance of this is unclear, it has previously been speculated that the perception of UV light by nectar-feeding bats may aid navigation or the detection of flowers due to UV reflectance (Muller et al., 2009;Winter et al., 2003).
Aside from sensory specializations, both nectar-feeding lineages share possible adaptations to their high-sugar diets through adaptations in FASN (Fatty Acid Synthase), which in humans is associated with Hyperinsulinaemic Hypoglycaemia, Familial, 3, characterized by excessive insulin secretion (Safran, et al., 2010). Of note, FASN was also under positive selection in insectivorous Mormoopidae (B), but different amino acid sites were under selection in the three branches, and this therefore does not preclude a role in both nectar and insect diets. At the same time, we identified independent PSGs in the two lineages with functions in metabolism, digestion and cranial morphology (see Supporting Information).
Identified PSGs in the subfamily Stenodermatinae also suggest fine-tuning of their visual system, perhaps linked to their specialized diet of figs. As the only case of increased species diversification across all bats (Shi & Rabosky, 2015), biomechanical adaptations to bite into figs have been proposed as key innovations explaining their success (Dumont et al., 2012). But before biting into figs, bats must first find them, and a combination of olfaction and echolocation has been found to contribute to foraging in these bats (Korine & Kalko, 2005). At the same time, experiments with captive Artibeus spp. show bats do use visual cues for finding fruit when light comparable to moonlight is available (Gutierrez et al., 2014). This flexibility in sensory modes used for foraging may explain why UV cones are conserved in this subfamily, in contrast to nectar-feeding bats, which include several instances of loss (Sadier et al., 2018). In short, behavioural experiments show vision is used to forage under natural night-time light conditions, and the molecular machinery for detecting high-frequency light is conserved. Absolute numbers of PSGs along this branch were not exceptional, but there was evidence of an association with phototransduction (visible light) and the rhodopsin-mediated signalling pathway. This suggests a greater reliance on vision in this clade, with foraging as a potential use.
Our selection analyses across noctilionoid bats highlight the relative importance of genes associated with specific aspects of the eye during different stages of noctilionoid evolution. Specifically, during the initial shift in foraging from aerial insectivory to gleaning, and also during the evolution of nectarivory, genes associated with the eye lens appear to be under either positive or intensified selection, compared to intensified selection acting on genes associated with photoreceptors during later dietary shifts. Despite the known differences in functional retention of noctilionoid visual opsins-OPN1SW has been lost multiple times while OPN1LW and RHO are maintained (Gutierrez, Castiglione, et al., 2018;Kries et al., 2018;Sadier et al., 2018)-we found evidence of relaxed selection acting on OPN1SW in both gleaning and plant-visiting bat species, as well as on RHO in plant-visiting species and no evidence of differences in selection intensity in OPN1LW. Relaxation in OPN1SW could correspond to the ongoing loss of this gene across the clade, although an alternative interpretation, particularly in respect to RHO, may be that the relaxed selective constraint has allowed these lineages to take advantage of ecological opportunity (Yoder et al., 2010).
Our data set of protein-coding genes expressed as mRNA in the eyes of adult neotropical bats may lack regulatory and/or developmental genes expressed in the early stages of eye formation.
Furthermore, expression of a gene in eye tissue (classed here as eye-expressed genes) does not guarantee a critical role in vision, but, of the thousands of genes expressed in the eye, many hundreds do have such roles (e.g., lens structural components, vitreous humour solutes) (Wistow et al., 2008). However, it is not always straightforward to relate enriched GO terms to particular adaptations, and importantly GO terms are not exhaustive in reflecting gene function; for example, ALDH3A1, GAS6 and TRVP4 (under selection in branch A) have putative functional roles in the eye such as UV-protection in the cornea (Estey, Piatigorsky, Lassen, & Vasiliou, 2007;Ryskamp et al., 2016;Valverde, Obin, & Taylor, 2004), but were not associated with any of the GO terms obviously linked to vision. Thus, PSGs with potential sensory, and even visual, functions may in fact be currently underestimated due to incomplete GO annotations, and as such are candidates for future investigation. Besides visual adaptations, our analyses suggest possible reliance on other senses, such as hearing, over vision in the subfamily Phyllostominae, which hunt by listening to sounds generated by prey (e.g., frogs, cicadas and other small bats) (Belwood & Morris, 1987;Surlykke, Jakobsen, Kalko, & Page, 2013;Tuttle, Ryan, & Belwood, 1985). GO annotations of PSGs along this branch highlight diverse sensory functions (e.g., audition, mechanical and temperature sensation), with some genes involved in both hearing and vision (e.g., PCDH15), and therefore determining which sensory trait this putative adaptation relates to requires further analyses involving the auditory system. Despite variation in RNA integrity and short-read number across samples, due to variable field conditions and sequencing depth variation, a considerable proportion of genes (~43%) were recovered across all species (data not shown). In the remaining genes, incomplete taxonomic sampling may mean inferences of selection do not relate solely to the branch we assume. The appropriate approach for correcting multiple tests across genes is currently debated (Beichman et al., 2019;Davies et al., 2018;Prost, et al., 2019); we tested ~10,000 genes across eight branches of interest, and then adjusted for these multiple tests on a branchwise basis (Kosiol & Anisimova, 2019). We also report uncorrected results, and performed GO enrichment analyses on nominal p-values, because branch-site models have been shown to be conservative, particularly when using the chi-squared test thresholds adopted here (Yang & dos Reis, 2011). Previous studies have shown that the power of branch-site models, such as model A in paml and absrel in hyphy, varies in relation to foreground branch length Yang & dos Reis, 2011). Our simulated data sets based on parameters estimated from the data also support this (see Supporting Information). Branches A and E correspond to ~10 and 6 million years of evolution, respectively ( Figure S1). While average branch lengths, based on 500 genes, recover a shorter length for branch E compared to A ( Figure S2), gene-wise branch lengths are estimated during each analyses by codeml and absrel. Therefore, variation in branch lengths alone is unlikely to account for the distribution of numbers of PSGs across the noctilionoid tree. Finally, by focusing on shifts in selection, other aspects of molecular evolution (e.g., gene duplication or gene expression) remain unstudied.

| Eye size, osmotic balance and visual adaptation
We uncovered molecular adaptations associated with osmotic balance in several noctilionoid branches. Maintaining appropriate osmotic pressure is crucial for correctly functioning eyes (Murgatroyd & Bembridge, 2008), and is likely to be more physiologically challenging in taxa with larger eyes (Mark, 2007). In support of this interpretation we detected more evidence of molecular adaptations in loci related to intraocular pressure, glaucoma and osmotic response in branches representing species with larger eyes (e.g., A: Noctilionoidea, C: Phyllostomidae, H: Stenodermatinae) compared to those with smaller eyes (e.g., B: Mormoopidae) (Figures 3 and   4). A recent study compared intraocular pressure in Artibeus lituratus and Anoura caudifer, and confirmed a higher average value in the larger A. lituratus (Tavares Somma, Coimbra, Lange, Moore, & Montiani-Ferreira, 2020). However, as comparative values are currently lacking for other phyllostomid species the anatomical significance of this remains unclear. Nevertheless, most associated PSGs, or enriched GO terms, including hyperosmotic response or response to salt stress, cannot unambiguously be assigned to either eye or kidney functions and thus may have implications for both excretory and sensory evolution. While genes involved in kidney function and excretion, linked to dietary demands, have previously been shown to have undergone adaptive evolution in bats (Sharma et al., 2018;Zepeda Mendoza et al., 2018), in some cases the hypothesized ecological demands on eyes or kidneys cannot easily be distinguished.
For example, the primarily frugivorous stenodermatines have both larger eyes and excretory demands arising from their sugar-and water-rich diet, while nectar-feeding species must carefully regulate water and electrolytes to avoid either over-or dehydration during feeding and fasting (Bakken et al., 2008;Studier et al., 1983;Thiagavel et al., 2018). We also found evidence of molecular adaptation in phyllostomine bats relating to cellular response to fluid shear stress; these bats have protein and mineral-rich diets that could also be challenges to osmotic balance (Studier et al., 1983).

| CON CLUS IONS
Behavioural, physiological and molecular studies demonstrate the importance of vision to bat foraging (Bell & Fenton, 1986;Gutierrez et al., 2014;Kugler et al., 2019). We detected several periods of positive selection: during the initial noctilionoid radiation, the ancestral phyllostomid branch, and branches corresponding to the origins of highly specialized plant-based diets (i.e., nectarivory and fig-specialized frugivory). However, we found limited detectable molecular adaptations associated with the hypothetical initial dietary shift to plant visiting. Thus, our analyses imply the evolution of numerous adaptations in the ancestors of noctilionoids and phyllostomids, resulting in preadaptation for fruit gleaning in the plant-visiting phyllostomids by exaptation of pre-existing molecular machinery that arose in the ancestral noctilionoids associated with a shift from aerial to gleaning insectivory.

DATA AVA I L A B I L I T Y S TAT E M E N T
The 39 RNA-Seq libraries used in this study have been deposited in the NCBI SRA under Bioproject PRJNA555243 (Davies et al., 2020b).
Gene alignments for all genes used for selection analyses are available from Dryad, https://doi.org/10.5061/dryad.00000 001g (Davies et al., 2020a). Custom scripts used for the processing of the data are available from corresponding author K.T.J.D. upon request.