VARIATION IN THERMOREGULATION AND LINKING WHOLE ORGANISM BEHAVIOR TO THERMOSENSORY NEUROPHYSIOLOGY IN THE , CINCTIPES

A thesis submitted to the faculty of San Francisco State University ^ < In partial fulfillment of the requirements for the Degree

< 2 o n * 0 Master of Science

. L 3 G In

Biology: Marine Science

by

Emily Kathryn Lam

San Francisco, California

Fall 2017 Copyright by Emily Kathryn Lam 2017 CERTIFICATION OF APPROVAL

I certify that I have read Variation in Thermoregulation and Linking Whole Organism

Behavior to Thermosensory Neurophysiology in the Porcelain Crab, Petrolisthes cinctipes by Emily Kathryn Lam, and that in my opinion this work meets the criteria for approving a thesis submitted in partial fulfillment of the requirement for the degree

Master of Science in Biology: Marine Science at San Francisco State University.

Jonathon Stillman, Ph.D. Profes

Robyn Croiok, Ph.D. Assistant Professor of Biology

Andrew Zink, Ph.D. Associate Professor of Biology VARIATION IN THERMOREGULATION AND LINKING WHOLE ORGANISM BEHAVIOR TO THERMOSENSORY NEUROPHYSIOLOGY IN THE PORCELAIN CRAB, PETROLISTHES CINCTIPES

Emily Kathryn Lam San Francisco, California 2017

Small-scale shifts in species distributions are expected to occur under future climate for many species. These shifts can have consequences as they alter population dynamics, and it is important to understand when and why they occur. The intertidal porcelain crab Petrolisthes cinctipes currently experiences temperatures that can reach near-lethal levels at low tide. However, the thermal thresholds that trigger migration to cooler microhabitats and the extent to which crabs move in response to temperature remain unknown. We tested for effects of body size and reproductive state on escape temperature

( T e s c ). In addition, we tested for the relationship between T eSc and the temperature of peak action potential firing frequency in nerve fibers. We found that both size and reproductive state influence behavioral sensitivity to temperature. Small crabs tolerate significantly higher temperatures before they move to cool refuges (a higher T eSc ) compared to large crabs. In addition, non-gravid crabs have significantly higher T eSc than gravid females. Tesc is positively correlated with peak neural performance of spontaneous action potentials. The vulnerability of marine organisms to global change is predicated by their ability to utilize and integrate physiological and behavioral strategies as a response to temperature, in order to maximize survival and reproductive fitness; understanding these strategies will allow predictions of species distributions under warming.

I certify tha '' 1 ' ' ‘ ‘ ** intent of this thesis

Chair, Thes Date ACKNOWLEDGEMENTS

I would like to thank Dr. Jonathon Stillman for the opportunity to work in his lab and contribute to the field of biology. Thank you for your mentorship, guidance and friendship. I would like to acknowledge my committee members, Robyn Crook and

Andrew Zink, for their expertise and thoughtful suggestions. I had endless valuable conversations with Dr. Alex Gunderson in the planning and execution of this project.

Thank you for your leadership and insight. Technical expertise was provided by Adam

Paganini, thank you for your advice, training and help in developing methods. I would like to thank all members of the Stillman Lab for their kindness and companionship. I am grateful to Richelle Tanner, Emily King, Metadel Abegz and Eric Armstrong for helpful comments, discussions and assistance with data analysis. Thanks to Kayley You Mak for collaborating on heart rate and initial escape experiments. Thank you to our collaborators in Dr. Brian Tsukamura’s lab. This work was supported by the National Science

Foundation. Many thanks to the members of the RTC staff and faculty. Finally, thanks to my family for all of their love and support. TABLE OF CONTENTS

List of Table...... viii

List of Figures...... ix

List of Appendices...... x

1.0 Introduction...... 1

2.0 Methods...... 7

2.1 Porcelain crab collection and maintenance...... 7

2.2 Thermal tolerance in Cardiac CT max ...... 7

2.3 Thermal preference...... 8

2.4 Thermal escape behavior...... 9

2.5 Thermal escape behavior: size-dependent thermal sensitivity ...... 10

2.6 Thermal escape behavior: thermal sensitivity after thermal acclimation 10

2.7 Thermal escape behavior: thermal sensitivity to gravid state...... 11

2.8 Thermosensory behavior...... 12

2.9 Neural thermal performance...... 13

2.10 Statistical Analyses...... 15

3.0 Results...... 16

3.1 Thermal tolerance in Cardiac CTmax...... 16

3.2 Thermal preference...... 16

3.3 Thermal escape behavior...... 16 TABLE OF CONTENTS CONTINUED

3.4 Thermal escape behavior: size-dependent thermal sensitivity...... 17

3.5 Thermal escape behavior: thermal sensitivity after thermal acclimation...... 17

3.6 Thermal escape behavior: thermal sensitivity to gravid state...... 18

3.7 Thermosensory behavior...... 18

3.8 Neural thermal performance...... 18

4.0 Discussion...... 20

4.1 Thermal tolerance in Cardiac CTmax...... 20

4.2 Thermal preference...... 21

4.3 Thermal escape behavior...... 22

4.4 Thermal escape behavior: size-dependent thermal sensitivity ...... 23

4.5 Thermal escape behavior: thermal sensitivity after thermal acclimation...... 24

4.6 Thermal escape behavior: thermal sensitivity to gravid state...... 26

4.7 Thermosensory behavior...... 27

4.8 Neural thermal performance...... 28

References...... 49

Appendices...... 55 LIST OF TABLES

Table Page

1. Table 1...... 35 2. Table 2...... 37 3. Table 3...... 40 4. Table 4 ...... 41 5. Table 5...... 44 6. Table 6...... 47

viii LIST OF FIGURES

Figures Page

1. Figure 1...... 30 2. Figure 2 ...... 31 3. Figure!...... 32 4. Figure4...... 34 5. Figure 5...... 36 6. Figure 6...... 38 7. Figure 7...... 39 8. Figure 8...... 42 9. Figure 9 ...... 43 10. Figure 10...... 45 11. Figure 11...... 46 12. Figure 12...... 48

ix LIST OF APPENDICES

Appendix Page

1. R-Scrips 55

x 1

1.0 Introduction

Organisms are facing increasing levels of stress due to human-mediated environmental change (Schulte et.al, 2011). One of the most important stressors is elevated temperature, which affects organisms at all levels of biological organization

(Huey et al., 2012). Sustained rapid warming is expected to constrain viable habitats and shift species dynamics ((IPCC)Houghton, 1995). One of the most well-documented response to warming is large scale shifts in species’ distributions (Parmesan et al., 1999).

For example, while many sessile marine ectotherms are experiencing an expansion in their poleward range boundaries and a reduction in their equatorward boundaries at the population level, mobile marine organisms may behaviorally thermoregulate to avoid critical temperatures by moving to cooler localized environments which may offset latitudinal shifts (Sunday et. al., 2012). These localized, small-scale distribution shifts occur along highly stratified environments where temperature extremes are highly variable over short distances and thermal refuge can be attained by moving between microhabitats (Levy, 1998; Nakamura, 1976; Kearney et al., 2009). The extent to which behavioral thermoregulation can mitigate latitudinal range shifts is unknown but heterogeneous environments provide greater buffering capacity (Huey et al., 2009).

The rocky intertidal zone is a thermally dynamic habitat in which temperature strongly influences population structure as species are tightly constrained by their physiological limits (Evans, 1948). Organisms are typically distributed in narrow vertical bands along the intertidal thermal gradient, where it is possible to observe small-scale distributional shifts between microhabitats of each species in response to temperature 2 fluctuations (Connell, 1961; Somero, 2010). inhabiting the high-intertidal zone, where they experience longer, more frequent exposure to extreme temperature, typically live at the upper edge of their thermal tolerance limits (Helmuth et al., 2006). These organisms also appear to have limited physiological plasticity to cope with increased warming (Stillman, 2003), such that they are forced to move down to the cooler and more stable low-intertidal zone (Stillman & Somero, 2000). As temperatures rise, shifting to cooler microhabitats could allow intertidal organisms to remain within a physiologically optimal range at a given latitude, opposed to exhibiting large latitudinal shifts to combat warming. Understanding the physiological and behavioral mechanisms that promote distributional shifts can help us to predict what species will move and in what direction and magnitude.

In marine species, smaller individuals often survive at higher temperatures than larger individuals and higher proportions of small species are found in warm environments (Daufresne et al., 2009; Peck et al., 2009). Populations with a higher frequency of small adults may result in mean overall reduced fitness of individuals, as larger body size is associated with higher fitness because larger animals can produce and brood more offspring (Kingsolver & Huey, 2008). Body size and temperature also influence metabolism, the process by which energy is transformed to materials that sustain life, where biological rate processes scale with 3A power body size and temperature exponentially affects metabolic rates due to the kinetic effects on biochemical reactions (Gillooly, 2001; Kleiber, 1932). Large organisms with a higher basal metabolic rates have higher total oxygen demands under thermal stress, and may be less likely to tolerate increased warming (Somero, 2010). In the rocky intertidal crab

Pachygrapsus marmoratus, small individuals are found in warmer environments and have higher critical thermal maximum (CTmax) and higher heat shock protein (Hsp70) induction than their large counterparts, indicating that heat tolerance is negatively size- dependent in (Madeira, 2012). This size-dependence of temperature stress may have unforeseen ecological consequences and it is unclear to what extent organisms will be able to compensate for changes, either physiologically or behaviorally.

Phenotypic plasticity of thermal performance allows organisms to cope with environmental variation (Lachenicht et al. 2010). Thermal acclimatization is a possible response to prevent mortality by physiologically buffering individuals near their thermal

limit (Gunderson & Stillman, 2015). However, physiological compensation is biochemically constrained (Seebacher et al., 2015). At some point, as a result of warming temperatures, animals will have to move and knowing when to move may be key to

successful mitigation. Behavioral plasticity may allow organisms to overcome the effects

of changes in temperature by migrating to different microhabitats (Chelini et. al, 2011;

Gibert et al., 2016). Organisms living in thermally challenging environments, where temperatures may become more precipitous, must respond with more careful thermoregulation in order to escape near lethal temperatures (Lagerspetz & Vainio,

2006). Heat escape behavior is significantly influenced by thermal history in aphids (Ma,

2012) and examining how organisms will behaviorally respond when exposed to different

temperatures is crucial in understanding how organisms may counter the effects of a

warming climate. Thermal sensitivity and the subsequent behavioral responses can vary in an organism across different stages of the life cycle (Angilletta, 2009). One major life- history stage that seems to influence temperature-dependent behavior in females is gravidity or egg bearing (Cree & Hare, 2016). In Brachyuran crabs, the high cost of maintaining embryos lowers energy reserves. As a consequence, gravid female crabs are more thermally constrained than non-gravid females (Fernandez et.al., 2000), which likely has an impact on their behavior. When females of the lizard Podarics muralis become gravid, thermoregulatory behavioral changes are observed that result in reduced body temperature and reduced distance to refuge (Brana, 1993). It is unclear as to the precise mechanism that causes such behavioral shifts although there is some evidence that suggests it could be either mechanical, hormonal or a combination of both. When female lobsters become gravid, they develop aggressive behavior. When the brood is mechanically removed these lobsters revert back to non-aggressive behavior (Figler et al.,

2004). Additionally, changes in sex hormones can have a dramatic effect on behavior, physiology and morphology. For example, the androgenic gland (AG) is responsible for sexual differentiation in crustaceans which is evident as males that undergo ablation AG become feminized and females that undergo AG implantation become masculinized. In both cases, mating/agnostic behavior, development of secondary sexual characteristics, and reproductive ability are completely reversed (Barki et al., 2006; Karplus, 2003).

Thus, there is evidence that changes in hormone secretion in early stages of development lead to a complete reorganization of the neural circuits in sensory, central, or motor pathways that are responsible for sexually dimorphic behaviors (Barki et al., 2006). This 5 suggests that sex hormones associated with gravid state or brood presence may be responsible for changes in physiological thermal sensitivity and behavioral responses.

Organisms remain within a thermally optimum range by eliciting escape reflexes to avoid thermal stress (Lagerspetz & Vainio, 2006). Many decapod crustaceans have nerve fibers that coordinate escape reflexes and single neurons can command specific behavioral patterns in response to normal input (Edwards et al., 1999; Weirsma, 1946).

While certain neurons may be responsible for thermal sensitivity and behavioral thresholds in crustaceans, relevant neurophysiological data on specific thermoreceptors in crustaceans is lacking (Lagerspetz, 1973; Lagerspetz & Vainio, 2006). In lobsters, neurons change their rate of firing when exposed to different temperatures but it is unclear if they trigger thermally driven behaviors (Konishi & Kravitz, 1978).

Additionally, nervous tissues are highly temperature dependent and neuronal firing is impaired at critical temperatures (Miller and Stillman, 2012). By examining changes in neural and behavioral processes in response to thermal stimuli, it may be possible to determine relevant thresholds for predicting how organisms will respond to climate change.

The anomuran porcelain crab, Petrolisthes cinctipes inhabits the rocky coasts along the Northeastern Pacific from British Columbia to Southern California within the mid to high intertidal zone. This species experiences varying periods of emersion that strongly influence the temperatures that individuals experience (Jensen & Armstrong,

1991; Stillman & Somero, 1996). Reproductive adults range in body size (carapace width) from 5-20 mm where larger crabs are often competitively dominant and have 6 increased fecundity (Donahue, 2004). When acclimated to different temperatures, P. cinctipes exhibits plastic shifts in their thermal tolerance limits for neural and cardiac performance where higher acclimation temperatures increased tolerance limits (Miller &

Stillman, 2012; Stillman & Somero, 2000; Stillman, 2002). Gravid female crabs have extruded their broods and maintain them under their abdomen until the embryos hatch as larvae (Lardies et al., 2004). P. cinctipes currently live at the upper limit of their physiological thermal range where they have limited ability to buffer against increasing temperature (Stillman & Somero, 2000) and must either acclimatize and/or behaviorally thermoregulate to avoid overheating (McGaw, 2003).

This study assessed the behavioral and physiological responses of P. cinctipes to temperature and the extent to which variation in body size, acclimation and reproductive state influence thermal sensitivity and thermal tolerance. The main hypotheses were: (1) large individuals have a lower cardiac thermal tolerance (2) large individuals exhibit escape behavior at lower temperatures, (3) thermal acclimation to higher temperatures increases the threshold for escape behavior and (4) gravid females have a lower behavioral heat tolerance and should exhibit escape behavior at lower temperatures, and

(5) afferent neural thermal sensitivity correlates with escape temperatures for all categories (size and gravid). The goal of this research is to determine if demographic patterns could be explained by temperature sensitive behaviors. Furthermore, this study highlights the physiological pathways and neural mechanisms that may be responsible for shifts in species distributions under warming. 7

2.0 Methods

2.1 Porcelain crab collection and maintenance

Crab specimens were collected at Fort Ross State Park (38.5143°N,123.2438°W) and transported in coolers to the Romberg Tiburon Center for Environmental Studies in

