# Habitat choice meets thermal specialization: Competition with specialists may drive suboptimal habitat preferences in generalists

Staffan Jacob<sup>a,b,1</sup>, Estelle Laurent<sup>a</sup>, Bart Haegeman<sup>b,c</sup>, Romain Bertrand<sup>b,c</sup>, Jérôme G. Prunier<sup>b</sup>, Delphine Legrand<sup>b</sup>, Julien Cote<sup>d</sup>, Alexis S. Chaine<sup>b,e</sup>, Michel Loreau<sup>b,c</sup>, Jean Clobert<sup>b</sup>, and Nicolas Schtickzelle<sup>a</sup>

<sup>a</sup>Earth and Life Institute, Biodiversity Research Centre, Université Catholique de Louvain, 1348 Louvain-la-Neuve, Belgium; <sup>b</sup>Station d'Ecologie Théorique et Expérimentale (UMR5321), CNRS, Université Paul Sabatier, F-09200 Moulis, France; <sup>c</sup>Centre for Biodiversity Theory and Modelling, Station d'Ecologie Théorique et Expérimentale (UMR5321), CNRS, Université Paul Sabatier, F-09200 Moulis, France; <sup>d</sup>Laboratoire Evolution and Diversité Biologique (UMR5174), CNRS, Université Paul Sabatier, F-31062 Toulouse, France; and <sup>e</sup>Toulouse School of Economics, Institute for Advanced Studies in Toulouse, 31015 Toulouse, France

Edited by Alan Hastings, University of California, Davis, CA, and approved October 10, 2018 (received for review April 3, 2018)

Limited dispersal is classically considered as a prerequisite for ecological specialization to evolve, such that generalists are expected to show greater dispersal propensity compared with specialists. However, when individuals choose habitats that maximize their performance instead of dispersing randomly, theory predicts dispersal with habitat choice to evolve in specialists, while generalists should disperse more randomly. We tested whether habitat choice is associated with thermal niche specialization using microcosms of the ciliate *Tetrahymena thermophila*, a species that performs active dispersal. We found that thermal specialists preferred optimal habitats as predicted by theory, a link that should make specialists more likely to track suitable conditions under environmental changes than expected under the random dispersal assumption. Surprisingly, generalists also performed habitat choice but with a preference for suboptimal habitats. Since this result challenges current theory, we developed a metapopulation model to understand under which circumstances such a preference for suboptimal habitats should evolve. We showed that competition between generalists and specialists may favor a preference for niche margins in generalists under environmental variability. Our results demonstrate that the behavioral dimension of dispersal—here, habitat choice—fundamentally alters our predictions of how dispersal evolve with niche specialization, making dispersal behaviors crucial for ecological forecasting facing environmental changes.

dispersal | ecological niche | informed decision | habitat matching | niche margin

Dispersal and ecological specialization are widely accepted as important drivers of population and species responses to environmental changes (1–9). Ecological specialization favors local adaptation and thus, diversification (10–12), and it can play an important role in species tolerance to environmental changes (6, 13, 14). Limited dispersal propensity is also classically considered as a prerequisite for ecological specialization to evolve (2, 6, 12, 15–17). Generalists are thus expected to show greater dispersal propensity compared with specialists (2, 6, 12, 15–17). This coupling between specialization and low dispersal can arise, because dispersal may hinder local adaptation and thus, the evolution of specialization (18–20) or because generalists are more likely to find suitable habitats after dispersal than specialists and should thus evolve higher dispersal propensity (12, 15–17). Accordingly, recent studies found that generalists show greater dispersal propensity compared with specialists across animals (21, 22). In the context of current global changes, the more generalist organisms are thus generally predicted to show a higher ability to shift their range distributions owing to a greater dispersal propensity coupled with a tolerance of a broader range of environments (2, 4, 6, 14, 21, 23, 24).

However, current theories predicting a coupling between ecological specialization and low dispersal propensity assume

dispersal to be random, an assumption that contrasts with the accumulating evidence for nonrandom dispersal (7, 9, 25, 26). Instead of dispersing randomly, individuals may indeed modify their dispersal decisions depending on the environmental context to selectively stay in or disperse toward habitats that maximize their performance (27–30). This process, named habitat choice, is predicted to break the coupling of specialization and limited dispersal predicted by classical theory: specialists should not evolve low dispersal propensity as expected but rather, should modify their dispersal decisions depending on the environmental context to preferentially live in habitats that they are specialized for (Fig. 1) (27–29, 31). Indeed, habitat choice should allow individuals to live preferentially in optimal habitats and thus, reduce movements toward suboptimal ones (e.g., the margin of the niche) (30–33). Habitat choice should, therefore, favor niche conservatism by decreasing exposure to selection of new mutations potentially favoring fitness at the margin of the species’ niche (27, 31, 32, 34, 35). Such context-dependent dispersal in specialists should improve their ability to track suitable

## Significance

In contrast to the classically expected coupling between ecological specialization and low dispersal propensity, theory predicts that dispersal with habitat choice (i.e., individuals that choose habitats maximizing their performance) should evolve in specialists, while generalists should disperse more randomly. Here, we show in ciliate microcosms that thermal specialists indeed prefer optimal habitats, whereas surprisingly, generalists also perform habitat choice but with a preference for suboptimal habitats. To tackle the question of why generalists should prefer suboptimal habitats, we developed a metapopulation model and showed that competition between generalists and specialists may favor a preference for niche margins in generalists under environmental variability. Our results point out the importance of dispersal strategies for ecological and evolutionary dynamics.

Author contributions: S.J., B.H., J.G.P., D.L., J. Cote, A.S.C., M.L., J. Clobert, and N.S. designed research; S.J., E.L., B.H., R.B., and J.G.P. performed research; S.J., B.H., R.B., and J.G.P. analyzed data; and S.J., B.H., R.B., J.G.P., D.L., J. Cote, A.S.C., M.L., J. Clobert, and N.S. wrote the paper.

The authors declare no conflict of interest.

This article is a PNAS Direct Submission.

Published under the PNAS license.

Data deposition: The data supporting the findings of this study have been deposited in a Dryad repository (doi:10.5061/dryad.5q02f35).

