Introduction

Organisms live in environments that vary, often unpredictably, both in time and space. If variation impacts the ability to survive and reproduce, organisms must either avoid the unfavorable conditions or try to cope with them, by functionally adjusting their phenotypes. In evolutionary biology, adaptive phenotypic plasticity describes the ability of organisms to respond to variation in the environment, by modifying their phenotypes in a direction that increases survival and reproduction (Whitman and Agrawal 2009). A classic case of adaptive phenotypic plasticity is the antipredator defenses developed by prey after exposure to predator cues (Agrawal 2001; Benard 2004): for example, in the presence of predators, water fleas (Daphnia sp.) develop sharp helmets and long tail spines (Dodson 1988), mussels increase shell thickness and abductor muscles (Leonard et al. 1999), and anuran tadpoles develop deeper tails (Relyea 2001a).

Adaptive phenotypic plasticity can be divided into two categories, developmental plasticity and phenotypic flexibility, depending on whether the plastic response is or is not reversible (Forsman 2015). Developmental plasticity involves mainly life-history and morphological traits, which are controlled by mechanisms acting on long timescales and at different hierarchical levels. The above-mentioned changes in the morphology of water fleas, mussels, and tadpoles are examples of this category of plastic traits. Phenotypic flexibility, in contrast, involves morphological and behavioral traits that can be reversibly changed over shorter timescales to cope with the local and ephemeral conditions of the environment (Piersma and Drent 2003). For example, under high predator risks, prey increase vigilance and reduce feeding activity (Ferrari et al. 2009), they change spatial distribution favoring aggregations and social interactions (Kimbell and Morrell 2015), and modify several aspects of their breeding behavior (Lima 2009).

To study the evolution of developmental plastic traits, quantitative genetics models describe plasticity in terms of reaction norms, the set of phenotypes that a genotype develops under different environmental conditions. These models consider phenotypic variation as the sum of two additive components, genetic and environmental variation, and of their interaction. When different genotypes have different reaction norms (that is, when there is gene-by-environment phenotypic variation), then adaptive developmental-plastic phenotypes may evolve. The reaction-norm approach allows to separate the genetic and environmental component of among-individual variation, but since it does not consider intra-individual environmental variation, it may not be properly suited to study the evolution of flexible phenotypes (Piersma and Drent 2003; Beaman et al. 2016). In fact, flexible traits may be viewed as the expression of multidimensional reaction norms (sensu Westneat et al. 2019), in which individuals with the same genotype, but with different environmental experiences, develop different context-dependent responses. Indeed, there is accumulating evidence that environmental cues during development may influence the flexible responses later in life. For example, woodfrog tadpoles reared under high-predator risk develop more intense anti-predator responses than their conspecifics under low-predator risk, because they learn predator cues more effectively and retain their memory for longer (Ferrari 2014).

These studies clearly show that the environment has a double effect on the expression of flexible phenotypes: it influences the development of the physiological and/or neurological machinery controlling for the flexible responses (a long timescale effect) and it provides the stimuli that make this machinery at work (a short timescale effect). The phenotypic variation of flexible traits can thus be divided into two different environmental components, the developmental plastic \(\left({\sigma }_{D}^{2}\right)\) and the flexible component \(\left({\sigma }_{F}^{2}\right)\), together with their interaction \(\left({\sigma }_{D\times F}^{2}\right)\), as suggested by Piersma and Drent (2003). The environmental components combine additively with the genotypic components to explain the total phenotypic variation of flexible traits, which can be described by the following equation:

$${\sigma }_{T}^{2}={\sigma }_{G}^{2}+{\sigma }_{D}^{2}+{\sigma }_{F}^{2}+{\sigma }_{G\times D}^{2}+{\sigma }_{D\times F}^{2}+e$$
(1)

where \(e\) is an error term, \({\sigma }_{G}^{2}\) is the genetic component, which can be further divided into additive, dominance, and epistatic variance, and \({\sigma }_{G\times D}^{2}\) is the gene-by-environment interaction, which is assumed to involve only the developmentally plastic component of environmental variance, because this is the only component responsible for among-individual variation. In Fig. 1, we present four simplified examples of “flexible reaction norms.” We imagine two genotypes (black and blue lines), which developed under different environmental conditions (E1 and E2) and which were exposed to different acute stimuli (S1, solid line, and S2, dotted line). The x-axis shows the developmental environment and the y-axis the flexible phenotypic response (T) to the acute stimuli. In Fig. 1a, past (ontogenetic) and present environments (acute stimuli) show only additive effects on the flexible trait, whereas, in Fig. 1b-d, the effects of genotype-by-environment and environment-by-environment interactions are shown.

Fig. 1
figure 1

