Data analysis
To test the statistical significance of variation in shape across different factors, including size (a commonly used factor in morphometric analyses, measured as the mean position of all the landmarks for an individual specimen), instar, genotype and predation risk, we performed Procrustes ANOVA using the procD.lm() function from the geomorph package v4.0.5 . The Procrustes ANOVA used a permutation procedure of 10,000 iterations to assess the importance of variation in shape across the different factors for our set of Procrustes-aligned coordinates.
To further understand the relationship between different factors, specifically genotype and predation risk, we performed trajectory analysis using the trajectory.analysis() function in RRPP package v1.3.1 for R . The phenotypic trajectory analysis measured morphological variation between treatments in terms of its magnitude (distance moved in shape space), direction (angle of the change in shape space) and shape (relative position of the change in shape space). The mean phenotypic trajectories were visualised using principal component analysis and were connected in order of increasing predation risk. Thin-plate spline deformation grids were used to describe the principal component axes by indicating the departure from the mean shape of the sample to the lower and upper bounds of the sample (see .
We evaluated modularity and integration of morphological (co)variation using the covariance ratio and partial least-squares (PLS) analysis .The CR is a ratio of the overall covariation between modules relative to the overall covariation within modules. The significance of the CR is tested by comparison to a distribution of values obtained by randomly assigning landmarks into subsets. A significant result, which indicates modularity, is found when the observed CR is small relative to this distribution.
When used with landmark data, PLS analysis is referred to as singular warps analysis . The analysis calculates normalized composite scores (linear combinations), one from the X-variables and one from the Y-variables, that have the greatest mutual linear predictive power. Similar to the test for modularity, the observed PLS value is compared to a distribution of values obtained by randomly permuting the individuals (rows) in one set relative to those in the other. A significant result, which indicates integration, is found when the observed PLS correlation is large relative to this distribution.
We applied the CR and singular warps analyses with 999 iterations to test for two non-mutually exclusive potential patterns of modularity and integration between 1) the head (snout, head top, neck) and lower body (belly, tail base, back) regions, and 2) the dorsal (head top, neck, back) and ventral (snout, belly, tail base) regions. It is important to note that these tests do not represent two ends of a continuum. Both modularity and integration can co-occur and it is entirely possible to find modules (by rejecting a null model of no covariation within modules) and detect integration between these modules (by rejecting a null model of no covariation between modules). We performed these tests across clones and predation risk levels.