¹To whom correspondence should be addressed. Email: jacobstaffan@gmail.com.

This article contains supporting information online at www.pnas.org/lookup/suppl/doi:10.1073/pnas.1805574115/-/DC Supplemental.
<figure><img src="image_1.png" /><figcaption>**Fig. 1.** Predictions for the relationship between dispersal decisions and expected fitness illustrated for dispersal at emigration (i.e., decision to stay or leave the local habitat depending on local expected fitness). Specialists should modify their dispersal decisions depending on the environmental context to preferentially live in habitats that they are specialized for (i.e., habitat choice *h* > 0), while generalists should disperse randomly (*h* = 0).</figcaption></figure>

environmental conditions facing environmental changes (2, 6, 12, 14–17). However, we still lack empirical investigation of this predicted link between habitat choice and ecological specialization, with specialists adjusting dispersal decisions to the environmental context, while generalists perform random dispersal.

Here, we tested this predicted relationship between specialization and habitat choice using microcosms, an approach that has proven powerful for experimentally addressing key questions in ecology and evolution (36, 37). We used *Tetrahymena thermophila*, a ciliate naturally living in freshwater ponds under spatiotemporal thermal variability. A recent study showed that this species can adjust dispersal decisions depending on temperature (i.e., temperature-dependent habitat choice) and demonstrated that dispersal with habitat choice can favor rather than hinder local adaptation (30). Given the importance of temperature-related dispersal and thermal niche specialization in the context of current climate change (3, 6, 38), we crucially need to quantify variability in habitat choice and how it covaries with niche specialization. To do so, we quantified thermal specialization (i.e., niche width) and temperature-dependent habitat choice separately for each of 12 clonally reproducing genotypes of *T. thermophila* (Fig. 2). We used dispersal systems in which patches differed in their temperature (*Methods*) to quantify habitat choice as the ability to adjust dispersal depending on expected fitness (i.e., growth rate): that is, the fitness that a genotype would reach if choosing a given temperature. Since

dispersal decisions can occur at different steps of the dispersal process (25, 29, 39), we quantified habitat choice at both emigration (whether to leave the local temperature) and immigration (where to settle).

Based on current theory, we predicted that habitat choice ability should increase with niche specialization, while more generalist genotypes should disperse more randomly (Fig. 1). Surprisingly, we found that, although the more specialist genotypes showed the expected habitat choice behavior, generalists also performed habitat choice and preferred suboptimal habitats, although better ones were available. This finding challenges current theory that considers generalism as an alternative to habitat choice and brings up the question of why generalists would prefer suboptimal habitats. We thus constructed a metapopulation model to test the hypothesis that, under spatiotemporal variability of temperature, competitive interactions between specialists and generalists might favor the evolution of a preference for suboptimal habitats in generalists.

## Results

We measured habitat choice at emigration and immigration for each genotype. Habitat choice can range from -1 to 1: *h* = 0 for random dispersal, *h* > 0 for a preference for optimal habitats, and *h* < 0 for a preference for suboptimal habitats (Fig. 1 and SI Appendix). We found evidence for among-genotype variability in temperature-dependent habitat choice in *T. thermophila*. Of the 12 genotypes tested, 11 showed significant habitat choice at emigration, and 8 showed significant habitat choice at immigration (SI Appendix, Table S2). We found that habitat choice *h* of the different genotypes ranged from -0.46 to 0.60 at emigration and from -0.93 to 0.95 at immigration.

We quantified the relationship between habitat choice and niche specialization and found that habitat choice correlated negatively with niche width (emigration: estimate ± SE = -0.179 ± 0.063; $t_{11} = -2.83$; *P* = 0.018; $R^2 = 44.52\%$; immigration: -0.263 ± 0.092; $t_{11} = -2.85$; *P* = 0.017; $R^2 = 44.81\%$; 95% confidence interval with bootstrap at emigration: [-0.210; -0.099]; 95% confidence interval with bootstrap at immigration: [-0.289; -0.164]) (Methods). As predicted by theory, genotypes with the highest thermal specialization showed positive habitat choice values (Fig. 3), meaning that they preferentially stayed in or joined habitats maximizing their expected fitness. Specialists did not, on average, disperse more or less than generalists (regression of average dispersal propensity $D_p$ on niche width: -0.006 ± 0.021; $t_{11} = -0.27$; *P* = 0.79) (SI Appendix) but instead, modified their dispersal decisions depending on temperature (Fig. 1).

In contrast, the more generalist genotypes showed negative habitat choice (Fig. 3), meaning that they preferred to stay in or join the temperature in which their expected fitness was the lowest. Note that these suboptimal conditions still represent viable habitats for genotypes and that the quality of patches that

<figure><img src="image_2.png" /><figcaption>**Fig. 2.** Experimental design to (A) measure thermal niche of genotypes and their expected fitness in the tested temperatures and (B) quantify temperature-dependent habitat choice at emigration and immigration. (A) The fitness of each genotype along a thermal gradient (11 °C to 39 °C) was quantified to reconstruct its thermal niche (SI Appendix, Fig. S1). From these thermal niches, we quantified the expected fitness *f* at each focal environmental condition (e.g., 35 °C expected fitness: growth rate at 35 °C relative to performance at optimum) (*Methods*). (B) Genotypes were initially inoculated in the central patch of three-patch systems (start patch and temperature set at either 27 °C or 35 °C) connected to one 27 °C patch and one 35 °C patch. Genotypes were thus allowed to choose their habitat at emigration (stay or leave the start patch) and immigration (where to settle). *T. thermophila* silhouette was obtained from Phylopic.org.</figcaption></figure>
<figure><img src="image_3.png" /><figcaption>**Fig. 3.** Habitat choice correlates with niche specialization at emigration (A) and immigration (B). Each dot represents the estimation of habitat choice *h* for a given genotype (mean ± SE). Thermal niche width was computed as the temperature range containing 80% of the thermal niche expressed in degrees Celsius. *R*² values of the regression of habitat choice over niche width are shown.</figcaption></figure>