Behavioral plasticity and flexibility. The lines represent hypothetical flexible reaction norms of the black and blue genotypes. The genotypes are assumed to develop under different environmental conditions and to be exposed to different acute stimuli (S1, solid line; S2 dot line). In (a), phenotypic variation is explained by the additive effects of genes and environments. In (b), there is also the effect of the gene-by-environment interaction. In (c), there is the interaction between the two components of environmental variation (D, the development component, and F, the flexible component). In (d), all additive and interaction components are present. See the text for an explanation of the equations

In the present study, we analyze variation in anti-predator phenotypic responses in tadpoles of the Italian Treefrog, Hyla intermedia. Anuran larvae are model organisms for investigating phenotypic plasticity in response to predation risk (Van Buskirk et al. 1997; Relyea 2001a, b, c; Altwegg and Reyer 2003; Benard 2004; Touchon and Robertson 2018). Their response often differs in relation to the type of predator. For example, if tadpoles live with aquatic insects that adopt a sit-and-wait predator strategy (i.e., dragonfly larvae), they develop tails with large fins, which are thought to increase turning speed (Blair and Wassersug 2000), and with conspicuous spots, which are thought to direct predators’ attack toward the less vulnerable parts of the body (Innes-Gold et al. 2019). In contrast, if tadpoles live in the presence of fish that actively chase their prey, they develop shallow and translucent tails to reduce detection and to increase overall swimming speed (Innes-Gold et al 2019). Independent of the type of predator, tadpoles respond to predation risk by modifying both the timing and the size at metamorphosis, although the directions of changes vary among species (Benard 2004; Relyea 2007). Besides these changes in morphology and life-history, predators are known also to modify tadpole behavior, causing a reduction in their overall feeding activity (Relyea 2001c; but see Steiner 2007). Interestingly, there is evidence that both morphological and behavioral plasticity depend on the activity of the neuroendocrine stress axis and that they are the long-term (morphology) and the short-term consequences (behavior) of variation in corticosterone content (Maher et al. 2013).

In this study, we analyzed the predator effects on three developmentally plastic characters (tail morphology, age, and size at metamorphosis) and on a flexible trait (tadpole anti-predator behavior). Tadpoles involved in the rearing experiment belonged to eight fullsib families, formed using an incomplete-factorial breeding design, which allowed to control for both maternal and paternal effects. Our goal was to assess the relative role of genes and environments on the tadpole phenotypes to provide insights into the evolutionary mechanisms of plastic phenotypes.

Materials and methods

The rearing experiment

The breeding experiment used an incomplete factorial design, which allowed us to disentangle maternal and paternal effects (Roff 1997; Botto and Castellano 2016). At the beginning of the 2018 breeding season (on April 29th), we caught four mating pairs. The treefrogs in amplexus were separated and randomly assigned to two groups (mating quartets) of two males and two females. Within each mating quartet, males and females were randomly paired and were let to spawn in separate tanks. As soon as the two females had laid a sufficient amount of eggs, they were gently separated from amplexus and forced to swap their partners. The newly formed pairs were transferred to a new tank and let to complete spawning. This forced mating procedure allowed us to obtain, for each mating quartet, four fullsib families, each sharing with the other three families of the mating quartet either the mother (dam), the father (sire), or none of the parents. In total, we obtained eight fullsib egg masses, each containing from 300 to 600 eggs. Eggs of each family were split in two groups and let to develop either in the presence (Ontogenetic-predator treatment) or in the absence (ontogenetic control treatment) of Aeshnid dragonfly larvae (Aeshna sp.), which coexist with treefrogs in many ponds and which are known to alter behavior and morphology of tadpoles of many anuran species (Petranka et al. 1987; Van Buskirk and Relyea 1998; Relyea 2001c, 2002a, bc; Gazzola et al. 2015). After hatching, we randomly selected 20 tadpoles from each of the 16 treatment*family groups and further divided them into two replicates, obtaining 32 experimental nits, each of 10 full-sibling tadpoles. A sample of the full-sibling tadpoles that were excluded from the experiment were kept in separate tanks, under similar rearing conditions, to be eventually used as a reserve, if some of their experimental siblings accidentally died (Botto and Castellano 2016).

The tadpoles of the 32 experimental units were transferred into 32 perforated stainless-steel baskets (40 × 40 × 15 cm, hole diameter = 1 mm), which were placed into eight fiberglass troughs (217 × 40 × 15 cm), so that each trough contained the four experimental units from the same mating quartet, treatment, and replicate. While the perforated lateral sides of the baskets allowed a continuous horizontal water flows within the trough, the perforated bottoms were covered with a plastic sheet to facilitate the accumulation of food and to prevent young tadpoles to be injured by vertical water flows. In the four predator troughs, we placed two hemispheric predator cages (diameter = 300 mm), constructed of 2-mm metal meshes. To promote a homogeneous diffusion of predator chemical cues within the troughs, the two cages were positioned outside the baskets so that only one side of each basket was in physical contact with the cage. Each cage contained three Aeshna larvae, which were fed twice a week with three treefrog tadpoles. All troughs were placed outdoor in a sunny lawn, under a shelter made with shade cloth material that caused approximately 40% shade. To further improve experimental control over solar radiation, we used replicates within a mating quartet as a block factor, and positioned troughs of the same mating quartet and replicate, but of different treatment, in close contact, so that they could share the most similar radiation conditions.