Tiburon, CA on the same day. Specimens were held at a density of 82 crabs/m2 in a controlled 4,000L flow-through recirculating seawater system at an ambient lab temperature of 13 ± 0.5°C and of salinity 33 ± 3 ppt for 2-6 weeks. P. cinctipes can occur naturally in densities up to 3933 crabs/m2 (Jensen & Armstrong, 1991). Specimens were fed 1ml of a 1:10 dilution of Reed Mariculture Inc. Shellfish Diet approximately every 3 days.

2.2 Thermal tolerance in Cardiac CTmax

Cardiac break point temperature (BPT) was used as a proxy for thermal tolerance or critical thermal maximum (CTmax), per methods in Stillman, 2003. Heart rate was measured under a thermal ramp in male and female crabs (n=40) of different body sizes

(10-24mm carapace length). Methods for measuring thermal tolerance of heart rate are described in Stillman & Somero, 1996. The temperature was held at 12°C for 30 minutes, then increased 1°C every 10 minutes until 36°C. Following published protocol, cardiac

BPT was calculated as the intersection of the two lines fit to the ascending and descending portion of the heart rate thermal performance curve with heart rate and temperature adjusted to an Arrhenius scale (Stillman, 2003). 2.3 Thermal preference

Thermal preference behavior was measured by placing crabs in an aquatic thermal gradient and recording water temperature at the location of the crab (n=17) over time.

The gradient was established by placing two aluminum troughs (150cmx9cmx5cm) filled with seawater on a temperature controlled aluminum bar (200cmx20cm) with embedded copper tubing (outer 3/8”) attached with PVC (inner 3/8”) to a hot-water bath (55°C) on one end and cold-water bath (-15°C) on the other end. The gradient was established as the water baths ran for 12h and stabilized by insulating the aluminum bar and tubing with

Styrofoam. The gradient was maintained at 8-30°C across the 150cm bar. Surfaces on each lane were covered in grip tape (Jessup The Original®) for traction and light was diminished using by a red acrylic lid. Holes were drilled in the lid at intervals of 33cm and a T-type thermocouple with a digital thermometer (Omega model HH603A, type T) was used to record temperature at each interval. Crabs were placed in the thermal gradient bar in the 13°C region and were given 30 minutes to acclimate to the gradient and choose an initial temperature before preferred temperature measurements began.

Water temperature at the location of the crab, as an estimate of the crab’s body temperature, was recorded every fifteen minutes for three hours. Two outliers were removed where a crab stayed at the warm end and another at the cold end of the thermal gradient bar because they were not behaving normally. 9

2.4 Thermal escape behavior

Thermal escape temperature ( T eSc ) was measured as the temperature at which crabs voluntarily exit a temperature chamber during a thermal ramp. Two temperature chambers were constructed for these experiments, a temperature chamber for a single individual and a high throughput temperature chamber that held 6 individuals. The single temperature chamber was constructed using a petri dish (lOOmmxl 5mm) filled with aerated, filtered seawater nested in an aluminum block (15cmxl5cm) fitted with internal copper tubing (outer 3/8”) and connected to a water bath by flexible PVC (inner 3/8”).

The aluminum block and tubing were insulated and walking surfaces were covered in grip tape (Jessup The Original®). The chamber was covered by a ceramic plate elevated

4cm above the surface to provide shelter. Water temperature was monitored with a digital thermometer (Omega model HH603A, type T, sensitivity 0.1°C). T eSc was recorded as the water temperature at which the crab fully exited the petri dish. The high throughput escape chamber was developed using an insulated aluminum block

(36cmx23cm) with six small nested petri dishes (60mmxl5mm). Each dish was covered with a plastic lid to provide shelter and prevent disturbance and was filled with aerated seawater. Temperature was recorded using a multichannel thermocouple (Omega model

HH378, type K).

In both devices, crabs were placed in the dish at 13°C and were prevented from escaping with a blockade for 10 minutes. The blockade was then removed and the 10 temperature was ramped at 0.5°C per minute. When the crab exited the dish and all appendages were in contact with the grip tape surface constituted a true escape. Under control conditions, crabs were likewise held at the laboratory ambient temperature (13°C) for 10 minutes then allowed to escape from the dish while the temperature remained at ambient. Crabs that did not escape were removed after 30 minutes. This protocol was used for the three following escape behavior experiments.

2.5 Thermal escape behavior: size-dependent thermal sensitivity

The first experiment aimed to determine if thermal escape behavior is size- dependent in adult female and male crabs (n=16) of different body sizes (10-20mm carapace width). A select group of individuals were used as controls and escape behavior was assayed using the single temperature chamber where temperature was not ramped and was maintained at 13°C.

2.6 Thermal escape behavior: thermal sensitivity after thermal acclimation

In the second experiment, the effect of thermal acclimation history on escape temperature was examined in adult males. Males were acclimated to one of three temperatures, cold (8°C, n=9), ambient (13°C, n=8) or warm (17°C, n=7) for 2 weeks.

The crabs were brought to 13°C over 30 minutes and were then assayed individually.

Each crab was assayed under control conditions where they did not experience a thermal ramp. They were returned to acclimation tanks overnight and were then assayed under experimental conditions with a thermal ramp the following day. Each crab acted as a control for itself. 11

2.7 Thermal escape behavior: thermal sensitivity to gravid state

The third experiment aimed to determine if thermal escape behavior is different in gravid females (GF) and non-gravid crabs (NG). Gravid females with carapace width

(CW) 8mm-15mm (n=23) were assayed using the single temperature chamber where they experienced a thermal ramp and a select group of individuals were used as controls and experienced a stable temperature.

To parse out the potential mechanism for increased thermal sensitivity in gravid females, we tested whether physical brood presence or hemolymph injection had an effect on thermal escape behavior. Gravid female and non-gravid females (11mm-15mm

CW) were tagged with a unique identification number to differentiate each individual.

Thermal escape behavior was measured in gravid females (n=48) and non-gravid females

(n=26) using the high-throughput chamber. Each group was then divided into subgroups to examine the effects of brood removal and hemolymph injection. An additional group was assayed for neural thermal performance as described below (Fig 1).

The gravid females either had broods removed (n=6) or their broods were not removed as a control (n=l 1) at random. Broods were removed by manipulating the abdomen flap to expose the brood and the eggs were removed using a scoopula. In the sham manipulation, the crabs were handled and their abdomen flap was opened to expose the brood sac but broods were not removed. Crabs were given 5 days to recover before the second TeSc measurement.

In a different group of crabs, non-gravid females were injected with gravid female hemolymph (n=5), and another group was injected with non-gravid female hemolymph as 12 a control (n=5). Hemolymph of gravid or non-gravid females was extracted from the body between the right middle and posterior legs using a 27G x 1/2 syringe. The hemolymph was vortexed in a lmL microcentrifuge tube and lOOpL of hemolymph was drawn and immediately injected into non-gravid females underneath the carapace on the posterior end of the body. After injection, all individuals were held in coolers for one hour to allow for the hemolymph to circulate through the body before post injection TeSc was measured.

2.8 Thermosensory behavior

Next, I wanted to determine if individual variation in escape behaviors are related to neuronal function. I decided to test afferent neuron function in the walking legs, as these are the appendages that perform the escape. I first had to demonstrate that sensory neurons in the walking legs influence escape behavior. To do so, seawater of different temperatures was dropped on the left 3rd walking leg of gravid female crabs (n = 7) with a

27G x 1/2 syringe. Seawater of temperatures between 17-39°C, maintained in a thermal gradient, were dropped on the leg in approximately 1°C intervals. Water temperature was measured with a digital thermometer (Omega model HH603A, type T, sensitivity 0.1 °C) immediately before administering a drop to the crab leg. Experiments were conducted with crabs placed in a petri dish held at room temperature (21-24°C). When a drop of water was placed on the leg of a crab, I recorded whether or not the crab responded with neuromuscular activity (i.e., walked away or moved the leg away from the stimulus). 2.9 Neural thermal performance

To quantify thermal sensitivity of neuronal systems in crab walking legs, action potential propagation was measured in nerve fibers exposed to a thermal ramp. Neural thermal performance was recorded in gravid and non-gravid females 7-16 days after being assayed for thermal escape behavior (Fig. 1). These individuals did not experience thermal stimulus isolated to their walking leg as in the previous experiment. Spontaneous action potential propagation was determined in nerve fibers of the leg during a thermal ramp following the protocol from Miller & Stillman (2012). The left 3rd walking leg was removed by gently tapping the joint between the coxa and basischium with forceps and allowing it to autotomize. Sensory neurons were isolated by cutting away the basischium article and separating the merus from the carpus. Using this method, the nerve bundle is exposed and attached to the distal portion of the walking leg (Miller & Stillman, 2012).

The dissected nerve preparation was placed in a temperature controlled petri dish filled with seawater at 13°C.

Measurements were taken on an anti-vibrational table, in a grounded faraday cage with the lights turned off to reduce electrical noise, using a handmade Ag/AgCl suction electrode. A glass capillary tube was pulled with an oxygen acetylene torch and the tip was flame polished. Silver wires were submerged in bleach for 30 min to chloride the wire. An Ag/AgCl wire was placed in the glass capillary tube and a reference Ag/AgCl wire was wrapped around the tube. The electrode was attached to a Grass P55 A.C. pre­ amplifier lOOOx amplification with the low filter set to 30Hz, the high filter set to 1kHz to distinguish neural spikes. The glass Ag/AgCl electrode was filled with seawater and 14 negative pressure was applied with a lOmL disposable syringe to suction a loop of the nerve into the tip of the electrode. The output was recorded using a Power Lab 15T (AD

Instrument) and continuous measurements were recorded using LabChart software (chart v.8.1.5).

Spontaneous action potentials of nerve fibers were recorded in mV with the detection threshold set to 200mV at a rate of 40k/s. The temperature was ramped at

0.5°C per minute controlled by a Lauda proline RP 855 water bath. The frequency of action potential firing as a function of temperature provided a thermal performance curve.

Recordings began immediately after nerve was fixed to the suction electrode and continued until nerve function ceased. Thermal performance curves were obtained by using LabChart software extension spike histogram and the built-in macros to extract action potential frequency (Hz) and temperature data. The initial point at which firing frequency showed a significant change from baseline was considered the initial firing temperature and the point at which firing frequency was the highest was called peak firing temperature. Initial firing temperature was extracted by identifying frequency values that are significantly different from baseline using a sliding window function.

Optimal peak firing temperature was determined from thermal performance curve using

R software and applying the “loess” function (Fig. 2). Neural profiles were discarded if a peak temperature was not generated because of diminished signal due to the nerve slipping from the suction from the electrode. 15

2.10 Statistical Analyses

Statistical analyses were conducted in R software using version 3.2.2. Linear regression analysis was also used to assess the relationship between several different response variables (cardiac breakpoint temperature, preferred temperature and escape temperature) and crab carapace width. Differences in average response was examined with Welch two sample t-test for comparing differences in size-dependent physiology and behavior, differences between gravid and non-gravid crabs in physiology and behavior, and differences in escape time/removal in experimental vs control individuals in all escape experiments. The effect of acclimation temperature and carapace width on escape temperature was examined by performing an ANCOVA. A linear mixed effects model was used to assess thermal sensitivity to gravid state. A generalized linear mixed effects model was used to response to repeated increasing stimulus on crab walking leg.

The relationship between peak sensory nerve firing and whole organism escape behavior in female crabs was assesed using linear regression. 16

3.0 Results

3.1 Thermal tolerance in Cardiac C T m a x

Petrolisthes cinctipes cardiac critical thermal maximum ( C T max) was size dependent. Cardiac thermal tolerance of P. cinctipes decreased with increasing size where large individuals have a lower a break point temperature than small crabs (linear regression, Fi,37=4.49, P<0.05) (Fig. 3 A). Large (L) animals have a lower mean BPT than small (S) P. cinctipes (L mean= 29.94°C±0.36 SE, S mean= 31.14°C± 0.45 SE) (Fig. 3D)

3.2 Thermal preference

The mean preferred temperature (± 1 SD) of crabs was 15.1±1.5°C. There was not a statistically significant relationship between crab carapace width and preferred temperature (linear regression, Fi, 13=1.75, P>0.05) (Fig. 3B). No significant difference was found between mean preferred temperature between males and females, independent of carapace width (L mean= 16.14°C± 0.36 SE, S mean= 15.23°C± 1.59 SE) (Fig. 3E)

3.3 Thermal escape behavior: size-dependent thermal sensitivity

Thermal escape temperature was negatively associated with body size in P. cinctipes (linear regression; R2=0.3495, Fi,m=9. P<0.01) (Fig. 3C), with an overall mean escape temperature ( T eSc ) (± 1 SD) of 21.5 ± 4.6°C. Mean escape temperature in large

(>15mm) P. cinctipes was 19.47± 1.2 SE and 24.2°C± 1.5 SE in small (<15mm) P. cinctipes (Fig. 3F) 17

3.4 Thermal escape behavior: thermal sensitivity after thermal acclimation

Acclimation temperature did not influence escape behavior. There was no significant relationship between acclimation temperature and TeSc (F2J 9 =1.68 P>0.05) or an interaction between carapace width and acclimation group (F2,i9=2.5 P>0.05).

Consistent with the results reported above, there was a significant negative relationship between Tescand body size across groups (Fi,i9=5.29, P<0.05), (Table 1, Fig. 4)

3.5 Thermal escape behavior: thermal sensitivity to gravid state

Escape temperature was 2.52°C lower in gravid females (GF) (GF mean 19.61°C

±0.74 SE) than in non-gravid crabs (NG) (NG mean 22.13°C ±1.0 SE) where there was a significant relationship between gravid state and TeSc (F135 =9.8, P<0.01), but the size- dependence of escape temperature was not present in gravid females (Fig. 5, Table 2).

Within and intermediate size range of 10-16mm (to reduce the effect of size-dependent behavior) there was a significant 4.68°C reduction in TeSc in gravid females than non- gravid crabs (NG mean=24.25°C±1.3, GF mean = 19.57±1.0, P<0.05; Welch Two

Sample t-test) (Fig. 6).

Thermal escape behavior of gravid and non-gravid females (NGF) was not impacted by brood presence or presence by circulating hemolymph from gravid females, respectively. Gravid females with broods removed (mean change -0.97°C±1.9) did not change their escape behavior one week after removal compared to females without broods removed assessed one week after manipulation (mean change 1.13°C± 1.33) (Fig.

7A, Table 3) (P>0.05; liner mixed effects model). Likewise, non-gravid females injected 18 with gravid hemolymph (mean change -0.08°C±0.91) (P>0.05; liner mixed effects model) did not change their behavior compared to control females injected with non-gravid hemolymph (mean change -0.28°C±.98) (P>0.05; liner mixed effects model) (Fig. 7B,

Table 4).

3.6 Controlling for thermal escape behavior

Escape temperature was not influenced by random movements and the timing of escape was significantly influenced by the thermal ramp (P<0.001, T-test). Most control crabs were removed at the 30-min removal time. (Fig. 8).

3.7 Thermosensory behavior

When a thermal stimulus (drops of water) was applied to the walking legs of crabs, no crabs moved at temperatures between 17-23°C. Two out if the seven crabs moved at 24-31°C. All crabs exhibited a behavioral response to the hot water at temperatures above 31°C (Generalized mixed effects model Pr (>|z|) <2e-16) (Table 5)