genotypes had access to in our experiment was independent of their level of thermal specialization (Methods). Since we found that the more generalist genotypes tend to also have a cooler thermal optimum (Pearson correlation coefficient: -0.66; $t_{11} = -2.78$; $P = 0.02$; no significant correlation with performance at optimum: -0.38; $t_{11} = -1.32$; $P = 0.22$), we applied variance-partitioning analyses to determine if thermal specialization or thermal optimum drove variance in habitat choice. We found that thermal specialization is the main contributor to the variance in habitat choice at emigration and that 11.5% of variance at immigration is explained by thermal specialization itself, while 33.3% is commonly explained by thermal specialization and thermal optimum (SI Appendix, Table S3).

Since we found that generalists performed habitat choice and preferred suboptimal habitats in our experiment instead of dispersing randomly as theoretically predicted, we constructed a simple metapopulation model to explore the conditions under which such a strategy could be favored. Specifically, we hypothesized that competitive interactions between generalists and specialists might favor a preference for fundamentally suboptimal habitats in generalists. Providing that the metapopulation faces spatiotemporal variability of thermal conditions, we found that generalists with a preference for suboptimal habitats can coexist with specialists of the central temperature that prefer their optimal temperature. Specifically, this coexistence occurs when the proportion of marginal temperatures (i.e., $p_m$, the proportion of time during which the temperature is marginal) is below 50% (except for very low durations of marginal temperatures; i.e., very small $t_m$) (Fig. 4). When the proportion of marginal temperatures increases, either a single generalist or three specialists (for cold, central, and warm conditions) are favored (for low and high duration of marginal temperatures conditions $t_m$, respectively), and in all cases, they show positive habitat choice (i.e., preference for optimal habitat). When the proportion of marginal temperatures is too low, a specialist for the central temperature excludes all other strategies (Fig. 4).

## Discussion

Classical theory predicts low dispersal propensity to evolve together with ecological specialism (2, 12, 15–17). However, several studies have predicted that specialists should not evolve limited dispersal propensity but instead, evolve efficient prospecting skills, allowing individuals to preferentially find and live in specific habitats that they are specialized for (27, 31, 33–35). Using a microcosm approach, we showed that habitat choice correlates with thermal niche specialization. Genotypes with the greatest thermal specialization performed habitat choice, preferring to stay in or join optimal habitats. This result provides empirical demonstration that ecological specialists perform habitat choice, a link that should make specialists more likely to track suitable conditions under environmental changes than expected under the random dispersal assumption (2, 6, 12, 14–17).

On the other side of the thermal specialization gradient, we found that the more generalist genotypes also performed habitat choice but with a preference for suboptimal habitats. This habitat choice strategy is in opposition to current theory that typically considers generalism as an alternative to habitat choice (40–43). Furthermore, choosing suboptimal habitats when better ones are available seems unlikely to evolve: all individuals should prefer better habitats, especially if dispersal incurs costs or in the absence of competition with specialists.

Our results thus bring up the question of why generalists should evolve a preference for suboptimal habitats. Habitat choice has been previously suggested to favor specialist–generalist coexistence in source–sink systems (44), but whether generalists actively preferring suboptimal habitats can be favored is still unexplored. A key point in our experiment is that the quality of habitats was quantified relative to each genotype’s fundamental niche (i.e., without competition among genotypes and everything other than temperature kept constant). Although generalists are by definition able to deal with a larger range of environmental conditions, specialists usually achieve greater efficiency at their ecological optimum and hence, should exclude generalists from their optimal habitats (45). Competitive interactions should thus lead to major differences between the fundamental and realized niche of generalists as illustrated by numerous theoretical and experimental studies that provide evidence for competitive exclusion of generalists by specialists (12, 35, 45, 46). A generalist competing with a specialist sharing a similar niche optimum should thus achieve higher realized fitness in fundamentally

<figure><img src="image_4.png" /><figcaption>**Fig. 4.** Habitat choice strategies and coexistence of specialists and generalists depend on the proportion and duration of marginal conditions ($p_m$ and $t_m$, respectively) (SI Appendix, Fig. S2) has an illustration of the spatiotemporal variability implemented). The duration of marginal conditions $t_m$ is expressed relative to generation time (e.g., marginal conditions last for one generation when $t_m = 1$). S and G refer to specialists and generalists, respectively. $S_{central}$, $S_{cold}$, and $S_{warm}$ refer to specialist of the central patch, cold margin, and warm margin, respectively; + and – denote positive and negative habitat choice, respectively. The dark gray area illustrates the parameter space where a generalist with negative habitat choice ($h = -1$; $G^-$) can coexist with a specialist with positive habitat choice ($h = 1$; $S_{central}^+$) (relative abundance and degree of specialization are in SI Appendix, Fig. S4). In the lower right region, only one strategy with positive habitat choice is favored, with specialization level that decreases when the proportion of marginal events increases (i.e., $S_{central}^+$ toward $G^+$ when $p_m$ increase). This means that, although always showing a preference for the central temperature, there is a smooth transition in this region from a specialist toward a generalist. Increasing $p_m$ values above 0.7 expands the two regions on the right of the graph: either a single generalist (for low duration of marginal events $t_m$) or specialists with positive habitat choice are favored (for higher $t_m$).</figcaption></figure>
suboptimal habitats (45, 47, 48), which may favor a preference for niche margins in generalists.

The results of our model support this hypothesis: generalists with a preference for suboptimal habitats can be favored and coexist with specialists. Importantly, our model revealed that environmental variability is crucial for generalists with a preference for suboptimal habitats to be favored. While specialists of niche margins can persist only when the proportion of marginal conditions is high (Fig. 4), a reduced proportion of marginal temperature events, as often found in natural systems (49, 50), favors generalists with a preference for suboptimal habitats coexisting with specialists with a preference for optimal habitats (Fig. 4). A preference for suboptimal habitats in generalists should favor the spatial segregation of specialists and generalists and thus, the likelihood of specialist-generalist coexistence in metapopulations and metacommunities, pointing out the importance of dispersal strategies in community assemblage and dynamics (29, 44, 51, 52).