Tadpoles were fed fish vegetable flakes ad libitum until completion of metamorphosis and were released in their parental breeding site.

Morphological and life-history traits

We analyzed plasticity of one morphometric property (tail shape) and two life-history traits (body size and age at metamorphosis).

Every week, tadpoles were placed on one side in a Petri dish, lined with graph paper, and photographed on their lateral view with a Raspberry Pi v2.1 8 MP camera module on a Raspberry Pi model 3B + . In the present work, we used only the pictures of tadpoles at Gosner (1960) stages 33–37. We described variation in tail shape by two-dimensional landmarks and semilandmarks (Fig. 2), which were digitized using tpsDig2 v. 2.26 (Rohlf 2015) and analyzed with the R package geomorph v. 4.0.0 (Adams et al. 2021) in R statistical environment v.4.1.0 (R Development Core Team 2018) (see below).

Fig. 2
figure 2

A tadpole treefrog with 6 landmarks (black) and 10 semilandmarks (gray). The landmarks and semilandmarks are as follows: 1, intersection of the dorsal edge of the tail with the head/body; 2, tip of the tail; 3, intersection of the ventral edge of the tail and head/body; 4, tip of the head; 5, intersection of the dorsal edge of the tail muscle and the head/body; 6, intersection of the ventral edge of the tail muscle and the head/body; 7–14, equally spaced semi-landmarks delineating the dorsal margin of the tail fin; 15–22, equally spaced semi-landmarks delineating the ventral margin of the tail fin. Scale bar: 1 cm

To describe body size at metamorphosis, we captured froglets at Gosner stages 45–46, when their tails were almost completely reabsorbed. Froglets were anesthetized in a 0.1% MS-222 solution and photographed (see above) in both dorsal and ventral positions. From these pictures, we used ImageJ 1.x (Schneider et al. 2012) to measure the following morphometric properties: snout-vent lengths (SVL), elbow-to-elbow distance (EtoE), femur length (FemL), tibia length (TL), and foot length (FL). To minimize observer bias, blinded methods were used when the morphological data were collected. With the exception of EtoE, all the other traits were measured from the ventral and dorsal pictures and their averages were computed. Body size was the first principal component of the five morphometric properties and explained 67% of their total variance (canonical loadings: SVL = 0.736; EtoE = 0.595; FemL = 0.919; TL = 0.888; FL = 0.904).

We defined age at metamorphosis as the number of days from hatching to completion of larval development (stages 45–46, Gosner 1960).

Analysis of tadpole behavior

We described activity and spatial distribution of tadpoles by observing their positions both in the rearing baskets and during the recording trials.

Activity in the rearing baskets was described by slowly approaching the troughs and counting, for each family, the proportion of tadpoles which were either resting on the bottom (inactive tadpoles) or swimming in the water column or along the walls of the basket (active tadpoles). Surveys were carried out from 1 to 17 of June 2018, every day, several times per day, for a total of 49 samples, divided into four phases of the day: early morning (from 7 to 10 am, N = 12), late morning and early afternoon (from 10 am to 2:30 pm, N = 13), late afternoon (from 2:30 to 6:00 pm, N = 8), and evening (after 6:00 pm, N = 16).

The second method to describe tadpole activity was based on time-lapse recordings of the positions of tadpoles inside experimental arenas (60 × 40 × 15 cm plastic tanks). We used six tanks half filled with well water. In each tank, in proximity of its shorter side, we placed a 5-mm metal mesh cage (15 × 15 × 15 cm). In three tanks, the cage contained an Aeshna larva, and in the other three, it was empty. About 80 cm above each cage, we placed a Raspberry Pi v2.1 8MP camera, connected to a raspberry Pi B3 + . A custom-designed software for time-lapse recording was installed in each raspberry and remotely controlled from a laptop computer via Bluetooth standards. Technical details of the hardware and codes of the software are provided in github-repository at https://github.com/olivierfriard/raspberry_time-lapse_coordinator. During a recording session, we randomly collected four tadpoles from three experimental families. Two of the four tadpoles of each family were placed inside one of the three “predator” arenas, the other two inside one of the other three “no-predator” arenas. Tadpoles were let to acclimatize inside a small cylindrical mesh cage (diameter = 10 cm), placed at the center of the arena, for 5 min; then the cage was lifted and tadpoles were free to move. Time-lapse recording was set at 1 frame every 5 s and it lasted for 1 h (720 pictures saved). At the end of each recording session, tadpoles were returned to their baskets. In total, we conducted 266 1-h time-lapse recordings between the 4 and the 16 of June. Each experimental family was tested from a minimum of three to a maximum of six times both in the no-predator trials (mean number of time-lapse recordings = 3.8; median = 4) and in the predator trials (mean number of time-lapse recordings = 4.5; median = 5).

