Alternative Ways of Computing the Numerator Relationship Matrix - Nilforooshan, Mohammad Ali; Garrick, Dorian; Harris, Bevin (Frontiers in Genetics, 2021)
Pedigree relationships between every pair of individuals forms the elements of the additive genetic relationship matrix (A). Calculation of A^-1 does not require forming and inverting A, and it is faster and easier than the calculation of A. Whereas A^{-1} is used in best linear unbiased prediction of genetic merit, A is used in population studies and post-evaluation procedures, such as breeding programs and controlling the rate of inbreeding. Three pedigrees with 20,000 animals (20K) and different (1, 2, 4) litter sizes, and a pedigree with 180,000 animals (180K) and litter size 2 were simulated. Aiming to reduce the computation time for calculating A, new methods (Array-Tabular method, (T^-1)^-1 instead of T in Thompson's method, Iterative updating of D in Thompson's method, and Iteration by generation) were developed and compared with some existing methods. The methods were coded in the R programming language to demonstrate the algorithms which were coded to minimise the computational time in R. Among 20K, computational time decreased with increasing litter size for most of the methods. Methods deriving A from A^-1 were relatively slow. The other methods were either using only pedigree information or both the pedigree and inbreeding coefficients. Calculating inbreeding coefficients was extremely fast (< 0.2s for 180K). Parallel computing (15 cores) was adopted for methods that were based on solving A^-1 for columns of A, as those methods allowed implicit parallelism. Optimising the code for one of the earliest methods enabled A to be built in 13s (faster than the 31s for calculating A^-1) for 20K, and in 17m:3s for 180K. Memory is a bottleneck for large pedigrees but attempts to reduce the memory usage increased the computational time. To reduce disk space usage, memory usage and computational time, relationship coefficients of old animals in the pedigree can be archived and relationship coefficients for parents of the next generation can be saved in an external file for successive updates to the pedigree and the A matrix.