(Fig. 9).

3.8 Neural thermal performance

Baseline spontaneous action potential rates starting at 13°C were between 10 and

80 Hz. When terminal segments of the walking leg were exposed to a thermal ramp, action potential rates increased slowly, reached a peak or optimal firing frequency, and then fell at temperatures beyond permissive thermal thresholds (Fig. 2). Peak nerve firing temperature was not significantly different in gravid and non-gravid females

(P>0.05, GF mean= 30.7 ± 0.80 SE, F mean=30.0 ± 3.98 SE; Welch Two Sample t-test) 19

(Fig. 10A). Initial firing temperature was higher in gravid than non-gravid females, however, it was not significant (P>0.05, GF mean 20.23°C ±5.19 SE, F mean=T9.96°C

±5.27 SE; Welch Two Sample t-test) (Fig. 10B). In these individuals where neural performance data was generated, there was no significant difference in escape temperature between gravid and non-gravid females (P>0.05, GF mean 28.33°C ±1.43

SE, F mean=24.4°C ±0.74 SE; Welch Two Sample t-test) (Fig. 10C) but overall gravid females escaped at significantly lower temperatures than non-gravid females (p=0.039, linear mixed effects model) (Fig. 11, Table 6). The temperature of peak sensory nerve firing was positively correlated to Tesc in female crabs (slope y=4.5+0.51x) (linear regression; R2=0.259, Fi,i7=5.94 P<0.05) (Fig. 12). 20

4.0 Discussion

This study examined thermal tolerance, thermal escape behavior and the neuronal mechanisms underlying whole organism response to precise variation in temperature in the intertidal porcelain crab, Petrolisthes cinctipes. The main findings from this study were: (1) large individuals have a lower cardiac thermal tolerance, (2) large individuals have lower escape temperatures, (3) thermal acclimation to high and low temperatures did not influence escape behavior, (4) gravid females exhibit escape behavior at lower temperatures but did not differ from non-gravid females in neural thermal tolerance, and

(5) neural thermal sensitivity correlates with escape temperatures. Below, I discuss the implications of these findings.

4.1 Size dependence of cardiac thermal tolerance

Under rock temperatures in the high intertidal zone inhabited by P. cinctipes are thermally variable and maximum temperatures can reach levels beyond a physiologically viable range (Gunderson et al. unpublished). Whole-organism thermal limits, in some aquatic organisms, may be set by the disruption of oxygen circulation due to cardiac failure inhibiting aerobic performance (Somero, 2010). Upper thermal tolerance of cardiac function may be set by the thermal sensitivity of Na+ channels (Vomanen et. al.,

2013). Crustaceans are unable to overcome heat stress beyond their cardiac break point temperature (Tepolt & Somero, 2014), so exposure to such temperatures is lethal. Cardiac thermal tolerance in P. cinctipes is highly size-dependent, with large individuals being

less tolerant (Fig. 3A&3D) indicating that large individuals are less likely to survive in 21 this region during extreme heat events. The negative size-dependence of cardiac CTmax suggests that increasing occurrence of extremely hot days will disproportionately impact large individuals, removing them from the population. This finding supports the idea that small animals are less vulnerable to extinction events while large individuals are at greater risk for extirpation (Cardillo, 2003; Gaston & Blackburn, 1995). Because large crabs are more susceptible to increases in microhabitat temperature, to survive they must either acclimatize or move to cooler regions. However, because this species is at the upper edge of its thermal range, they may have limited ability to plasticity alter their physiology to buffer against expected warming (Stillman, 2003).

4.2 Thermal preference

Preferred body temperatures and optimal thermal physiology are often closely co­ adapted and it is expected that preferred temperatures are near or slightly below temperatures that maximize fitness (Angilletta et al., 2006; Kingsolver & Huey, 2008;

Martin & Huey, 2008). Many crustaceans exhibit behavioral thermoregulation to remain within their preferred range (Crossin et.al, 1998; McGaw, 2003) but few studies have examined the relationship between body size and preferred temperature. We saw no relationship between crab body size and thermal preference (Fig. 3B&3E), which is consistent with findings from a similar study in crawfish (Espina et al., 1993). Some sources of error associated with gradient experiments are that some organisms have a tendency to aggregate in the comers despite thermal preference (Lagerspetz & Vainio,

2006). However, in this experiment only two individuals were removed for this reason, and thus the aggregating behavior is unlikely to have strongly influenced the results. This 22 study demonstrates that while P. cinctipes can detect and remain within its preferred thermal environment, this range is not tightly associated with body size.

4.3 Thermal escape behavior: size-dependent thermal sensitivity

P. cinctipes can experience fluctuations in temperature of up to 20°C in a period of 6 hours (Stillman & Somero, 1996). Avoidance of noxious heat during emersion and navigating a thermally heterogeneous environment is crucial to their success. Porcelain crab body size was significantly negatively related to thermal escape behavior where large crabs had a lower escape temperature (TeSc) than small crabs (Fig. 3C&3F) suggesting that movement is driven by temperature and that large individuals are more likely to move down the shore. Findings from this study, in combination with other investigations, provide evidence that temperature can drive the distributions of body sizes within populations (Daufresne et al., 2009).

The movement and subsequent loss of large individuals from a population will likely have a consequences for reproduction (Peck et al., 2009) because large adult body size contributes to increased reproductive fitness (Kingsolver & Huey, 2008).

Additionally, size-dependent movements in response to temperature mediate ecological interactions (Gibert et al., 2016) because the movement of large animals into new habitats is more likely to be disruptive to communities than the movement of small animals as large individuals are often competitively dominant (Rypien & Palmer, 2007). The results of this study predict that large crabs would be more abundant in the lower intertidal zone where it is cooler and that small crabs would be more abundant in the upper intertidal 23 zone and are more tolerant of warmer temperatures. This prediction is consistent with demographic data from P. cinctipes habitat surveys where abundance of large crabs is higher in the lower intertidal transect (Gunderson et al. unpublished). It is likely that this pattern is a result of temperature, rather than food availability, because small P. cinctipes are less tolerant to high temperature when food limited than large P. cinctipes (Donahue,

2004). If food availability was working against the temperature signal, smaller crabs would be lower in the intertidal zone where they could be exposed to longer periods of immersion allowing them to filter feed.

4.4 Thermal escape behavior: thermal sensitivity after thermal acclimation

Escape behavior is important in driving the size structure of this species but how plastic is this response? Thermal acclimation history has been shown to influence neural thermal tolerance (Miller and Stillman, 2012) and cardiac thermal tolerance (Stillman,

2003) in P. cinctipes. However, thermal history did not appear to strongly influence escape behavior. Acclimation temperature and the interaction with body size had no effect on escape behavior (Table 1). There is some evidence that thermal acclimation influences thermal escape behavior in Daphnia magna, but there is a need for further investigation of this topic (Lagerspetz, 2000). When all three acclimation groups were combined there was still a statistically significant negative correlation between escape behavior and body size (Fig. 4), supporting previous findings (Fig. 3C). The groups in the acclimation experiment had a relatively limited body size range which may have diminished the effects of individual plasticity of thermal behavior. However, it is clear that physiological tolerance in P. cinctipes can be influenced by acclimation but there 24 may be an adaptive significance for preserving escape thresholds. Maintaining these thresholds would provide a wider safety margin for organisms exposed to high acclimation temperatures (Heatwole, 1970).

4.5 Thermal sensitivity to gravid state

Because behavior was not easily altered extrinsically through thermal acclimation,

I investigated if intrinsic changes in thermal sensitivity due to reproductive state could influence behavior. Escape temperature was significantly lower in gravid females than in non-matemal crabs (males and non-gravid females) (Fig. 5, Table 2). This difference was greater in small individuals than in intermediate and large crabs. To remove the effect of size, these groups were size restricted to 10-16mm, the intermediate size range for this species, in the analysis and the relationship remained true (Fig. 6). This result predicts that gravid females should be found in cooler, more stable regions of their habitat and is supported by findings from our demographic study where gravid females are more abundant in the low intertidal zone (Gunderson et al. unpublished). If gravid females move down the shore to avoid stress, they could face increased competition or predation with consequences for reproduction. Gravid or reproductive females tend to seek refuge from predation to a higher degree than non-gravid crabs. Because P. cinctipes is more susceptible to predation when lower in the intertidal zone,(Jensen & Armstrong,

1991) it appears this pattern is driven by biotic rather than abiotic factors.

There are several potential explanations for why gravid females might be more averse to high temperatures. Gravid females invest a substantial amount of energy on brood care in addition to reproductive output which place constraints on their available 25 energy budget for activity (Brante et al., 2003). Therefore, they are may have fewer energy reserves available to tolerate thermal stress. Reproduction itself is highly thermally constrained. For example, egg attachment and retention are temperature controlled processes and in crustaceans, attachment failure has been reported at high temperatures (Fischer & Thatje, 2008; Waddy & Aiken, 1995). Additionally, temperature regulates ovarian maturation and egg laying where egg laying, or extrusion of the brood, only occurs at low temperatures (Aiken, 1969). Additionally, previous research on P. cinctipes shows that exposing late-stage embryos to a heat-shock of 30°C for one hour causes a 16% reduction in brood survival (Yockachonis 2016).

To test for mechanisms that could explain the low escape temperatures of gravid females, I manipulated brood presence and hormonal cues in the circulating hemolymph to determine if these factors influenced thermal sensitivity and behavioral thermoregulation in gravid females. No changes in behavior were observed due to manipulations (Fig. 7A & 7B, Table 3 & 4) indicating that behavioral shifts occur by another mechanism. Perhaps some caveats from this experiment were the short duration of time post-injection and before the behavioral test, as well as the small sample size and the inadequate concentrations of potentially influential hormones within the hemolymph.

Future studies that specifically target neural/hormonal triggers may be more effective at discriminating the mechanism for increased thermal sensitivity in gravid P. cinctipes.

The behavioral and physiological pathways through which maternal thermosensitivity is heightened remain to be delineated, however, previous research suggests that biogenic amines (serotonin) and reproductive hormones (methyl famesoate) 26 act as behavioral modulators and are associated with the maternal condition (Figler et al.,

2004). Directly injecting hormones or neurotransmitters rather than injecting hemolymph could improve the design of this experiment. In vivo injection of methyl famesoate (MF) increases vitellogenin levels, stimulates ovarian maturation and oocyte development which corresponds to reproductive maturity (Borst et al., 1987; Laufer et al., 1993;

Nagaraju, 2007) and may have an effect on thermal escape behavior. Additionally,

Serotonin or 5-hydroxytryptamine (5-HT) is responsible for stimulating ovarian maturation (Milton, 1995), injection of 5-HT increases the embryonic development of the brood (Tinikul, 2008) and high levels of 5-HT in the heart are associated with heat resistance (Lagerspetz, 1973). 5-HT stimulates the release of neurodepressing hormone which depress sensory and motor functions (Arechiga, Cortes, Garcia, & Rodriguez-sosa,

1985) making it a likely candidate for influencing thermosensitive behavior in gravid females

4.6 Thermosensory behavior

On the most basic level, nerves control how organisms sense their environment and systematically respond to it. Neural functions may be the physiological basis for thermal escape behavior in crabs (Lagerspetz, 2000). Neural control of temperature selection may be mediated by thermoreceptors or thermosensitive neurons; however, little is known about the location or mechanisms used to sense temperature in crustaceans. Behavioral studies reveal that crustaceans can detect fluctuations in temperatures with great precision. For example, in lobsters, changes of 0.15 °C can trigger a response (Crossin et al., 1998; Jury & Watson, 2000). Our study confirmed that 27

P. cinctipes individuals respond to thermal stimulus isolated to their walking legs. This provides evidence that suggests that crabs have thermosensory neuronal systems in their walking legs could be triggering avoidance behavior (Fig. 9) (Table 5). Understanding how organisms generate and integrate thermosensory information to accurately perceive and respond to their environment is important because thermotactic guided behavior contributes to thermoregulation to effectively prevent contact with lethal temperatures

(Harshaw et al., 2016).

4.7 Neural thermal performance

Although no changes in behavior were detected due to egg removal or hemolymph injection, we hypothesized that differences in gravid and non-gravid females may be observed in their neural thermal thresholds. However, gravid and non-gravid females did not differ significantly in two metrics of neural thermal sensitivity (Fig. 10A,

B). In this group of individuals where neural data was obtained, there was no difference in escape behavior potentially due to the small sample size (Fig. 10C). Using a linear mixed model, I determined that overall gravid state had a significant effect on escape temperature (Fig. 11, Table 6) indicating that a larger sample size could expose differences. To determine the relationship between neurophysiology and whole organism behavior in porcelain crabs, I compared thermosensitive neural recordings and thermal escape behavior in gravid and non-gravid females. There was a significant positive correlation between peak nerve firing temperature and escape temperature (Fig. 12).

Although the neural thresholds for peak firing temperature are higher than escape temperature, they are in line with the temperatures that elicited a response in isolated 28 thermal stimulus experiments (Fig. 9). The effect of temperature on neuronal systems corresponds tightly with thermal thresholds that trigger behavior suggesting that the thermosensitive property of neurons in the walking leg may result in motor output responsible for behavioral ly determined temperature selection.

This finding provides evidence for thermosensitive neurons acting as a mechanistic trigger for whole organism behavior. A likely the signaling mechanism involved in temperature sensation and perception are transient receptor potential (TRP) ion channels (Rosenzweig et al., 2008). ThermoTRPs may be directly activated by intrinsic thermodynamic properties through conformational changes or, as suggested by

Voets and colleagues (2004), differences in activation energy of voltage-dependent gating (opening and closing of ions) (Dhaka et al., 2006; Voets et al., 2004). The thermoTRP, TRPA1, regulates the behavioral response of sea star larvae to heat (Saito et.al., 2017) but our understanding of the role of TRPs in other marine invertebrates, particularly crustaceans, is lacking. TRPA1 would make an interesting candidate for investigating sensory transduction required for thermotaxis in P. cinctipes. What is still unknown is how firing rates provide specific information that is interpreted through central processing allowing organisms to precisely respond to the external temperature of their environment but there is strong evidence linking thermosensory neurophysiology and thermoregulatory behavior in porcelain crabs.

4.8 Conclusion

Under expected warming, organisms with limited ability to adjust their physiology, like P. cinctipes, must move or they will die. Understanding how 29 physiological stress elicits behavioral responses, especially in reproductive individuals is crucial in predicting imminent ecological consequences. This study provides evidence that allows us to predict that intertidal species will move to cooler microhabitats where they will interact with other species or aggregate at higher densities. Furthermore, this research demonstrates a potential mechanism responsible for species distributional shifts and the role of individual variability in setting species ranges. Large reproductive individuals are expected to move first and this could influence distributions. The implications of these movements will extend to many types of interactions such as mating, competition and predator prey dynamics that may shift due to altering species zonation (Gibert et al., 2016). Using empirical data, we show precisely when animals move in response to increasing temperature and the importance of size, thermal history and reproductive state in influencing temperature induced behaviors. This study has applications for many species that are currently at the upper edge of their thermal distribution and are thus influenced by the tradeoff hypothesis of thermal adaptation