To analyze the large number of pictures collected during the recording sessions, we used a custom-designed graphical-user interface program, written in Python3. The code is presented in the supplementary materials of the present paper. The program processes the images of a time-lapse session sequentially. At time t = 0, it opens the first picture and let the operator to set the perimeter of the arena, the reference axes, and the initial positions of the two tadpoles, which are assigned with a binary code of 0 (first click of the mouse left button) and 1 (second click). The program saves the coordinates, closes the picture, and opens the next one. In the new picture, to facilitate individual tracking, the program shows the tadpoles’ previous positions. If tadpoles have not moved, a right-button click of the mouse makes the program to save the same coordinates and pass to the next images. If tadpoles have moved, the first left-button click indicates the new position of tadpole 0, and the second left-button click indicates that of the tadpole 1. Furthermore, the program is equipped with several functions that allow the operator to move forward and backward in the time-lapse sequence, to correct possible mistakes. To minimize observer bias, blinded methods were used when the tadpoles’ coordinates were recorded. From the coordinate files, we computed eight descriptors of the tadpole spatial behavior: (i) the between-frame average displacement (DISPL); (ii) the mean distance from the cage (CD); (iii) the mean distance between the two tadpoles (bTD); (iv) the portion of frames during which the tadpole was resting (REST) (we used a 2-mm distance threshold; if the between-frame distance was lower than the threshold, the tadpole was assigned a “resting state”; otherwise, it was assigned a “moving state”); (v) the mean (mMD) and the (vi) variance (vMD) of movement durations, we considered only the sequences of frames in which the tadpole was in a moving state and measured their mean and variance; (vii) cage proximity (CP), the portion of frames with the tadpole less than 5 mm from the cage; (viii) the average distance from the arena wall (WD).

Statistical analyses

Morphological and life-history traits

We used geomorph v.4.0.0 in R to describe variation in tail shape. 2D landmarks and semi-landmarks were aligned with the generalized Procrustes function. To obtain a synthetic representation of the tail morphospace, a principal component analysis was carried out on the Procrustes coordinates and the biological meaning of the extracted components was inferred by observing their deformation grids (Sherratt et al. 2018; Theska et al. 2020). Since the first PC explains much of tail-shape variation induced by the ontogenetic treatment (see “Results” section), we used this component as the descriptor of tail-shape plasticity in successive analyses.

To analyze environmental and parental effects, we used generalized linear mixed models (GLMMs), in which tadpoles’ tail-shape and froglets’ age and body size were the dependent variables, whereas ontogenetic treatment, mating quartet, replicate, family, and/or dam and sire identity were the predictors. For statistical inference, we adopted a forward-model selection approach for pairs of nested models as suggested by Roff and Wilson (2014). We estimated models using the package lme4 in R (Bates et al. 2015) and compared their fits by computing the change in deviance with a χ2 distribution. For each of the dependent variables, we started with the analysis of the null model, which included the mating quartet, as a fixed factor, and the replicate as a random factor nested within the mating quartet. We compared the fit of the null model with that of the ontogenetic-treatment model, which included the treatment as a fixed factor. We then tested for a family-by-treatment interaction and compared the ontogenetic-treatment model with the family random-slope model. Finally, we removed the family factor and built two random-intercept models: the first included the dam factor only, the second both the dam and sire factors. If the treatment-by-family interaction was statistically significant, then the dam and sire effects were assessed in the two ontogenetic treatments, separately. In contrast, if the family-by-treatment interaction was not statistically significant, then the parental effects were assessed on the entire sample.

Behavioral traits

To analyze the parental and environmental effects on tadpoles’ behavior, we carried out three series of statistical tests. In the first, we focused on the acute treatment. We used Wilcoxon signed-rank tests to analyze behavioral differences between tadpoles from the same experimental unit, which, during a recording session, were tested either with or without caged predators in the arenas.

In the second series of analyses, we focused on the ontogenetic and the parental effects. Since we recorded tadpoles several times, without individual recognition, we controlled for pseudo-replication errors, by carrying out these analyses at the experimental-unit level (i.e., using the mean values of the 32 replicates recorded under the two acute treatments, with a sample size of N = 64). In a preliminary investigation, we carried out bivariate correlation analyses between the eight behavioral variables, adopting, for each test, a Bonferroni significance threshold of α=0.0018. Since correlation was on average high (see “Results” section), we extracted the first two principal components from the correlation matrix and used them as the dependent variables in successive analyses. The effects of the ontogenetic and the acute treatments (fixed factors) were inferred from the model, which included the mating quartet and the replicate as random factors. Parental effects were inferred adopting the forward-selection approach as described for the analyses of morphological and life-history traits (see above).

