Thermal tolerance and preference are both consistent with the clinal distribution of house fly proto-Y chromosomes

Selection pressures can vary within localized areas and across massive geographical scales. Temperature is one of the best studied ecologically variable abiotic factors that can affect selection pressures across multiple spatial scales. Organisms rely on physiological (thermal tolerance) and behavioral (thermal preference) mechanisms to thermoregulate in response to environmental temperature. In addition, spatial heterogeneity in temperatures can select for local adaptation in thermal tolerance, thermal preference, or both. However, the concordance between thermal tolerance and preference across genotypes and sexes within species and across populations is greatly understudied. The house fly, Musca domestica, is a well-suited system to examine how genotype and environment interact to affect thermal tolerance and preference. Across multiple continents, house fly males from higher latitudes tend to carry the male-determining gene on the Y chromosome, whereas those from lower latitudes usually have the male-determiner on the third chromosome. We tested whether these two male-determining chromosomes differentially affect thermal tolerance and preference as predicted by their geographical distributions. We identify effects of genotype and developmental temperature on male thermal tolerance and preference that are concordant with the natural distributions of the chromosomes, suggesting that temperature variation across the species range contributes to the maintenance of the polymorphism. In contrast, female thermal preference is bimodal and largely independent of congener male genotypes. These sexually dimorphic thermal preferences suggest that temperature-dependent mating dynamics within populations could further affect the distribution of the two chromosomes. Together, the differences in thermal tolerance and preference across sexes and male genotypes suggest that different selection pressures may affect the frequencies of the male-determining chromosomes across different spatial scales. Impact Statement Genetic variation within species can be maintained by environmental factors that vary across the species’ range, creating clinal distributions of alleles responsible for ecologically important traits. Some of the best examples of clinal distributions come from temperature-dependent phenotypes, such as thermal tolerance and preference. Although genotype and developmental temperature strongly affect physiological and behavioral traits in ectotherms, the correlation between these traits across genotypes and sexes within species is greatly understudied. We show that two different male-determining chromosomes found in natural populations of house flies affect both thermal tolerance and preference in a way that is concordant with their clinal distributions across latitudes. This provides strong evidence that temperature variation across the species range contributes to the maintenance of the polymorphism. Furthermore, we find evidence that thermal preference is sexually dimorphic, suggesting that temperature-dependent mating dynamics could further affect the distribution of genetic variation in this system. Therefore, at a macro-geographical scale, the differences in thermal tolerance and preference across male genotypes likely contributes to the maintenance of the cline. Within populations, differences in thermal preference likely affect sexual selection dynamics, which may further affect the frequencies of the chromosomes.

examine how genotype and environment interact to affect thermal tolerance and preference. 23 Across multiple continents, house fly males from higher latitudes tend to carry the male-24 determining gene on the Y chromosome, whereas those from lower latitudes usually have the 25 male-determiner on the third chromosome. We tested whether these two male-determining 26 chromosomes differentially affect thermal tolerance and preference as predicted by their 27 geographical distributions. We identify effects of genotype and developmental temperature on 28 male thermal tolerance and preference that are concordant with the natural distributions of the 29 chromosomes, suggesting that temperature variation across the species range contributes to the 30 maintenance of the polymorphism. In contrast, female thermal preference is bimodal and largely 31 independent of congener male genotypes. These sexually dimorphic thermal preferences suggest 32 that temperature-dependent mating dynamics within populations could further affect the 33 distribution of the two chromosomes. Together, the differences in thermal tolerance and 34 preference across sexes and male genotypes suggest that different selection pressures may affect 35 the frequencies of the male-determining chromosomes across different spatial scales. 36 Introduction 8 Thermal preference 165 We measured thermal preference as the position of individual flies along a 17-37°C 166 thermal gradient ( Figure S1), following a slightly modified version of previous protocols 167 (Anderson et al., 2013;Lynch et al., 2018). For each individual fly, we report mean thermal 168 preference (Tpref) as the average position during a 10 minute assay window (measured once per 169 minute). We also report thermal breadth, Tbreadth (Carrascal et al., 2016), as the coefficient of 170 variation of individual-level Tpref during the assay window. Tbreadth provides an estimate of how 171 individuals utilize thermal space within their environment (Slatyer et al., 2013). Choosier 172 individuals show a lower Tbreadth value and, thus, would be expected to occupy a narrower range 173 of temperatures within a given thermal habitat. 174 To determine the effects of developmental temperature (18°C, 22°C, and 29°C), genotype 175 (Y M and III M ), and their interaction on mean Tpref across sexes, we created a mixed-effects model 176 using the lme4 package (v1.1) in R (Bates et al., 2015). Developmental temperature, genotype, 177 and their interaction were included as fixed effects, and strain, batch, and lane in the thermal 178 gradient (L) were included as random effects: 179 Tpref ~ G + T + G×T + B + S + L. 180 We did the same for Tbreadth. We then determined whether groups significantly differed in Tpref or 181 Tbreadth using Tukey contrasts with the multcomp package (v1.4) in R (Hothorn et al., 2008). 182 Within developmental temperature treatments, we used Bayesian information criterion (BIC) 183 scores from the mclust (v5.4.5) package in R (Scrucca et al., 2016) to determine whether the 184 distribution of individual measures of Tpref within a group are best explained by one or multiple 185 normal distributions. 186