(Stillman, 2003) by advancing our understanding of how organisms may behaviorally mitigate the effects of warming through shifting their zonation. Adaptive compensatory behavior may allow organisms to overcome human induced environmental change to some extent through genetic assimilation allowing beneficial traits to become fixed (Sih et al., 2011). Alternatively, it is important to understand conflicting selective pressures which conserve phenotypic behavioral plasticity to temperature. If we know more about what controls range boundaries we can better predict how organisms will respond to warming and identify which organisms are most vulnerable. 30

Figure 1: Treatment groups for determining thermal sensitivity to gravid state. 31

100

N 1 >O 75 c 3CD CT 2 LL 50

25

20 30 Temperature (°C)

Figure 2. Action potential frequency and temperature in individual #98 with raw data fitted by Loess function. Peak firing temperture is denoted by (*) and initial firing temperature is denoted by (x). 32

° A D 2 -3 4 M 34

30

28

18 B 18 E O 0 V—16 16 *—•03 w.0 Q. E 14 14 0

T 3 L,

CL 10 10 .30 C 30 oO F

10.0 12.5 15.0 17.5 20.0 Carapace Size (mm) <15mm >15mm

Figure 3: A) The relationship between cardiac break point temperature and carapace

length in male and female crabs (n=38) (Slope y= 33+-0.15x, r*= 0.108 P<0.05). 33

Figure 3: B) Preferred temperature in male and female crabs of different carapace widths

(n=17) (Slope y=12+0.25x, r2=0.0266, P>0.05). C) The relationship between escape temperature and carapace width in male and female crabs (n=16) (Slope y= 35+-0.88x r2=0.393, P<0.05). D) Arrhenius break point temperature in male and female crabs with carapace length greater than 15mm and less than 15 mm. E) Preferred temperature in male and female crabs with carapace width greater than 15mm and less than 15 mm. F)

Escape temperature in male and female crabs with carapace width greater than 15mm and less than 15 mm. 34

28

O S^24 CD D 03 0 ♦ 8°C CL • 13°C §20 ■ 17°C

8 - 10 12 14 16 Carapace Width (mm)

Figure 4: The correlation between escape temperature and carapace width in male crabs acclimated to different temperatures (slope y=29+-0.5x, r2=0.162 P<0.05). Shapes represent acclimation group where diamond is 8°C (n=9), circle is 13°C (n=8), and square is 17°C (n=7). Table 1: ANCOVA results comparing the effect of acclimation temperature and carapace width on escape temperature.

Df Sum Sq F P Carapace width 1 37.64 5.292 P<0.05 Acclimation temperature 2 23.87 1.678 P>0.05 Carapace width x acclimation 2 35.78 2.515 P>0.05 temperature Residuals 19 135.15 36

30

O o 0 25 3I— ro i— • Non-gravid Female a> Q. Gravid Female E ▲ Male

Figure 5. Relationships between escape temperature and body size, sex, and reproductive status. NG (Slope y= 35+-0.88x r2=0.393, P<0.01), GF (Slope y= 21+-0.15x r2=0.011,

P>0.05) 37

Table 2: ANCOVA results comparing the effect of gravid state and carapace width on escape temperature.

Df Sum Sq F P Carapace width 1 8.2 0.684 P>0.05 Gravid State 1 117.4 9.806 P<0.01 Carapace width x gravid state 1 33.1 2.515 P>0.05 Residuals 35 419.1 38

26

0 24 O

18 NG GF

Figure 6: Mean escape temperature in gravid females (n=14) and non-gravid crabs (male and female, n=8) with a restricted size range between 10mm and 16mm. Error bars represent standard error. 39

B

GF unremoved NGF removed GF hemolymph NGF hemolymph

Figure 7: A) Mean difference in escape temperature between pre-and post-brood removal comparing control gravid females with unremoved broods (n=l 1) and experimental gravid females with broods removed (n=6). B) Mean difference in escape temperature between pre-and post-hemolymph injection comparing experimental non-gravid females injected with gravid female hemolymph (n=5) and control non-gravid females injected with non-gravid hemolymph (n=5). 40

Table 3: Results from linear mixed effects model for repeated measures of escape temperature in gravid females pre-and post-egg removal.

Fixed Effects Estimate Standard df t value p value Error Linear mixed effects model (AIC = 248.5252) Brood removal 1.190904 23 -0.61465 P>0.05 0.731987 41

Table 4: Results from linear mixed effects model for repeated measures of escape

temperature in non-gravid females before and after injection with gravid hemolymph or

non-gravid hemolymph.

Fixed Effects Estimate Standard df t value p value Error Linear mixed effects model (AIC = 89.1505) Gravid hemolymph 0.467009 0.9013797 8 0.518104 P>0.05 Non-gravid hemolymph -0.107009 0.9013797 -0.118717 P>0.05 42

30

.£20 E

10

Control Experimental

Figure 8: Boxplot of escape time in control (n=80) and experimental (n=80) (grey) crabs.

Control animals were removed at 30 min. 43

1.00

"D <1) 1 0.75

03 JZ -♦—* JD 2 0.50 M—O c o t 8.0.25 V—O Q_

0.00 17-20 21-23 24-27 28-31 32-35 36-39 Temperature °C

Figure 9: The proportion of crabs that responded to isolated thermal stimulus from a drop of water on the distal portion of a walking leg (n=7). 44

Table 5: Results from generalized linear mixed effects model for isolated thermal stimulus response temperature.

Fixed Effects Estimate Standard df z value Pr (>|z|) Error Generalized linear mixed effects model (AIC=14.2) Temperature -7.2661 0.6431 -11.30 <2e-16 45

NGF GF NGF GF NGF GF

Figure 10: Thermal sensitivity of non-gravid females (NGF) and gravid females (GF) to a thermal ramp in behavioral response and two measures of neural response. A) Peak firing temperature in NGF (n=10) and GF (n=9). B) Initial firing temperature in NGF (n=10) and GF (n=9). C) Escape temperature in NGF(n=10) and GF (n=9). Values are means ± 1 standard error. 46

23

22 O

221CO 1 k - CD CL E CD h 20

18 NGF GF

Figure 11: Escape temperature in all gravid and non-gravid females in NGF(n=30) and

GF (n=62). 47

Table 6: Results from linear mixed effects model for escape temperature in GF and NGF over time and between trials.

Fixed Effects Estimate Standard df t value p value Error Linear mixed effects model (AIC = 476.0901) Gravid state -3.04563 1.358715 17 -2.24155 P<0.05 48

P 35

• NGF ^ GF

15 20 25 Escape Temperature (°C)

Figure 12: Temperature of peak neuronal firing and escape temperature in female porcelain crabs exposed to a thermal ramp (n=16). There was no difference with reproductive state. Gravid females (GF) are represented by triangles and non-gravid females (NGF) are represented by circles. 49

References:

Aiken, D. E. (1969). Ovarian maturation and egg laying in the crayfish Orconectes virilis: influence of temperature and photoperiod. Canadian Journal of Zoology, 47, 931— 935. Alberts, J., Harshaw, C., Blumberg, M. S., & Alberts, J. R. (2016). Thermoregulation, Energetics, and Behavior, (December). Angilletta, M. J. (2009). Thermal Adaptation: A Theoretical and Empirical Synthesis. Thermal Adaptation: A Theoretical and Empirical Synthesis. Angilletta, M. J., Bennett, A. F., Guderley, H., Navas, C. A., Seebacher, F., & Wilson, R. S. (2006). Coadaptation : A Unifying Principle in Evolutionary Thermal Biology, 2004(2), 282-294. Arechiga, H., Cortes, J. L., Garcia, U., & Rodriguez-sosa, L. (1985). Neuroendocrine correlates of circadian rhythmicity in crustaceans. Integrative and Comparative Biology, 25(1), 265-274. Barki, A., Karplus, I., Manor, R , & Sagi, A. (2006). Intersexuality and behavior in crayfish: The de-masculinization effects of androgenic gland ablation. Hormones and Behavior, 50(2), 322-331. Borst, D. W., Laufer, H., Landau, M., Chang, E. S., Hertz, W. A., Baker, F. C., & Schooley, D. A. (1987). Methyl famesoate and its role in reproduction and development. Insect Biochemistry, 17(1), 1123-1127. Brana, F. (1993). Shifts in Body Temperature and Escape Behaviour of Female Podarcis muralis during Pregnancy, Nordic Society Oikos, 66(2), 216-222. Brante, A., Fernandez, M., Eckerle, L., Mark, F., Portner, H. O., & Amtz, W. (2003). Reproductive investment in the crab Cancer setosus along a latitudinal cline: Egg production, embryo losses and embryo ventilation. Marine Ecology Progress Series, 257(Clarke 1987), 221-232. Cardillo, M. (2003). Biological determinants of extinction risk: why are smaller species less vulnerable? Animal Conservation, 6(2003), 63-69. Chelini, M. C., Willemart, R. H., & Gnaspini, P. (2011). Caves as a Winter Refuge by a Neotropical Harvestman (Arachnida, Opiliones). Journal o f Insect Behavior, 24(5), 393-398. Connell, J. H. (1961). The Influence of Interpsecific Competition and Other Factors on the Distribution of the Barnacle Chtamalus stellatus. Ecology, 42(4), 710-723. Cree, A., & Hare, K. M. (2016). Maternal basking regime has complex implications for birthdate and offspring phenotype in a noctumally foraging, viviparous gecko. The 50

Journal o f Experimental Biology, 279(18), 2934—2943. Crossin, G. T., Al-ayoub, S. A., Jury, S. H., Howell, W. H., & Iii, W. H. W. (1998). Behavioral Thermoregulation in the American Lobster Homarus Americanus. The Journal o f Experimental Biology, 574(201), 365-374.

Daufresne, ML, Lengfellner, K., & Sommer, U. (2009). Global warming benefits the small. Proceedings o f the National Academy of Sciences, 106(31), 12788-93. Dhaka, A., Viswanath, V., & Patapoutian, A. (2006). TRP Ion Channels and Temperature Sensation. Annual Review of Neuroscience, 29 ,135-161. Donahue, M. J. (2004). Size-dependent competition in a gregarious porcelain crab Petrolisthes cinctipes (: Porcellanidae). Marine Ecology Progress Series, 261,219-231. Edwards, D. H., Heitler, W. J., & Krasne, F. B. (1999). Fifty years of a command neuron: the neurobiology of escape behavior in the crayfish, 153-161.

Espina, S., Diaz Herrera, F., & Buckle R., L. F. (1993). Preferred and avoided temperatures in the crawfish Procambarus clarkii (, Cambaridae). Journal of Thermal Biology, 75(1), 35-39. Evans, R. G. (1948). The Lethal Temperatures of Some Common British Littoral Molluscs. Journal o f Animal Ecology, 77(2), 165-173. Fernandez, Miriam; Bock,Christian; Portner, H. O. (2000). The cost of being a caring mother : the ignored factor in the reproduction of marine invertebrates, Ecology letters, 487-494. Figler, M. H„ Peeke, H. V. S., Snyder, M. J., Chang, E. S., Figler, M. H„ Peeke, H. V. S., Chang, E. S. (2004). Effects of egg removal on maternal aggression, biogenic amines , and stress indicators in ovigerous lobsters ( Homarus americanus ), Marine and Freshwater Behaviour and Physiology, 34-54. Fischer, S., & Thatje, S. (2008). Temperature-induced oviposition in the brachyuran crab Cancer setosus along a latitudinal cline: Aquaria experiments and analysis of field- data. Journal o f Experimental Marine Biology and Ecology, 357(2), 157-164. Gaston, K. J., & Blackburn, T. M. (1995). Birds , body size and the threat of extinction. The Royal Society, (347), 205-212. Gibert, J. P., Chelini, M. C., Rosenthal, M. F., & Delong, J. P. (2016). Crossing regimes of temperature dependence in animal movement. Global Change Biology, 22(5), 1722-1736. Gillooly, J., Brown, J., West, G., Savage, V. M., & Chamov, E. L. (2001). Effects of size and temperature on metabolic rate. Science (New York, N.Y.), 295(5538), 2248-51. 51

Gunderson, A. R., & Stillman, J. H. (2015). Plasticity in thermal tolerance has limited potential to buffer ectotherms from global warming. Proceedings of the Royal Society B-Biological Sciences, 282(20150401), 1-8. Heatwole, H. (1970). Thermal Ecology of the Desert Dragon Amphibolurus inermis. Ecological Monographs, 40(A), 425-457.