In the third series of analyses, we considered the environmental and the parental effects on tadpoles’ behavior in the rearing baskets. To analyze the ontogenetic-treatment effect, we carried out a Wilcoxon signed-rank test, which compared, for each survey, the proportions of active tadpoles in experimental units of the same family and replicate, but different ontogenetic treatments (sample size N = 784). To analyze the effects of the phase of the day, we carried out Kruskal–Wallis tests, separately, for the two ontogenetic treatments. Finally, to analyze the parental effects, we used, as dependent variable, the average frequencies of active tadpoles grouped by family, treatment, replicate, and phase of the day (sample size, N = 128), and carried out a model selection analysis. The null model included mating quartet and replicate as random factors, the ontogenetic treatment as a fixed factor, and the phase of the day as a covariate. Parental effects were inferred by adopting the same procedure described for morphological and life-history traits (see above).

Results

Tail-shape variation

The first principal component (PC1) explains 39% of the total variance in tail shape. Negative deviations of PC1 from the sample mean are associated with an in increase in the length and in the dorsal curvature of the tail and with a shortening of the head/body, whereas positive deviations from the mean are associated with an elongation of the head/body. Since tadpoles raised with predators showed PC1 values significantly smaller than those raised without predators (null vs. treatment model: \({\chi }_{1}^{2}\) = 130.9, P < 0.001) (Fig. 3), we used this component as a descriptor of tadpole plastic response to dragonfly predators. We found a strong family effect on the variation of this component (\({\chi }_{3}^{2}=26.102, P<0.001\)), but no clear evidence for a family-by-treatment interaction (\({\chi }_{3}^{2}=6.49, P=0.09\)). When we analyzed the independent additive effects of dams and sires, we found that both were statistically significant (dams: \({\chi }_{1}^{2}=8.893, P=0.003\); sires: \({\chi }_{1}^{2}=19367, P<0.001\)) (Fig. 4).

Fig. 3
figure 3

(a) Tail-shape frequency distribution in tadpoles raised either with or without predators. Tail shape is the first principal component (PC1) extracted from the Procrustes coordinates, which explains 39% of the total morphospace variation. In (b), the thin-plate spline shows changes from the mean shape (grid) to the minimum value of PC1. In (c), the thin-plate spline shows changes from the mean shape and the maximum value of PC1. Negative values of PC1 are associated with shapes developed in the presence of predators, whereas positive values are associated with shapes developed in the absence of predators

Fig. 4
figure 4

The effect of the ontogenetic treatment on tadpoles’ tail shape. Lines show changes in (quartet-adjusted) mean values between tadpoles of the same family and replicate. Line color encodes for dam identity, line style for sire identity

Life-history traits

We measured and determined the age at metamorphosis of 231 froglets (72% of the experimental tadpole population).

Table 1 shows results from model selection analyses to test for significant effects of treatment and family on life-history traits. Body size was not significantly affected by the ontogenetic treatment. The family random-intercept model performed slightly better than the fixed effects model and it was outperformed by the random-intercept-slope model, providing evidence for a significant parent-environment interaction on the body size variance structure (Fig. 5a). When we analyzed treatments separately, we found a significant additive effect only of dams and only in the control ontogenetic treatment (Table 1).

Table 1 Results of the GLMMs, with life-history and morphological traits as independent variables, rearing conditions (with — P — or without — N — PREDATOR) as fixed factor, and parents (DAM and SIRE, nested within mating quartet) as random factors. Since there was a significant interaction between the fixed and random factors, the random effects were further investigated by repeating GLMMs, separately, in both ontogenetic treatments. Significant P-values are bolded
Fig. 5
figure 5

The effect of the ontogenetic treatment on (a) froglets’ body size and (b) age at metamorphosis. Lines show changes in quartet-adjusted mean values between tadpoles of the same family and replicate. Line color and style are the same as in Fig. 3

The age at metamorphosis ranged from 40 to 57 days (mean = 48, SD = 4.4 days) and it was significantly affected by the ontogenetic treatment. In fact, the presence of predators reduced both the mean (marginal effect = -2.2 days, SD = 0.25) and the variance (Levine’s test: F = 9.207, df = 1, 229, P = 0.003) of the age at metamorphosis (Fig. 5b). Moreover, independent of the treatment, there was evidence for both an additive parental effect and a significant parent-by-treatment interaction (Table 1). However, evidence for additive effects of dams and sires was weak, because when the effects were analyzed separately in the two environments, they did not result statistically significant (Table 1).

Behavioral traits

Table 2 shows the descriptive statistics of the eight behavioral traits in the two acute treatments, with results of the Wilcoxon signed-rank tests. With respect to the empty-cage treatment, in the caged-predator treatment, tadpoles showed shorter average displacement (DISPL) and shorter mean and variance movement duration (mMD and vMD), longer resting (REST), larger distances from the border (WD) and from the cage (CD), and shorter permanencies in cage proximity (CP). In contrast, predators do not seem to affect the between-tadpole distances. Notice that, in these statistical tests, the two tadpoles within a trial were arbitrarily assigned with a binary code to allow univocal association between trials. Similar results (not shown) were found when the Wilcoxon tests were carried out on the within-trial means or when only one, arbitrarily selected tadpole was used in the analyses (in both cases, N = 133).