Results 187
Thermal tolerance depends on developmental temperature and male genotype 188 We measured extreme heat (53°C) and cold (4°C) tolerance as a readout of differences in 189 physiological thermal adaptation between Y M and III M house fly males. We observed the 190 expected effect of acclimation on both heat and cold tolerance (Chown & Terblanche, 2006): flies 191 raised at 18°C tolerate cold longer than the flies raised at 29°C, and flies raised at 29°C tolerate 192 heat longer than flies raised at 18°C (Figure 1). We also find that Y M males are more cold 193 tolerant, and III M males are more heat tolerant, consistent with the latitudinal distributions of Y M 194 and III M males in nature (Tomita & Wada, 1989;Hamm et al., 2005;Feldmeyer et al., 2008;195 Kozielska et al., 2008). However, the effect of genotype on thermal tolerance depends on 196 acclimation temperature. Specifically, a linear model with an interaction between genotype (Y M 197 or III M ) and developmental temperature fits the cold tolerance data significantly better than a 198 model without the interaction term (χ²1 = 19.3, p = 1.1 x 10 -5 ). This provides evidence for a G×T 199 effect on cold tolerance-Y M males are more cold tolerant than III M males, but only if they are 200 raised at 18°C ( Figure 1B). There is also a significant G×T interaction affecting heat tolerance 201 (χ²1 = 4.71, p = 0.030 comparing models with and without the interaction term): III M males are 202 more heat tolerant than Y M males, but only if raised at 29°C ( Figure 1D We next attempted to identify a threshold temperature for the genotype-specific benefits 213 of acclimation by comparing heat and cold tolerance of flies raised at 22°C and 29°C (instead of 214 18°C and 29°C). We did not observe a significant effect of the interaction between developmental 215 temperature and male genotype on extreme cold tolerance (χ²1 = 0.947, p = 0.331 comparing 216 models with and without an interaction term) ( Figure S2). We therefore hypothesize that there is 217 a threshold temperature between 18°C and 22°C, below which Y M males experience a greater 218 11 benefit of cold acclimation than III M males. In contrast, there is a significant interaction between 219 genotype and developmental temperature on heat tolerance when comparing males raised at 22°C 220 and 29°C (χ²1 = 11.02, p = 9.0 x 10 -4 comparing models with and without the interaction term) 221 ( Figure S2). Therefore, the threshold for a genotype-specific benefit from heat acclimation lies 222 between 22°C and 29°C. 223 We do not expect any difference in heat or cold tolerance across females from our 224 different strains because all females have the same genotype, regardless of the male genotype in 225 the strain. Indeed, a model with an interaction between developmental temperature and male 226 genotype does not fit the female cold tolerance data better than a model without the interaction 227 term (χ²1 = 1.46, p = 0.23) ( Figure 1C). There is a significant effect of developmental temperature 228 on cold tolerance in females (χ²1 = 43.5, p = 4.3 x 10 -11 comparing a model with and without 229 developmental temperature), demonstrating that females benefit from cold acclimation regardless 230 of male genotype ( Figure 1C). Surprisingly, there is a significant interaction between male 231 genotype and developmental temperature on heat tolerance in females (χ²1 = 10.4, p = 0.0013 232 comparing a model with and without the interaction term). In general, females raised at warmer 233 temperatures are more heat tolerant ( Figure 1E). However, the interaction of male genotype and 234 developmental temperature is in the opposite direction from what would be expected based on the 235 latitudinal distribution of Y M and III M : females from strains with Y M males that are raised at 29°C 236 are more heat tolerant than females from III M strains raised at 29°C ( Figure 1E). We thus 237 conclude that the heat and cold tolerance differences between Y M and III M males are specific to 238 males and/or the proto-Y chromosomes (i.e., not genetic background) because we do not observe 239 the same heat or cold tolerance differences in females from those strains (who do not carry the 240 proto-Y chromosomes).

Thermal preference depends on developmental temperature and male genotype 250
We next tested if genotype and developmental temperature affect thermal preference 251 (Tpref). First, we find that Tpref is inversely proportional to developmental temperature (  Table S1 for statistics). This 293 bimodal distribution is not a result of differences across strains because the same pattern was 294 observed among females separately analyzed based on male genotype ( Figure S4) Figure 3A). Similarly, the mean Tpref of F W females (32.2°C) is near the 306 mode of the Tpref of III M males (32.0-32.5°C; Figure 3A). 307 We further find that Tpref is predictive of Tbreadth for flies that develop at 22°C. We 308 considered flies from our four Tpref groups (Y M males, III M males, F C females, and F W females), 309 and we found a significant effect of group on Tbreadth (F3, 32.9 = 9.40, p = 1.24 x 10 -4 ). Specifically, 310 F C females have significantly greater Tbreadth than all other groups (Tukey's post hoc test, all p < 311 1.0 x 10 -5 , Figure 3B). Therefore, if we consider Tbreadth as a measure of the strength of Tpref, adult 312 house flies can be summarized by one of three phenotypes related to thermal behavior when 313 developed at 22°C: a relatively strong preference for warm temperatures (III M males and F W 314 females, which have high Tpref and low Tbreadth), a strong preference for cooler temperatures (Y M 315 males, with low Tpref and low Tbreadth), and a relatively weak preference for cooler temperatures 316 predicted by male genotype provides evidence that these traits are responsive to selection, 330 suggesting any Bogert effects are not sufficient to overwhelm thermal adaptation. These 331 differences in thermal tolerance and preference in males depend on developmental temperature, 332 and they are not observed in congener females from the same strains (who do not carry the Y M or 333 III M chromosome). However, females exhibit a bimodal Tpref, with females from each of the two 334 subgroups overlapping with one of the male genotypes. 335

Thermal tolerance and preference depend on developmental temperature, genotype, and sex 336
Our results demonstrate, to the best of our knowledge, the first documented example of 337 concordant temperature preference, cold tolerance, and heat tolerance across genotypes within a 338 species. We find that Y M males both have greater cold tolerance and prefer colder temperatures, 339 whereas III M males have greater heat tolerance and prefer warmer temperatures (Figures 1 and 2), 340 consistent with their latitudinal distributions (Tomita & Wada, 1989;Hamm et al., 2005;341 Feldmeyer et al., 2008;Kozielska et al., 2008). Previous work has identified concordant Tpref and 342 heat tolerance differences across species (Qu et al., 2011), or found no clear relationship between 343 thermal tolerance and preference across genotypes within species (Yang et al., 2008;Rego et al., 344 2010;Castañeda et al., 2019). Body size is also predicted to vary with thermal traits (Leiva et al.,345 2019). In our study, we did not measure insect body size. While we did not observe any obvious 346 differences between strains, it is possible that some of the genotypic effect on thermal tolerance 347 or preference we observed is due to (temperature-dependent) morphological differences between 348 Y M and III M males. Future studies should directly test this hypothesis. 349 We observed strong effects of developmental temperature on both thermal tolerance and 350 preference that depend on both genotype and sex. Acclimation effects on heat and cold tolerance 351 We identify multiple differences between males and females in their thermal tolerance 383 and preferences. The strain differences we observed are primarily limited to males, which is 384 expected because the males differ in genotypes (Y M and III M ) but females are isogenic (Meisel et 385 al., 2015). However, there is a difference in heat tolerance between females from strains with Y M 386 males and females from strains with III M males (Figure 1). While we can rule out certain 387 genotypic explanations for this difference (i.e., all females are isogenic and do not carry Md-388 tra D ), we do not yet have a mechanistic explanation on why females show the opposite 389 developmental heat tolerance from males. Nevertheless, the difference in heat tolerance observed 390 between females from different strains is in the opposite direction as between Y M and III M males 391 from those strains. This helps us to conclude that differences between Y M and III M males are 392 indeed a result of different proto-Y chromosomes rather than their genetic backgrounds. In other 393 words, the difference in heat tolerance between females is an exception that proves the rule with 394 respect to the effects of proto-Y chromosomes on male thermal tolerance and preference. 395 We identified a female-specific plasticity for thermal preference that does not map to male 396 genotype. In females, we found that neither thermal tolerance nor thermal preference differ 397 predictably between strains where males carry different proto-Y chromosomes ( Figures 1C, E and  398 2B). However, there is a bimodal thermal preference for females that develop at 22℃ (Figure  399 3A), regardless of congener male genotype. In addition, females that had colder Tpref when 400 developed at 22°C also had a larger Tbreadth ( Figure 3B). In small ectotherms with little thermal 401 inertia, measures of movement along a thermal gradient (such as Tbreadth) are predicted to be 402 positively correlated with environmental temperature (Anderson et al., 2007). However, we 403 observe the opposite relationship between mean environmental temperature (Tpref) and Tbreadth in 404 females (Figure 3), suggesting that the difference in Tbreadth cannot be explained by thermal 405 inertia. Our results suggest that, in nature, females with colder temperature preferences may 406 occupy a wider range of temperatures than females with warmer temperature preferences. 407 Because all females in our experiment are expected to have the same genotype, we hypothesize 408 that these differences in Tpref and Tbreadth are conferred by a plastic response to some yet to be 409 20 characterized factor (e.g., microclimates within larval rearing containers). Alternatively, this 410 plasticity could have a stochastic origin that is intrinsic to the development of thermal preference 411 (Honegger & de Bivort, 2018;Jensen, 2018). 412 The correlation between thermal preference and thermal breadth at 22℃ is female-413 specific: Y M and III M males have similar Tbreadth values when raised at 22℃ despite their 414 differences in Tpref. Although general sex differences in thermal tolerance (Hoffmann et al. 2005) 415 and thermal preference (Krstevska and Hoffmann 1994) have been documented, this is the first 416 study, to our knowledge, to identify sex differences in the relationship between thermal 417 preference and thermal breadth. Our results suggest that male and female house flies exhibit 418 different thermoregulatory behavioral patterns which may further be influenced by genotype. 419 Directly identifying a sex-by-genotype-by-environment interaction is beyond the scope of this 420 study because sex and genotype are confounded in our experimental design (the females in our 421 experiment have a different genotype from either male, characterized by a lack of either the III M 422 or Y M chromosome). Nonetheless, the house fly is a tractable system for directly testing for sex- However, these fitness differences can only explain the invasion or fixation of the III M 445 chromosome, not the maintenance of the polymorphism. In contrast, differences in thermal 446 tolerance and preference could maintain proto-Y chromosome polymorphism across the species' 447 range, similar to how selection maintains other clinal variation (Slatkin, 1973;Endler, 1977). KA analyzed, all thermal tolerance data. PD, RP, JT, and AM collected, and PD analyzed, all 515 thermal preference data. PD, KA, and RM wrote the manuscript, and all authors reviewed the 516 manuscript prior to submission. 517

Data Accessibility 518
All data files used for analyses described in this manuscript have been deposited in Dryad 519 (doi:10.5061/dryad.n2z34tmvs). Raw video and image files from thermal preference assays are 520 available from the authors upon request. 521 522