Helmuth, B. (2006). Mosaic Patterns of Thermal Stress in the Rocky Intertidal Zone : Implications for Climate Change. Ecological Monographs, 76(4), 461^179. Houghton, J. T. et al. (1995). Intergovernmental Panel on Climate Change. Climate Change. Report of Working Group I (Eds. Huey, R. B., Kearney, M. R., Krockenberger, A., Holtum, J. A. M., Jess, M., & Williams, S. E. (2012). Predicting organismal vulnerability to climate warming : roles of behaviour, physiology and adaptation, The Royal Society B, 1665-1679.

Jensen, G. C., & Armstrong, D. a. (1991). Intertidal Zonation among Congeners - Factors Regulating Distribution of Porcelain Crabs Petrolisthes Spp. (Anomura, Porcellanidae). Marine Ecology Progress Series, 75(1), 47-60. Jury, S. H., & Watson, W. H. (2000). Thermosensitivity of the Lobster, Homarus americanus , as Determined by Cardiac Assay. Biological Bulletin, 199(August), 257-264. Karplus, I., Sagi, A., Khalaila, I., & Barki, A. (2003). The Influence of Androgenic Gland Implantation, Behaviour, 649-663.

Kingsolver, J. G., & Huey, R. B. (2008). Size , temperature , and fitness : three rules, Evolutionary Ecology Research, 251-268. Kleiber, M. (1932). Body Size and Metabolism. A Journal of Agricultural Science, <5(11), 315-353. Konishi, B. Y. S., & Kravitz, E. A. (1978). The Physiological Properties of Amine- containing Neurones in the Lobster Nervous System. J Physiol., 279,215-229.

Lagerspetz, K. Y. H. (1973). Temperature Acclimation and Adaptive Changes in the Nervous System. Effects of Temperature on Ectothermic Organisms, 25-34. Lagerspetz, K. Y. H. (2000). Thermal avoidance and preference in Daphnia magna, Journal o f Thermal Biology, 25,4-9. Lagerspetz, K. Y. H., & Vainio, L. A. (2006). Thermal behaviour of crustaceans. Biol. Rev., (81), 237-258. Lardies, M. A., Rojas, J. M., & Wehrtmann, I. S. (2004). Breeding biology and population structure of the intertidal crab Petrolisthes laevigatus (Anomura: 52

Porcellanidae) in central-southern Chile. Journal o f Natural History, 38(3), 375- 388.

Laufer, H.J.S.B.Ahl, & Sagi, A. (1993). The role of juvenile hormone in crustacean reproduction Amer. Zol, 3 74(August), 365-374.

Levy, D. A. (1998). Sensory Mechanism and Selective Advantage for Diel Vertical Migration in Juvenile Sockeye Salmon, Oncorhynchus nerka. Can. J. Fish. Aquat. Sci, 1796-1802.

M.W. Lachenicht, S. Clusella-Trullas , L. Boardmana, C. Le Rouxa, J. S. T. (2010). Effects of acclimation temperature on thermal tolerance , locomotion performance and respiratory metabolism ... Journal o f Insect Physiology, (56), 822-830. Ma, G., & Ma, C. Sen. (2012). Effect of acclimation on heat-escape temperatures of two aphid species: Implications for estimating behavioral response of insects to climate warming. Journal of Insect Physiology, 55(3), 303-309.

Madeira, D. (2012). Thermal tolerance of the crab Pachygrapsus marmoratus : intraspecific differences at a physiological ( CTMax ) and molecular level ( Hsp70 ), Cell Stress and Chaperones, 707—716.

Martin, T. L., & Huey, R. B. (2008). Why “ Suboptimal ” Is Optimal: Jensen ’ s Inequality and Ectotherm Thermal Preferences, The American Naturalist, 171(3), 102-118. McGaw, I. J. (2003). Behavioral Thermoregulation in Hemigrapsus nudus, the Amphibious Purple Shore Crab, Biol. Bull 204(February), 38—49.

Miller, Nathan A, J. H. S. (2012). Neural Thermal Performance in Porcelain Crabs, Genus Petrolisthes. Physiological and Biochemical Zoology 85(1):29—39.

Milton, F. (1995). Endocrine Mechanisms in Crayfish, with Emphasis on Reproduction and Neurotransmitter Regulation of Hormone Release. Amer. Zool. 1, 7#(December 1993), 68-78. Nagaraju, G. P. C. (2007). Is methyl famesoate a crustacean hormone? Aquaculture, 272(1-4), 39-54. Nakamura, R. (1976). Temperature and the Vertical Distribution of Two Tidepool Fishes ( Oligocottus maculosus , O . snyderi ). Copeia, 7976(1), 143-152. Parmesan, C., Ryrholm, N., Stefanescu, C., Hill, J. K., Thomas, C. D., Descimon, H., Warren, M. (1999). Poleward shifts in geographical ranges of butterfly species associated with regional warming, Letters to Nature, 599(June), 579-583. Peck, L. S., Clark, M. S., Morley, S. A., Massey, A., & Rossetti, H. (2009). Animal 53

temperature limits and ecological relevance : effects of size , activity and rates of change, Functional Ecology, 23, 248-256. Rosenzweig, M., Kang, K., & Garrity, P. A. (2008). Distinct TRP channels are required for warm and cool avoidance in Drosophila melanogaster, Proceedings of the National Academy of Sciences, 105(38) 14668-73. Rypien, K. L., & Palmer, A. R. (2007). The effect of sex, size and habitat on the incidence of puncture wounds in the claws of the porcelain crab Petrolisthes cinctipes (Anomura: Porcellanidae). Journal of Crustacean Biology, 27(1), 59-64.

Saito, S., Hamanaka, G., Kawai, N., Furukawa, R , & Gojobori, J. (2017). Characterization of TRP A channels in the starfish Patiria pectinifera : involvement of thermally activated TRPA1 in thermotaxis in marine planktonic larvae. Scientific Reports, (April 2016), 1-14. Schulte, P. M., Healy, T. M., & Fangue, N. A. (2011). Thermal performance curves, phenotypic plasticity, and the time scales of temperature exposure. Integrative and Comparative Biology, 51(5), 691-702. Seebacher, F., White, C. R , & Franklin, C. E. (2015). Physiological plasticity increases resilience of ectothermic animals to climate change. Nature Climate Change, 5(December 2014), 61-66. Sih, A., Ferrari, M. C. O., & Harris, D. J. (2011). Evolution and behavioural responses to human-induced rapid environmental change. Evolutionary Applications, 4(2), 367- 387. Somero, G. N. (2010). The physiology of climate change: how potentials for acclimatization and genetic adaptation will determine “winners” and “losers”. The Journal o f Experimental Biology, 213(6), 912-920. Stillman, J. H. (2002). Causes and consequences of thermal tolerance limits in rocky intertidal porcelain crabs, genus petrolisthes. Integrative and Comparative Biology, 42(4), 790-796. Stillman, J. H. (2003). Acclimation capacity underlies susceptibility to climate change. Science, 301(5629), 65. Stillman, J. H., & Somero, G. N. (2000). A comparative analysis of the upper thermal tolerance limits of eastern Pacific porcelain crabs, genus Petrolisthes: influences of latitude, vertical zonation, acclimation, and phylogeny. Physiological and Biochemical Zoology: PBZ, 73(2), 200-208.

S tillm a n , J., & Somero, G. (1996). Adaptation to temperature stress and aerial exposure in congeneric species of intertidal porcelain crabs (genus Petrolisthes): correlation of physiology, biochemistry and morphology with vertical distribution. The Journal of 54

Experimental Biology, 199(Pt 8), 1845-55. Sunday, J. M., Bates, A. E., & Dulvy, N. K. (2012). Thermal tolerance and the global redistribution of animals. Nature Climate Change. 686-690. Tepolt, C. K., & Somero, G. N. (2014). Master of all trades: thermal acclimation and adaptation of cardiac function in a broadly distributed marine invasive species, the European green crab, Carcinus maenas. The Journal of Experimental Biology, 217(7), 1129-1138. Tinikul, Y., Joffre Mercier, A., Soonklang, N., & Sobhon, P. (2008). Changes in the levels of serotonin and dopamine in the central nervous system and ovary, and their possible roles in the ovarian development in the giant freshwater prawn, Macrobrachium rosenbergii. General and Comparative Endocrinology, 158(3), 250- 258. Voets, T., Voets, T., Droogmans, G., Wissenbach, U., Janssens, A., Flockerzi, V., & Nilius, B. (2004). The principle of temperature-dependent gating in cold- and heat- sensitive TRP channels, Nature 203(September)748-754. Vomanen, M., Haverinen, J., Egginton, S., Kingdom, U., & Vomanen, M. (2013). Acute heat tolerance of cardiac excitation in the brown trout ( Salmo trutta fario ), The Company of Biologists (September). Waddy, S. L., & Aiken, D. E. (1995). Temperature regulation of reproduction in female American lobsters (_Homarus americanus_) . Ices Mar.Sci Symp, 199 (January), 54-60. Weirsma, C. A .. (1946). Giant Nerve Fiber Sysytem of the Crayfish . A Contribution to Comparative Physiology. 24-38. 55

R-Scrips

#Figure 2 setwd(’VDocuments/R Data/Escape Temperature/Neural'’) temphz <- read.csv("ID98Gxsv") require("ggplot2") temp_hzz=temp_hz[! (temp_hz$freq>=250),] qplot(temp_hz$temp, temp_hz$freq, geom -’smooth",xlab-Temperature (°C)”,ylab-’Frequency (Hz)’’)+

theme_bw()+

theme(legend.title = element_blank(),

axis.text.x = element_text(size=40),

axis.text.y = element_text(size=40),

axis.title.x = element_text(size=40),

axis.title.y = element_text(size=40),

legend.text = element_text(size=43))+

geom_text(x==10,y=34.5,label=f,C",size=20,color='black’)

t_f<-loess(freq~temp,data==temp_hz) summary(tf)

#remove N A te m p h z <- temp_hz[complete.cases(temp_hz),]

#temp between 25 and 30 at interval o f 0.1 newtemp <- seq(min(temp_hz$temp),max(temp_hz$temp),0.1)

#predic freq pre<-predict(t_f,newdata=newtemp)

#combine peak<-as.data.frame(cbind(newtemp,pre))

#flnd temperature at max freq peak$newtemp[peak$pre==max(peak$pre)] ggplot(data= temp_hz,aes(x=temp, y=freq))+

geom_smooth(method = "loess", size = 1.5,color='blackf)+

theme_bw() +

xlab("Temperature (°C)")+

ylab("Frequency (Hz)")+

theme(legend.title = element_blank(),

axis.text.x = element_text(size=40),

axis.text.y = elementtextCsize^O),

axis.title.x = element_text(size=40),

axis.title.y = element_text(size=40),

legend, text = element_text(size=43))+

geom_text(x=19,y=49,label="x",size=:12,color=,black,)+

geom_text(x=32.00686,y=l 10,label="*",size=20,color=fblack’)

#Figure 3 ddr <- "~/Documents/R_Data/Escape Temperature/" escapeStats <- read.csv(paste(ddr, "escapestats.csv", sep="")) sz <- data.frame(data=:escapeStats[escapeStats$TrialExp="l_size"

esc<- subset(sz, data.Experiment=="size") pref<- subset(sz, data.Experiment="pref")

A B T<- subset(sz, data.Experim ent="ABT")

fitl <- lm(data.EscTemp ~ data.CarapaceWidth, data=ABT ) summary(fitl) fitl <- lm(data.EscTemp - data.CarapaceWidth, data=pref) summary(fitl) fitl <- lm(data.EscTemp ~ data.CarapaceWidth, data=esc ) summary(fitl) 57

#plot r2 and slope on plot lm equabt <-function(ABT){

m <-lm(data.EscTemp~data.Carapace Width, ABT);

eq<-substitute(italic(y)= a + b %.% italic (x)*","— italic(r)A2 ~ - ”~r2,

list(a = format(coef(m)[l],digits = 2),

b = format(coef(m)[2],digits = 2),

r2 = format(summary(m)$r.squared, digits =3)))

as.character(as.expression(eq));

}

lm equpref <-function(pref){

m <-lm(data.EscT emp~data.Carapace Width,pref);

eq<-substitute(italic(y)== a + b %.% italic (x)*1',”— italic(r)A2~"~’~r2,

list(a = format(coef(m)[l],digits = 2),

b = format(coef(m)[2],digits = 2),

r2 = format(summary(m)$r.squared,digits =3)))

as.character(as.expression(eq));

}

lm equ esc <-fiinction(esc){

m <-lm(data.EscTemp~data.Carapace Width,esc);

eq<-substitute(italic(y)= a + b %.% italic (x)* — italic(r)A2~,,="~r2,

list(a = format(coef(m)[l],digits = 2),

b = format(coef(m)[2],digits = 2),

r2 = format(summary(m)$r.squared,digits =3)))

as.character(as.expression(eq));

} 58

#esc et<-ggplot(data=esc, aes(x=data.Carapace Width, y=data.EscTemp)) +

geom_point(aes(),size=5) +

theme_bw() +

geomsmootf^methodHm, se=FALSE, size=3, color=!black') +

geom_text(x=10,y=30,label-’C",size=20,color='black,)+

xlab(MCarapace Size (m m)”) +

ylab("Escape Temperature (°C)’’) +

theme(legend.title = element_blank(),

axis.text.x = element_text(size=40),

axis.text.y = element_text(size=40),

axis.title.x = element_text(size=45),

axis.title.y = element_text(size=45),

legend, text = element_text(size=43))+

scale_x_continuous(limits=c( 10,20))

#geom_text(x=17.5,y=29,label-’p=0.0534",size=20,color=fblack')+

#geom_text(x=l 5,y=l 8,label=lm_equ_pref(pref), parse=TRUE)+

#pref pt<-ggplot(data=pref, aes(x=data.CarapaceWidth, y=data.EscTemp)) +

geom_point(aes(),size=5) +

themebw() +

geom_text(x=10,y=17.75,label-,B",size=20,color=,blackf)+

xlab("Carapace Width") +

ylab("Preferred Temperature (°C)") +

theme(legend.title = element_blank(),

axis.text.x = element_blank(),

axis.text.y = element_text(size=40), 59

axis.title.x = element_blank(),

axis.title.y = elementtextCsize^S),

legend.text = element_text(size=43))+

scale_y_continuous(limits=c( 10,18)) +

scale_x_continuous(limits=c( 10,20))

#geom_text(x=22,y=34.5,label="p=0.04086*",size=20,color=’black’)+

#geom_text(x=T5,y=28,label=lm_equ_abt(ABT),parse=:TRUE)+

#ct ct<-ggplot(data=ABT, aes(x=data.Carapace Width, y=data.EscTemp)) +

geom_point(aes(),size=5) +

theme_bw() +

geom_smooth(method=lm, se=FALSE, size=3,color=’black!) +

geom_text(x=10,y=34.5,label-'A",size=20,color=,black,)+

xlab("Carapace Size (m m)")+

ylab("Break Point Temperature (°C)")+

theme(legend.title = element_blank(),

axis.text.x = element_blank(),

axis.text.y = element_text(size=40),

axis.title.x = element_blank(),

axis.title.y = element_text(size=45),

legend.text = element_text(size=43))

grid.arrange(pt, et, ct, ncol=T, nrow =3)

#ABT ddr <- "-/Documents/RJData/Escape Temperature/”

A B T <- read.csv(paste(ddr, "ABT.csv", s e p -’")) 60

fitl <- lm(ahr ~ size, data=ABT ) summary(fitl) anova(fitl)

l_df <- subset(ABT, size==”L”) s_df <- subset(ABT, size=-’S")

#T Test tTest <- t.test(l_df!>ahr, s_df$ahr) tTest

## Summarizes data.

## Gives count, mean, standard deviation, standard error o f the mean, and confidence interval (default 95%).

## data: a data frame.

## measurevar: the name o f a column that contains the variable to be summariezed

## groupvars: a vector containing names o f columns that contain grouping variables

## na.rm: a boolean that indicates whether to ignore NA's

## conf.interval: the percent range o f the confidence interval (default is 95% )

summarySE <- function(data=NULL, measurevar, groupvars=NULL, na.rm=FALSE,

conf.interval=.95, .drop=TRUE) {

library(plyr)

# New version o f length which can handle N A ’s: if na.rm==T, don’t count them

length2 <- function (x, na.rm=FALSE) { 61

if (na.rm) sum(!is.na(x))

else length(x)

}

# This does the summary. For each group’s data frame, return a vector with

# N, mean, and sd

datac <- ddply(data, groupvars, .drop=.drop,

.fun = function(xx, col) {

c(N = length2(xx[[col]], na.rm=na.rm),

mean = mean (xx[[col]], na.rm=na.rm),

sd =sd (xx[[col]], na.rm=na.rm)

) },

measurevar

)

# Rename the "mean” column

datac <- rename(datac, c("mean" = measurevar))

datac$se <- datac$sd / sqrt(datac$N) # Calculate standard error o f the mean

# Confidence interval multiplier for standard error

# Calculate t-statistic for confidence interval:

# e.g., if conf.interval is .95, use .975 (above/below), and use df=N-l

ciMult <- qt(conf.interval/2 + .5, datac$N-l)

datac$ci <- datac$se * ciMult

retum(datac)

} summary <-summarySE(ABT ,measurevar = "ahr", groupvars = "size")

library(ggplot2) summary$size <- as.character(summary$size) summary$size <- factor(summary$size, levels=c("S", "L"))

eta <- ggplot(data=summary,aes(x=size,y= ahr))+

geom_point(size=5) +

geom_errorbar(aes(ymin=ahr-se,ymax=ahr+se), size=.5, width=.5) +

theme_bw() +

geom_text(x=0.5,y=34.5,label="D",size=20,color=,black’)+

xlab("< 15mm >17mm")+

ylab("ABT (°C)") +

theme(legend.title = element_blank(),

axis.text.x = element_blank(),

axis.text.y = element_text(size=40),

axis.title.x = element_blank(),

axis.title.y = element_blank(),

legend.text = element_text(size=43))+

scale_y_continuous(limits=c(27,3 5))

#preferred temperature

#import data ddr <- "~/Documents/R_Data/Escape Temperature/" pref <- read.csv(paste(ddr, "pref.csv", s e p -'"))

require("ggplot2")

#significance test fitl <- lm(ptemp ~ size, data=pref)

anova(fitl)

l_df <- subset(pref, size=="L")

s_df <- subset(pref, s iz e = -’S")

#T Test

tTest <- t.test(l df$ptemp, s_df$ptemp) tTest

summarySE <- fiinction(data=NULL, measurevar, groupvars=NULL, na.rm=FALSE,

conf.interval=.95, .drop=TRUE) {

library(plyr)

# New version o f length which can handle N A ’s: if na.rm==T, don't count them

length2 <- function (x, na.rm=FALSE) {

if (na.rm) sum(!is.na(x))

else length(x)

}

# This does the summary. For each group's data frame, return a vector with

# N , mean, and sd

datac <- ddply(data, groupvars, .drop=.drop,

.fun = fimction(xx, col) {

c(N = length2(xx[[col]], na.rm=na.rm),

mean = mean (xx[[col]], na.rm=na.rm), 64

sd = sd (xx[[col]], na.rm=na.rm)

) },

measurevar

)

# Rename the "mean” column

datac <- rename(datac, c(Mmean" = measurevar))

datacSse <- datac$sd / sqrt(datac$N) # Calculate standard error o f the mean

# Confidence interval multiplier for standard error

# Calculate t-statistic for confidence interval:

# e.g., if conf.interval is .95, use .975 (above/below), and use d f=N -l

ciMult <- qt(conf.interval/2 + .5, datac$N-l)

datac$ci <- datacSse * ciM ult

retum(datac)

} summary <-summarySE(pref,measurevar = "ptemp”, groupvars = ’’size")

library(ggplot2)

summary$size <- as.character(summary$size) summary$size <- factor(summary$size, levels=c(”SM, "L"))

pta <-ggplot(data=summary,aes(x=size,y= ptemp))+

geom_point(size=5) +

geom_errorbar(aes(ymin=:ptemp-se,ymax=ptemp+se), size=.5, width=.5) + 65

themebw() +

geom_text(x=0.5,y=17.75,label-,E",size=20,color=,black')+

xlab(">15mm <16mm")+

ylab(’’Tp (°C)M) +

theme(legend.title = element_blank(),

axis.text.x = element_blank(),

axis.text.y = element_text(size=40),

axis.title.x = element_blank(),

axis.title.y = element_blank(),

legend.text = element_text(size=43))+

scale jy_continuous(limits=c( 10,18))

#Size escape ddr <- "~/Documents/R_Data/Escape Temperature/"

G NG df <- read.csv(paste(ddr, "Gravid NonGravid.csv", sep=""))

G NG dfSTemp <- as.numeric(G_NG_df$Temp)

G_NG_df$Width <- as.numeric(G_NG_df$Width)

G_df <- subset(G_NG_df, Gravidity=="G") sizedf <- subset(G_NG_df, Gravidity=="NG")

require("ggplot2")

#significance test fitl <- lm(Temp ~ size, data= size d f ) anova(fitl) 66

l_df <- subset(size_df, s iz e = -’L") s_df <- subset(size_df, s iz e = -’S")

#T Test

tTest <- t.test(l_df$Temp, s dfSTemp) tTest

summarySE <- function(data=NULL, measurevar, groupvars=NULL, na.rm=FALSE,

conf.interval=.95, .drop=TRUE) {

library(plyr)

# New version o f length which can handle N A ’s: if na .rm = T , don’t count them

length2 <- function (x, na.rm=FALSE) {

if (na.rm) sum(!is.na(x))

else length(x)

}

# This does the summary. For each group's data frame, return a vector with

# N , mean, and sd

datac <- ddply(data, groupvars, .drop=.drop,

.fun = function(xx, col) {

c(N = length2(xx[[col]], na.rm=na.rm),

mean = mean (xx[[col]], na.rm=na.rm),

sd = sd (xx[[col]], na.rm=na.rm)

) },

measurevar 67

)

# Rename the "mean" column

datac <- rename(datac, c("mean" = measurevar))

datac$se <- datacSsd / sqrt(datac$N) # Calculate standard error o f the mean

# Confidence interval multiplier for standard error

# Calculate t-statistic for confidence interval:

# e.g., if conf.interval is .95, use .975 (above/below), and use d f=N -l

ciMult <- qt(conf.interval/2 + .5, datac$N-l)

datac$ci <- datac$se * ciM ult

retum(datac)

} summary <-summarySE(size_df,measurevar = 'Temp", groupvars = ’’size”)

library(ggplot2)

summary$size <- as.character(summary$size) summary$size <- factor(summary$size, levels=c(,'S”, ”L"))

eta <-ggplot(data=summary,aes(x=size,y= Temp))+

geomjpoint(size=5) +

geom_errorbar(aes(ymin=Temp-se,ymax=Temp+se), size=.5, width=.5) +

theme_bw() +

geom_text(x=0.5,y=30,label-fF’l,size=20,color=’blackf)+

xlab("<15mm >15mm")+

ylab(’’Tesc (°C)") + 68

theme(legend.title = element_blank(),

axis.text.x = element_blank(),

axis.text.y = element_text(size=40),

axis.title.x = element_text(size=45),

axis.title.y = element_blank(),

legend.text = element_text(size=43))+

scale_y_continuous(limits=c( 13,31))

# make 3 pannel figure with escape temp, prefered temp, and ctmax vs body size

library("gridExtra”)

grid.arrange(pt, et, ct, ncol=3, nrow =1)

grid.arrange(ct, eta, pt,pta, et, eta, ncol=2, nrow =3)

#median box plot

ddr <- "-/Documents/R Data/Escape Temperature/”

ELptemp <- read.csv(paste(ddr, ’’ELptemp.csv", sep=”"))

library(plyr)

library(ggplot2)

p meds <- ddply(ELptemp, .(id), summarise, med = median(temp))

ggplot(ELptemp,aes(group=id, x = id, y = temp)) +

themebw() + geom_boxplot() ■+■ geom_text(data = p meds, aes(x = id, y = med, label = med),

size = 3, vjust = -1.5)+ 69

xlab("Crab ID")+

ylab("Preferred Temperature (°C)") +

theme(legend.title = element_blank(),

axis.text.x = element_text(size=40),

axis.text.y = element_text(size=40),

axis.title.x = element_text(size=45),

axis.title.y = element_text(size=40),

legend, text = element_text(size=43))

#Figure 4 ddr <- "~/Documents/R_Data/Escape Temperature/” escapeStats <- read.csv(paste(ddr, "escapestats.csv", s e p -'”))

escapeStats$AccTemp <- as.factor(escapeStats$AccTemp)

#Table 1 acc<- aov(EscTemp~CarapaceWidth*AccTemp,data=escapeStats[escapeStats$TrialExp=::- ,2_acclimation",]) summary(acc)

#plot accdata <- data.frame(data=escapeStats[escapeStats$TrialExp==”2_acclimation",])

accdata$data.AccTemp <- as.factor(accdata$data.AccTemp)

Acc_8<- subset(accdata, data.AccTemp=="8")

Acc_13<- subset(accdata, data.AccTemp==M13M)

Acc_17<- subset(accdata, data.AccTem p=-’17") 70

lm equacc <-fimction(accdata){

m <-lm(data.EscT emp~data.Carapace Width,accdata);

eq<-substitute(italic(y)== a + b %.% italic (x)*",M—italic(r)A2~"="~r2,

list(a = format(coef(m)[l],digits = 2),

b = format(coef(m)[2], digits = 2),

r2 = format(summary(m)$r. squared, digits =3)))

as.character(as.expression(eq));

}

# geom_text(x=T4,y=28,label-'Size p=0.0329* Acclimation p=0.2133",size=10,color='black')+

#geom_text(x= 12,y= 18,label=lm_equ_acc(accdata), parse=TRUE)+

#plot o f Acclimation temperatures (different colors) with best fit lines ggplot(data=accdata, aes(x=data.Carapace Width, y=data.EscTemp)) +

geom_point(aes(shape=data. AccT emp),size=9) +

theme_bw() +

geom_smooth(method=lm, se=FALSE, size=5,color='black') +

xlab("Carapace Width (mm)") +

ylab("Escape Temperature (°C)") +

theme(legend.title = element_blank(),

axis.text.x = element_text(size=40),

axis.text.y = element_text(size=40),

axis.title.x = element_text(size=45),

axis.title.y = elementtex^size^S),

legend.key.size = unit(2.5, 'lines'),

legend, text = element_text(size=43))+

scale_shape_manual("data. AccTemp", values=c( 16,15,18), breaks=c("8"," 1317"), labels=c("8°C"," 13°C"," 17°C"))

legend.key = element_rect(size = 5, color = 'white') 71

#scale_color_manual(”data.AccTemp”, values=c(”yellowgreen",”orange2”,”cyan4"), breaks=c("8"," 13 V 17"), labels=c(”8 ° C 13°C"," 17°C”))

#Figure 5

ddr <- "-/Documents/R Data/Escape Temperature/” escapeStats <- read.csv(paste(ddr, "escapestats.csv”, s e p -"’)) require(”ggplot2”) size <-subset(escapeStats,regexpr("Size",ignore.case = TRU E, escapeStats$Experiment)>0) grav <-subset(escapeStats,regexpr(" 1 gravid”,ignore.case = TRUE, escapeStats$TrialExp)>0) escapeStats<-rbind(size,grav)

#Table 2 preg<-aov(EscTemp~CarapaceWidth*TrialExp,data=escapeStats) summary(preg) #does the effect o f size depend on acclimation temp visca versa?

###linear regression fitl <- lm(EscTemp ~ Carapace Width, data=grav ) summary(fitl)

lm equgrav <-function(grav){

m <-lm(EscT emp~Carapace Width,grav);

eq<-substitute(italic(y)= a + b %.% italic (x)*”,”— italic(r)A2~"=”~r2,

list(a = format(coef(m)[l],digits = 2),

b = format(coef(m)[2],digits = 2),

r2 = format(summary(m)$r. squared, digits =3)))

as.character(as.expression(eq));

} 72

#plot o f gravid and non-gravid crabs (different shapes) with best fit lines

ggplot(data=escapeStats, aes(x=Carapace Width, y^EscTemp, color=Experiment)) +

geom_point(aes(shape=Sex),size= 10) +

#labs(shape-'gravid state")+

theme_bw() +

geom smooth(method=lm, se=FALSE, size=2) +

xlab("Carapace Width (mm)") +

ylab("Escape Temperature (°C)") +

#geom_text(x=15,y=28,label=:lm_equ_grav(grav),parse=TRUE)+

theme(legend.title = element_blank(),

axis.text.x = element_text(size=40),

axis.text.y = element_text(size=40),

axis.title.x = element_text(size=45),

axis.title.y = element_text(size=45),

legend.key.size = unit(2.5, 'lines'),

legend.text = element_text(size=35)) +

scale_color_manual("Experiment", guide=FALSE, values=c("black","black"), breaks=c("gravid", "size"))+

scale_shape_manual("Sex", values =c(l 6,1,17,18), breaks=c("F","GF","M","U"), labels=c("Non-gravid Female","Gravid Female","Male","Unknown"))

#Figure 6 ddr <- "-/Documents/R Data/Escape Temperature/" escapeStats <- read.csv(paste(ddr, "escapestats.csv", sep^"")) require("ggplot2")

#escapeStats=escapeStats[!(escapeStats$CarapaceWidth>=16),]

#escapeStats=escapeStats[!(escapeStats$CarapaceWidth<=TO),] size <-subset(escapeStats,regexpr("Size",ignore.case = TRU E, escapeStats$Experiment)>0) 73 grav <-subset(escapeStats,regexpr("l_gravid",ignore.case = TRUE, escapeStats$TrialExp)>0)

escapeStats<-rbind(size,grav)

# p-value = 0.01222 tTest <- t.test(size$EscTemp, grav$EscTemp) tTest

summarySE <- function(data=NULL, measurevar, groupvars=NULL, na.rm=FALSE,

conf.interval=.95, .drop=TRUE) {

library(plyr)

# New version o f length which can handle N A ’s: if na.rm==T, don’t count them

length2 <- function (x, na.rm=FALSE) {

if (na.rm) sum(!is.na(x))

else length(x)

}

# This does the summary. For each group's data frame, return a vector with

# N, mean, and sd

datac <- ddply(data, groupvars, .drop=.drop,

.fun = function(xx, col) {

c(N = length2(xx[[col]], na.rm=na.rm),

mean = mean (xx[[col]], na.rm^na.rm),

sd = sd (xx[[col]], na.rm=na.rm)

) h

measurevar

) 74

# Rename the "mean" column

datac <- rename(datac, c("mean" = measurevar))

datac$se <- datacSsd / sqrt(datac$N) # Calculate standard error o f the mean

# Confidence interval multiplier for standard error

# Calculate t-statistic for confidence interval:

# e.g., if conf.interval is .95, use .975 (above/below), and use d f=N -l

ciMult <- qt(conf.interval/2 + .5, datac$N-l)

datac$ci <- datac$se * ciMult

retum(datac)

}

summary <-summarySE(escapeStats ,measurevar = "EscTemp", groupvars = "Experiment")

summarySExperiment <- as.character(summary$Experiment) summary$Experiment <- factor(summary$Experiment, levels=c("size", "gravid"))

ggplot(data=summary,aes(x=Experiment,y= EscT emp))+

geom_point(size=5) +

geom_errorbar(aes(ymin=:EscTemp-se,ymax=EscTemp+se),size=.5, width=.5) +

theme_bw() +

ylab("Escape Temperature (°C)") +

theme(legend.title = element_blank(),

axis.text.x = element_text(size=40),

axis.text.y = element_text(size=40),

axis.title.x = element_blank(), 75

axis.title.y = element_text(size=45),

legend.text = element_text(size:=43))+

scale_y_continuous(limits=c(l 8,26)) +

scale_x_discrete(breaks=c("size","gravid"), labels=c("NG","GF"))

# Figure 7

ddr <- "~/Documents/R_Data/Escape Temperature/" escapeStats <- read.csv(paste(ddr, "escapestats.csv", sep=""))

#gravid vs egg removal

#separate all GF and R data points from the rest o f the dataset

#separate data frames for each one

GF dataset <-subset(escapeStats,regexpr("3_gravid",ignore.case = TRUE, escapeStats$TrialExp)>0) gfdata <-subset(escapeStats,regexpr("l_egg removal",ignore.case = TRUE, escapeStats$TrialExp)>0)

gfdata <-subset(gfdata,regexpr("H",ignore.case = TRUE, gfdata$Sex)<0) gfdata <-subset(gfdata,regexpr("R",ignore.case = TRUE, gfdata$Sex)<0)

R dataset <-subset(escapeStats,regexpr("R",ignore.case = TRUE, escapeStats$Sex)>0)

R dataset <- rbind(gfdata, R dataset)

#merge by ID then make a complete data frame again

G FRdataset <- merge(GF_dataset,R_dataset,by="ID") newGF dataset <- data.frame(ID = GF_R_dataset$ID, Sex = GF_R_dataset$Sex.x, EscTemp = GF_R_dataset$EscT emp.x) newRdataset <- data.frame(ID = GF_R dataset$ID, Sex = GF_R_dataset$Sex.y, EscTemp = GF_R_dataset$EscT emp.y)

GF R dataset <- rbind(newGF_dataset, newR dataset)

GF_R_dataset<- GF_R dataset[! is.na(GF_R dataset)]

# Table 3 require(nlme)

GF Ranova <- lme(EscTemp ~ Sex, random— 1|ID, data=GF_R_dataset) summary(GFRanova)

#NonGravid Vs injected with N G H and GH

#separate all F and G H /N G H data points from the rest o f the dataset

#separate data frames for each one

F dataset <-subset(escapeStats,regexpr(”F”,ignore.case = TRUE, escapeStats$Sex)>0)

GH dataset <-subset(escapeStats,regexpr(,,G H M,ignore.case = TRUE, escapeStats$Sex)>0)

#merge by ID then make a complete data frame again

FG Hdataset <- merge(GH_dataset,F_dataset,by="ID") newF dataset <- data.frame(ID - F_GH_dataset$ID, Sex = F_GH_dataset$Sex.x, EscTemp = F_GH_dataset$EscT emp.x) newGH dataset <- data.frame(ID = F_GH_dataset$ID, Sex = F_GH_dataset$Sex.y, EscTemp F_GH_dataset$EscT emp.y)

F GH dataset <- rbind(newF_dataset, newGH dataset)

# Table 4

#no sig between F and N G H or F and GH hemolymph injection has no effect require(nlme)

F GHanova <- lme(EscTemp ~ Sex, random™ 1|ID, data=F_GH_dataset) summary(FGHanova) 77

# Figure 5

ddr <- ’’-/Documents/RData/Escape Temperature/’’

G_R_df <- read.csv(paste(ddr, ’’Gravid_Removed_Escape2.csv”, s e p -’’’))

require("ggplot2”)

summarySE <- function(data=NULL, measurevar, groupvars=NULL, na.mHFALSE,

conf.interval= 95, .drop=TRUE) {

library(plyr)

# New version o f length which can handle N A ’s: if na.rm==T, don’t count them

length2 <- function (x, na.rm=FALSE) {

if (na.rm) sum(!is.na(x))

else length(x)

# This does the summary. For each group’s data frame, return a vector with

# N, mean, and sd

datac <- ddply(data, groupvars, .drop=.drop,

.fun = function(xx, col) {

c(N = length2(xx[[col]], na.rm^na.rm),

mean = mean (xx[[col]], na.rm=na.rm),

sd = sd (xx[[col]], na.rm=na.rm)

) },

measurevar 78

# Rename the "mean” column

datac <- rename(datac, c("mean" = measurevar))

datac$se <- datac$sd / sqrt(datac$N) # Calculate standard error o f the mean

# Confidence interval multiplier for standard error

# Calculate t-statistic for confidence interval:

# e.g., if conf.interval is .95, use .975 (above/below), and use d f=N -l

ciMult <- qt(conf.interval/2 + .5, datac$N-l)

datac$ci <- datac$se * ciMult

retum(datac)

}

summary <-summarySE(G_R_df,measurevar = "deltatemp", groupvars = "Gravidity")

library(ggplot2)

rem<-ggplot(data=summary,aes(x=Gravidity,y=:deltatemp))+

geom_point(size=5) +

geom_errorbar(aes(ymin=deltatemp-se,ymax=deltatemp+se), size=.5 , width=.5) +

theme_bw() +

geom_text(x=.75,y=3,label=" A",size= 18,color=’black')H-

#geom_text(x:=2,y=2.5,label="G p=0.127 R p=0.22",size=10)+

xlab("GF unremoved GF removed")+

ylab("A Tesc (°C) egg removal") +

theme(legend.title = element_blank(),

axis.text.x = element_text(size=40),

axis.text.y = element_text(size=40), 79

axis.title.x = element_blank(),

axis.title.y = element_text(size=45),

legend, text = element_text(size=43))+

scale_y_continuous(limits=c(-3,3))+

scale_x_discrete(breaks=c("G","R"), labels=c("GF unremoved",”GF removed"))

#mean tpav<-aggregate(templ-Gravidity, data = G_R_df, mean)

#Program plots average escape temperatures o f non-gravid crabs pre and post hemolymph injection

# Injcted vs not injected

#import data ddr <- "~/Documents/R_Data/Escape Temperature/"

N G I d f <- read.csv(paste(ddr,"Nongravid_injected_escape.csv", sep=""))

require("ggplot2")

summarySE <- fiinction(data=NULL, measurevar, groupvars=NULL, na.rm=FALSE,

conf.interval=.95, .drop=TRUE) {

library(plyr)

# New version o f length which can handle N A ’s: if na .rm ^ T , don’t count them

length2 <- function (x, na.rmHFALSE) {

if (na.rm) sum(!is.na(x))

else length(x)

} 80

# This does the summary. For each group’s data frame, return a vector with

# N, mean, and sd

datac <- ddply(data, groupvars, .drop= drop,

.fun = function(xx, col) {

c(N = length2(xx[[col]], na.rm=na.rm),

mean = mean (xx[[col]], na.rm=na.rm),

sd = sd (xx[[col]], na.rm=na.rm)

) h

measurevar

# Rename the "mean” column

datac <- rename(datac, c f’mean” = measurevar))

datac$se <- datac$sd / sqrt(datac$N) # Calculate standard error o f the mean

# Confidence interval multiplier for standard error

# Calculate t-statistic for confidence interval:

# e.g., if conf.interval is .95, use .975 (above/below), and use df=N-l

ciMult <- qt(conf.interval/2 + .5, datac$N-l)

datac$ci <- datac$se * ciMult

retum(datac)

} summary <-summarySE(NG_I_df,measurevar = ’’deltatemp", groupvars = "Gravidity”)

library(ggplot2) 81

inj <-ggplot(data=summary,aes(x=Gravidity,y=deltatemp))+

geom_point(size=5) +

geom_errorbar(aes(ymin=:deltatemp-se,ymax=deltatemp+se),size=5, width= 5) +

theme_bw() +

geom_text(x=0.75,y=3,label=MB",size=18,color=,black,)+

#geom_text(x=2,y=.85,label-' GH p=0.681 NGH p=0.908",size=10)+

xlab("GF hemolymph NGF hemolymph")+

ylab("A Tesc (°C) hemolymph injection")*

theme(legend.title = element_blank(),

axis.text.x = element_text(size=40),

axis.text.y = element_text(size=40),

axis.title.x = element_blank(),

axis.title.y = element_text(size=45),

legend.text = element_text(size=43))+

scale_y_continuous(limits=c(-3,3))+

scale_x_discrete(breaks=c("GH","NGH"), labels==c(f,GF hemolymph”,"NGF hemolymph’1))

# make 2 panel figure library("gridExtra") grid.arrange(rem, inj, ncol=2, nrow =1)

#Figure 9

library(MASS) setwd("~/Documents/R_Data/Escape T emperature/Neural ”)

chi <- read.csv("TSB.csvf’) chi=as.table(chi) 82

chisq.test(chi[,-l])

library(fifer)

chisq.post.hoc(chi[,-1 ],test=c("fisher.test"), control= c("bonferroni"))

# fisher exact test and post hoc pairwise compar w bonferroni correction

#p= 0.0001569

setwd( 'WDocuments/R Data/Escape Temperature/Neural")

TSBE<- read.csv(”TSBE.csv")

ggplot(TSBE)+

aes(x=temp, fill= response)+

geom_bar(position-fiir)+

scale_fill_manual("legend", values = c("move" = "cyan4", ’’no” = ”orange2"))+

theme_bw() +

xlab("T emperature °C”)+

ylab(”Proportion o f crabs that moved”) +

theme(legend.title = element_blank(),

axis.text.x = element_text(size=40),

axis.text.y = element_text(size=40),

axis.title.x = element_text(size=45),

axis.title.y = element_text(size=45),

legend.text = elem enttextCsize^S))

#linear mixed model library(lme4) 83

#Table 5 lrl <- glmer(response ~ temp + (1 |id), data = TSBE, family = binomial); summary(lrl)

library(nlme)

TSBE$temp <-as.factor(TSBE$temp)

lrl <- lme(response ~ temp, random=(~l |id), data = TSBE) summary(lrl)

TSBE$temp <-as.factor(TSBE$temp)

library(nlme) escTemp tsbe L M E <- lme(response ~ temp, random=list(~l|id), data=TSBE)

ano va(escT em p s e x L M E ) summary(escT em psexLM E)

friedman.test()

as.nprop<-numeric()

prop[l] <-sum(TSBE$temp==H 17-20” & TSBE$response=-’move")/7 prop[2] <-sum(TSBE$temp=-’21-23" & TSBE$response==:,,move,,)/7 prop[3] <-sum(TSBE$temp=-’24-27" & TSBE$response=-’move")/7 prop[4] <-sum(TSBE$temp=:=f'28-31” & TSBE$response=’’move’’)/7 prop[5] <-sum(TSBE$temp=-’32-35" & TSBE$response=-'move’’)/7 prop[6] <-sum(TSBE$temp=="36-39" & TSBE$response=-'move")/7 84

temp<-c(" 17-20”, ”21-23”, ”24-27”, ”28-31”, ”32-35”, ”36-39”) prop.df<-data.frame(temp,prop) prop.df

ggplot(TSBE, aes(temp)) +

geom_bar(aes(y = (..count..)/sum(..count..))) +

scale_y_continuous(labels=scales: ipercent) +

ylab(”relative frequencies")

ggplot(tips2, aes(x = day, y = perc)) + geom_bar(stat = "identity")

TSBE <-subset(TSBE,regexpr("no",ignore.case = TRUE, TSBE$resopnse)<0)

ggplot(TSBE) +

aes(x = temp, fill= response)*

geom_bar(position = fdodgef)+

scale_fill_manual("legend", values = c("move" = "cyan4", "no" = "white"))

#Black and white ggplot(prop.df)+

aes(x=temp, y=prop)+

geom_bar(stat = "identity")+

theme_bw() +

xlab("Temperature °C")+

ylab("Proportion o f crabs that moved") +

theme(legend.title = element_blank(),

axis.text.x = element_text(size=40), 85

axis.text.y = elementtextCsize^O),

axis.title.x = element_text(size=45),

axis.title.y = element_text(size=45),

legend.text = elem enttex^size^S ))

library(dplyr)

library(ggplot2)

library(tidyr)

library(scales)

#Figure 10

ddr <- "~/Documents/R_Data/Escape Temperature/”

escapeStats <- read.csv(paste(ddr, ”escapestats.csv", s e p -’"))

require("ggplot2")

escapeStats <-subset(escapeStats,regexpr("H",ignore.case = TRUE, escapeStats$Sex)<0)

escapeStats <-subset(escapeStats,regexpr("8ff,ignore.case = TRUE, escapeStats$AccTemp)<0)

escapeStats <-subset(escapeStats,regexpr(" 17",ignore.case = TRUE, escapeStats$AccTemp)<0)

escapeStats <-subset(escapeStats,regexpr("M",ignore.case = TRUE, escapeStats$Sex)<0)

escapeStats <-subset(escapeStats,regexpr("l_egg removal",ignore.case = TRUE, escapeStats$TrialExp)<0) escapeStats <-subset(escapeStats,regexpr("l_acclimation",ignore.case = TRUE, escapeStats$TrialExp)<0)

escapeStats <-subset(escapeStats,regexpr("2_gravid",ignore.case = TRU E, escapeStats$TrialExp)<0)

escapeStats <-subset(escapeStats,regexpr("ABT",ignore.case = TRUE, escapeStats$Experiment)<0) escapeStats <-subset(escapeStats,regexpr("pref',ignore.case = TRU E, escapeStats$Experiment)<0)

escapeStats <-subset(escapeStats,regexpr("U",ignore.case = TRU E, escapeStats$Sex)<0) 86

escapeStats <- escapeStats[complete.cases(escapeStats),]

escapeStats$Control <- N U L L escapeStats$peaktemp <- N U L L escapeStats$firetemp < -N U L L

sex_GF<- subset(escapeStats, Sex=="GF") sex_F<- subset(escapeStats, Sex=="F")

tTest <- t.test(sex_GF$EscTemp, sex_F$EscTemp) tTest

summarySE <- function(data=NULL, measurevar, groupvars=NULL, na.rm=FALSE,

conf.intervaH.95, .drop=TRUE) {

library(plyr)

# New version o f length which can handle NA's: if na.rm==T, don't count them

length2 <- function (x, na.rm=FALSE) {

if (na.rm) sum(!is.na(x))

else length(x)

# This does the summary. For each group's data frame, return a vector with

# N , mean, and sd

datac <- ddply(data, groupvars, .drop=.drop, 87

.fun = fimction(xx, col) {

c(N = length2(xx[[col]], na.rm=na.rm),

mean = mean (xx[[col]], na.rm=na.rm),

sd = sd (xx[[col]], na.rm=na.rm)

) },

measurevar

)

# Rename the "mean” column

datac <- rename(datac, c("mean" = measurevar))

datac$se <- datac$sd / sqrt(datac$N) # Calculate standard error o f the mean

# Confidence interval multiplier for standard error

# Calculate t-statistic for confidence interval:

# e.g., if conf.interval is .95, use .975 (above/below), and use df=N-l

ciMult <- qt(conf.interval/2 + .5, datac$N-l)

datac$ci <- datac$se * ciMult

retum(datac)

}

summary <-summarySE(escapeStats ,measurevar = "EscTemp", groupvars = "Sex")

fgf <-ggplot(data=summary,aes(x=Sex,y== EscT emp))+

geom_point(size=5) +

geom_errorbar(aes(ymin=EscTemp-se,ymax=EscTemp+se),size=.5, width=.5) + 88

themebw() +

#geom_text(x=2,y=31.65,label="p=0.6224",size=T 0)+

geom_text(x=0.5,y=32.75,label=”C’’,size=10)+

xlab("NGF GF")+

ylab(”Escape Temperature (°C )M) +

theme(legend.title = element_blank(),

axis.text.x = element_text(size=40),

axis.text.y = element_text(size=40),

axis.title.x = element_blank(),

axis.title.y = element_text(size=45),

legend.text = element_text(size=43))+

scaleycontinuousClimits^cC 18,33))+

scale_x_discrete(breaks=c("F","GF"), labels=c("NGF","GF"))

ddr <- "~/Documents/R_Data/Escape Temperature/” escapeStats <- read.csv(paste(ddr, ”escapestats.csv”, sep="”)) require("ggplot2") escapeStats <- escapeStats[complete.cases(escapeStats),]

#p = 0.63 ancova<- lm(peaktemp~Sex, data=escapeStats) summary(ancova)

g_df <- subset(escapeStats, Sex==”GF") f_df <- subset(escapeStats, S e x = "F ")

# Welch Two Sample t-test p-value = 0.6224

tTest <- t.test(g_df$peaktemp, f_df$peaktemp) 89 tTest

require("ggplot2")

summarySE <- function(data=NULL, measurevar, groupvars^NULL, na.rm=FALSE,

conf.interval= 95, .drop=TRUE) {

library(plyr)

# New version o f length which can handle N A ’s: if n a .rm = T , don't count them

length2 <- function (x, na.rm=FALSE) {

if (na.rm) sum(!is.na(x))

else length(x)

}

# This does the summary. For each group's data frame, return a vector with

# N, mean, and sd

datac <- ddply(data, groupvars, .drop=.drop,

.fun = function(xx, col) {

c(N = length2(xx[[col]], na.rm=na.rm),

mean = mean (xx[[col]], na.rm=na.rm),

sd = sd (xx[[col]], na.rm=na.rm)

) },

measurevar

)

# Rename the "mean" column 90

datac <- rename(datac, c("mean" = measurevar))

datac$se <- datac$sd / sqrt(datac$N) # Calculate standard error o f the mean

# Confidence interval multiplier for standard error

# Calculate t-statistic for confidence interval:

# e.g., if conf.interval is .95, use .975 (above/below), and use df=N-l

ciMult <- qt(conf.interval/2 + .5, datac$N-l)

datac$ci <- datac$se * ciMult

retum(datac)

} summary <-summarySE(escapeStats ,measurevar = "peaktemp", groupvars = "Sex")

library(ggplot2)

pea <-ggplot(data=summary,aes(x=:Sex,y= peaktemp))+

geom_point(size=5) +

geom_errorbar(aes(ymin=peaktemp-se,ymax=:peaktemp+se),size:=.5, width=.5) +

theme_bw() +

#geom_text(x=2,y=31.65,label-’p==0.6224",size=l 0)+

geom_text(x=0.5 ,y=32.75, la b e l-’ A " ,size= 10)+

xlab("NGF GF")+

ylab("Peak Temperature (°C)") +

theme(legend.title = element_blank(),

axis.text.x = element_text(size=40),

axis.text.y = element_text(size=40),

axis.title.x = element_blank(),

axis.title.y = element_text(size=:45), 91

legend, text = element_text(size=43))+

scale_y_continuous(limits:=c( 18,33))+

scale_x_discrete(breaks=c("Fll,"GF”), labels=c(”N G F ,,,”GFM))

#gravid females vs non gravid females fire temp

#set ddr

#import data ddr <- "—/Documents/R Data/Escape Temperature/” escapeStats <- read.csv(paste(ddr, "escapestats.csv", sep="")) require("ggplot2") escapeStats <- escapeStats[complete.cases(escapeStats),]

#p = 0.121 ancova<- lm(flretemp~Sex, data=escapeStats) summary(ancova)

g_df <- subset(escapeStats, Sex=="GFl?) f_df <- subset(escapeStats, Sex==”F ”)

# Welch Two Sample t-test p-value = 0.1204

tTest <- t.test(g_dfSfiretemp, f_df$firetemp) tTest

require(”ggplot2”) 92

summarySE <- fiinction(data=NULL, measurevar, groupvars=NULL, na.rm=FALSE,

conf.interval=.95, .drop=TRUE) {

library(plyr)

# New version o f length which can handle NA's: if na.rm==T, don't count them

length2 <- function (x, na.rm=FALSE) {

if (na.rm) sum(!is.na(x))

else length(x)

# This does the summary. For each group's data frame, return a vector with

# N, mean, and sd

datac <- ddply(data, groupvars, .drop^.drop,

.fun = function(xx, col) {

c(N = length2(xx[[col]], na.rm=na.rm),

mean = mean (xx[[col]], na.rm=na.rm),

sd = sd (xx[[col]], na.rm=na.rm)

) },

measurevar

# Rename the "mean" column

datac <- rename(datac, c("mean" = measurevar))

datac$se <- datac$sd / sqrt(datac$N) # Calculate standard error o f the mean

# Confidence interval multiplier for standard error 93

# Calculate t-statistic for confidence interval:

# e.g., if conf.interval is .95, use .975 (above/below), and use d f=N -l

ciMult <- qt(conf.interval/2 + .5, datac$N-l)

datac$ci <- datac$se * ciMult

retum(datac)

} summary <-summarySE(escapeStats ,measurevar = "firetemp", groupvars = ”Sex”)

library(ggplot2)

fir <-ggplot(data=summary,aes(x=Sex,y=: firetemp))+

geom_point(size=5) +

geom_errorbar(aes(ymin=firetemp-se,ymax=:firetemp+se),size=.5, width=.5) +

theme_bw() +

#geom_text(x=2,y=30.25,label="p=0.1204M,size=10)+

geom_text(x=0.5,y=32.75,label="Bf,,size=10)+

xlab("NGF GF")+

ylab('Tnitial Temperature (°C)") +

theme(legend.title = element_blank(),

axis.text.x = element_text(size=40),

axis.text.y = element_text(size=40),

axis.title.x = element_blank(),

axis.title.y = element_text(size=45),

legend, text = element_text(size=43))+

scale_y_continuous(limits=c( 18,33))+

scale_x_discrete(breaks=c(MF",MGF"), labels=c("NGF","GF")) 94

# make 3 pannel figure with escape temp, prefered temp, and ctmax vs body size library("gridExtra") grid.arrange( pea, fir, fgf, ncol=3, nrow =1)

# Figure 11

#set ddr

#import data ddr <- 'WDocuments/R Data/Escape Temperature/" escapeStats <- read.csv(paste(ddr, "escapestats.csv", sep -'")) require("ggplot2")

escapeStats <-subset(escapeStats,regexpr("H",ignore.case = TRUE, escapeStats$Sex)<0) escapeStats <-subset(escapeStats,regexpr("8",ignore.case = TRUE, escapeStats$AccTemp)<0) escapeStats <-subset(escapeStats,regexpr(" 17",ignore.case = TRUE, escapeStats$AccTemp)<0) escapeStats <-subset(escapeStats,regexpr("M",ignore.case = TRUE, escapeStats$Sex)<0)

escapeStats <-subset(escapeStats,regexpr("l_egg removal",ignore.case = TRUE, escapeStats$TrialExp)<0) escapeStats <-subset(escapeStats,regexpr("l_acclimation",ignore.case = TRUE, escapeStats$TrialExp)<0) escapeStats <-subset(escapeStats,regexpr("2_gravid",ignore.case = TRUE, escapeStats$TrialExp)<0) escapeStats <-subset(escapeStats,regexpr("ABT",ignore.case = TRUE, escapeStats$Experiment)<0) escapeStats <-subset(escapeStats,regexpr("pref’,ignore.case = TRU E, escapeStats$Experiment)<0) escapeStats <-subset(escapeStats,regexpr("U",ignore.case = TRUE, escapeStats$Sex)<0)

escapeStats$Control <- N U L L escapeStats$peaktemp <- N U L L escapeStats$firetemp <-N U L L 95

sex GF<- subset(escapeStats, Sex=="GF") sex_F<- subset(escapeStats, Sex— ’F")

#p= 0.02172 tTest <- t.test(sex_GF$EscTemp, sex_F$EscTemp) tTest

#does the trial number influence escape temperature?

#yes, but artificially inflated because o f confounding date and trial with gravid/non-gravid, will disregard trialAOV all <- aov(EscTemp ~ TrialExp, data=escapeStats) summary(trialAOVall) dateAOV all <- aov(EscTemp ~ Date, data=escapeStats) summary(dateAOVall)

#Table 5

#linear mixed effects model library(nlme) escTemp sex L M E <- lme(EscTemp ~ Sex, random=list(~l|Date, ~l|TrialExp), data=escapeStats) anova(escT empsexJLME) summary(escT empsexLME)

summarySE <- fimction(data=NULL, measurevar, groupvars=NULL, na.rm=FALSE,

conf.interval=.95, .drop=TRUE) {

library(plyr) 96

# New version o f length which can handle N A ’s: if na.rm==T, don’t count them length2 <- function (x, na.rm=FALSE) {

if (na.rm) sum(!is.na(x))

else length(x)

}

# This does the summary. For each group’s data frame, return a vector with

# N, mean, and sd datac <- ddply(data, groupvars, .drop=.drop,

.fun = function(xx, col) {

c(N = length2(xx[[col]], na.rm=na.rm),

mean = mean (xx[[col]], na.rm=na.rm),

sd = sd (xx[[col]], na.rm=na.rm)

) },

measurevar

)

# Rename the ’’mean” column datac <- rename(datac, c(”mean" = measurevar))

datac$se <- datac$sd / sqrt(datac$N) # Calculate standard error o f the mean

# Confidence interval multiplier for standard error

# Calculate t-statistic for confidence interval:

# e.g., if conf.interval is .95, use .975 (above/below), and use d f=N -l ciMult <- qt(conf.interval/2 + .5, datac$N-l) datac$ci <- datac$se * ciMult retum(datac)

}

summary <-summarySE(escapeStats ,measurevar = "EscTemp", groupvars = ”SexM)

ggplot(data=summary ,aes(x=Sex,y= EscT emp))+

geom_point(size=5) +

geom_errorbar(aes(ymin=EscTemp-se,ymax=EscTemp+se),size=.5, width=.5) +

theme_bw() +

#geom_text(x=2,y=31.65,label="p=0.6224",size=l 0)+

#geom_text(x=0.5,y=:32.75,label=l’BM,size=10)+

xlab("NGF GF")+

ylab("Escape Temperature (°C)ff) +

theme(legend.title = element_blank(),

axis.text.x = element_text(size=40),

axis.text.y = element_text(size=40),

axis.title.x = element_blank(),

axis.title.y = element_text(size=45),

legend.text = element_text(size=43))+

scale_y_continuous(limits=c( 18,23))+

scale_x_discrete(breaks=c("F","GF"), labels=c(,,NG F,,,,,GF"))

#Figure 12 ddr <- "~/Documents/R_Data/Escape Temperature/” escapeStats <- read.csv(paste(ddr, "escapestats.csv", s e p -'"))

# create a new dataframe for peaktemp in g and non 98 nonpeaklm <- data.frame(data=escapeStats[escapeStats$TrialExp=-' lnongravid",]) gpeaklml <- data.frame(data=escapeStats[escapeStats$TrialExp=:="3_gravid",]) gpeaklm<- data.frame(data=escapeStats[escapeStats$TrialExp=-f4_gravid",]) nong <- rbind(nonpeaklm, gpeaklm,gpeaklml) nong <- non_g[complete.cases(non_g),]

# ancova esctemp p=0.031400 sex p=0.657952 peaklm <- lm(data.peaktemp~data.EscTemp+data.Sex, data=non_g) summary(peaklm)

peaklm <- lm(data.peaktemp~data.EscTemp, data=non_g) summary(peaklm)

#plot r2 and slope on plot lm_equ_pea <-function(non_g){

m <-lm(data.EscTemp~data.peaktemp,non_g);

eq<-substitute(italic(y)= a + b %.% italic (x)*",M—italic(r)A2~”=="~r2,

list(a = format(coef(m)[l],digits = 2),

b = format(coef(m)[2],digits = 2),

r2 = format(summary(m)$r.squared, digits =3)))

as.character(as.expression(eq));

}

#plot escape temperature as a function peak temp in all ***** ggplot(data = non g, aes(x=data.EscTemp, y=data.peaktemp)) +

geom_point(aes(shape=data.Sex),size=8) +

theme_bw() +

#geom_text(x= 15,y= 18,label=lm_equ_pea(non_g), parse=TRUE)+

#geom_text(x==25,y=38,label-’p=0.0260*", size=12)+ 99

geom_smooth(method=lm, se=FALSE, size=5,color=’black’) +

theme(legend.title = element_blank(),

axis.text.x = element_text(size=40),

axis.text.y = element_text(size=40),

axis.title.x = element_text(size=45),

axis.title.y = element_text(size=45),

legend.key.size = unit(2.5, ’lines’),

legend, text = element_text(size=43)) +

scale_shape_manual("data.Sex”, values=c(16, 17), breaks=c(”F", "GF"), labels=c("NGF", "GF”))+

xlab(”Escape Temperature (°C)”) +

ylab(”Peak Temperature (°C)”)

#Figure 12 ddr <- "-/Documents/RData/Escape Temperature/” control <- read.csv(paste(ddr, ’’control.csv’’, s e p -’")) require(”ggplot2”)

library(ggplot2) ggplot(control, aes(x=time, fill=group)) +

geom_histogram()+

theme_bw() +

xlab(’’Time of escape or removal (min)”) +

ylab(”Number o f crabs”)+

theme(legend.title = element_blank(),

axis.text.x = elementtex^size^O),

axis.text.y = elementtex^size^O),

axis.title.x = element_text(size=45),

axis.title.y = element_text(size=45),

legend, text = element_text(size=43)) + 100

scale_fill_manual(’’group”, values=c("black", ’’grey”), breaks=c("con”, "exp”), labels=c(”Control”, ’’Experimental”))

summarySE <- function(data=NULL, measurevar, group vars=NULL, na.rm=FALSE,

conf.intervaH.95, .drop=TRUE) {

library(plyr)

# New version o f length which can handle N A ’s: if na.rm==T, don’t count them

length2 <- function (x, na.rm=FALSE) {

if (na.rm) sum(!is.na(x))

else length(x)

}

# This does the summary. For each group’s data frame, return a vector with

# N , mean, and sd

datac <- ddply(data, groupvars, .drop=.drop,

.fun = fimction(xx, col) {

c(N = length2(xx[[col]], na.rm=na.rm),

mean = mean (xx[[col]], na.rm=na.rm),

sd = sd (xx[[col]], na.rm=na.rm)

) },

measurevar

) 101

# Rename the "mean” column

datac <- rename(datac, c("mean" = measurevar))

datac$se <- datac$sd / sqrt(datac$N) # Calculate standard error o f the mean

# Confidence interval multiplier for standard error

# Calculate t-statistic for confidence interval:

# e.g., if conf.interval is .95, use .975 (above/below), and use df=N-l

ciMult <- qt(conf.interval/2 + .5, datac$N-l)

datac$ci <- datac$se * ciMult

retum(datac)

summary <-summarySE(control,measurevar = "time”, groupvars = "group")

library(ggplot2)

ggplot(data=control,aes(x=group,y= time))+

geom_boxplot(color = "black", fill = "grey")+

#geom_errorbar(aes(ymin=time-se,ymax:=time+se),size=.5, width=.5) +

theme_bw() +

#geom_text(x=2,y=31.65,label="p=0.6224",size=10)+

xlab("Control Experimental")+

ylab("Time (min)") +

theme(legend.title = element_blank(),

axis.text.x = element_text(size=40),

axis.text.y = element_text(size=40),

axis.title.x = element_blank(), 102

axis.title.y = element_text(size=45),

legend.text = element_text(size=43))+

scale_x_discrete(breaks=c("con’7 ’exp"), labels^cC'Control'V’Experimentar))

ancova<- lm(time~group, data=control) summary(ancova)

cont <- subset(control, group==”con”) expi <- subset(control, group==”exp”)

tTest <- t.test(cont$time, expi$time) summary(tTest)