Table 2 Descriptive statistics of the eight behavioral variable used to describe the tadpole behavior, during the 266 recording sessions. In each session, four tadpoles of the same replicate were tested simultaneously either with (two tadpoles) or without (the other two tadpoles) predators. The null-hypothesis of no predator effect on tadpole behavior was tested with Wicoxon tests for paired samples

Table 3 shows the pattern of bivariate association between behavioral traits and Table 4 shows the canonical loadings of the first two principal components. The first component explains 40.68% of the total variance and it is easily interpreted as an activity index, because it is positively correlated with DISPL, mMD, and vMD, while it is negatively correlated with REST and WD. The second component explains 22.35% of the remaining variation and it is a spatial factor, being positively correlated with CD and negatively with CP: tadpoles that stayed away from the cage scored high in this component.

Table 3 Pearson correlation coefficients (above the main diagonal) between the variables used to describe tadpoles’ behavior in the recording sessions. Null-hypothesis probabilities are shown below the main diagonal (in bold, values below the Bonferroni significance threshold of α=0.0018)
Table 4 Canonical loadings of the first and second principal components of the behavioral variables (the behavioral variables that weight strongly on a component are in bold)

The activity index was significantly affected by both the ontogenetic (F = 25.707; df = 1, 58, P < 0.001) and the acute treatments (F = 9.076; df = 1, 58; P = 0.004): tadpoles raised with predators were less active than those raised without and the differences in activity slightly increased in the caged-predator acute treatment, although not significantly (F = 2.050, df = 1, 58, P = 0.842, Fig. 6a). Independent of the treatments, the family explained a significant portion of variation in activity (\({\chi }_{1}^{2}\) = 6.718, P = 0.009), with similar effects on the ontogenetic treatments (random-intercept versus random-slope models: \({\chi }_{2}^{2}\) = 0.219, P = 0.8963).

Finally, when the effects of dams and sires were analyzed separately, only those of dams were statistically significant (\({\chi }_{1}^{2}\) = 11.482, P < 0.001).

Fig. 6
figure 6

Marginal means of (a) activity and (b) average cage distances in tadpoles raised and recorded either with or without predators. On the x-axis, there are the ontogenetic treatments, whereas the acute treatments are represented by different lines, either solid (empty-cage treatment) or dashed (caged-predator treatment)

When we applied the same procedure on the tadpoles’ spatial position, we observed a significant effect of the acute treatment only (\({\chi }_{1}^{2}\)= 15.160, P < 0.001): independently of both the ontogenetic treatment and parental factor, tadpoles stayed farther away from the cage when it contained a predator than when it was empty (Fig. 6b).

Activity in the rearing baskets

Tadpole activity in the rearing tanks was significantly reduced by the presence of predators (mean difference = 0.192, Wilcoxon test: N = 784, Z = 16.727, P < 0.001) and it was significantly affected by the phase of the day (Kruskal–Wallis: with predators, H = 153.389, P < 0.001; without predators, H = 130.623, df = 3, P < 0.001), with higher activity in the early morning (mean frequency = 0.545, SE = 0.014) and late morning and early afternoon (mean frequency = 0.535, SE = 0.012) and lower activity in the late afternoon (mean frequency = 0.373, SE = 0.014) and in the evening (mean frequency = 0.319, SE = 0.009).

GLMM analyses showed significant effects of both the family (fixed vs. random-intercept model: \({\chi }_{1}^{2}\) = 7.228, P = 0.007) and the treatment-by-family interaction (random-intercept vs. random-slope model: \({\chi }_{2}^{2}\) = 41.195, P < 0.001) on tadpole activity in the rearing baskets. The analyses in the two ontogenetic treatments showed significant effects of dams in the control (\({\chi }_{1}^{2}\) = 8.689, P = 0.0032), but not in the predator treatment (\({\chi }_{1}^{2}\) = 0, P = 1). Sires had no effect i both the control and predator treatment (\({\chi }_{1}^{2}\) = 0, P = 1).

Discussion

Predation is an important selective mechanism driving adaptive evolution. Since predation varies both in time and space, natural selection has favored the evolution of mechanisms that allow prey to perceive and to respond effectively to the current risk they face. In this study, we have analyzed the environmental and parental components of variation in life history, morphology, and behavior to provide insights into the evolutionary mechanisms of plastic and flexible phenotypes.