Genotypes were isolated in our experiments, yet the more generalist genotypes still preferred suboptimal habitats, despite the absence of competition with more specialized genotypes. This suggests that generalists might choose habitats depending on temperature, preferring suboptimal temperatures where they are unlikely to compete with specialists (53, 54), instead of directly relying on the presence of specialist competitors to plastically adjust their habitat choice. Obtaining information about temperature in a potential habitat might indeed be easier or more reliable than quantifying the degree of specialism of competitors. More generally, identifying the mechanisms and drivers of dispersal decisions is an important step forward (55). In this study, we showed that dispersal decisions vary depending on local and neighboring temperature, an information use process that might involve, for instance, prospecting or social information (56-59). Note that habitat choice here rarely approaches -1 or 1 (SI Appendix, Table S2). Such imperfect decisions are expected, since information available about local and neighboring environmental conditions is usually limited and because performing informed dispersal decision usually involves costs (29, 39, 41, 60). Furthermore, dispersal decisions might involve different cues about the environment or the fitness that an organism can reach. Here, we found that the expected rate of reproduction (i.e., growth rate) and the expected size of the resulting populations (maximal density) are two correlated components of fitness that may underlie habitat choice decisions. Finally, additional effort should be devoted to the study of the occurrence of generalist habitat choice and the identification of the environmental conditions where such a strategy can be favored. Indeed, the consequences of habitat choice strategies for populations and community dynamics under environmental changes are expected to differ depending on whether generalists disperse randomly, show fixed habitat preferences, or adjust their habitat choice to the presence and abundance of specialists (29, 61).

Our understanding and ability to forecast population and community responses to environmental changes are among the main current challenges in ecology and evolutionary research. Critical to tackle these challenges is a deep understanding of the variability in life history strategies as pointed out by numerous recent studies (1, 4-6, 38, 62-64). In particular, dispersal strategies and other associated life history traits, like niche specialization, can profoundly affect ecological and evolutionary dynamics, such as community assembly, species range shifts, and adaptation in the face of environmental changes (3, 6, 7, 29, 29, 30, 38). Our experimental results using a microcosm system challenge the idea that specialists usually evolve reduced dispersal compared with generalists, pointing out the importance of the behavioral rules underlying dispersal movement for biodiversity response to current environmental changes (3, 7, 30).

## Methods

**Culture Conditions and Genotypes.** *T. thermophila* is a 30- to 50-µm unicellular eukaryote, a ciliated protozoa naturally living in freshwater ponds and streams in North America and used as a model organism in cell and

molecular biology (65). Here, we used 12 isolated clonal genotypes originally sampled by F. P. Doerder in different locations in North America (*SI Appendix, Table S1*) (66). In contrast to a previous study where genotypes were mixed to test whether habitat choice favors local adaptation compared with random dispersal (30), here genotypes were kept isolated to quantify among genotype variability in habitat choice, niche specialization, and how they covary. Cells were maintained in axenic-rich liquid growth media (0.6% Difco proteose peptone, 0.06% yeast extract) at 23 °C. All manipulations were performed in sterile conditions under a laminar flow hood.

**Thermal Niche.** To reconstruct the thermal niche of each genotype, we quantified population growth rate along a thermal gradient (from 11 °C to 39 °C) as our proxy of fitness. To do so, small numbers of cells (~100) from a single genotype were transferred to 96-well plates (250-µL wells) filled with growth media, with five replicates per genotype. These cultures were maintained at 11 °C, 19 °C, 23 °C, 27 °C, 31 °C, 35 °C, and 39 °C, and population growth was quantified through absorbance measurements at 550 nm twice a day until the populations reached their carrying capacity (from about 10 d at 39 °C to 3 wk at 11 °C) using a microplate reader (Synergy H1; BioTek). Absorbance, as classically used in cell culture research, is significantly and linearly correlated with cell density within the range of densities observed under our laboratory conditions (30, 67). After smoothing growth curves using a general additive model [*gam*; using the *gam* R-package (68)] to avoid any bias due to slight technical variability in absorbance measures, we computed the growth rate as the maximum slope of population growth for each genotype at each temperature using the *gcfit* function (*grofit* R-package) with spline fit (30).

