A multivariate comparison of phenotypic and genetic covariance matrices: when P can be used for making evolutionary predictions
Data files
Sep 16, 2026 version files 75.96 MB
-
angle_results_n4_E_small_fam.csv
8.73 KB
-
Angles.r
1.03 KB
-
AvgEvolvabilities.r
1.37 KB
-
disparity_results_n_large_fam.csv
8.91 KB
-
disparity_results_n_small_fam.csv
8.87 KB
-
disparity_results_n4_E_small_fam.csv
8.82 KB
-
disparity_results_n8_E_small_fam.csv
9.46 KB
-
Disparity.r
1.41 KB
-
fig1_regression_results_small_fam.csv
1.52 KB
-
figS1_regression_results_large_fam.csv
1.52 KB
-
figures.Rmd
43.69 KB
-
KrzCorsFirst.r
1.71 KB
-
KrzCorsLast.r
1.93 KB
-
large_families_matrices.csv
38.10 MB
-
main.r
926 B
-
mantel_tests_n4_E_large_fam.csv
8.98 KB
-
mantel_tests_n4_E_small_fam.csv
8.93 KB
-
MantelCors.r
1.37 KB
-
MantelTests.r
1.23 KB
-
matrixsim.r
14.91 KB
-
MaxEvolvabilities.r
1.50 KB
-
norm_large_fam.csv
1.14 KB
-
norm_small_fam.csv
1.14 KB
-
phensim.r
1.89 KB
-
RDifferences.r
1.49 KB
-
read_matrices.r
1 KB
-
README.md
6.21 KB
-
RSkewers.r
1.91 KB
-
small_families_matrices.csv
37.70 MB
Abstract
Accurate predictions of evolutionary response are required to determine whether populations can adapt to changing environments, or whether they will go extinct. The breeder’s equation enables us to make these predictions using the genetic variance and covariance between traits (G) and selection. However, estimating G is a challenge that requires known relatedness among a large sample of individuals in a population. Phenotypic correlations are easier to estimate, and past studies have argued that they can be used as a proxy, known as Cheverud’s conjecture. However, multivariate patterns of variation are rarely captured in these studies. Here, we use simulated data in which we vary heritability, sample size, pleiotropy, and the alignment of genetic and environmental effects on phenotypes, and determine the multivariate similarity of G and P, the phenotypic covariance matrix. We find that the extent of pleiotropy and the relationship between genetic and environmental effects are important determinants of their similarity. While we show that P can provide a better prediction of evolutionary response when sample sizes are small, or under the limited conditions of weak pleiotropy, congruent genetic and environmental effects, and accurate heritability estimates, quantitative genetic studies remain crucial for making good evolutionary predictions that cannot be bypassed by using P.
Comparing simulated genetic and phenotypic variance-covariance matrices across a range of sample sizes, heritabilities, and pleiotropy levels.
Workflow
- Generate pedigree
- Generate phenotypes along pedigree (
phensim.r) - Estimate G matrix (WOMBAT)
- Compare G, A, and P using utility scripts in
/util/ - Generate figures (
figures.Rmd)
Scripts
Main:
main.r— Entry point. Sets simulation parameters (number of traits, sires, heritability, error structure) and callsmatrixsim()for each parameter combination.matrixsim.r— Core simulation function. Generates a pedigree, simulates phenotypes viaphensim(), estimates G via WOMBAT, then writes A (true breeding value covariance), G (WOMBAT-estimated), and P (phenotypic covariance) matrices to a CSV file. Results are saved as*name*_matrices.csvin the project root.phensim.r— Simulates phenotypes along a pedigree given A and E matrices. Based on thephensimfunction from the Pedantics package.figures.Rmd— Generates all ggplot figures from the matrices CSV files and analysis outputs.
Utility scripts that take the matrices CSV as input and compute comparison statistics, returning results as dataframes:
read_matrices.r— Reads*_matrices.csvfiles into RAngles.r— Angles between matrix subspacesAvgEvolvabilities.r/MaxEvolvabilities.r— Average and maximum evolvabilityDisparity.r— Matrix disparityKrzCorsFirst.r/KrzCorsLast.r— Krzanowski subspace correlations (first and last axes)MantelCors.r/MantelTests.r— Mantel correlations and testsRDifferences.r— Response differencesRSkewers.r— Random skewers analysis
Data files
Simulation output matrices
small_families_matrices.csv— Simulation results for small family structures: 20/60/200 families (10/30/100 sires × 2 dams/sire × 2 offspring/dam).large_families_matrices.csv— Simulation results for large family structures: 50/150/500 families (10/30/100 sires × 5 dams/sire × 3 offspring/dam).
Each row is one simulation replicate. Columns:
A— True additive genetic covariance matrix (from phensim breeding values), stored as a space-separated vector of the lower triangleG— Estimated G matrix from WOMBAT, same formatP— Phenotypic covariance matrix from phensim, same formatn— Number of traitsh— Heritabilitymulticoll— Pleiotropy/multicollinearity level of the true G matrix (low,medium,high)f— Number of familiese_type— Environmental covariance structurename— Simulation run identifier
Analysis results
angle_results_n4_E_small_fam.csv — Angles between pairs of matrices for 4-trait small-family simulations, varying environmental covariance structure. Each row is one parameter combination. Columns:
Angle— Mean angle (degrees) between the compared matrices across replicatesSE— Standard error of the mean angleComparison— Matrix pair compared (e.g.P and true G,Estimated G and true G)X..of.Traits— Number of traitsX..of.Families— Number of familiesHeritability— HeritabilityMulticollinearity— Pleiotropy/multicollinearity level (low,medium,high)E.Type— Environmental covariance structure
disparity_results_n_small_fam.csv — Matrix disparity between pairs of matrices for small-family simulations, varying number of traits. Same columns as angle results but with Disparity and SE in place of Angle and SE.
disparity_results_n_large_fam.csv — Same as above for large-family simulations.
disparity_results_n4_E_small_fam.csv — Matrix disparity for 4-trait small-family simulations, varying environmental covariance structure. Same column structure.
disparity_results_n8_E_small_fam.csv — Matrix disparity for 8-trait small-family simulations, varying environmental covariance structure. Same column structure.
fig1_regression_results_small_fam.csv — Element-wise regression of estimated G on true G and P on true G, for small-family simulations. Each row is one parameter combination. Columns:
n— Number of traitsh— HeritabilityE— Environmental covariance structureComparison— Matrix pair comparedslope— Regression sloper_squared— R² of the regression
figS1_regression_results_large_fam.csv — Same as above for large-family simulations.
mantel_tests_n4_E_small_fam.csv — Mantel test results for 4-trait small-family simulations, varying environmental covariance structure. Each row is one parameter combination. Columns:
P— Mantel test p-valueComparison— Matrix pair comparedn— Number of traitsf— Number of familiesh— HeritabilityMulticollinearity— Pleiotropy/multicollinearity levelE— Environmental covariance structure
mantel_tests_n4_E_large_fam.csv — Same as above for large-family simulations.
norm_small_fam.csv — Ratio of matrix norms (F_G / F_P) for small-family simulations. Each row is one parameter combination. Columns:
Ratio— Mean ratio of Frobenius norms across replicatesSE— Standard error of the mean ratioComparison— Norm ratio computed (e.g.F_G/F_P)X..of.Traits— Number of traitsX..of.Families— Number of familiesHeritability— HeritabilityMulticollinearity— Pleiotropy/multicollinearity levelE.Type— Environmental covariance structure
norm_large_fam.csv — Same as above for large-family simulations.
Dependencies
- R with packages: tidyverse, MCMCglmm, mixtools, monomvn, here, Matrix, evolvability, evolqg, reshape2
- WOMBAT available in the system path as
wombat - UNIX-like system (Linux, macOS, WSL on Windows)
Acknowledgements
- Dr. JL Sztepanacz (principal investigator)
- Alexander MacKenzie (code to interface with WOMBAT)
- Dr. M Videlier (helpful suggestions and discussions)
- Dr. M Morrissey (phensim function)