Life-history traits are developmental plastic characters and we show that the presence of predators affects their expression. Specifically, we show that tadpoles metamorphose earlier, but at a similar body size, when they are raised with predators than when they are not. This response is unusual among anurans. For example, Touchon et al. (2013) found that nonlethal predators caused red-eyed treefrogs to metamorphose at the same time and at similar size as controls. Relyea (2007) reviewed 41 studies on the effects of caged predators on tadpole metamorphosis and found that in 39 of them, tadpoles raised with caged predators metamorphosed at the same time or later than tadpoles of the no-predator treatment. In the two studies where the opposite trend was observed, tadpoles either metamorphosed earlier and at smaller body size, as predicted by theoretical models (Werner 1986), or, as in our own study, they metamorphosed earlier but at the same size of tadpoles raised without predators (Laurila et al. 1998). From the one hand, our results provide clear evidence that treefrogs are able to reduce their time to metamorphosis when exposed to predation. From the other hand, however, they fail to support the theoretical prediction of a trade-off between growth and developmental rate. We argue that failure is an artifact of our experimental setup, in which food was never a limiting factor for larval growth and development. Tadpoles are known to decrease activity in the presence of predators and to increase it in the presence of conspecifics (Relyea 2001c). If the amount of ingested food decreases with the decreasing of tadpoles’ activity, then we should expect that tadpoles exposed to high predation risk ingested less food and, consequently, have less resources to invest in growth and development than tadpoles under a lower predation risk. Experimental evidence, however, provides no support to this prediction and suggests that the link between activity and feeding might not be as simple as it is often assumed (Steiner 2007). In our experiment, food was provided ad libitum and the predator-induced decrease in feeding had no limiting effects on growth and development. In contrast, in the absence of predators, since tadpoles were more active, they were also more likely to physically interact with each other and to perceive the environment as being more competitive than it actually was (since food was not a limiting resource). The overestimation of intraspecific competition might have thus induced tadpoles to invest proportionally more in searching and feeding than in growth and development. For example, tadpoles of Rana sylvatica were found to increase activity and to decrease growth and development, when raised in aquaria with mirror walls that increased perceived conspecific density (Rot-Nikcevic et al. 2006). We are aware that our explanation is an ad hoc hypothesis for unexpected experimental results, but it is a testable hypothesis in that it predicts that the amount of food and intraspecific competition are pivotal for determining the predator effect on tadpole growth and development, as observed, at the interspecific level, in R. sylvatica and R. pipiens (Relyea 2000).

Like life-history morphological traits are also developmental plastic characters and we show that, in the presence of predators, tadpoles develop larger and deeper tails. This plastic response has been observed in many anuran species (reviewed in Benard 2004) and there is strong evidence for its adaptive significance: tadpoles with induced deep tails, in fact, are more likely to survive to the attacks of ambush predators than tadpoles with shallow tails (Van Buskirk et al 1997). While the benefits are clear, the costs are much less so. Van Buskirk et al (1997) observed a negative correlation between the induced tail morphology and growth rate, whereas others found no evidence of a negative association either with growth rate or with age and size at metamorphosis (Van Buskirk and Relyea 1998; Relyea 2001a). Relyea (2002b) suggests that the costs of predator-induced morphology should be viewed in terms of decreased competitive ability: while investing in a deep tail makes a tadpole more likely to survive to predator attacks, it prevents it to invest in morphological traits that would improve feeding efficiency and survival under limited resources and high densities (i.e., wide mouths, long guts), as observed in tadpoles of the treefrog Dendropsophus embraccatus (Innes-Gold et al 2019). Because of the trade-off between competitive ability and predator avoidance, the costs of plastic responses depend on the environmental or on laboratory conditions. In our experiment, we find no evidence for costs associated to the plastic morphological response, probably not because the plastic responses are costless, but because the low intra-specific competition prevents them to constrain larval growth and development.

Unlike morphology and life history traits, behaviors are flexible phenotypes that tadpoles vary at any moment in relation to the risk they currently perceive. As explained in the “Introduction” section (see Eq. 1), the environmental variation of flexible traits can be divided into flexible, developmental, and their interaction components (Piersma and Drent 2003). Independent of the ontogenetic treatment, tadpoles reduced activity and spent more time far away from a caged predator than from an empty cage. This result demonstrates the importance of the flexible component of environmental variation in behavior (\({\sigma }_{F}^{2}>0\), see Eq. 1). It is important to notice that, during the recording sessions, we did not feed the caged predator, to prevent the release of chemical cues by injured tadpoles. For this reason, the only stimulus that could have elicited the anti-predator response was the predator itself. Since the response was carried out also by naive tadpoles, it might have been genetically encoded in the tadpoles’ brain. However, this is not to say that learning (and the ontogenetic environment) plays no role in the development of anti-predator behaviors. For example, Ferrari et al. (2005) demonstrated that researchers can teach tadpoles to recognize new predators by using classical associative learning techniques, with alarm cues from injured conspecifics as unconditioned stimuli and predator cues as conditioned stimuli. Interestingly, this ability to learn was found to depend on the environment (Ferrari 2014). In fact, tadpoles that developed in high-predation environments learned to respond with higher intensity to a predator and retained the anti-predator response for longer than conspecifics that experienced low-predation environments. Consistently with these findings, our results provide further evidence for the role of experience on the development of flexible behaviors (\({\sigma }_{D}^{2}>0\), see Eq. 1). We found that tadpoles raised with predators were always less active than those raised without predators, although differences in activity were not significantly different in the two acute treatments (\({\sigma }_{DxF}^{2}=0\), see Eq. 1). Similar results were observed in tadpoles of the treefrog Dendropsophus embraccatus, whose behavioral responses to predators were affected by the exposure to predator cues in both the ontogenetic and acute treatments (Reuben and Touchon 2021). The phenotypic effects of the environment exerted at different time scales have been described as a case of sequential multidimensional plasticity (Westneat et al. 2019), where a stimulus experienced early in life influences how it will be perceived and processed later. Our results are consistent with the multidimensional-plasticity hypothesis, suggesting that behavioral flexibility is controlled by neurophysiological mechanisms, whose development, like that of morphological and life-history traits, is directly and irreversibly affected by the environment.

