DOI: 10.5061/dryad.p8cz8wb54
title: Phenotypic plasticity drives local adaptation by disrupting a genetically integrated jaw apparatus in Trinidadian guppies

description: Consistently across clades researchers find a high degree of covariation
 in the shape of disparate elements within the same individual, a pattern
 known as morphological integration. Although integration can help to
 maintain functionality of multi-component systems, it can also constrain
 long-term evolution. On shorter time scales, morphology is often shaped by
 plastic environmental responses, however, it remains an open question
 whether plasticity is constrained by the patterns of morphological
 integration that emerge over longer evolutionary time scales. Here we ask
 whether an incipient adaptive trophic divergence among Trinidadian guppies
 displays similar patterns of covariation between benthic and limnetic
 populations that are either reared in a common lab environment or sampled
 from wild populations. We perform geometric morphometric analysis (n=83)
 on the premaxilla, dentary, anguloarticular, and lower pharyngeal jaw, and
 find that morphology correlates with trophic niche in both lab-reared and
 wild-caught fish. Furthermore, we find that integration among these bones
 is significantly stronger in lab-reared fish (absence of environmental
 differences), while their shapes vary independently in wild-caught
 individuals. This suggests that phenotypic plasticity may allow organisms
 to explore novel morphospace as they locally adapt, but does so at the
 expense of maintaining a highly integrated feeding apparatus.
description: # Data for "Phenotypic plasticity drives local adaptation by
 disrupting a genetically integrated jaw apparatus in Trinidadian
 guppies" [Access this dataset on
 Dryad](https://doi.org/10.5061/dryad.p8cz8wb54) Our analysis includes four
 geometric morphometric analyses, as well as an integration analysis. This
 is reflected in the folder structure, with each of these five analyses
 having their own folder. To run any of the codes, you must first install
 all required packages in R (below). Then you set the working directory as
 appropriate. After this, the code should run as normal. ## Description of
 the data and file structure All data listed below is contained in a single
 compressed file called "DataAndCode.zip" Each of the four
 geometric morphometric analysis folders are named after the bone that they
 examine; Anguloarticular, dentary, lower pharyngeal jaw, and premaxilla.
 Within each of these folders is an R code that runs the analysis, a .PLY
 file of the focal bone that is used for visualization in the analysis, and
 two .csvs. The first .csv, "cureslideHalf.csv" gives a list of
 which landmarks are treated as semi-landmarks in the morphometrics
 analysis. The second .csv, "Segmentation_Landmarking Log..."
 lists all of the individuals contained in the analysis, with demographic
 information and which side (left or right) of the model was used in the
 final analysis. There is also another folder containing the landmarks for
 each individual in the given analysis. Each file within is named for the
 individual from which it was collected (see abbreviations below), and
 contains the X, Y, and Z coordinates for each landmark. The specific data
 contained in each folder is as follows: 1. Premaxilla folder ```
 Premax_geomorph_code.R Segmentation_Landmarking Log - Premax LM.csv
 curveslideHalf.csv test_half2_2.ply Landmarks ``` 2. Dentary folder ```
 Dentary_geomorph_code.R Segmentation_Landmarking Log - Dentary LM.csv
 curveslideHalf.csv test_halfd.ply Landmarks ``` 3. Anguloarticular folder
 ``` AA_geomorph_code.R Segmentation_Landmarking Log - AA LM.csv
 curveslideHalf.csv test_half_aa.ply Landmarks ``` 4. Lower pharyngeal jaw
 folder ``` Lower_Pharyngeal _Jaw_Geomorph_Code.R Segmentation_Landmarking
 Log - LPJ LM.csv curveslideHalf.csv Aripo_WC_HP_F_C4_PJL_Right.ply
 Landmarks ``` The final folder, "Integration Analysis", contains
 four R data files, which are the outputs of the other four scripts. It
 also contains an R file which reads in each of these data files and then
 conducts the integration analysis. 1. Integration analysis folder ```
 Integration_Analysis_Script.R LPJ_variables.RData - Output data from the
 lower pharyngeal jaw geometric morphometric analysis AA_variables.RData -
 Output data from the anguloarticular geometric morphometric analysis
 Dentary_variables.RData - Output data from the dentary geometric
 morphometric analysis PM_variables.RData - Output data from the premaxilla
 geometric morphometric analysis ``` **Abbreviations** File names are
 constructed to include all information about the particular specimen.
 Yarra/Aripo: River drainage that the fish comes from WC: Wild-caught LR:
 Lab-reared LP: Low-predation, benthic HP: High-predation, limnetic AA:
 Anguloarticular D: Dentary LPJ: Lower pharyngeal jaw PM: Premaxilla ##
 Sharing/Access information 3D models of the fish from which these bones
 were sampled and landmarked are [available on
 Dryad](https://doi.org/10.5061/dryad.95x69p8rw) ## Code/Software There are
 two primary types of scripts, the geometric morphometric analysis scripts
 and the integration script. All four geometric morphometric scripts follow
 the exact same structure, and therefore can be summarized collectively.
 The general structure of the geometric morphometric scripts is: 1. Read in
 landmark data, and subsample it so that we only have points from one side
 of the head and along the midline. 2. Read in the list of semi-landmarks
 and run a generalized procrusted analysis (function "gpagen") to
 scale, rotate, and translate all the specimens in space to overlap as much
 as possible. 3. Check if specimen body length has an effect on bone shape
 (known as the allometric effect). If there is an allometric effect, then
 estimate it using a linear model. Finally, record the residuals of this
 model, and use this to calculate the new, allometrically corrected, shapes
 for each individual. 4. Run a principle components analysis (PCA) on the
 allometrically corrected shapes (function "gm.prcomp") 5.
 Visualize the results using PCA plots, 3d deformation plots, and by
 warping the .PLY file contained in the folder to reflect mean shapes of
 different populations. The structure of the integration analysis is: 1.
 Read in the analysis results from the geometric morphometrics 2. Clean and
 align data from each analysis to be sure that we're grouping bones
 from the same individuals. 3. Estimate the degree of integration across
 all pairwise sets of bones within each population (function
 "integration.test"). Specifically, conduct this analysis for
 sets of fish that are grouped by rearing environment and also for trophic
 niche. **Necessary R packages** * geomorph * morpho * plotly * ggplot2 *
 ggthemes