BACKGROUND
the tropical andes harbor a significant fraction of global diversity , with half this diversity comprised of regional endemics  <cit> .
in contrast to other diverse montane regions , a major fraction of andean diversity is derived from lineages that have radiated extensively in situ .
thus, identifying the historical and landscape characteristics that foster speciation in the andes will be crucial for understanding the mechanisms that have made the region a diversification hotspot.
the topographically complex andean landscape seems to drive diversification in two ways  <cit> .
first, topographic barriers can fragment the narrow distributions of montane taxa and promote divergence via allopatric speciation .
second, topography creates climate variation over small spatial scales that can drive ecological divergence, leading to reproductive isolation  and/or accelerated niche divergence  <cit> .
although some evidence for both mechanisms operating in the andes exists, the relative importance of each mechanism working independently or in concert during the diversification process remains poorly understood.
topographic barriers are frequently associated with phenotypic and genetic discontinuities in andean species, providing evidence for the importance of physical isolation in andean diversification .
however, if physical isolation across topographic barriers were the sole driver of andean speciation, species-level differences would be expected to accumulate via neutral processes.
substantial empirical evidence supports non-neutral mechanisms of speciation  <cit> , although the overall tempo of diversification in the tree of life has recently been interpreted as evidence of neutral diversification  <cit> .
discordant patterns of phenotypic and genetic diversity are frequently found in andean lineages, in contrast to neutral expectations .
moreover, coalescent simulations of plumage evolution in arremon brushfinches indicate that plumage differentiation proceeds at a much faster rate than expected via neutral divergence  <cit> .
in sum, it seems that range fragmentation alone is an insufficient mechanism for explaining the generation of andean diversity.
ecological speciation occurs when ecological factors, regardless of gene flow, catalyze reproductive isolation by natural selection  <cit> .
in the andes, higher diversification rates are associated with climatic-niche shifts indicating that ecoclimatic variation may be an important driver of lineage proliferation  <cit> .
several studies of andean taxa have found morphometric and functional divergence arising among populations distributed along ecological gradients in the face of ongoing gene flow .
although these results suggest that ecological mechanisms might be the primary drivers of divergence in the region, abundant evidence from outside the andes indicates that rates of phenotypic divergence and evolution of reproductive isolation will be slower in populations experiencing gene flow relative to those that are more isolated .
indeed, studies examining whether sister species replace one another along ecological gradients in the andes have been inconclusive, with some sister species found to replace one another along ecological gradients in andean butterflies  <cit>  and frogs  <cit> , but not in andean birds or mammals .
given the lack of clear support for an exclusive role of geographic isolation or ecological speciation in driving andean diversification, a better understanding of the speciation process in the andes will likely come from addressing how geographic and ecological isolation operate in concert  <cit> .
the topographic complexity of the region should allow for interactions between these two processes.
topographic barriers promote the reduction of gene flow, while the increased climatic variation associated with topography potentially increases the tempo of divergence via differential selection pressures  <cit> .
one approach to test whether divergence is associated with topographic relief will be to assay divergence among population pairs that  occupy similar climates on either side of a topographic barrier,  occupy different climates on either side of a topographic barrier, and  occupy different climates in the absence of a topographic barrier.
in particular, comparing patterns of spatial variation in effectively neutral genetic markers and functional traits will provide a means to understand the relative influence of geographic and ecological isolation in promoting genetic structure and divergence in ecologically relevant traits.
we focus on peruvian populations of the andean hummingbird metallura tyrianthina to understand the drivers of spatial diversity in functional morphology and genetics.
the geological history of the peruvian andes generated a topographically complex landscape, with glaciated cordilleras >5000 m in elevation interspersed with deep river valleys  <cit> .
these landscape features generated habitat discontinuities in the elevational distribution of m. tyrianthina .
final uplift of the central andes over the last ~ <dig> myr also dramatically altered the climate  <cit> , generating a steep rainfall gradient from the wet eastern slope to the desert-like western slope  <cit> .
m. tyrianthina likely colonized peru from northern populations ~2 ma and presently spans several topographic barriers and steep climatic gradients in the peruvian andes  <cit> .
three subspecies of metallura tyrianthina occur in peru: m. t. tyrianthina north and west of the marañón valley in humid montane forests and edge habitat; m. t. septentrionalis in semi-humid montane scrub along the western cordillera of peru south to the department of lima; and m. t. smaragdinicollis throughout the eastern andes of peru in humid forests along east-facing slopes and in semi-humid scrub on west-facing and rain-shadowed slopes .fig.
<dig>
a map illustrating the distribution of all three metallura tyrianthina subspecies that occur in peru.
circles denote sampling sites for both genetic and bill length data; squares represent sampling sites for bill length data only.
blue points are sites where the habitat was characterized as humid montane forest and brown points semi-humid montane scrub.
b map of sampling sites from the department of cusco, peru.
one pair of sites was from the humid  and drier  sides of the cordillera de vilcanota, separated by ~20 km.
a second pair of sites was along the manu road, with a humid  and drier  site ~5 km apart.
c topographic profile of the cordillera de vilcanota, which exceeds 5000 m, and the manu road where a cordillera less than 4000 m in elevation separates the two sites along the manu road
we compared spatial patterns of variation in bill length and effectively neutral dna sequences in m. tyrianthina to test predictions derived from models of geographic speciation, ecological speciation, or a combination.
if geographic isolation drives divergence then we will expect to find a concordant relationship between phenotypic and genetic divergence across topographic barriers.
however,  if divergence is primarily driven by ecological factors then we expect to find linked phenotypic and genetic divergence in association with ecological dissimilarities, independent of geographic isolation.
finally,  if topographic barriers and ecological differences interact to drive divergence then we expect to find phenotypic divergence between different environments, but only when a topographic barrier that reduces gene flow separates those environments.
methods
sampling
tissue samples of metallura tyrianthina were obtained from frozen tissue collections at natural history museums, primarily the museum of southwestern biology .
collection of these samples was approved by the university of new mexico institutional animal care and use committee  and permitted by peruvian management authorities .
the geographic breadth of sampling was increased through tissue loans of an additional  <dig> individuals from other natural history collections .
from all  <dig> individuals, we extracted genomic dna from pectoral muscle that was either frozen or preserved in rnalater®  using a qiagen dneasy blood and tissue kit and following the manufacturer’s protocols .
the mitochondrial gene nadh dehydrogenase, subunit  <dig>  was sequenced for all  <dig> individuals.
for all of the  <dig> individuals sampled in the department of cusco we sequenced an additional two nuclear introns: adenylate kinase, intron  <dig>  and β-fibrinogen, intron  <dig> ; and the z-linked locus muscle, skeletal, tyrosine receptor kinase .
primers and sequencing protocols were identical to those used in benham et al.
<cit> .
all sequences were manually assembled and edited using sequencer v.  <dig> .
<dig>  and aligned using muscle v.  <dig>   <cit> .
haplotype reconstruction for nuclear loci with multiple double peaks was conducted using the program phase v.  <dig> .
<dig>  <cit> .
the size and shape of hummingbird bills vary in association with floral resources  <cit>  and competitive interactions with other hummingbirds  <cit> .
the hummingbird bill is an ideal trait in which to examine functional diversification across the andean landscape due to its functional importance and the fact that bill characteristics tend to be highly heritable  <cit> .
we measured bill length  to the nearest  <dig>  mm using digital calipers on  <dig> museum specimens collected from throughout peru .
all specimens included in this study were associated with precise locality and mass data and all measurements were made on dried specimens to avoid increased error from specimen shrinkage  <cit> .
sexual dimorphism in bill length and shape is widely encountered within trochilidae  <cit> ; however, using a two-tailed t-test for the entire dataset, we did not detect any significant differences between the sexes in bill length; accordingly, males and females were pooled for subsequent analyses.
all statistical analyses were conducted using the open source program r .
to assess environmental differences among all specimen localities we obtained bioclimatic data at 30-s resolution from the worldclim dataset  <cit> .
using coordinates for each sampling locality we extracted data from gridfiles of the bioclim variables within the program diva-gis .
the climatic data includes  <dig> variables related to measures of temperature, precipitation and seasonality .
these data are derived from interpolated climate surfaces available for the entire globe at 30-arc sec spatial resolution and were gathered from several independent sources between  <dig> and  <dig>  <cit> .
although the worldclim dataset may be error-prone in montane regions due to interpolation  <cit> , such error is likely to be random with respect to our hypotheses.
the worldclim dataset has been used successfully in a number of modeling and morphological studies of andean birds .
worldclim data has also been used successfully at fine spatial scales to guide surveys for range-restricted andean hummingbird species  <cit> .
we divided the  <dig> bioclim variables into three groups each corresponding to variables related to temperature, precipitation, and seasonality.
secondly, we performed a principal components analysis on each of the three groups and used the first components of temperature , precipitation , and seasonality , respectively, for analyses .
influence of topographic barriers on divergence
to assess the association of genetic structure with topographic barriers we constructed a phylogeny of all metallura tyrianthina nd <dig> samples using bayesian methods in mrbayes v.  <dig>   <cit>  on the cipres science gateway  <cit> .
for an outgroup we obtained nd <dig> data of metallura phoebe from genbank .
a gtr + i + Γ model was selected as the most appropriate substitution model based on akaike information criteria  <cit>  estimated in jmodeltest v.  <dig>   <cit> .
we also partitioned the dataset by codon position following mcguire et al.
<cit> .
the mcmc analysis ran for  <dig> million generations sampling every  <dig> generations and consisted of four simultaneous runs of four chains each with a temperature for heated chains of  <dig> .
we assessed convergence using the program awty  <cit>  and discarded the first 10 % of trees as burnin.
to further evaluate patterns of genetic structure we calculated the number of haplotypes for nd <dig> in dnasp  <cit>  and visualized these as a haplotype network using a median-joining method in network v.  <dig> .
<dig>  <cit> .
we evaluated the proportion of genetic diversity explained by topographic barriers as identified with phylogenetic and network analyses in peruvian metallura tyrianthina using an amova analysis.
for this analysis we divided the sampled individuals into six groups each divided by a topographic barrier.
these barriers include: the north peru low, high andean ridgeline, the mantaro valley, the apurímac valley, and the cordillera de vilcanota .
these barriers also correspond to phenotypic and genetic discontinuities in other andean bird species .
degree of divergence among clades was assessed with fst values and nei’s average corrected pairwise differences , which accounts for intra-population polymorphism with the equation da = dxy -  <dig>  , where x and y are the two populations compared and d is the average uncorrected genetic differences.
for each of the clades identified using the above analyses we also calculated standard indices of molecular diversity, including nucleotide and haplotype diversity.
finally, we calculated tajima’s d and fu’s f  to determine whether any of the nd <dig> clades exhibit deviations from neutrality.
all population genetic analyses were performed in the program arlequin v.  <dig>   <cit> .fig.
<dig>
a
nd <dig> bayesian phylogeny for peruvian populations of metallura tyrianthina.
posterior probabilities for each node printed above branches .
the six geographically structured clades are lettered on all figures.
each clade is colored by subspecies as in panel c. b median-joining haplotype network of nd <dig>  brown color indicates semi-humid montane scrub habitat; blue indicates humid montane forest.
c geographic distribution of each clade .
red dotted lines signify putative physical barriers that isolate the six clades
concordance between genetic and morphological divergence
to test for concordance between patterns of genetic divergence and bill length variation we compared bill length differences to two measures of genetic divergence, da and linearized fst , across sixteen sampling localities.
these measures of genetic distance were compared to the average difference in bill length between each pair of sampling localities.
we used a series of linear regression analyses to compare genetic and bill length differences among all pairwise comparisons of populations, among populations in humid montane forest habitats, in semi-humid montane scrub habitats, and among populations distributed in different habitat types .
climatic drivers of divergence
populations distributed across different climatic regimes could experience adaptive divergence that will have a negative influence on gene flow leading to reproductive isolation and genetic divergence even at neutral loci, a process referred to as isolation by environment .
we test for ibe in metallura tyrianthina by comparing the relative roles of climatic distance and geographic distance in shaping patterns of genetic variation using a variation partitioning method in the r-package ‘vegan’  <cit> .
variation partitioning utilizes canonical redundancy analysis to dissect the contributions of different explanatory factors  to variation in a response variable .
variation partitioning has been shown to perform similarly to other recently developed tests for teasing apart spatially autocorrelated drivers of genetic diversity  <cit>  and performs better than partial mantel tests, which can exhibit a high type i error rate when considering spatially autocorrelated data  <cit> .
for m. tyrianthina we assessed the influence of environmental variation on genetic distance as measured by da and linearized fst.
we used euclidean geographic distances among sampling localities to assess the role of geographic isolation.
to assess the role of climate, we performed principal components analysis on all  <dig> bioclim variables from the  <dig> sampling sites for which we had both genetic and bill length data to reduce these variables to two principal components.
the first principle component explained  <dig>  % of bioclim variation, with the heaviest loading linked to annual precipitation.
the second principle component explained  <dig>  % of bioclim variation, with the heaviest loading associated with precipitation in the wettest quarter .
as alternative climatic variables, we used the first principle components of the bioclim variables for temperature, seasonality, and precipitation, respectively.
using either da or linearized fst we performed a series of variation partitioning analyses using all potential combinations of climatic principal components plus geographic distance as the explanatory variables .
we then tested whether the fraction of variation explained by each climatic variable was significant when conditioned for geography, and vice versa, using a permutation analysis with the ‘anova’ function in the vegan package .table  <dig> proportion of genetic variance explained by geographic or climatic variation
geographic distance  is the euclidean distance among sampling sites and climate is the proportion of variance explained by the different climatic variables included in each model.
clim <dig> and clim <dig> are the first two principal components of the entire  <dig> variable bioclim dataset, explaining 97 % of the variance in total.
temp, seas, and prec are the first principal components for temperature, seasonality, and precipitation bioclim variables, respectively.
the proportion of variance shared by both geography and climate is reported in the columns labeled ‘shared’.
high ‘shared’ values would indicate collinearity between ecological and geographic parameters; negative values are an artifact of subtracting adjusted r <dig> values to derive the shared proportion of variance  <cit>
*p <  <dig> ; **p <  <dig> ; ***p <  <dig>
we tested the influence of different climatic variables on bill length variation throughout peru using an information-theoretic approach.
we performed regression analyses with bill length as the dependent variable and pc <dig> of temperature, precipitation, and seasonality, respectively, as explanatory variables.
we also explored the possibility of using pc <dig> and pc <dig> of all  <dig> bioclim variables as predictors; however, pc <dig> and pc <dig> were found to be strongly correlated with seasonality and temperature, respectively .
consequently, we excluded pc <dig> and pc <dig> predictors to avoid issues associated with multi-collinearity in downstream analyses.
finally, we also include body mass in this analysis as another potential predictor of bill length variation.
we evaluated  <dig> models representing all possible main effect combinations of predictor variables and included an additional six models to evaluate all possible pairwise interactions between the four variables.
the likelihood of all  <dig> models was evaluated using an akaike information criterion corrected for sample size .
each model was ranked using Δaicc and akaike weights  <cit>  to determine which of our hypothesized climatic models best explains bill length variation in peru.
we discarded models from consideration if a nested model  had a better aicc score  <cit> .
dual influence of topography on divergence
we assess the combined influence of topographic barriers and climatic differences in shaping patterns of genetic and morphological divergence across two pairs of populations in which the members of each pair are adjacent but occur in different environments .
the first pair of populations were 20 km apart on either side of the cordillera de vilcanota with one population sampled in the semi-humid scrub of the urubamba valley  and the second within humid montane forest near the town of carrizales .
a second pair of populations was distributed along the manu road only 5 km apart with birds sampled in the semi-humid scrub near the town of paucartambo  and in humid montane forest near pillahuata .
the cordillera de vilcanota is glaciated and exceeds 5000 m elevation, with passes as low as 4300 m; whereas the pass separating humid and semi-humid populations along the manu road is only 3900 m .
given that the typical elevational distribution of m. tyrianthina is 1900–4200 m  <cit>  the cordillera de vilcanota likely imposes a more significant barrier to gene flow then any ridge along the manu road.
we used a one-way anova and tukeyhsd test to examine differences in bill length among the four sites.
to determine how our small sample sizes for the carrizales  and paucartambo  populations would impact our statistical power, we performed a power analysis in the r package pwr .
for this analysis we first performed two t-tests comparing bill length differences across the cordillera de vilcanota and the manu road.
the results of these t-tests were used to estimate the effect size of bill length divergence between both humid and semi-humid population pairs.
given the calculated effect of habitat on bill length divergence across both population pairs we confirmed that the statistical power using our small sample sizes exceeded the a priori defined threshold of  <dig>  .
to assess patterns of genetic divergence among sampling localities we calculated all pairwise fst-values across the four sampled populations for each of the four loci in arlequin v. <dig>   <cit> .
secondly, we determined levels of gene flow among the four populations using the program ima <dig>  <cit> .
ima <dig> is a coalescent genealogy sampler that simultaneously estimates effective population size, migration rates, and divergence times within the framework of an isolation with migration model  <cit> .
the ima <dig> program assumes no recombination and before analyses we assessed patterns of recombination in the nuclear loci using the four-gamete test  <cit>  in dnasp  <cit> .
this test detected recombination in regions of both ak <dig> and bfib <dig>  we saved the longest segment of each gene exhibiting no evidence of recombination, leaving segments of 232 bp for ak <dig> and 313 bp for bfib <dig>  we conducted pairwise comparisons between humid and semi-humid populations distributed along the manu road and across the cordillera de vilcanota.
additionally, we ran analyses comparing the two humid populations and the two semi-humid populations.
for each locus we specified a mutation rate with error ) derived from a multi-locus dataset analyzed in *beast using both geological and fossil calibrations for hummingbirds  <cit> .
these mutation rates were: nd2:  <dig>  × 10− <dig> μ/l/y ; ak1:  <dig>  × 10− <dig> μ/l/y ; bfib7:  <dig>  ×10− <dig> μ/l/y ; and musk:  <dig>  × 10− <dig> μ/l/y .
we applied inheritance scalars to each locus  to account for variation in effective population sizes.
benham et al.
<cit>  hypothesized that metallura tyrianthina colonized southern peru ~2 ma  based on a time-calibrated phylogeny.
we use the upper bound of the 95 % hpd from this previous analysis to set the prior for divergence time in all analyses as t = 3 ma.
we constrained the migration rate parameter m to be symmetric to reduce the number of parameters, as preliminary analyses estimating asymmetric migration rates were poorly resolved.
we also ran several preliminary runs with large, flat priors to estimate migration rate and population size  <cit> .
based on these preliminary analyses, we set the upper bound of a uniform prior that included the entire posterior distribution of each parameter .
preliminary analyses were unable to resolve q for the ancestral population ; accordingly, we followed peters et al.
<cit>  by setting the upper bound of θa to be greater than the sum of θ for the two sampled populations.
for all four comparisons, we ran three independent mcmc analyses to ensure convergence on similar parameter estimates.
we also evaluated stationarity of the mcmc analyses by checking whether ess was > <dig> for all parameters and examining plots generated by the program for log  for evidence of long term trends.
runs ran for  <dig> steps of burnin and at least  <dig> steps post-burnin, sampling every  <dig> steps to generate  <dig> genealogies.
for all runs, we employed a geometric heating scheme with  <dig> heated chains.
RESULTS
sequence characteristics
nd <dig> sequences were 1041 bp in length and included  <dig> informative sites .
a 90 bp indel in the ak <dig> intron and a 15 bp indel found in the bfib <dig> intron were removed before any analyses were conducted, leaving: 337 bp of ak <dig> , 629 bp of bfib <dig> , and 594 bp of musk .
there were no internal stop codons, indels, or anomalous substitution patterns in the nd <dig> sequences that might indicate amplification of pseudogenes.
however, we excluded one sample  because it did not align with other sequences and blast returned ambiguous matches with a variety of hummingbird species.
mitochondrial and nuclear intron sequence data have been deposited on genbank, accession numbers: ku527140-ku <dig>
geographic isolation
seven well-supported mitochondrial clades  were recovered in the bayesian phylogeny .
this structure only corresponds to the populations sampled in peru and more extensive phylogeographic structure exists within this species in the northern andes  <cit> .
the nominate subspecies consists of one clade  isolated by the north peru low and >2 % divergent from all other populations .
topographic barriers were associated with phylogenetic structure among all other clades, including: m. t. septentrionalis, on the west side of the central andes , which is  <dig>  % divergent from a northern clade of m. t. smaragdinicollis on the east side of the central andes ; clade d of southeastern peru, which is isolated from clade e , of the upper apurímac and urubamba valleys, by the cordillera de vilcanota; and finally, an ayacucho population  that is bounded by the mantaro river to the north  and the aprurímac river to the south .
some structure was also detected within clade c potentially due to the influence of the huallaga valley or isolation by distance.
fst values largely corresponded to corrected pairwise differences among clades .
a single individual from the same locality as clade d showed closer affinities to an extra-limital haplogroup from bolivia .
haplotype networks reaffirmed the prominent role of physical barriers in structuring neutral genetic diversity.
haplotype structure between the humid montane forest and semi-humid montane scrub habitats only existed in conjunction with physical barriers.
within clade d, birds from both humid and semi-humid habitats shared identical mtdna haplotypes .
finally, using an amova analysis we found that  <dig>  %  of the genetic variance within peruvian m. tyrianthina corresponds to the barriers highlighted in red  and only  <dig>  %  of the genetic variation is found within groups between topographic barriers .
nucleotide diversity was highest in clades a and c. only clade d exhibited significant deviations from neutrality based on both fu’s f and tajima’s d. clade b also exhibited significant fu’s f and clades a and c exhibited significant tajima’s d .
deviations from neutrality in these clades may reflect the recent expansion of the species into the central andes  <cit>  or subtle geographic structure among sampling localities within these clades.
ecological divergence
results of variation partitioning analyses corroborated a strong role for isolation by geographic distance, but not ecological isolation, in shaping patterns of genetic variation in peruvian metallura tyrianthina.
when da was used as a metric for genetic distance,  <dig> – <dig>  % of the variance was explained by geographic isolation alone compared to the  <dig> – <dig>  % attributable to certain climatic dissimilarities among localities.
in no instance did climatic variation explain patterns of genetic variation better than geographic distance .
moreover, the genetic variance explained by geographic distance alone was found to be significant when each of the different climatic models were accounted for using permutation tests.
the highest level of genetic variance explained by climate was when pc <dig> of temperature, precipitation, and seasonality were all included in a model .
this was also the only combination of climatic variables found to explain a significant proportion of the genetic variance using the permutation test; however, there was also a high degree of collinearity between geography and climate when all climate parameters were included in the model .
patterns for linearized fst values were consistent with those found for da, in that geographic isolation always explained a greater proportion of the variance  than climate .
however, less of the overall variance was explained by geographic isolation and, using the same permutation test, none of the variance explained by geographic distance was found to be significant when climate was accounted for .
a simple linear regression of bill length versus body mass indicated a weak, positive relationship ; however, body mass was also found to contribute very little to bill length variation in m. tyrianthina relative to climatic factors in an aicc analysis .
given the weak relationship between body mass and bill length we use length measurements uncorrected for variation in body mass for all subsequent analyses.
divergence in mean bill length was greater in comparisons between habitats than comparisons within habitats .
bill length divergence was comparable among humid and semi-humid population comparisons, respectively .
there were no relationships between genetic distance and bill length divergence, regardless of whether we compared all populations, populations within the same habitat, or populations between habitats .table  <dig> the two best models predicting bill length variation based on aicc analysis:  seasonality, precipitation and their interaction; and  seasonality alone
the  <dig> models we evaluated include all  <dig> possible combinations of body mass, pc <dig> of seasonality , pc <dig> of precipitation , pc <dig> of temperature  as well as all six pairwise interactions among the four predictor variables.
relative variable importance  was much greater for seasonality  than precipitation , temperature , or body mass
fig.
<dig> linear regression of bill length versus a pairwise genetic differences  and b linearized fst among all populations.
no significant relationships were found across all comparisons.
c boxplot of mean divergence in bill length between all humid sites, semi-humid sites, and among sites in different habitats.
mean divergence between habitats was significantly greater than that between habitats, whereas within habitat divergence did not differ
the model including an interaction between pc <dig> of seasonality and pc <dig> of precipitation, plus their main effects, was the single best model explaining bill length variation, containing  <dig>  % of the akaike weight.
the second best model consisted solely of the pc <dig> of seasonality .
although a number of models were competitively ranked with pc <dig> of seasonality  all of these models include pc <dig> of seasonality as a nested component and were thus considered uninformative .
we additionally quantified the relative importance of each predictor variable by adding together the model weights for each model in which the variable appeared  <cit> .
this analysis highlighted the overwhelming influence of seasonality  relative to precipitation , temperature , or body mass .
linear regression of bill length versus pc <dig> of seasonality was also highly significant .
seasonality remained a significant explanatory variable of bill length variation after accounting for spatial autocorrelation by incorporating data on latitude and longitude from each sampling site into a non-linear mixed effects model in the r package nlme .fig.
<dig> bill length as a function of pc <dig> of seasonality .
the linear regression model was highly significant  with an r <dig> of  <dig>
dual influence of topography on divergence
nd <dig>  ak <dig> and musk all exhibited significant divergence in fst across the cordillera de vilcanota between urubamba and carrizales, fst for bfib <dig> was non-significant .
significant fst structure along the manu road was only found for the ak <dig> intron, which also had a lower fst value  than across the cordillera de vilcanota .
significant genetic structure was also found between the two humid sites  across all loci and for nd <dig> and ak <dig> between the two drier sites .table  <dig> fst-values among pairwise comparisons of all four cusco localities
nd2
ak1
bfib7
musk
vilcanota and manu road columns each represent a comparison between a pair of humid and semi-humid environments.
humid comparisons are between carrizales and pillahuata populations, semi-humid comparisons are between urubamba and paucartambo populations
ns
p >  <dig> ; *p <  <dig> ; **p <  <dig> ; ***p <  <dig>
ima <dig> analyses of populations separated by the cordillera de vilcanota and between the two semi-humid sampling localities showed good evidence of convergence with ess values > <dig> and all three runs exhibiting similar values for all parameters.
by contrast, analyses of the populations along the manu road and comparisons between the two humid-site populations did not exhibit evidence for convergence  after sampling  <dig>  genealogies despite similar results being obtained across each of the three independent runs.
migration rates  based on all four loci across both humid to semi-humid comparisons were found to be greater than zero ; however, average migration rates along the manu road  were estimated to be over  <dig> times greater than the average migration rate across the cordillera de vilcanota .
within habitat migration rates were greater on average between the two humid sites  than between the two semi-humid sites .
estimated average divergence times were greater between the urubamba population and all others  than they were between the two manu road populations  or between the two humid-climate populations .
however, the 95 % hpds of all divergence time estimates overlapped and resolution of this parameter was generally poor, with a peak found in the distribution of t followed by either a long plateau or the values of t decreasing in probability but plateauing at a low non-zero value.
the poor resolution of dates was most likely due to insufficient data.
θ was generally low, varying from  <dig>  to  <dig>  in all well-resolved populations .
the posterior distribution of θa was always poorly resolved as was θ for the population sampled at pillahuata with estimates exhibiting long non-zero tails within the specified prior distribution.
again, we think that this is due to insufficient data to resolve these estimates rather than an inappropriate designation of the upper bound of the prior given that all other population sizes were much smaller than the upper bound .fig.
<dig>
a topographic profiles of the two cordilleras separating sampling sites in the vilcanota region and along the manu road .
arrows with red lettering indicate mean migration rates  estimated from ima <dig> analyses .
b bill length differences among the four cusco localities.
blue represents the two humid sites and brown the two drier sites.
asterisks indicate p-values for the comparisons of bill length between two pairs of adjacent populations in humid and semi-humid environments
t
m
95 % hpd range for each parameter presented in parentheses.
mean parameter estimates represent the average across the three independent runs performed for all four comparisons.
θ <dig> refers to estimates of θ for the semi-humid comparison for vilcanota and manu road and θ <dig> for the humid site.
for between humid sites and semi-humid site comparisons θ <dig> refers to sites from the manu road and θ <dig> the vilcanota
cusco populations on the drier, west-facing slopes had longer bills than those on the humid, east-facing slopes .
bill length in urubamba was significantly longer than all three of the other populations .
although bill length in paucartambo was slightly longer  than birds from the adjacent humid slopes at pillahuata, this result was not significant when corrected for multiple comparisons .
there were no differences in bill length between the two humid sites .
discussion
geographic isolation promotes genetic divergence
phylogenetic, network, and amova analyses all point to an important role for topographic barriers in structuring genetic diversity in metallura tyrianthina, a result consistent with studies of the genus metallura as a whole  <cit>  and many other andean taxa .
we found the north peru low, apurímac valley and high andean ridges to be associated with genetic structure in m. tyrianthina as in many other taxa  <cit> .
we also found the cordillera de vilcanota to be an important landscape feature structuring genetic and phenotypic diversity; the same cordillera was linked to an older phenotypic and genetic divergence in the hummingbird adelomyia melanogenys  <cit> .
topographic barriers were implicated in generating neutral genetic divergence, but not divergence in bill length .
this suggests that hummingbird bill morphology does not evolve steadily over time, but diverges only in response to differential ecological pressures.
although we found discordant patterns of genetic and morphological divergence in m. tyrianthina, patterns of plumage variation in the species appear to vary in association with topographic barriers and the degree of genetic divergence.
a high andean ridge separates the similar looking subspecies m. t. smaragdinicollis and m. t. septentrionalis, and the marañón valley corresponds to turnover between the red-tailed subspecies, m. t. tyrianthina, and the two purple-tailed subspecies occupying the rest of peru  <cit> .
plumage variation among these subspecies cannot be explained by the climatic characteristics of the regions in which they are distributed.
instead, plumage divergence generally corresponds with time since divergence.
the two similar purple-tailed subspecies, which occupy different environments, were found to be only  <dig>  % divergent at the nd <dig> locus; whereas divergence between red and purple-tailed subspecies distributed in similar environments across the marañón valley was ~ <dig>  %.
concordance between tail color and genetic divergence in m. tyrianthina is consistent with the positive correlation between the extent of plumage and mtdna divergence across the marañón valley, based on multiple passerine genera  <cit> .
plumage divergence rate appears to be linked to neutral genetic divergence and decoupled from functional trait divergence .
bill length varies in association with climate
populations of metallura tyrianthina occupying habitats characterized by semi-humid montane scrub were found to have significantly longer bills than birds in humid forest habitats .
this marked morphological divergence was not associated with neutral genetic divergence; rather, we found a strong relationship between climatic and bill length variation, with a model of seasonality, precipitation and their interaction being the strongest predictor of bill variation  and seasonality being the most important single predictor .
our estimate of the strength of this relationship  is likely conservative considering that the climate data is coarsely interpolated from unevenly distributed weather stations in the peruvian andes.
in the andes, consistent patterns of morphological divergence occurring in association with ecological dissimilarities have been found in adelomyia hummingbirds  <cit>  and glyphorhynchus woodcreepers  <cit> .
a similar relationship between bill length and climate was found in the hummingbird adelomyia melanogenys, where 57 % of the variance in bill length was explained by precipitation seasonality, minimum temperature of the coldest month, and mean elevation  <cit> .
these results suggest that climatic variables or other ecological factors correlated with climate  may play important roles in shaping the impressive diversity of hummingbird bill morphology in the andes.
concordance between ecological variation and morphological variation is well documented in organisms  <cit>  especially birds where bill morphology responds readily to climatic and dietary change .
patterns of bill morphology in m. tyrianthina contribute to mounting evidence that the ecological differences generated by the topographically complex andean landscape play an important role in promoting local adaptation and functional diversity in andean taxa  <cit> .
the variation partitioning approach we used to test for ibe revealed that geographic distance, not climatic variation, explained the greatest proportion of genetic variance.
these results provide additional evidence for an exclusive role of geographic isolation in promoting genetic divergence at the neutral loci studied.
our results resemble a similar study in trinidadian guppies where no influence of ecological dissimilarity on genetic variation was detected  <cit> .
however, both a study of caribbean anolis species  <cit>  and a meta-analysis  <cit>  found consistent roles for ecologically mediated genetic divergence when comparing the influence of geographic and ecological distance on patterns of genetic variation.
in the andes, similar analyses assaying genetic variation among populations of the woodcreeper glyphorynchus spirurus in ecuador found that the andean ridge separating eastern and western populations played the largest role in structuring genetic divergence.
whereas genetic variance within eastern or western populations was explained largely by ecological variation  <cit> .
although we do not find evidence for isolation by environment in m. tyrianthina, negative results for this test can be difficult to interpret due to factors such as insufficient time for divergence to occur at neutral loci or inappropriate ecological variables selected  <cit> .
other distance estimates, such as resistance-based distances  <cit> , consistently explain a greater proportion of the variance in genetic diversity than euclidean geographic distance  <cit> .
thus, our use of euclidean distances likely resulted in a conservative estimate of the effect of geographic features on genetic divergence.
in general, the results of our variation partitioning and phylogeographic analyses implicate geographic isolation as the major driver of neutral genetic divergence in this species, with little or no additional divergence attributable to ecological differences.
barriers facilitate functional divergence
in a wide array of taxa, mismatches between morphology and neutral genetic diversity have been interpreted as evidence for phenotypic divergence with gene flow .
these studies have generally compared morphology of adjacent populations in different environments versus isolated populations in similar environments; however, they do not assess the extent to which gene flow might prevent populations from achieving local adaptive optima.
we compared patterns of gene flow and morphological divergence between pairs of populations in humid and semi-humid environments that were either isolated by a topographic barrier  or not .
this allowed us to assess how interactions between barriers and climate might facilitate functional diversification.
at all four loci, we found greater fst-values across the cordillera de vilcanota than the manu road, with only a single locus exhibiting an fst significantly different from zero along the manu road .
coalescent-based analyses in ima <dig> confirmed that migration rates across the manu road were significantly greater than across the cordillera de vilcanota .
furthermore, migration rates along the manu road were found to be equal to or greater than rates between the two humid sites or between the two semi-humid sites.
although mcmc searches in some ima <dig> analyses exhibited uncertain convergence, three independent runs always indicated higher migration rates along the manu road than across the vilcanota, and fst values corroborated patterns suggested by ima <dig> analysis.
we found an inverse relationship between bill length divergence and gene flow, with greater divergence in bill length found across the cordillera de vilcanota than the manu road .
a similar relationship between gene flow and adaptive divergence has been found in numerous non-andean taxa .
although this pattern has frequently been interpreted as the result of gene flow constraining adaptive divergence, adaptive divergence could also restrict gene flow to the extent that it reinforces reproductive isolation.
teasing apart these mechanisms is a widely recognized challenge  <cit> .
in the present case, the fact that landscape features appear to explain levels of gene flow  suggests that adaptive divergence is constrained by gene flow, rather than the reverse.
an alternative explanation for differences in bill length between urubamba and paucartambo is that they reflect differences in the amount of time spent in semi-humid environments.
in support of this possibility, migration-rate estimates from ima <dig> can be spuriously high, according to two recent simulation studies  <cit> .
both studies found that in cases of recent divergence , datasets with few loci exhibited high false-positive rates for non-zero migration.
given that we only sequenced four unlinked loci, it is possible that this bias could have conflated the migration rates that we found along the manu road.
however, we think it is likely that low fst between populations distributed along the manu road was due, at least in part, to ongoing gene flow.
these populations are only 5 km apart and the intervening area contains a gradual habitat transition from semi-humid scrub to humid forest.
secondly, the uplift of the cordillera dividing the two sampled populations along the manu road occurred >4 ma before m. tyrianthina colonized the central andes from the north  <cit> .
although we consider high gene flow to be the most likely interpretation of low genetic divergence across the manu road, our relative estimates of gene flow and divergence time should be interpreted with caution.
the most conservative interpretation of our results is that bill length similarity is associated with genetic similarity at the population level, regardless of whether that similarity is due to recent divergence or ongoing connectivity.
although subtle morphological divergence in the face of gene flow has been demonstrated in other andean birds , phylogenetic analyses have failed to find a pattern of sister species replacement along ecological gradients  <cit> .
our results potentially reconcile these contradictory patterns as we find that adaptive divergence with gene flow is possible, but severely constrained.
in andean birds, it appears that allopatry is a pre-requisite or co-requisite for functional diversification and likely the completion of speciation.
selection for longer bills
repeated evolution of longer bills in drier, more seasonal habitats suggests adaptation by natural selection, although the mechanism by which increased bill length may increase fitness in these environments has yet to be tested.
given that climatic variation likely covaries with a number of other potential ecological pressures, pinpointing the mechanistic basis of inter-population variation in bill length would require rigorous field observations and experimentation.
climate could play a direct role in driving bill length differences; however, bill length variation in m. tyrianthina and other metallura species  <cit>  directly contradicts allen’s rule  <cit> .
additionally, even though increased bill size can be a key mechanism for shedding excess heat while conserving water in drier environments  <cit>  hummingbirds acquire large volumes of water from their nectarivorous diets and as a consequence do not suffer from water limitations to the same degree as other birds  <cit> .
instead, biotic interactions represent more likely drivers of geographic variation in bill length in metallura tyrianthina.
first, longer bills in drier, less diverse environments could be caused by competitive release, analogous to bird populations on depauperate islands which tend to exhibit divergent bill morphologies as part of a more generalist phenotype .
m. tyrianthina has a shorter bill than most other hummingbird species in the humid forests of east-facing andean slopes.
longer bills might allow m. tyrianthina to exploit a greater variety of flowers on rain-shadowed slopes that harbor fewer competing nectarivore species.
second, diversifying selection on bill length could be exerted by flower species that have different corolla shapes, a co-evolutionary process that has been well-documented in other hummingbird species ; this is plausible for m. tyrianthina because striking floral species turnover coincides with the climatic gradients along which it occurs.
CONCLUSIONS
andean ridges and valleys hinder connectivity among populations and also create local climatic variation that imposes differential selection pressures  <cit> .
we investigated this dual role of topography for its effects on diversity in a widespread hummingbird species, metallura tyrianthina.
across the peruvian distribution of this species, we found that topographic barriers play the dominant role in structuring effectively neutral genetic diversity, whereas climatic variation shapes patterns of bill morphology.
moreover, analyses across four sites in the department of cusco indicated that topography promotes genetic structure even across small spatial scales  and bills are longer on rain-shadowed, west-facing slopes.
this fine-scale analysis also revealed how gene flow constrains functional divergence, suggesting that topography and climatic variation interact to promote andean diversification.
if functional divergence driven by climatic variation permits coexistence upon secondary contact  <cit> , it could potentially contribute to the evolution of reproductive isolation at later stages of divergence  <cit> .
these processes could increase the overall tempo of diversification  <cit> .
based on our results from metallura, the east-to-west precipitation gradient may have played an important role in the diversification of several avian genera that contain narrowly distributed and geographically variable taxa in the central andes .
indeed, analyses comparing speciation rates among andean and adjacent lowland lineages have found overall higher speciation rates in the andes, a pattern driven in part by genera such as cranioleuca  <cit>  and spinus  <cit> .
topographic barriers and ecological variation have clearly interacted to produce high species diversification rates in andean birds.
the current results suggest that rates of functional diversification should also be accelerated when physical landscape features coincide with ecoclimatic variation.
availability of supporting data
the bill length dataset supporting the results of this article are included within the article ).
mitochondrial and nuclear intron sequence data have been deposited on genbank, accession numbers: ku527140-ku <dig>
additional file
additional file 1: table s <dig>  museum specimens and tissues used in study, sampling localities, bill length measurements, and body mass.
table s <dig>  loadings from principal component analysis of temperature, precipitation, and seasonality bioclim variables.
table s <dig>  loadings from principal components analysis of all  <dig> bioclim variables.
table s <dig>  parameter settings for each of the four ima <dig> analyses.
table s <dig>  corrected pairwise differences and fst values among all populations.
table s <dig>  results of amova analysis.
table s <dig>  standard indices of molecular diversity for each clade based on nd <dig>
competing interests
the authors declare that they have no competing interests.
authors’ contributions
pmb and ccw designed the research and wrote the paper.
p.m.b.
collected and analyzed the data.
both authors have read and approved the final version of the manuscript.

 the tropical andes harbor a significant fraction of global diversity, with half this diversity comprised of regional endemics. in contrast to other diverse montane regions, a major fraction of andean diversity is derived from lineages that have radiated extensively in situ. thus, identifying the historical and landscape characteristics that foster speciation in the andes will be crucial for understanding the mechanisms that have made the region a diversification hotspot. the topographically complex andean landscape seems to drive diversification in two ways. first, topographic barriers can fragment the narrow distributions of montane taxa and promote divergence via allopatric speciation. second, topography creates climate variation over small spatial scales that can drive ecological divergence, leading to reproductive isolation and/or accelerated niche divergence. although some evidence for both mechanisms operating in the andes exists, the relative importance of each mechanism working independently or in concert during the diversification process remains poorly understood. topographic barriers are frequently associated with phenotypic and genetic discontinuities in andean species, providing evidence for the importance of physical isolation in andean diversification. however, if physical isolation across topographic barriers were the sole driver of andean speciation, species-level differences would be expected to accumulate via neutral processes. substantial empirical evidence supports non-neutral mechanisms of speciation, although the overall tempo of diversification in the tree of life has recently been interpreted as evidence of neutral diversification. discordant patterns of phenotypic and genetic diversity are frequently found in andean lineages, in contrast to neutral expectations. moreover, coalescent simulations of plumage evolution in arremon brushfinches indicate that plumage differentiation proceeds at a much faster rate than expected via neutral divergence. in sum, it seems that range fragmentation alone is an insufficient mechanism for explaining the generation of andean diversity. ecological speciation occurs when ecological factors, regardless of gene flow, catalyze reproductive isolation by natural selection. in the andes, higher diversification rates are associated with climatic-niche shifts indicating that ecoclimatic variation may be an important driver of lineage proliferation. several studies of andean taxa have found morphometric and functional divergence arising among populations distributed along ecological gradients in the face of ongoing gene flow. although these results suggest that ecological mechanisms might be the primary drivers of divergence in the region, abundant evidence from outside the andes indicates that rates of phenotypic divergence and evolution of reproductive isolation will be slower in populations experiencing gene flow relative to those that are more isolated. indeed, studies examining whether sister species replace one another along ecological gradients in the andes have been inconclusive, with some sister species found to replace one another along ecological gradients in andean butterflies and frogs, but not in andean birds or mammals. given the lack of clear support for an exclusive role of geographic isolation or ecological speciation in driving andean diversification, a better understanding of the speciation process in the andes will likely come from addressing how geographic and ecological isolation operate in concert. the topographic complexity of the region should allow for interactions between these two processes. topographic barriers promote the reduction of gene flow, while the increased climatic variation associated with topography potentially increases the tempo of divergence via differential selection pressures. one approach to test whether divergence is associated with topographic relief will be to assay divergence among population pairs that occupy similar climates on either side of a topographic barrier, occupy different climates on either side of a topographic barrier, and occupy different climates in the absence of a topographic barrier. in particular, comparing patterns of spatial variation in effectively neutral genetic markers and functional traits will provide a means to understand the relative influence of geographic and ecological isolation in promoting genetic structure and divergence in ecologically relevant traits. we focus on peruvian populations of the andean hummingbird metallura tyrianthina to understand the drivers of spatial diversity in functional morphology and genetics. the geological history of the peruvian andes generated a topographically complex landscape, with glaciated cordilleras >5000 m in elevation interspersed with deep river valleys. these landscape features generated habitat discontinuities in the elevational distribution of m. tyrianthina. final uplift of the central andes over the last ~ myr also dramatically altered the climate, generating a steep rainfall gradient from the wet eastern slope to the desert-like western slope. m. tyrianthina likely colonized peru from northern populations ~2 ma and presently spans several topographic barriers and steep climatic gradients in the peruvian andes. three subspecies of metallura tyrianthina occur in peru: m. t. tyrianthina north and west of the marañón valley in humid montane forests and edge habitat; m. t. septentrionalis in semi-humid montane scrub along the western cordillera of peru south to the department of lima; and m. t. smaragdinicollis throughout the eastern andes of peru in humid forests along east-facing slopes and in semi-humid scrub on west-facing and rain-shadowed slopes.fig. a map illustrating the distribution of all three metallura tyrianthina subspecies that occur in peru. circles denote sampling sites for both genetic and bill length data; squares represent sampling sites for bill length data only. blue points are sites where the habitat was characterized as humid montane forest and brown points semi-humid montane scrub. b map of sampling sites from the department of cusco, peru. one pair of sites was from the humid and drier sides of the cordillera de vilcanota, separated by ~20 km. a second pair of sites was along the manu road, with a humid and drier site ~5 km apart. c topographic profile of the cordillera de vilcanota, which exceeds 5000 m, and the manu road where a cordillera less than 4000 m in elevation separates the two sites along the manu road we compared spatial patterns of variation in bill length and effectively neutral dna sequences in m. tyrianthina to test predictions derived from models of geographic speciation, ecological speciation, or a combination. if geographic isolation drives divergence then we will expect to find a concordant relationship between phenotypic and genetic divergence across topographic barriers. however, if divergence is primarily driven by ecological factors then we expect to find linked phenotypic and genetic divergence in association with ecological dissimilarities, independent of geographic isolation. finally, if topographic barriers and ecological differences interact to drive divergence then we expect to find phenotypic divergence between different environments, but only when a topographic barrier that reduces gene flow separates those environments. methods sampling tissue samples of metallura tyrianthina were obtained from frozen tissue collections at natural history museums, primarily the museum of southwestern biology. collection of these samples was approved by the university of new mexico institutional animal care and use committee and permitted by peruvian management authorities. the geographic breadth of sampling was increased through tissue loans of an additional individuals from other natural history collections. from all individuals, we extracted genomic dna from pectoral muscle that was either frozen or preserved in rnalater® using a qiagen dneasy blood and tissue kit and following the manufacturer’s protocols. the mitochondrial gene nadh dehydrogenase, subunit was sequenced for all individuals. for all of the individuals sampled in the department of cusco we sequenced an additional two nuclear introns: adenylate kinase, intron and β-fibrinogen, intron; and the z-linked locus muscle, skeletal, tyrosine receptor kinase. primers and sequencing protocols were identical to those used in benham et al.. all sequences were manually assembled and edited using sequencer v.. and aligned using muscle v.. haplotype reconstruction for nuclear loci with multiple double peaks was conducted using the program phase v... the size and shape of hummingbird bills vary in association with floral resources and competitive interactions with other hummingbirds. the hummingbird bill is an ideal trait in which to examine functional diversification across the andean landscape due to its functional importance and the fact that bill characteristics tend to be highly heritable. we measured bill length to the nearest  mm using digital calipers on museum specimens collected from throughout peru. all specimens included in this study were associated with precise locality and mass data and all measurements were made on dried specimens to avoid increased error from specimen shrinkage. sexual dimorphism in bill length and shape is widely encountered within trochilidae; however, using a two-tailed t-test for the entire dataset, we did not detect any significant differences between the sexes in bill length; accordingly, males and females were pooled for subsequent analyses. all statistical analyses were conducted using the open source program r. to assess environmental differences among all specimen localities we obtained bioclimatic data at 30-s resolution from the worldclim dataset. using coordinates for each sampling locality we extracted data from gridfiles of the bioclim variables within the program diva-gis. the climatic data includes variables related to measures of temperature, precipitation and seasonality. these data are derived from interpolated climate surfaces available for the entire globe at 30-arc sec spatial resolution and were gathered from several independent sources between and. although the worldclim dataset may be error-prone in montane regions due to interpolation, such error is likely to be random with respect to our hypotheses. the worldclim dataset has been used successfully in a number of modeling and morphological studies of andean birds. worldclim data has also been used successfully at fine spatial scales to guide surveys for range-restricted andean hummingbird species. we divided the bioclim variables into three groups each corresponding to variables related to temperature, precipitation, and seasonality. secondly, we performed a principal components analysis on each of the three groups and used the first components of temperature, precipitation, and seasonality, respectively, for analyses. influence of topographic barriers on divergence to assess the association of genetic structure with topographic barriers we constructed a phylogeny of all metallura tyrianthina nd samples using bayesian methods in mrbayes v. on the cipres science gateway. for an outgroup we obtained nd data of metallura phoebe from genbank. a gtr + i + Γ model was selected as the most appropriate substitution model based on akaike information criteria estimated in jmodeltest v.. we also partitioned the dataset by codon position following mcguire et al.. the mcmc analysis ran for million generations sampling every generations and consisted of four simultaneous runs of four chains each with a temperature for heated chains of. we assessed convergence using the program awty and discarded the first 10 % of trees as burnin. to further evaluate patterns of genetic structure we calculated the number of haplotypes for nd in dnasp and visualized these as a haplotype network using a median-joining method in network v... we evaluated the proportion of genetic diversity explained by topographic barriers as identified with phylogenetic and network analyses in peruvian metallura tyrianthina using an amova analysis. for this analysis we divided the sampled individuals into six groups each divided by a topographic barrier. these barriers include: the north peru low, high andean ridgeline, the mantaro valley, the apurímac valley, and the cordillera de vilcanota. these barriers also correspond to phenotypic and genetic discontinuities in other andean bird species. degree of divergence among clades was assessed with fst values and nei’s average corrected pairwise differences, which accounts for intra-population polymorphism with the equation da = dxy -, where x and y are the two populations compared and d is the average uncorrected genetic differences. for each of the clades identified using the above analyses we also calculated standard indices of molecular diversity, including nucleotide and haplotype diversity. finally, we calculated tajima’s d and fu’s f to determine whether any of the nd clades exhibit deviations from neutrality. all population genetic analyses were performed in the program arlequin v..fig. a nd bayesian phylogeny for peruvian populations of metallura tyrianthina. posterior probabilities for each node printed above branches. the six geographically structured clades are lettered on all figures. each clade is colored by subspecies as in panel c. b median-joining haplotype network of nd brown color indicates semi-humid montane scrub habitat; blue indicates humid montane forest. c geographic distribution of each clade. red dotted lines signify putative physical barriers that isolate the six clades concordance between genetic and morphological divergence to test for concordance between patterns of genetic divergence and bill length variation we compared bill length differences to two measures of genetic divergence, da and linearized fst, across sixteen sampling localities. these measures of genetic distance were compared to the average difference in bill length between each pair of sampling localities. we used a series of linear regression analyses to compare genetic and bill length differences among all pairwise comparisons of populations, among populations in humid montane forest habitats, in semi-humid montane scrub habitats, and among populations distributed in different habitat types. climatic drivers of divergence populations distributed across different climatic regimes could experience adaptive divergence that will have a negative influence on gene flow leading to reproductive isolation and genetic divergence even at neutral loci, a process referred to as isolation by environment. we test for ibe in metallura tyrianthina by comparing the relative roles of climatic distance and geographic distance in shaping patterns of genetic variation using a variation partitioning method in the r-package ‘vegan’. variation partitioning utilizes canonical redundancy analysis to dissect the contributions of different explanatory factors to variation in a response variable. variation partitioning has been shown to perform similarly to other recently developed tests for teasing apart spatially autocorrelated drivers of genetic diversity and performs better than partial mantel tests, which can exhibit a high type i error rate when considering spatially autocorrelated data. for m. tyrianthina we assessed the influence of environmental variation on genetic distance as measured by da and linearized fst. we used euclidean geographic distances among sampling localities to assess the role of geographic isolation. to assess the role of climate, we performed principal components analysis on all bioclim variables from the sampling sites for which we had both genetic and bill length data to reduce these variables to two principal components. the first principle component explained  % of bioclim variation, with the heaviest loading linked to annual precipitation. the second principle component explained  % of bioclim variation, with the heaviest loading associated with precipitation in the wettest quarter. as alternative climatic variables, we used the first principle components of the bioclim variables for temperature, seasonality, and precipitation, respectively. using either da or linearized fst we performed a series of variation partitioning analyses using all potential combinations of climatic principal components plus geographic distance as the explanatory variables. we then tested whether the fraction of variation explained by each climatic variable was significant when conditioned for geography, and vice versa, using a permutation analysis with the ‘anova’ function in the vegan package.table proportion of genetic variance explained by geographic or climatic variation geographic distance is the euclidean distance among sampling sites and climate is the proportion of variance explained by the different climatic variables included in each model. clim and clim are the first two principal components of the entire variable bioclim dataset, explaining 97 % of the variance in total. temp, seas, and prec are the first principal components for temperature, seasonality, and precipitation bioclim variables, respectively. the proportion of variance shared by both geography and climate is reported in the columns labeled ‘shared’. high ‘shared’ values would indicate collinearity between ecological and geographic parameters; negative values are an artifact of subtracting adjusted r values to derive the shared proportion of variance *p < ; **p < ; ***p <  we tested the influence of different climatic variables on bill length variation throughout peru using an information-theoretic approach. we performed regression analyses with bill length as the dependent variable and pc of temperature, precipitation, and seasonality, respectively, as explanatory variables. we also explored the possibility of using pc and pc of all bioclim variables as predictors; however, pc and pc were found to be strongly correlated with seasonality and temperature, respectively. consequently, we excluded pc and pc predictors to avoid issues associated with multi-collinearity in downstream analyses. finally, we also include body mass in this analysis as another potential predictor of bill length variation. we evaluated models representing all possible main effect combinations of predictor variables and included an additional six models to evaluate all possible pairwise interactions between the four variables. the likelihood of all models was evaluated using an akaike information criterion corrected for sample size. each model was ranked using Δaicc and akaike weights to determine which of our hypothesized climatic models best explains bill length variation in peru. we discarded models from consideration if a nested model had a better aicc score. dual influence of topography on divergence we assess the combined influence of topographic barriers and climatic differences in shaping patterns of genetic and morphological divergence across two pairs of populations in which the members of each pair are adjacent but occur in different environments. the first pair of populations were 20 km apart on either side of the cordillera de vilcanota with one population sampled in the semi-humid scrub of the urubamba valley and the second within humid montane forest near the town of carrizales. a second pair of populations was distributed along the manu road only 5 km apart with birds sampled in the semi-humid scrub near the town of paucartambo and in humid montane forest near pillahuata. the cordillera de vilcanota is glaciated and exceeds 5000 m elevation, with passes as low as 4300 m; whereas the pass separating humid and semi-humid populations along the manu road is only 3900 m. given that the typical elevational distribution of m. tyrianthina is 1900–4200 m the cordillera de vilcanota likely imposes a more significant barrier to gene flow then any ridge along the manu road. we used a one-way anova and tukeyhsd test to examine differences in bill length among the four sites. to determine how our small sample sizes for the carrizales and paucartambo populations would impact our statistical power, we performed a power analysis in the r package pwr. for this analysis we first performed two t-tests comparing bill length differences across the cordillera de vilcanota and the manu road. the results of these t-tests were used to estimate the effect size of bill length divergence between both humid and semi-humid population pairs. given the calculated effect of habitat on bill length divergence across both population pairs we confirmed that the statistical power using our small sample sizes exceeded the a priori defined threshold of. to assess patterns of genetic divergence among sampling localities we calculated all pairwise fst-values across the four sampled populations for each of the four loci in arlequin v.. secondly, we determined levels of gene flow among the four populations using the program ima. ima is a coalescent genealogy sampler that simultaneously estimates effective population size, migration rates, and divergence times within the framework of an isolation with migration model. the ima program assumes no recombination and before analyses we assessed patterns of recombination in the nuclear loci using the four-gamete test in dnasp. this test detected recombination in regions of both ak and bfib we saved the longest segment of each gene exhibiting no evidence of recombination, leaving segments of 232 bp for ak and 313 bp for bfib we conducted pairwise comparisons between humid and semi-humid populations distributed along the manu road and across the cordillera de vilcanota. additionally, we ran analyses comparing the two humid populations and the two semi-humid populations. for each locus we specified a mutation rate with error ) derived from a multi-locus dataset analyzed in *beast using both geological and fossil calibrations for hummingbirds. these mutation rates were: nd2: × 10− μ/l/y; ak1: × 10− μ/l/y; bfib7: ×10− μ/l/y; and musk: × 10− μ/l/y. we applied inheritance scalars to each locus to account for variation in effective population sizes. benham et al. hypothesized that metallura tyrianthina colonized southern peru ~2 ma based on a time-calibrated phylogeny. we use the upper bound of the 95 % hpd from this previous analysis to set the prior for divergence time in all analyses as t = 3 ma. we constrained the migration rate parameter m to be symmetric to reduce the number of parameters, as preliminary analyses estimating asymmetric migration rates were poorly resolved. we also ran several preliminary runs with large, flat priors to estimate migration rate and population size. based on these preliminary analyses, we set the upper bound of a uniform prior that included the entire posterior distribution of each parameter. preliminary analyses were unable to resolve q for the ancestral population; accordingly, we followed peters et al. by setting the upper bound of θa to be greater than the sum of θ for the two sampled populations. for all four comparisons, we ran three independent mcmc analyses to ensure convergence on similar parameter estimates. we also evaluated stationarity of the mcmc analyses by checking whether ess was > for all parameters and examining plots generated by the program for log for evidence of long term trends. runs ran for steps of burnin and at least steps post-burnin, sampling every steps to generate genealogies. for all runs, we employed a geometric heating scheme with heated chains.  sequence characteristics nd sequences were 1041 bp in length and included informative sites. a 90 bp indel in the ak intron and a 15 bp indel found in the bfib intron were removed before any analyses were conducted, leaving: 337 bp of ak, 629 bp of bfib, and 594 bp of musk. there were no internal stop codons, indels, or anomalous substitution patterns in the nd sequences that might indicate amplification of pseudogenes. however, we excluded one sample because it did not align with other sequences and blast returned ambiguous matches with a variety of hummingbird species. mitochondrial and nuclear intron sequence data have been deposited on genbank, accession numbers: ku527140-ku geographic isolation seven well-supported mitochondrial clades were recovered in the bayesian phylogeny. this structure only corresponds to the populations sampled in peru and more extensive phylogeographic structure exists within this species in the northern andes. the nominate subspecies consists of one clade isolated by the north peru low and >2 % divergent from all other populations. topographic barriers were associated with phylogenetic structure among all other clades, including: m. t. septentrionalis, on the west side of the central andes, which is  % divergent from a northern clade of m. t. smaragdinicollis on the east side of the central andes; clade d of southeastern peru, which is isolated from clade e, of the upper apurímac and urubamba valleys, by the cordillera de vilcanota; and finally, an ayacucho population that is bounded by the mantaro river to the north and the aprurímac river to the south. some structure was also detected within clade c potentially due to the influence of the huallaga valley or isolation by distance. fst values largely corresponded to corrected pairwise differences among clades. a single individual from the same locality as clade d showed closer affinities to an extra-limital haplogroup from bolivia. haplotype networks reaffirmed the prominent role of physical barriers in structuring neutral genetic diversity. haplotype structure between the humid montane forest and semi-humid montane scrub habitats only existed in conjunction with physical barriers. within clade d, birds from both humid and semi-humid habitats shared identical mtdna haplotypes. finally, using an amova analysis we found that  % of the genetic variance within peruvian m. tyrianthina corresponds to the barriers highlighted in red and only  % of the genetic variation is found within groups between topographic barriers. nucleotide diversity was highest in clades a and c. only clade d exhibited significant deviations from neutrality based on both fu’s f and tajima’s d. clade b also exhibited significant fu’s f and clades a and c exhibited significant tajima’s d. deviations from neutrality in these clades may reflect the recent expansion of the species into the central andes or subtle geographic structure among sampling localities within these clades. ecological divergence results of variation partitioning analyses corroborated a strong role for isolation by geographic distance, but not ecological isolation, in shaping patterns of genetic variation in peruvian metallura tyrianthina. when da was used as a metric for genetic distance, –  % of the variance was explained by geographic isolation alone compared to the –  % attributable to certain climatic dissimilarities among localities. in no instance did climatic variation explain patterns of genetic variation better than geographic distance. moreover, the genetic variance explained by geographic distance alone was found to be significant when each of the different climatic models were accounted for using permutation tests. the highest level of genetic variance explained by climate was when pc of temperature, precipitation, and seasonality were all included in a model. this was also the only combination of climatic variables found to explain a significant proportion of the genetic variance using the permutation test; however, there was also a high degree of collinearity between geography and climate when all climate parameters were included in the model. patterns for linearized fst values were consistent with those found for da, in that geographic isolation always explained a greater proportion of the variance than climate. however, less of the overall variance was explained by geographic isolation and, using the same permutation test, none of the variance explained by geographic distance was found to be significant when climate was accounted for. a simple linear regression of bill length versus body mass indicated a weak, positive relationship; however, body mass was also found to contribute very little to bill length variation in m. tyrianthina relative to climatic factors in an aicc analysis. given the weak relationship between body mass and bill length we use length measurements uncorrected for variation in body mass for all subsequent analyses. divergence in mean bill length was greater in comparisons between habitats than comparisons within habitats. bill length divergence was comparable among humid and semi-humid population comparisons, respectively. there were no relationships between genetic distance and bill length divergence, regardless of whether we compared all populations, populations within the same habitat, or populations between habitats.table the two best models predicting bill length variation based on aicc analysis: seasonality, precipitation and their interaction; and seasonality alone the models we evaluated include all possible combinations of body mass, pc of seasonality, pc of precipitation, pc of temperature as well as all six pairwise interactions among the four predictor variables. relative variable importance was much greater for seasonality than precipitation, temperature, or body mass fig. linear regression of bill length versus a pairwise genetic differences and b linearized fst among all populations. no significant relationships were found across all comparisons. c boxplot of mean divergence in bill length between all humid sites, semi-humid sites, and among sites in different habitats. mean divergence between habitats was significantly greater than that between habitats, whereas within habitat divergence did not differ the model including an interaction between pc of seasonality and pc of precipitation, plus their main effects, was the single best model explaining bill length variation, containing  % of the akaike weight. the second best model consisted solely of the pc of seasonality. although a number of models were competitively ranked with pc of seasonality all of these models include pc of seasonality as a nested component and were thus considered uninformative. we additionally quantified the relative importance of each predictor variable by adding together the model weights for each model in which the variable appeared. this analysis highlighted the overwhelming influence of seasonality relative to precipitation, temperature, or body mass. linear regression of bill length versus pc of seasonality was also highly significant. seasonality remained a significant explanatory variable of bill length variation after accounting for spatial autocorrelation by incorporating data on latitude and longitude from each sampling site into a non-linear mixed effects model in the r package nlme.fig. bill length as a function of pc of seasonality. the linear regression model was highly significant with an r of dual influence of topography on divergence nd ak and musk all exhibited significant divergence in fst across the cordillera de vilcanota between urubamba and carrizales, fst for bfib was non-significant. significant fst structure along the manu road was only found for the ak intron, which also had a lower fst value than across the cordillera de vilcanota. significant genetic structure was also found between the two humid sites across all loci and for nd and ak between the two drier sites.table fst-values among pairwise comparisons of all four cusco localities nd2 ak1 bfib7 musk vilcanota and manu road columns each represent a comparison between a pair of humid and semi-humid environments. humid comparisons are between carrizales and pillahuata populations, semi-humid comparisons are between urubamba and paucartambo populations ns p > ; *p < ; **p < ; ***p <  ima analyses of populations separated by the cordillera de vilcanota and between the two semi-humid sampling localities showed good evidence of convergence with ess values > and all three runs exhibiting similar values for all parameters. by contrast, analyses of the populations along the manu road and comparisons between the two humid-site populations did not exhibit evidence for convergence after sampling genealogies despite similar results being obtained across each of the three independent runs. migration rates based on all four loci across both humid to semi-humid comparisons were found to be greater than zero; however, average migration rates along the manu road were estimated to be over times greater than the average migration rate across the cordillera de vilcanota. within habitat migration rates were greater on average between the two humid sites than between the two semi-humid sites. estimated average divergence times were greater between the urubamba population and all others than they were between the two manu road populations or between the two humid-climate populations. however, the 95 % hpds of all divergence time estimates overlapped and resolution of this parameter was generally poor, with a peak found in the distribution of t followed by either a long plateau or the values of t decreasing in probability but plateauing at a low non-zero value. the poor resolution of dates was most likely due to insufficient data. θ was generally low, varying from to in all well-resolved populations. the posterior distribution of θa was always poorly resolved as was θ for the population sampled at pillahuata with estimates exhibiting long non-zero tails within the specified prior distribution. again, we think that this is due to insufficient data to resolve these estimates rather than an inappropriate designation of the upper bound of the prior given that all other population sizes were much smaller than the upper bound.fig. a topographic profiles of the two cordilleras separating sampling sites in the vilcanota region and along the manu road. arrows with red lettering indicate mean migration rates estimated from ima analyses. b bill length differences among the four cusco localities. blue represents the two humid sites and brown the two drier sites. asterisks indicate p-values for the comparisons of bill length between two pairs of adjacent populations in humid and semi-humid environments t m 95 % hpd range for each parameter presented in parentheses. mean parameter estimates represent the average across the three independent runs performed for all four comparisons. θ refers to estimates of θ for the semi-humid comparison for vilcanota and manu road and θ for the humid site. for between humid sites and semi-humid site comparisons θ refers to sites from the manu road and θ the vilcanota cusco populations on the drier, west-facing slopes had longer bills than those on the humid, east-facing slopes. bill length in urubamba was significantly longer than all three of the other populations. although bill length in paucartambo was slightly longer than birds from the adjacent humid slopes at pillahuata, this result was not significant when corrected for multiple comparisons. there were no differences in bill length between the two humid sites. discussion geographic isolation promotes genetic divergence phylogenetic, network, and amova analyses all point to an important role for topographic barriers in structuring genetic diversity in metallura tyrianthina, a result consistent with studies of the genus metallura as a whole and many other andean taxa. we found the north peru low, apurímac valley and high andean ridges to be associated with genetic structure in m. tyrianthina as in many other taxa. we also found the cordillera de vilcanota to be an important landscape feature structuring genetic and phenotypic diversity; the same cordillera was linked to an older phenotypic and genetic divergence in the hummingbird adelomyia melanogenys. topographic barriers were implicated in generating neutral genetic divergence, but not divergence in bill length. this suggests that hummingbird bill morphology does not evolve steadily over time, but diverges only in response to differential ecological pressures. although we found discordant patterns of genetic and morphological divergence in m. tyrianthina, patterns of plumage variation in the species appear to vary in association with topographic barriers and the degree of genetic divergence. a high andean ridge separates the similar looking subspecies m. t. smaragdinicollis and m. t. septentrionalis, and the marañón valley corresponds to turnover between the red-tailed subspecies, m. t. tyrianthina, and the two purple-tailed subspecies occupying the rest of peru. plumage variation among these subspecies cannot be explained by the climatic characteristics of the regions in which they are distributed. instead, plumage divergence generally corresponds with time since divergence. the two similar purple-tailed subspecies, which occupy different environments, were found to be only  % divergent at the nd locus; whereas divergence between red and purple-tailed subspecies distributed in similar environments across the marañón valley was ~  %. concordance between tail color and genetic divergence in m. tyrianthina is consistent with the positive correlation between the extent of plumage and mtdna divergence across the marañón valley, based on multiple passerine genera. plumage divergence rate appears to be linked to neutral genetic divergence and decoupled from functional trait divergence. bill length varies in association with climate populations of metallura tyrianthina occupying habitats characterized by semi-humid montane scrub were found to have significantly longer bills than birds in humid forest habitats. this marked morphological divergence was not associated with neutral genetic divergence; rather, we found a strong relationship between climatic and bill length variation, with a model of seasonality, precipitation and their interaction being the strongest predictor of bill variation and seasonality being the most important single predictor. our estimate of the strength of this relationship is likely conservative considering that the climate data is coarsely interpolated from unevenly distributed weather stations in the peruvian andes. in the andes, consistent patterns of morphological divergence occurring in association with ecological dissimilarities have been found in adelomyia hummingbirds and glyphorhynchus woodcreepers. a similar relationship between bill length and climate was found in the hummingbird adelomyia melanogenys, where 57 % of the variance in bill length was explained by precipitation seasonality, minimum temperature of the coldest month, and mean elevation. these results suggest that climatic variables or other ecological factors correlated with climate may play important roles in shaping the impressive diversity of hummingbird bill morphology in the andes. concordance between ecological variation and morphological variation is well documented in organisms especially birds where bill morphology responds readily to climatic and dietary change. patterns of bill morphology in m. tyrianthina contribute to mounting evidence that the ecological differences generated by the topographically complex andean landscape play an important role in promoting local adaptation and functional diversity in andean taxa. the variation partitioning approach we used to test for ibe revealed that geographic distance, not climatic variation, explained the greatest proportion of genetic variance. these results provide additional evidence for an exclusive role of geographic isolation in promoting genetic divergence at the neutral loci studied. our results resemble a similar study in trinidadian guppies where no influence of ecological dissimilarity on genetic variation was detected. however, both a study of caribbean anolis species and a meta-analysis found consistent roles for ecologically mediated genetic divergence when comparing the influence of geographic and ecological distance on patterns of genetic variation. in the andes, similar analyses assaying genetic variation among populations of the woodcreeper glyphorynchus spirurus in ecuador found that the andean ridge separating eastern and western populations played the largest role in structuring genetic divergence. whereas genetic variance within eastern or western populations was explained largely by ecological variation. although we do not find evidence for isolation by environment in m. tyrianthina, negative results for this test can be difficult to interpret due to factors such as insufficient time for divergence to occur at neutral loci or inappropriate ecological variables selected. other distance estimates, such as resistance-based distances, consistently explain a greater proportion of the variance in genetic diversity than euclidean geographic distance. thus, our use of euclidean distances likely resulted in a conservative estimate of the effect of geographic features on genetic divergence. in general, the results of our variation partitioning and phylogeographic analyses implicate geographic isolation as the major driver of neutral genetic divergence in this species, with little or no additional divergence attributable to ecological differences. barriers facilitate functional divergence in a wide array of taxa, mismatches between morphology and neutral genetic diversity have been interpreted as evidence for phenotypic divergence with gene flow. these studies have generally compared morphology of adjacent populations in different environments versus isolated populations in similar environments; however, they do not assess the extent to which gene flow might prevent populations from achieving local adaptive optima. we compared patterns of gene flow and morphological divergence between pairs of populations in humid and semi-humid environments that were either isolated by a topographic barrier or not. this allowed us to assess how interactions between barriers and climate might facilitate functional diversification. at all four loci, we found greater fst-values across the cordillera de vilcanota than the manu road, with only a single locus exhibiting an fst significantly different from zero along the manu road. coalescent-based analyses in ima confirmed that migration rates across the manu road were significantly greater than across the cordillera de vilcanota. furthermore, migration rates along the manu road were found to be equal to or greater than rates between the two humid sites or between the two semi-humid sites. although mcmc searches in some ima analyses exhibited uncertain convergence, three independent runs always indicated higher migration rates along the manu road than across the vilcanota, and fst values corroborated patterns suggested by ima analysis. we found an inverse relationship between bill length divergence and gene flow, with greater divergence in bill length found across the cordillera de vilcanota than the manu road. a similar relationship between gene flow and adaptive divergence has been found in numerous non-andean taxa. although this pattern has frequently been interpreted as the result of gene flow constraining adaptive divergence, adaptive divergence could also restrict gene flow to the extent that it reinforces reproductive isolation. teasing apart these mechanisms is a widely recognized challenge. in the present case, the fact that landscape features appear to explain levels of gene flow suggests that adaptive divergence is constrained by gene flow, rather than the reverse. an alternative explanation for differences in bill length between urubamba and paucartambo is that they reflect differences in the amount of time spent in semi-humid environments. in support of this possibility, migration-rate estimates from ima can be spuriously high, according to two recent simulation studies. both studies found that in cases of recent divergence, datasets with few loci exhibited high false-positive rates for non-zero migration. given that we only sequenced four unlinked loci, it is possible that this bias could have conflated the migration rates that we found along the manu road. however, we think it is likely that low fst between populations distributed along the manu road was due, at least in part, to ongoing gene flow. these populations are only 5 km apart and the intervening area contains a gradual habitat transition from semi-humid scrub to humid forest. secondly, the uplift of the cordillera dividing the two sampled populations along the manu road occurred >4 ma before m. tyrianthina colonized the central andes from the north. although we consider high gene flow to be the most likely interpretation of low genetic divergence across the manu road, our relative estimates of gene flow and divergence time should be interpreted with caution. the most conservative interpretation of our results is that bill length similarity is associated with genetic similarity at the population level, regardless of whether that similarity is due to recent divergence or ongoing connectivity. although subtle morphological divergence in the face of gene flow has been demonstrated in other andean birds, phylogenetic analyses have failed to find a pattern of sister species replacement along ecological gradients. our results potentially reconcile these contradictory patterns as we find that adaptive divergence with gene flow is possible, but severely constrained. in andean birds, it appears that allopatry is a pre-requisite or co-requisite for functional diversification and likely the completion of speciation. selection for longer bills repeated evolution of longer bills in drier, more seasonal habitats suggests adaptation by natural selection, although the mechanism by which increased bill length may increase fitness in these environments has yet to be tested. given that climatic variation likely covaries with a number of other potential ecological pressures, pinpointing the mechanistic basis of inter-population variation in bill length would require rigorous field observations and experimentation. climate could play a direct role in driving bill length differences; however, bill length variation in m. tyrianthina and other metallura species directly contradicts allen’s rule. additionally, even though increased bill size can be a key mechanism for shedding excess heat while conserving water in drier environments hummingbirds acquire large volumes of water from their nectarivorous diets and as a consequence do not suffer from water limitations to the same degree as other birds. instead, biotic interactions represent more likely drivers of geographic variation in bill length in metallura tyrianthina. first, longer bills in drier, less diverse environments could be caused by competitive release, analogous to bird populations on depauperate islands which tend to exhibit divergent bill morphologies as part of a more generalist phenotype. m. tyrianthina has a shorter bill than most other hummingbird species in the humid forests of east-facing andean slopes. longer bills might allow m. tyrianthina to exploit a greater variety of flowers on rain-shadowed slopes that harbor fewer competing nectarivore species. second, diversifying selection on bill length could be exerted by flower species that have different corolla shapes, a co-evolutionary process that has been well-documented in other hummingbird species; this is plausible for m. tyrianthina because striking floral species turnover coincides with the climatic gradients along which it occurs.  andean ridges and valleys hinder connectivity among populations and also create local climatic variation that imposes differential selection pressures. we investigated this dual role of topography for its effects on diversity in a widespread hummingbird species, metallura tyrianthina. across the peruvian distribution of this species, we found that topographic barriers play the dominant role in structuring effectively neutral genetic diversity, whereas climatic variation shapes patterns of bill morphology. moreover, analyses across four sites in the department of cusco indicated that topography promotes genetic structure even across small spatial scales and bills are longer on rain-shadowed, west-facing slopes. this fine-scale analysis also revealed how gene flow constrains functional divergence, suggesting that topography and climatic variation interact to promote andean diversification. if functional divergence driven by climatic variation permits coexistence upon secondary contact, it could potentially contribute to the evolution of reproductive isolation at later stages of divergence. these processes could increase the overall tempo of diversification. based on our results from metallura, the east-to-west precipitation gradient may have played an important role in the diversification of several avian genera that contain narrowly distributed and geographically variable taxa in the central andes. indeed, analyses comparing speciation rates among andean and adjacent lowland lineages have found overall higher speciation rates in the andes, a pattern driven in part by genera such as cranioleuca and spinus. topographic barriers and ecological variation have clearly interacted to produce high species diversification rates in andean birds. the current results suggest that rates of functional diversification should also be accelerated when physical landscape features coincide with ecoclimatic variation. availability of supporting data the bill length dataset supporting the results of this article are included within the article ). mitochondrial and nuclear intron sequence data have been deposited on genbank, accession numbers: ku527140-ku additional file additional file 1: table s museum specimens and tissues used in study, sampling localities, bill length measurements, and body mass. table s loadings from principal component analysis of temperature, precipitation, and seasonality bioclim variables. table s loadings from principal components analysis of all bioclim variables. table s parameter settings for each of the four ima analyses. table s corrected pairwise differences and fst values among all populations. table s results of amova analysis. table s standard indices of molecular diversity for each clade based on nd competing interests the authors declare that they have no competing interests. authors’ contributions pmb and ccw designed the research and wrote the paper. p.m.b. collected and analyzed the data. both authors have read and approved the final version of the manuscript. 