We inferred the thermal niche of each genotype from the relationship observed between growth rate and temperature fitted by a *gam* (Fig. 2A), a nonparametric statistical model commonly used in ecological niche modeling that does not require any assumption regarding the shape of the curve (69); *gam* was fitted using local cubic splines with four degrees of freedom for smoothness [a value considered flexible enough to model response curves in biology without over fitting (69)] and a Gaussian error distribution. We then computed three niche parameters for each genotype from these curves (Fig. 2A): (i) niche width (i.e., a proxy for thermal specialization) was computed as the temperature range containing 80% of the thermal niche [i.e., 80% of the area under the curve (70); 70 and 90% temperature ranges led to similar results: niche width computed with 80% temperature range compared to 70%: Pearson correlation = 0.989; compared to 90%: correlation = 0.992]; (ii) thermal optimum, the temperature at maximal growth rate; and (iii) performance at optimum, the growth rate at thermal optimum (*SI Appendix, Fig. S1* has an illustration of genotypes' thermal niches).

**Dispersal and Habitat Choice.** To quantify habitat choice for each genotype, we used dispersal systems consisting of three linearly connected patches (Fig. 2B) (5-mL standard Eppendorf tubes) connected by corridors (4-mm-internal diameter silicon tube; 5 cm long) and filled with growth media (30, 71). Patches are, therefore, separated by ~2,500 times the size of *T. thermophila* cells, and we previously demonstrated that dispersal among patches in these microcosms influences local adaptation by generating gene flow among patches and affecting population differentiation (30). Isolated genotypes were separately inoculated in the central patch of the three-patch systems at standard density (start patch temperature set at either 27 °C or 35 °C; five replicates for each start patch temperature; ~40,000 cells), connected to one 27 °C patch and one 35 °C patch, defined to maximize fitness differences between the tested temperatures. To quantify dispersal decisions without introducing variability due to density-dependent dispersal, dispersal systems were inoculated with a standardized population size of ~40,000 cells. Since the fitness associated with the two environmental conditions differs among genotypes, we quantified for each genotype the expected fitness $\bar{f}(T)$ in these two conditions as the growth rate relative to the performance at optimum as identified in the thermal niche quantification (see above): $\bar{f}(T) = f(T)/f_{Topt}$ (Fig. 2A).

The expected fitness of genotypes in the better of the two temperatures varies between 0.42 and 0.93 (mean ± SE = 0.73 ± 0.04), and in the sub-optimal temperature, it varies between 0.21 and 0.56 (0.45 ± 0.03). Importantly, the quality of patches that genotypes had access to in our experiment was independent from their thermal specialization: the expected fitness in these two environmental conditions did not significantly correlate with thermal niche width (relationship between thermal niche width and expected fitness in a genotype's most optimal patch: estimate ± SE = 0.042 ± 0.026; t = 1.591; *P* = 0.143; in suboptimal temperature: 0.013 ± 0.021; *t* = 0.613; *P* = 0.554).

Temperature in patches was manipulated using dry bath systems (H2O3 Dry Bath Incubator; Coyote Bioscience) placed in incubators. Genotypes were
allowed to disperse and thus, to choose their habitat at emigration (stay or leave the start patch) and immigration (where to settle) (Fig. 2B) (29). Following previous experiments (58, 59), we chose to let cells disperse for 6 h. This species shows a latency time before growth initiation [at 27 °C: mean ± SE = 17.34 ± 1.80 h; at 35 °C: 9.97 ± 2.49 h (66)], meaning that population growth is negligible during the 6 h of dispersal assay and thus, does not affect estimates of dispersal rates as previously shown (58).

To compute the emigration rate (proportion of cells that dispersed from the central patch) and the immigration rate (proportion of the dispersers that joined each neighboring patch; see below), we used a standardized procedure to quantify cell densities in patches: from each culture, we measured five samples (10 µL each) pipetted into counting slides (Kima precision cell) and took digital pictures under dark-field microscopy (30, 56, 58, 71–74). Cell density in cultures was measured based on an automatic analysis of pictures using IMAGEJ software (version 1.47; NIH; https://imagej.nih.gov/ij) (73).

To quantify habitat choice at emigration and immigration for each genotype, we then quantified the relationship between dispersal decisions (emigration and immigration rates) and the expected fitness in each habitat (two values of growth rate per genotype corresponding to the two temperatures tested: 27 °C and 35 °C; see above). This means that habitat choice describes how dispersal rate varies depending on the fitness that a genotype would reach if choosing a given temperature (Fig. 1). To do so, we fitted a simple model in which dispersal rates depend on expected fitness $\hat{f}$ and habitat choice ($h_e$ at emigration, $h_i$ at immigration) (SI Appendix). This method allows for quantifying standardized habitat choice parameters between -1 and 1 and yields results that are highly correlated with simple regression estimates (SI Appendix). We expected no relationship between dispersal and expected fitness under random dispersal ($h = 0$) (Fig. 1), a positive relationship for habitat choice with a preference to either stay in or join optimal habitats ($h > 0$), and a negative relationship when habitat choice consists of preferentially staying or joining suboptimal habitats ($h < 0$) (Fig. 1) (29). Finally, the proxy of fitness used here (i.e., growth rate) is significantly correlated to another important characteristic of population growth, which is maximal density (i.e., carrying capacity; at 27 °C: 0.85; $t_{10} = 5.13$; $P < 0.001$; at 35 °C: 0.98; $t_{10} = 15.98$; $P < 0.001$). Growth rate and maximal density are two components of fitness that both might underlie dispersal decisions, and we found that estimates of habitat choice based on maximal density as a measure of expected fitness are significantly correlated to those based on growth rate (at emigration $h_e$: 0.79; $t_{10} = 4.02$; $P = 0.002$; at immigration $h_i$: 0.57; $t_{10} = 2.17$; $P = 0.054$).

**Statistical Analyses.** We tested for a link between habitat choice and thermal niche width using linear models (lm, stats R-package), with habitat choice ability $h$ as the dependent variable and thermal niche width as the explanatory variable. Model residuals followed a normal distribution in all cases. To account for the variance in the estimation of thermal niche parameters (i.e., niche width, thermal optimum, and performance at optimum), we computed bootstrap confidence intervals of the slope of the relationship between habitat choice and niche width by bootstrapping 1,000 times the growth rate values along the thermal gradient and quantifying habitat choice $h$ and thermal niche width for each bootstrap sampling. Finally, analyses with linear models were followed by variance partitioning analyses (regr function, yhat R-package) (75, 76) to account for the correlation between thermal specialization and thermal optimum (Results).

## Model

We constructed a simple metapopulation model to explore the conditions under which generalists with a preference for fundamentally suboptimal habitats can be favored. Individuals differing in their degree of specialization, thermal optimum, and habitat choice (hereafter called "strategies") compete in metapopulations consisting in three fully connected patches.

**Environmental Variability.** Because we expected environmental variability to determine the strategies that are favored, we modeled metapopulation dynamics with each patch subjected to local temperature conditions that can change between patches and over time (i.e., spatiotemporal variability). We assumed that temperature $T$ can take three values: a cold $T_1$, a central $T_2$, and a warm temperature $T_3$. Temperature in each patch switches between the three values $T_1$, $T_2$, and $T_3$ sequentially (i.e., $T_1$, $T_2$, $T_3$, $T_2$, $T_1$, etc.). Each temperature variability profile is characterized by two parameters: the proportion of time $p_m$ during which the temperature is marginal (i.e., $T_1$ or $T_3$), and the duration $t_m$ of these periods of marginal conditions (49, 50). Spatiotemporal variability profiles with different proportion and duration of periods of marginal conditions are illustrated in SI Appendix, Fig. S2.

**Population Dynamics.** The dynamics of abundance $N_{ik}$ of strategy $i$ in patch $k$ are given by the differential equation:

$$ \frac{dN_{ik}}{dt} = r_{ik}N_{ik} \left( 1 - \frac{\sum_{j} N_{jk}}{K_{ik}} \right) + \sum_{l \neq k} d_{ikl}N_{il} - \sum_{l \neq k} d_{ikl}N_{lk}. $$

The first term on the right-hand side corresponds to local population growth in patch $k$, with $r_{ik}$ indicating the intrinsic growth rate of strategy $i$ in patch $k$, $K_{ik}$ indicating the carrying capacity, and $N_{ik}$ and $N_{jk}$ indicating the local population sizes of strategies $i$ and $j$, respectively. The second term corresponds to immigration from patches $l$, and the third term corresponds to emigration to patches $l$, with $d_{ikl}$ indicating the dispersal rate of strategy $i$ from patch $l$ to patch $k$ and $N_{il}$ indicating the neighboring patch population size of strategy $i$.

As in the analysis of the experimental data, we used the maximal slope of the growth curve as our proxy of fitness. For the logistic growth of the model, this implies that fitness $f_{ik}$ of strategy $i$ in patch $k$ should be proportional to the product of $r_{ik}$ and $K_{ik}$. Because intrinsic growth rate $r$ and carrying capacity $K$ are significantly correlated in the experimental system (Pearson correlation coefficient for growth at 27 °C: 0.85; $t_{10} = 5.13$; $P < 0.001$; growth at 35 °C: 0.98; $t_{10} = 15.98$; $P < 0.001$), we assumed a similar dependence of $r_{ik}$ and $K_{ik}$ on $f_{ik}$ (i.e., $r_{ik} = r_0 \sqrt{f_{ik}}$ and $K_{ik} = K_0 \sqrt{f_{ik}}$).

Denoting the fitness of strategy $i$ at temperature $T$ by $f_i(T)$, the fitness of strategy $i$ in patch $k$ is equal to $f_{ik} = f_i(T_k)$, where $T_k$ is the temperature of patch $k$. This means that the fitness $f_{ik}$ (i.e., growth rate) of a strategy $i$ changes through time according to changes in local temperature. To mirror the analyses performed on experimental data, we defined the expected fitness, taking values between zero and one, as the fitness of strategy $i$ in patch $k$ relative to fitness at thermal optimum $\hat{f}_{ik} = f_{ik}/f_{i(T_{opt})}$.

**Habitat Choice.** To model habitat choice, we let dispersal rate $d_{ikl}$ depend on the expected fitness of strategy $i$:

$$ d_{ikl} = d_0 (1 + h_i (\hat{f}_{il} - \hat{f}_{ik})), $$

with $h_i$ indicating the habitat choice parameter of strategy $i$ and $d_0$ indicating a reference dispersal rate. We used expected fitness [fitness relative to fitness at thermal optimum $f_{i(T_{opt})}$] in the dispersal rate $d_{ikl}$ to not artificially limit the habitat choice potential of generalists, for which the absolute fitness difference $\hat{f}_{il} - \hat{f}_{ik}$ is typically small. Habitat choice parameter $h_i$ is between -1 and 1 ($h = 0$ for random dispersal, in which case $d_{ikl} = d_0$; $h > 0$ for preference for optimal habitats; $h < 0$ for a preference for suboptimal habitats). Note that we modeled habitat choice as a one-step process, with the decision to leave a patch and join another depending on the expected fitness difference between the local and neighboring patches. This assumption is coherent with the consistency of habitat preferences found between emigration and immigration (SI Appendix, Table S2).

**Niche Specialization.** Each strategy $i$ has a thermal niche, which is characterized by a thermal optimum (3i.e., the temperature at which fitness is maximal; here, $T_1$, $T_2$, or $T_3$) and a degree of specialization $s_i$; determining the fitness difference between the optimal habitat and the other temperatures (SI Appendix, Fig. S3). Specialization $s_i$ is a number between zero (perfect generalist) and one (perfect specialist). The relationship between fitness and temperature furthermore satisfies a specialist–generalist tradeoff $\sum_{i} f_{i}(T)^{s_i} = 1$. Temperature $T$ runs over the three temperatures (cold, central, warm), and $\alpha$ is the tradeoff strength (40, 77) (here, $\alpha = 0.7$). Competing strategies, therefore, differ in their degree of specialization $s_i$ and thermal optimum as illustrated in SI Appendix, Fig. S3.

To specify the model, we fixed the overall model parameters (that is, $r_0$, $K_0$, $d_0$, and $\alpha$) and for each strategy $l$, its degree of specialization $s_l$ and its habitat choice parameter $h_l$ (SI Appendix). We set $r_0$ equal to one, so that all times are expressed in units of reference generation times, and $K_0$ equal to one, so that all population sizes are expressed in units of reference carrying capacities. Reference dispersal rate $d_0$ was fixed to one; the specialist–generalist tradeoff strength $\alpha$ was 0.7. We verified that qualitatively similar results were obtained for other values of parameters $d_0$ and $\alpha$ (SI Appendix, Fig. S5).

The model dynamics were simulated starting from randomly generated initial conditions until reaching a stationary regime. We repeated this simulation procedure for a range of environmental variability parameters $p_m$ and $t_m$ (within [0; 0.7] and [0.1; 10], respectively).

**ACKNOWLEDGMENTS.** This study was supported by the ANR (Agence Nationale de la Recherche; projects INDHET and Netselect), HFSP (Human Frontiers Science Program; Grant RGP0006/2015), F.R.S.-FNRS (Fonds de la Recherche Scientifique; Equipment Grant U.N035.16), and TULIP (Laboratory of Excellence Grant ANR-10-LABX-41). S.J. was supported by a Move-In-Louvain Marie Curie Action Postdoctoral Fellowship. This work is contribution BRC 428 of the Biodiversity Research Centre at Université Catholique de Louvain.
1. Bolnick DI, et al. (2003) The ecology of individuals: Incidence and implications of individual specialization. *Am Nat* 161:1–28.

2. Jocque M, Field R, Brendonck L, De Meester L (2010) Climatic control of dispersal-ecological specialization trade-offs: A metacommunity process at the heart of the latitudinal diversity gradient?: Climate, dispersal, ecological specialization and diversity. *Glob Ecol Biogeogr* 19:244–252.

3. Travis J, et al. (2013) Dispersal and species' responses to climate change. *Oikos* 122:1532–1540.

4. Bertrand R, et al. (2016) Ecological constraints increase the climatic debt in forests. *Nat Commun* 7:12643.

5. Hendry AP (2017) *Eco-Evolutionary Dynamics* (Princeton Univ Press, Princeton).

6. MacLean SA, Beissinger SR (2017) Species' traits as predictors of range shifts under contemporary climate change: A review and meta-analysis. *Glob Change Biol* 23:4094–4105.

7. Cote J, et al. (2017) Evolution of dispersal strategies and dispersal syndromes in fragmented landscapes. *Ecography* 40:56–73.

8. Loreau M, Mouquet N, Gonzalez A (2003) Biodiversity as spatial insurance in heterogeneous landscapes. *Proc Natl Acad Sci USA* 100:12765–12770.

9. Clobert J, Baguette M, Benton TG, Bullock J (2012) *Dispersal Ecology and Evolution* (Oxford Univ Press, Oxford).

10. Rainey PB, Travisano M (1998) Adaptive radiation in a heterogeneous environment. *Nature* 394:69–72.

11. Ronce O, Kirkpatrick M (2001) When sources become sinks: Migrational meltdown in heterogeneous habitats. *Evolution* 55:1520–1531.

12. Kisdι E (2002) Dispersal: Risk spreading versus local adaptation. *Am Nat* 159:579–596.

13. Berg MP, et al. (2010) Adapt or disperse: Understanding species persistence in a changing world. *Glob Change Biol* 16:587–598.

14. Buckley L, Kingsolver J (2012) Functional and phylogenetic approaches to forecasting species' responses to climate change. *Annu Rev Ecol Evol Syst* 43:205–226.

15. Bonte D, Vandenbroecke N, Lens L, Maelfait J-P (2003) Low propensity for aerial dispersal in specialist spiders from fragmented landscapes. *Proc Biol Sci* 270:1601–1607.

16. Nurmi T, Parvinen K (2008) On the evolution of specialization with a mechanistic underpinning in structured metapopulations. *Theor Popul Biol* 73:222–243.

17. Nurmi T, Parvinen K (2011) Joint evolution of specialization and dispersal in structured metapopulations. *J Theor Biol* 275:78–92.

18. Lenormand T (2002) Gene flow and the limits to natural selection. *Trends Ecol Evol* 17:183–189.

19. Kawecki TJ, Ebert D (2004) Conceptual issues in local adaptation. *Ecol Lett* 7:1225–1241.

20. Bolnick DI, Nosil P (2007) Natural selection in populations subject to a migration load. *Evolution* 61:2229–2243.

21. Stevens VM, et al. (2014) A comparative analysis of dispersal syndromes in terrestrial and semi-terrestrial animals. *Ecol Lett* 17:1039–1052.

22. Dahirel M, et al. (2015) Movement propensity and ability correlate with ecological specialization in European land snails: Comparative analysis of a dispersal syndrome. *J Anim Ecol* 84:228–238.

23. Clavel J, Julliard R, Devictor V (2011) Worldwide decline of specialist species: Toward a global functional homogenization? *Front Ecol Environ* 9:222–228.

24. Jarzyna MA, Porter WF, Maurer BA, Zuckerberg B, Finley AO (2015) Landscape fragmentation affects responses of avian communities to climate change. *Glob Change Biol* 21:2942–2953.

25. Bowler DE, Benton TG (2005) Causes and consequences of animal dispersal strategies: Relating individual behaviour to spatial dynamics. *Biol Rev Camb Philos Soc* 80:205–225.

26. Ronce O (2007) How does it feel to be like a rolling stone? Ten questions about dispersal evolution. *Annu Rev Ecol Evol Syst* 38:231–253.

27. Holt RD (1987) Population dynamics and evolutionary processes: The manifold roles of habitat selection. *Ecol Evol* 1:331–347.

28. Edelaar P, Siepielski AM, Clobert J (2008) Matching habitat choice causes directed gene flow: A neglected dimension in evolution and ecology. *Evolution* 62:2462–2472.

29. Jacob S, Bestion E, Legrand D, Clobert J, Cote J (2015) Habitat matching and spatial heterogeneity of phenotypes: Implications for metapopulation and metacommunity functioning. *Evol Ecol* 29:851–871.

30. Jacob S, et al. (2017) Gene flow favours local adaptation under habitat choice in ciliate microcosms. *Nat Ecol Evol* 1:1407–1410.

31. Holt RD, Barfield M (2008) Habitat selection and niche conservatism. *Isr J Ecol Evol* 54:295–309.

32. Holt R (2003) On the evolutionary ecology of species ranges. *Evol Ecol Res* 5:159–178.

33. Mortier F, Jacob S, Vandegehuchte M, Bonte D (2018) Habitat choice stabilizes meta-population dynamics through increased ecological specialisation. *bioRxiv:10.1101/267575*.

34. Rosenzweig ML (1987) Habitat selection as a source of biological diversity. *Evol Ecol* 1:315–330.

35. Brown S, Pavlovic N (1992) Evolution in heterogeneous environments: Effects of migration on habitat specialization. *Evol Ecol* 6:360–382.

36. Jessup CM, et al. (2004) Big questions, small worlds: Microbial model systems in ecology. *Trends Ecol Evol* 19:189–197.

37. Altermatt F, et al. (2015) Big answers from small worlds: A user's guide for protist microcosms as a model system in ecology and evolution. *Methods Ecol Evol* 6:218–231.

38. Bestion E, Clobert J, Cote J (2015) Dispersal response to climate change: Scaling down to intraspecific variation. *Ecol Lett* 18:1226–1233.

39. Clobert J, Le Galliard J-F, Cote J, Meylan S, Massot M (2009) Informed dispersal, heterogeneity in animal dispersal syndromes and the dynamics of spatially structured populations. *Ecol Lett* 12:197–209.

40. Ravigné V, Dieckmann U, Olivieri I (2009) Live where you thrive: Joint evolution of habitat choice and local adaptation facilitates specialization and promotes diversity. *Am Nat* 174:E141–E169.

41. Edelaar P, Bolnick DI (2012) Non-random gene flow: An underappreciated force in evolution and ecology. *Trends Ecol Evol* 27:659–665.

42. Scheiner SM (2016) Habitat choice and temporal variation alter the balance between adaptation by genetic differentiation, a jack-of-all-trades strategy, and phenotypic plasticity. *Am Nat* 187:633–646.

43. Edelaar P, Jovani R, Gomez-Mestre I (2017) Should I change or should I go? Phenotypic plasticity and matching habitat choice in the adaptation to environmental heterogeneity. *Am Nat* 190:506–520.

44. Schmidt KA, Earnhardt JM, Brown JS, Holt RD (2000) Habitat selection under temporal heterogeneity: Exorcing the ghost of competition past. *Ecology* 81:2622–2630.

45. Abrams PA (2006) The prerequisites for and likelihood of generalist-specialist coexistence. *Am Nat* 167:329–342.

46. Bohn T, Amundsen P (2001) The competitive edge of an invading specialist. *Ecology* 82:2150–2163.

47. Wolf JB, Brodie III ED, Moore AJ (1999) Interacting phenotypes and the evolutionary process. II. Selection resulting from social interactions. *Am Nat* 153:254–266.

48. Abrams PA (2010) Implications of flexible foraging for interspecific interactions: Lessons from simple models. *Funct Ecol* 24:7–17.

49. Rahmstorf S, Coumou D (2011) Increase of extreme events in a warming world. *Proc Natl Acad Sci USA* 108:17905–17909.

50. Coumou D, Rahmstorf S (2012) A decade of weather extremes. *Nat Clim Change* 2:491–496.

51. Binckley CA, Resetarits WJ, Jr (2005) Habitat selection determines abundance, richness and species composition of beetles in aquatic communities. *Biol Lett* 1:370–374.

52. Resetarits WJ, Jr, Binckley CA (2009) Spatial contaction of predation risk affects colonization dynamics in experimental aquatic landscapes. *Ecology* 90:869–876.

53. Akcali CK, Porter CK (2017) Comment on Van Belleghem et al. 2016: Habitat choice mechanisms in speciation and other forms of diversification. *Evolution* 71:2754–2761.

54. Jaenike J, Holt R (1991) Genetic variation for habitat preference: Evidence and explanations. *Am Nat* 137:67–90.

55. Legrand D, et al. (2015) Ranking the ecological causes of dispersal in a butterfly. *Ecography* 38:822–831.

56. Jacob S, Chaine AS, Schtickzelle N, Huet M, Clobert J (2015) Social information from immigrants: Multiple immigrant-based sources of information for dispersal decisions in a ciliate. *J Anim Ecol* 84:1373–1383.

57. Pennekamp F, Clobert J, Schtickzelle N (2018) The interplay between movement, dispersal and morphology in Tetrahymena ciliates. *PeerJ Prepr* 6:e26540v1.

58. Pennekamp F, Mitchell KA, Chaine A, Schtickzelle N (2014) Dispersal propensity in Tetrahymena thermophila ciliates-A reaction norm perspective. *Evolution* 68:2319–2330.

59. Jacob S, Clobert J, Legrand D, Schtickzelle N, Chaine A (2016) Social information in cooperation and dispersal in Tetrahymena. *Biocommunication of Ciliates*, eds Witzany G, Nowacki M (Springer, Zurich), pp 235–252.

60. Dall SR, Giraldeau LA, Olsson O, McNamara JM, Stephens DW (2005) Information and its use by animals in evolutionary ecology. *Trends Ecol Evol* 20:187–193.

61. Miner BG, Sultan SE, Morgan SG, Padilla DK, Relyea RA (2005) Ecological consequences of phenotypic plasticity. *Trends Ecol Evol* 20:685–692.

62. Violle C, et al. (2012) The return of the variance: Intraspecific variability in community ecology. *Trends Ecol Evol* 27:244–252.

63. Gilbert J, Dell A, DeLong J, Pawar S (2015) Scaling-up trait variation from individuals to ecosystems. *Adv Ecol Res* 52:1–17.

64. Legrand D, et al. (2017) Eco-evolutionary dynamics in fragmented landscapes. *Ecography* 40:9–25.

65. Collins K (2012) *Tetrahymena Thermophila* (Elsevier, New York).

66. Zufall RA, Dimond KL, Doerder FP (2013) Restricted distribution and limited gene flow in the model ciliate *Tetrahymena thermophila*. *Mol Ecol* 22:1081–1091.

67. Pennekamp F (2014) Swimming with ciliates-dispersal and movement ecology of Tetrahymena thermophila. PhD dissertation (Université Catholique de Louvain, Louvain-la-Neuve, Belgium).

68. Hastie T, Tibshirani R (2010) Generalized additive models. *Stat Sci* 1:297–310.

69. Oksanen J, Minchin P (2002) Continuum theory revisited: What shape are species responses along ecological gradients? *Ecol Modell* 157:119–129.

70. Bertrand R, Gégout J, Bontemps J (2011) Niches of temperate tree species converge towards nutrient-richer conditions over ontogeny. *Oikos* 120:1479–1488.

71. Chaine AS, Schtickzelle N, Polard T, Huet M, Clobert J (2010) Kin-based recognition and social aggregation in a ciliate. *Evolution* 64:1290–1300.

72. Schtickzelle N, Fjerdingstad EJ, Chaine A, Clobert J (2009) Cooperative social clusters are not destroyed by dispersal in a ciliate. *BMC Evol Biol* 9:251.

73. Pennekamp F, Schtickzelle N (2013) Implementing image analysis in laboratory-based experimental systems for ecology and evolution: A hands-on guide. *Methods Ecol Evol* 4:483–492.

74. Jacob S, et al. (2016) Cooperation-mediated plasticity in dispersal and colonization. *Evolution* 70:2336–2345.

75. Nimon K, Lewis M, Kane R, Haynes RM (2008) An R package to compute commonality coefficients in the multiple regression case: An introduction to the package and a practical example. *Behav Res Methods* 40:457–466.

76. Ray-Mukherjee J, et al. (2014) Using commonality analysis in multiple regressions: A tool to decompose regression effects in the face of multicollinearity. *Methods Ecol Evol* 5:320–328.

77. Egas M, Dieckmann U, Sabelis MW (2004) Evolution restricts the coexistence of specialists and generalists: The role of trade-off structure. *Am Nat* 163:518–531.