Independent of how plasticity is expressed (either reversibly or irreversibly), a plastic response can evolve by natural selection only if there is additive genetic variation in plasticity, that is, if there is a gene-by-environment interaction in reaction norms. Relatively few studies have measured the genetic basis of predator-induced plasticity in tadpoles. In Dendropsophus ebraccatus, Touchon and Robertson (2018) found heritable plasticity in the morphology of tadpoles raised with and without predators (either fish or aquatic insects). They found also cross-environment negative genetic correlation, which might maintain genetic variation, but prevent the evolution of optimal plastic reaction norms. In Rana sylvatica, Relyea (2005) found heritable plasticity to be higher in morphological than in behavioral and life-history traits. In both studies, heritability was higher in the presence than in the absence of predators. Our results confirm the relevant genetic component of tadpole plasticity, but, unlike in R. sylvatica, a gene-by-environment interaction (i.e., \({\sigma }_{GxD}^{2}\)) was not observed in morphology, but only in behavioral (activity in the rearing baskets) and in life-history traits (age and size at metamorphosis). Before discussing these results, we must consider an important limitation of our experimental setup. For logistic reasons, our experiment involved only a small number of dams and sires and this might affect the reliability of statistical inference. In particular, it might have increased the risk of false-positives (because of the low statistical power), but it should have had no effects on the risk of false negatives. For this reason, while a statistically significant interaction might be a reliable evidence for genetic variation in plasticity, a not-significant effect might not be a reliable evidence for the lack of it. Taking into account this statistical caveat, our results suggest that different traits are under different parental influences. Tail-shape variation is explained by both dams and sires, whose effects interact additively with the presence of predators, providing no evidence for a significant parental-by-environment interaction. In contrast, parental effects on variation in life-history and behavioral traits are mainly explained by dams and vary with the environment, being stronger when tadpoles are raised with than without predators. These results support the hypothesis that a large portion of the parental effects on tadpole plasticity might not be genetic, but related to the amount of resources invested by mothers in their offspring. If this interpretation is correct, then variation in tadpoles’ behavior and development might be explained by variation in their conditions, that is, in the amount of resources that tadpoles can afford to invest in these costly activities. Under high-predation risk, all tadpoles, independent of their conditions, decrease activity to prevent dangerous encounters. As it has been observed in plastic secondary sexual traits (Johnstone 1997), If these changes impose lower marginal costs to high- than to low-condition tadpoles, then development rate and age at metamorphosis should be expected to co-vary with tadpole conditions and, indirectly, with maternal effects (provided that maternal effects influence tadpole conditions). In this case, we should thus expect stronger maternal effects in the presence than in the absence of predators. In contrast, in predator-free environments, intra-specific competition is the main mechanism of natural selection. Tadpoles compete against each other for resources and if feeding activity imposes differential costs to high- and low-condition tadpoles, then activity should be expected to co-vary with condition and, eventually, with maternal effects (as observed in this study).

Maternal effects are mechanisms of non-genetic inheritance, which may either promote or constrain the evolution of phenotypic plasticity (Levis and Pfennig 2018). In the Italian treefrogs, maternal effects, measured in terms of egg size, were found to affect larval growth and development (Cadeddu and Castellano 2012). But there was also evidence for both a paternal and maternal genetic effect on these larval traits (Botto and Castellano 2016). Our results suggest that parents can promote plasticity in their offspring not (or not only) by providing them with “genes for plasticity,” but also by providing them with resources and genes that improve their condition and, thus, indirectly favor the expression of condition-dependent plastic traits. The condition-dependent hypothesis can be tested empirically, for example, by controlling the amount of food available to tadpoles, but it can be investigated also theoretically, by asking how the condition-dependent nature of plastic phenotypes may affect their genetic variance and, ultimately, their evolvability.