class: center, middle, inverse, title-slide .title[ # 7: Allometry ] .subtitle[ ## The Size-Shape Relationship ] .author[ ### ] --- ### What is Allometry? + From greek: `\(\small\acute\alpha\lambda\lambda\omicron\)` (álo) = other, different + `\(\small\mu\epsilon\tau\rho\acute\omega\)` (metró) = to measure + Differences in body proportions of an organism + A departure from geometric similarity + The relationship between size and shape --- ### Why Is There Allometry? + Allometry occurs due to several reasons: + Physical (e.g. surface area/volume ratio) + Physiological + Biomechanical/functional + Selection (e.g. sexual selection and male ornaments) <img src="LectureData/07.allometry/AllomIntro.png" width="70%" style="display: block; margin: auto;" /> --- ### Allometry: Basic Concepts .pull-left[ + What is allometry, and compared to what? + **Isometry**: no change in proportions + **Allometry**: change in proportions + Easily envisioned via single trait relative to size: `$$\small{log(Y)}=log(\beta)+\alpha{log(x)}$$` ] .pull-right[ ![](07-Allometry_files/figure-html/unnamed-chunk-2-1.png)<!-- --> ] --- ### Allometry: Basic Concepts .pull-left[ + **Note: concepts of positive and negative allometry are only applicable to univariate traits relative to another trait! (For multivariate traits, allometry is a vector in multi-dimensional space where 'positive' and 'negative' as directions are not defined and have no meaning).** + **Also, it is mathematically impossible for all body parts to grow simultaneously faster (positive) or slower (negative) than total body size.** ] .pull-right[ ![](07-Allometry_files/figure-html/unnamed-chunk-3-1.png)<!-- --> ] --- ### Types of Allometry + Allometric patterns may be observed at several levels of biological organization: + **Ontogenetic allometry**: Variation across individuals at differing stages or ages (e.g., growth allometry) + **Static allometry** : Variation across individuals in a single ontogenetic stage within a population or species + **Evolutionary allometry**: Variation across species <img src="LectureData/07.allometry/AllometryTypes.png" width="70%" style="display: block; margin: auto;" /> --- ### Allometry in GM Data + Procrustes shape variables are independent of CS when no allometry is present + CS: mathematically independent of shape; biological allometric effects are still there! .pull-left[ + Here is isometry... <img src="LectureData/07.allometry/IsometryPlot.png" width="70%" style="display: block; margin: auto;" /> ] -- .pull-right[ + and here is allometry <img src="LectureData/07.allometry/AllometryPlot.png" width="70%" style="display: block; margin: auto;" /> ] -- + How do we assess such patterns? + We use linear models! --- ### Multivariate Linear Regression + To characterize allometric patterns, we fit a model of `shape~size` as: `$$\small\mathbf{Z}=\mathbf{X}\mathbf{\beta } +\mathbf{E}$$` -- + We evaluate the allometry model `\(\small\mathbf{X}_{F}\)` by comparing it to an intercept model `\(\small\mathbf{X}_{R}\)`: `\(\tiny\mathbf{X}_R = \begin{bmatrix} 1\\ 1\\ 1\\ 1\\ 1\\ 1 \end{bmatrix}\)` & `\(\tiny\mathbf{X}_F = \begin{bmatrix} 1 & 0.3 \\ 1 & 0.5 \\ 1 & 0.2 \\ 1 & 1.2 \\ 1 & 0.7 \\ 1 & 1.1 \end{bmatrix}\)` -- Estimate | `\(\small\mathbf{X}_{R}\)`| `\(\small\mathbf{X}_{F}\)` :----------- | :------------------- | :-------------------------- Coefficients | `\(\tiny\hat{\mathbf{\beta_R}}=\left ( \mathbf{X}_R^{T} \mathbf{X}_R\right )^{-1}\left ( \mathbf{X}_R^{T} \mathbf{Z}\right )\)` | `\(\tiny\hat{\mathbf{\beta_F}}=\left ( \mathbf{X}_F^{T} \mathbf{X}_F\right )^{-1}\left ( \mathbf{X}_F^{T} \mathbf{Z}\right )\)` Predicted Values | `\(\small\hat{\mathbf{Z}}_R=\mathbf{X}_R\hat{\mathbf{\beta}}_R\)` | `\(\small\hat{\mathbf{Z}}_F=\mathbf{X}_F\hat{\mathbf{\beta}}_F\)` Model Residuals | `\(\small\hat{\mathbf{E}}_R=\mathbf{Z}-\hat{\mathbf{Z}}_R\)` | `\(\small\hat{\mathbf{E}}_F=\mathbf{Z}-\hat{\mathbf{Z}}_F\)` Model Residual Error `\((\small{SSE})\)` | `\(\small\mathbf{S}_R=\hat{\mathbf{E}}_R^T\hat{\mathbf{E}}_R\)` | `\(\small\mathbf{S}_F=\hat{\mathbf{E}}_F^T\hat{\mathbf{E}}_F\)` --- ### Assessing Significance: RRPP `\(^1\)` .pull-left[ 1: Fit `\(\small\mathbf{X}_{R}\)` for each `\(\small\mathbf{X}_{F}\)`; Estimate `\(\small\hat{\mathbf{Z}}_{R}\)` and `\(\small\mathbf{E}_{R}\)` 2: Permute, `\(\small\mathbf{E}_{R}\)`: obtain pseudo-values as: `\(\small\mathbf{\mathcal{Z}} = \mathbf{\hat{Z}}_{R} + \mathbf{E}_{R}\)` 3: Fit `\(\small\mathbf{X}_{F}\)` using `\(\small\mathbf{\mathcal{Z}}\)`: obtain coefficients and summary statistics 4: Calculate `\(\small{F}\)`-value in every random permutation (observed case counts as one permutation) ] .pull-right[ 5: For `\(\small{n}\)` permutations, `\(\small{P} = \frac{n(F_{random} \geq F_{obs})}{n}\)` 6: Calculate *effect size* as a standard deviate of the observed value in a normalized distribution of random values (helps for comparing effects within and between models); i.e.: `$$\small{z} = \frac{ \log\left( F\right) - \mu_{\log\left(F\right)} } { \sigma_{\log\left(F\right)} }$$` where `\(\small\mu_{\log\left(F\right)}\)` and `\(\sigma_{\log\left(F\right)}\)` are the expected value and standard deviation from the sampling distribution, respectively. ] .footnote[ 1: Collyer et al. *Heredity.* (2015); Adams & Collyer. *Evolution.* (2016); Adams & Collyer. *Evolution.* (2018) 2: For details see Shape Statistics II ] --- ### Regression: Example .pull-left[ Does body shape covary with size in *Pecos* pupfish? <img src="LectureData/07.allometry/Pupfish Motivation.png" width="80%" style="display: block; margin: auto;" /> This is a hypothesis of *Allometry* (shape~size covariation) ] .pull-right[ ``` r data(pupfish) pupfish$logSize <- log(pupfish$CS) pupfish$Group <- interaction(pupfish$Pop, pupfish$Sex) fit <- procD.lm(coords ~ logSize, data = pupfish, print.progress = FALSE) round(anova(fit)$table, 4) ``` ``` ## Df SS MS Rsq F Z Pr(>F) ## logSize 1 0.0140 0.0140 0.2489 17.229 4.3462 0.001 *** ## Residuals 52 0.0423 0.0008 0.7511 ## Total 53 0.0563 ## --- ## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 ``` Great, but how does one visualize this multivariate allometry?? ] --- ### Visualizing Multivariate Allometry .pull-left[ + need to summarize size-related variation in shape + Use some rotation/projection method <img src="LectureData/07.allometry/MultiAllomPlot.png" width="80%" style="display: block; margin: auto;" /> ] -- .pull-right[ + Several (complementary) solutions: + Regression scores (Drake and Klingenberg 2008): projection of shape data on the allometric line `$$\small\mathbf{s}=\mathbf{Z\beta^T(\beta^T\beta)^{-1/2}}$$` + PC1 of predicted values (Adams and Nistri 2010): PC rotation of Ŷ to summarize variation across the shape-size relationship `$$\small\mathbf{P_1}=svd(\mathbf{\hat{Z}})=svd(\mathbf{X(\tilde{X}^T\tilde{X})^{-1}(\tilde{X}^T\tilde{Z})})$$` ] --- ### Visualizing Multivariate Allometry (Cont.) + And now some shape predictions .pull-left[ ``` r M <- mshape(pupfish$coords) preds <- shape.predictor(fit$GM$fitted, x= pupfish$logSize, Intercept = TRUE, predmin = min(pupfish$logSize), predmax = max(pupfish$logSize)) ``` ] .pull-right[ ``` r par(mfrow=c(1,2)) plotRefToTarget(M, preds$predmin, mag=1) mtext("Regression Min") plotRefToTarget(M, preds$predmax, mag=1) mtext("Regression Max") ``` <img src="07-Allometry_files/figure-html/unnamed-chunk-11-1.png" width="80%" style="display: block; margin: auto;" /> ``` r par(mfrow=c(1,1)) ``` ] --- ### Allometry Example: *Podarcis* + Effects of human-mediated disturbance (urbanization) on *Podarcis* lizards + 5 urban and 5 rural populations + 359 individuals + 28 bilateral landmarks + How does environmental disturbance influence development? + Are size-shape relationships modified in urban populations? <img src="LectureData/07.allometry/LizardLatImage.png" width="60%" style="display: block; margin: auto;" /> --- ### Allometry Example: *Podarcis* .pull-left[ ``` ## ## No curves detected; all points appear to be fixed landmarks. ``` <img src="07-Allometry_files/figure-html/unnamed-chunk-13-1.png" width="80%" style="display: block; margin: auto;" /> ] .pull-right[ ``` r fit <- procD.lm(Y.gpa$coords~CS*type, data = gdf, print.progress = FALSE) anova(fit)$table ``` ``` ## Df SS MS Rsq F Z Pr(>F) ## CS 1 0.05814 0.058139 0.09503 40.0581 7.2274 0.001 *** ## type 1 0.03235 0.032350 0.05287 22.2892 4.6569 0.001 *** ## CS:type 1 0.00610 0.006105 0.00998 4.2061 3.0990 0.001 *** ## Residuals 355 0.51524 0.001451 0.84212 ## Total 358 0.61183 ## --- ## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 ``` ] --- ### Allometry Example: *Podarcis* (Cont.) <img src="07-Allometry_files/figure-html/unnamed-chunk-15-1.png" width="50%" style="display: block; margin: auto;" /> --- ### *Podarcis* Allometry: Visualization <img src="07-Allometry_files/figure-html/unnamed-chunk-16-1.png" width="50%" style="display: block; margin: auto;" /> --- ### *Podarcis* Allometry: Visualization (Cont.) .pull-left[ ``` r shape.gps <- coords.subset(fit$GM$fitted,type) CS.R <- gdf$CS[which(type=="R")] CS.U <- gdf$CS[which(type=="U")] mn <- Map(function(x) mshape(x),shape.gps) predsR <- shape.predictor(shape.gps$R,x = CS.R, Intercept = TRUE, predmin = min(CS.R), predmax = max(CS.R)) predsU <- shape.predictor(shape.gps$U,x = CS.U, Intercept = TRUE, predmin = min(CS.U), predmax = max(CS.U)) M <- mshape(Y.gpa$coords) ``` ] .pull-right[ <img src="07-Allometry_files/figure-html/unnamed-chunk-18-1.png" width="80%" style="display: block; margin: auto;" /> ] --- ### Post-Hoc Tests + Use randomization methods to test custom hypotheses + Do urban populations show higher deviations from their group’s trajectory? – a sign of developmental instability <img src="LectureData/07.allometry/LizUrbRur.png" width="40%" style="display: block; margin: auto;" /> --- ### Size-Shape Space + Size effects often dominate shape variation, especially in ontogenetic series + However, when other factors are present, PC1 does not necessarily relate directly to size-dependent variation (at least not to all of it) + Usual statistical methods do not capture subtle ontogenetic modifications in trajectories <img src="LectureData/07.allometry/SizeShapeConcept.png" width="80%" style="display: block; margin: auto;" /> + Examine allometric variation in **size-shape space** --- ### Size-Shape Space + Derived from the PCA of shape variables + `\(\small{ln}(Csize)\)` + 1: Calculate shape variables and `\(\small{ln}(Csize)\)`, and join them in a single data matrix + 2: Calculate PCA of this matrix ( `\(\small{SSPC1}\)`) + 3: Generate the **common allometric component** (CAC): the common size-shape regression coefficient, after mean-centering shapes by group `\(\small\mathbf{Z}_{c}\)` + 4: Calculate the **residual shape component**: SVD of data orthogonal to CAC + 5: Visualize allometry as (CAC vs. SSPC1) & (CAC vs. RSC1) `$$\small\alpha=(\mathbf{Z}_{c}^T\mathbf{CS})/\mathbf{(CS^TCS)}$$` `$$\small{CAC}=\mathbf{Z}_{c}\alpha$$` .center[where] `$$\small\alpha=\alpha\sqrt{(\alpha^T\alpha)}$$` --- ### Size-Shape Space: Example <img src="LectureData/07.allometry/Mitteroecker-04.png" width="70%" style="display: block; margin: auto;" /> --- ### note: CAC Scores vs. Regression Scores `\(^1\)` + `\(\small{CAC}\)`: regression under a common slope after group mean-centering + Regression scores (**s**): shape data projected on the regression line with size + When a single group is considered, `\(\small{CAC}\)` and **s** are **identical**! + Both are projections of mean-centered data on size/shape regression (and are equivalent to PLS1 scores of a PLS of shape on size) `$$\small\alpha=(\mathbf{Z}_{c}^T\mathbf{CS})/\mathbf{(CS^TCS)}$$` `$$\small{CAC}=\mathbf{Z}_{c}\alpha$$` `$$\small\alpha=\alpha\sqrt{}(\alpha^T\alpha)$$` `$$\small\mathbf{s}=\mathbf{Z\beta^T(\beta^T\beta)^{-1/2}}$$` .footnote[See Adams et al. 2013. *Hystrix* 24: 7-14.] --- ### Allometry: Other Tests `\(^1\)` + Many biological hypotheses are related to the comparison of ontogenetic allometries + Allometric trajectories are not only about their slope, or variation around it .footnote[1: See Shape Statistics II lecture for discussion of PTA as a general method for comparing all types of trajectories, including ontogenetic/allometric trajectories (i.e. Collyer and Adams 2007; Adams and Collyer 2009; Collyer and Adams 2013)] -- + Do they have similar starting points or ending points? + Are ontogenetic trajectories similar? (parallelism) + Do ontogenetic trajectories converge? + Do ontogenetic trajectories diverge? -- + We need quantitative methods to test such hypotheses + Take advantage of the toolkit of resampling methods --- ### Allometric Convergence and Divergence `\(^1\)` + Convergence: shape is more similar at the end of the trajectory, than at the beginning + A simple approach: test angular difference between trajectories .footnote[1: Adams and Nistri. (2010) *BMC. Evol. Biol.*] -- + 1: Obtain allometric vectors `\((\small\mathbf{\hat{Z}}_{start} - \small\mathbf{\hat{Z}}_{end})\)` for groups + 2: normalize vectors (divide by their length so they are unit length) and find the cross-product between pairs of vectors; i.e, `\(r_{ij} = \mathbf{\beta}_i^T \mathbf{\beta}_j\)` + 3: Obtain test measure: `\(\theta = \cos^{-1}(r_{ij})\)` + 4: RRPP with appropriate null model to test `\(\theta\)` + **Convergence** when `\(\theta\)` is significant and vectors tend toward a similar shape + **Divergence** when `\(\theta\)` is significant and vectors tend toward a different shape + **Parallelism** when `\(\theta\)` is not significant and/or effect size is small + Can also test absolute difference in vector lengths to determine if one group has greater ontogenetic shape change than another --- ### Evolutionary Convergence: *Hydromantes* Example + Ontogenetic series for 8 species of *Hydromantes* + These salamanders live in caves and they climb extensively on the walls as adults + Foot shape is a trait with functional relevance + How does foot shape change across ontogeny? <img src="LectureData/07.allometry/HydromantesEx.png" width="80%" style="display: block; margin: auto;" /> --- ### Evolutionary Convergence: *Hydromantes* Example (Cont.) <img src="LectureData/07.allometry/HydroRes1.png" width="75%" style="display: block; margin: auto;" /> --- ### Evolutionary Convergence: *Hydromantes* Example (Cont.) <img src="LectureData/07.allometry/HydroRes2.png" width="75%" style="display: block; margin: auto;" /> --- ### Comparing Allometric Trajectories: Pupfish Example + **Question**: Do your groups have parallel allometries? + **Question**: Do your groups have unique allometries? + **Question**: Which groups have different allometries, and how do they differ? ``` r data(pupfish) plotAllSpecimens(pupfish$coords) ``` <img src="07-Allometry_files/figure-html/unnamed-chunk-25-1.png" width="30%" style="display: block; margin: auto;" /> --- ### Comparing Allometric Trajectories: Pupfish Example (Cont.) .pull-left[ ``` r fit.common <- procD.lm(coords ~ logSize + Group, data = pupfish, print.progress = FALSE) fit.unique <- procD.lm(coords ~ logSize * Group, data = pupfish, print.progress = FALSE) ``` + now let's do a homogeneity of slopes test ] .med[.pull-right[ ``` r anova(fit.common, fit.unique, print.progress = FALSE) ``` ``` ## ## Analysis of Variance, using Residual Randomization ## Permutation procedure: Randomization of null model residuals ## Number of permutations: 1000 ## Estimation method: Ordinary Least Squares ## Effect sizes (Z) based on F distributions ## ## ResDf Df RSS SS MS Rsq ## coords ~ logSize + Group (Null) 49 1 0.024084 0.000000 ## coords ~ logSize * Group 46 3 0.022079 0.0020045 0.00066816 0.035583 ## Total 53 0.056333 ## F Z P Pr(>F) ## coords ~ logSize + Group (Null) ## coords ~ logSize * Group 1.3921 1.1451 0.136 ## Total ``` + Suggests allometric slopes are parallel ]] --- ### Comparing Allometric Trajectories: Pupfish Example (Cont.) + Allometric plots + We can see by plotting the prediction lines for both that a unique-allometries model is not practical <img src="07-Allometry_files/figure-html/unnamed-chunk-29-1.png" width="50%" style="display: block; margin: auto;" /> --- ### Comparing Allometric Trajectories: Pupfish Example (Cont.) + Hypothesis tests: vector lengths .scrollable[ ``` r PW.u <- pairwise(fit.unique, groups = pupfish$Group, covariate = log(pupfish$CS), print.progress = FALSE) summary(PW.u, test = "dist") ``` ``` ## ## Pairwise comparisons ## ## Groups: Marsh.F Sinkhole.F Marsh.M Sinkhole.M ## ## RRPP: 1000 permutations ## ## Slopes (vectors of variate change per one unit of covariate ## change, by group): ## Vectors hidden (use show.vectors = TRUE to view) ## ## Pairwise distances between slope vector ## (end-points), plus statistics ## d UCL (95%) Z Pr > d ## Marsh.F:Sinkhole.F 0.07848121 0.1621176 -0.9763904 0.838 ## Marsh.F:Marsh.M 0.08279940 0.1640452 -0.9689342 0.829 ## Marsh.F:Sinkhole.M 0.12322729 0.1610484 0.7139190 0.236 ## Sinkhole.F:Marsh.M 0.06418279 0.1095190 -0.3981426 0.652 ## Sinkhole.F:Sinkhole.M 0.11706696 0.1001323 2.2066562 0.015 ## Marsh.M:Sinkhole.M 0.10863856 0.1132783 1.5445168 0.063 ``` ] --- ### Comparing Allometric Trajectories: Pupfish Example (Cont.) + Hypothesis tests: angles between vectors .scrollable[ ``` r summary(PW.u, test = "VC", angle.type = "deg") ``` ``` ## ## Pairwise comparisons ## ## Groups: Marsh.F Sinkhole.F Marsh.M Sinkhole.M ## ## RRPP: 1000 permutations ## ## Slopes (vectors of variate change per one unit of covariate ## change, by group): ## Vectors hidden (use show.vectors = TRUE to view) ## ## Pairwise statistics based on slopes vector correlations (r) ## and angles, acos(r) ## The null hypothesis is that r = 1 (parallel vectors). ## This null hypothesis is better treated as the angle ## between vectors = 0 ## r angle UCL (95%) Z Pr > angle ## Marsh.F:Sinkhole.F 0.6318267 50.81498 83.57546 -0.07310658 0.527 ## Marsh.F:Marsh.M 0.6139591 52.12367 83.58445 -0.13196270 0.549 ## Marsh.F:Sinkhole.M 0.4461018 63.50614 81.89039 0.66791084 0.273 ## Sinkhole.F:Marsh.M 0.7175129 44.15048 63.60905 0.24275646 0.391 ## Sinkhole.F:Sinkhole.M 0.4627734 62.43378 60.22153 1.77232308 0.037 ## Marsh.M:Sinkhole.M 0.5629975 55.73665 65.19951 1.04510764 0.154 ``` ] --- ### Comparing Allometric Trajectories: Pupfish Example (cont.) + Conclusion: allometries do not significantly diverge. But concluding they are parallel allows one to compare means, accounting for common allometric variation .scrollable[ ``` r PW.c <- pairwise(fit.common, groups = pupfish$Group, print.progress = FALSE) summary(PW.c, test = "dist") ``` ``` ## ## Pairwise comparisons ## ## Groups: Marsh.F Sinkhole.F Marsh.M Sinkhole.M ## ## RRPP: 1000 permutations ## ## LS means: ## Vectors hidden (use show.vectors = TRUE to view) ## ## Pairwise distances between means, plus statistics ## d UCL (95%) Z Pr > d ## Marsh.F:Sinkhole.F 0.03639758 0.01759231 3.805424 0.001 ## Marsh.F:Marsh.M 0.03579214 0.01841414 3.996733 0.001 ## Marsh.F:Sinkhole.M 0.03809715 0.01528439 4.529552 0.001 ## Sinkhole.F:Marsh.M 0.03681731 0.02381545 2.952476 0.002 ## Sinkhole.F:Sinkhole.M 0.01939739 0.01857347 1.833261 0.031 ## Marsh.M:Sinkhole.M 0.02694896 0.01911014 2.798642 0.001 ``` ] --- ### Empirical Example: Cranial Ontogeny in Crocodilians + Phylogenetic relationships have long been under debate + What information can we extract from cranial ontogeny? <img src="LectureData/07.allometry/CrocRes1.png" width="75%" style="display: block; margin: auto;" /> --- ### Empirical Example: Cranial Ontogeny in Crocodilians (Cont.) + Some groups follow different ontogenetic paths + There is ontogenetic convergence, where adults are more similar than juveniles <img src="LectureData/07.allometry/CrocRes2.png" width="75%" style="display: block; margin: auto;" /> --- ### A Comment on Heterochrony + Evolutionary changes in the rate or timing of developmental sequences + i.e. changes in ontogenetic trajectories + Can be evaluated via allometric/ontogenetic investigations <img src="LectureData/07.allometry/Heterochrony.png" width="70%" style="display: block; margin: auto;" /> --- ### Allometry: Summary + Shape usually changes with size – allometry is a common pattern in biological data + We need to account for it when testing hypotheses about shape + Many biological hypotheses related directly to allometric variation + **Visualization**: + RegScore (**s**) vs. Csize (Drake and Klingenberg 2008) + PredLine `\(\small{P_1}\)` vs. Csize (Adams and Nistri 2010) + CAC, RSC, Csize (Mitteroecker et al. 2004) + **Comparison of ontogenies**: - MANCOVA + Convergence & divergence (Adams and Nistri 2010) + Orientation (Piras et al. 2010) + Heterochrony and related topics also of interest