moreover, the population experiencing more gene flow exhibited a lesser degree of bill length divergence despite similar differences in climate. we found that mutation-scaled migration rate between persistently humid and semi-humid environments was nearly times higher when the habitats were contiguous than when separated by a barrier, the cordillera de vilcanota. gene flow appears to hinder the evolution of functional traits toward local adaptive optima. to address this, we compared patterns of genetic and morphological diversity in peruvian populations of the hummingbird metallura tyrianthina. ecological differences, represented here by climate characteristics, are necessary for functional divergence. the ridges and valleys of the andes create physical barriers that limit animal dispersal and cause deterministic local variation in rainfall. however, the relative influences of geographic isolation, ecoclimatic conditions, and their potential interactions remain poorly understood. phylogenetic and variation partitioning analyses showed that geographic isolation rather than climatic dissimilarity explained the greatest proportion of genetic variance. geographic isolation is necessary for genetic divergence. this suggests that functional diversification requires geographic isolation followed or accompanied by a shift in ecological conditions. andean topography causes both isolation and climatic variation, underscoring its dual role in biotic diversification. in contrast, bill length variation was explained by climatic seasonality, but not by genetic divergence. this has resulted in physical isolation of animal populations and variation in habitats, each of which has likely contributed to the evolution of high species diversity in the region.
 the ridges and valleys of the andes create physical barriers that limit animal dispersal and cause deterministic local variation in rainfall. this has resulted in physical isolation of animal populations and variation in habitats, each of which has likely contributed to the evolution of high species diversity in the region. however, the relative influences of geographic isolation, ecoclimatic conditions, and their potential interactions remain poorly understood. to address this, we compared patterns of genetic and morphological diversity in peruvian populations of the hummingbird metallura tyrianthina.  phylogenetic and variation partitioning analyses showed that geographic isolation rather than climatic dissimilarity explained the greatest proportion of genetic variance. in contrast, bill length variation was explained by climatic seasonality, but not by genetic divergence. we found that mutation-scaled migration rate between persistently humid and semi-humid environments was nearly times higher when the habitats were contiguous than when separated by a barrier, the cordillera de vilcanota. moreover, the population experiencing more gene flow exhibited a lesser degree of bill length divergence despite similar differences in climate.  geographic isolation is necessary for genetic divergence. ecological differences, represented here by climate characteristics, are necessary for functional divergence. gene flow appears to hinder the evolution of functional traits toward local adaptive optima. this suggests that functional diversification requires geographic isolation followed or accompanied by a shift in ecological conditions. andean topography causes both isolation and climatic variation, underscoring its dual role in biotic diversification. electronic supplementary material the online version of this article contains supplementary material, which is available to authorized users. keywords andesecological speciationgeographic speciationbill morphologytrochilidaehttp://dx.doi.org/ /100005835american museum of natural historychapman memorial fundbenham phred m. http://dx.doi.org/ /100007179university of new mexicocetiwitt christopher c. http://dx.doi.org/ /100007179university of new mexicogracbenham phred m. issue-copyright-statement© the author 2016 