Imaginings of a Livestock Geneticist

Computation of Inbreeding Coeffecients

This section describes how to compute the inbreeding coefficients without having to set up the full L matrix that was described in a previous section . The motivation for the algorithm is based off the Henderson (1976) paper that outlined a method to generate A-1 directly from a list of sires and dams and the inbreeding coefficients for each animal. For a non-inbred population, A-1 can be computed without having to compute either A or L and the entire matrix doesn't need to be stored in memory. However, for an inbred population, the diagonal elements of L or A must first be found and when L is too large to store in memory this becomes an issue. In order to make Henderson's algorithm scale to a larger number of animals, modifications to generate the diagonal elements of L are needed. Shortly after the Henderson (1976) paper, the Quaas (1976) paper was published, which finds the diagonal elements of L or A without having to store the full L matrix in memory.
    As outlined in the section that describes the generation of L the diagonal elements of L can be computed as functions of the inbreeding coefficients of the known parents. As outlined in Quaas (1976) the inbreeding coefficients can be transformed into sums of squares of rows corresponding to the kth column of L. As a result, the kth column or inbreeding coefficient for animal "k" can be generated as a summation of the kth row only. The formulas are outlined below (p = parent; s = sire; d = dam):

Similar to previous methods, the pedigree has to be sorted so that parents come before progeny. Lastly, if animals are numbered from 1 to the very last animal then the sire and dam values can be used to index where the respective elements are located within the algorithm. Algorithms to sort and renumber a pedigree is outlined in the following section . The algorithm outlined below generates the diagonal values of L (i.e. D values) based on the method outlined above and in Quaas (1976) and then the remaining portion of the algorithm is the exact same as outlined in a Recursive Method to Create A Inverse section.

The following pedigree file from Henderson (1976) can be utilized with the R code above. The columns are animal, sire and dam and the pedigree is already ordered so that parents come before progeny. Lastly the animals go from 1 to the total number of animals. Outlined below is what (A-1), u and v look like at the end of each iteration of the for loop. Compare the final v vector to the diagonals of L outlined in a previous section.

Loop Iteration 1
u
1.000 0.000 0.250 0.250 0.250 0.563 0.391
v
1.000 0.000 0.500 0.500 0.500 0.750 0.625
A-1
1 2 3 4 5 6 7
1 1.0 0.0 0.0 0.0 0.0 0.0 0.0
2 0.0 0.0 0.0 0.0 0.0 0.0 0.0
3 0.0 0.0 0.0 0.0 0.0 0.0 0.0
4 0.0 0.0 0.0 0.0 0.0 0.0 0.0
5 0.0 0.0 0.0 0.0 0.0 0.0 0.0
6 0.0 0.0 0.0 0.0 0.0 0.0 0.0
7 0.0 0.0 0.0 0.0 0.0 0.0 0.0
Loop Iteration 2
u
1.000 1.000 1.000 0.500 0.500 0.625 0.500
v
1.000 1.000 0.866 0.00 0.433 0.000 0.217
A-1
1 2 3 4 5 6 7
1 1.0 0.0 0.0 0.0 0.0 0.0 0.0
2 0.0 1.0 0.0 0.0 0.0 0.0 0.0
3 0.0 0.0 0.0 0.0 0.0 0.0 0.0
4 0.0 0.0 0.0 0.0 0.0 0.0 0.0
5 0.0 0.0 0.0 0.0 0.0 0.0 0.0
6 0.0 0.0 0.0 0.0 0.0 0.0 0.0
7 0.0 0.0 0.0 0.0 0.0 0.0 0.0
Loop Iteration 3
u
1.000 1.000 1.000 0.500 0.500 0.625 0.500
v
1.000 1.000 0.866 0.00 0.433 0.000 0.217
A-1
1 2 3 4 5 6 7
1 1.3333 0.0 -0.6667 0.0 0.0 0.0 0.0
2 0.0 1.0 0.0 0.0 0.0 0.0 0.0
3 -0.6667 0.0 1.3333 0.0 0.0 0.0 0.0
4 0.0 0.0 0.0 0.0 0.0 0.0 0.0
5 0.0 0.0 0.0 0.0 0.0 0.0 0.0
6 0.0 0.0 0.0 0.0 0.0 0.0 0.0
7 0.0 0.0 0.0 0.0 0.0 0.0 0.0
Loop Iteration 4
u
1.000 1.000 1.000 1.000 0.625 0.750 0.625
v
1.000 1.000 0.866 0.707 0.354 0.354 0.354
A-1
1 2 3 4 5 6 7
1 1.8333 0.5 -0.6667 -1.0 0.0 0.0 0.0
2 0.5 1.5 0.0 -1.0 0.0 0.0 0.0
3 -0.6667 0.0 1.3333 0.0 0.0 0.0 0.0
4 -1.0 -1.0 0.0 2.0 0.0 0.0 0.0
5 0.0 0.0 0.0 0.0 0.0 0.0 0.0
6 0.0 0.0 0.0 0.0 0.0 0.0 0.0
7 0.0 0.0 0.0 0.0 0.0 0.0 0.0
Loop Iteration 5
u
1.000 1.000 1.000 1.000 1.125 0.750 0.750
v
1.000 1.000 0.866 0.707 0.707 0.000 0.354
A-1
1 2 3 4 5 6 7
1 1.8333 0.5 -0.6667 -1.0 0.0 0.0 0.0
2 0.5 1.5 0.0 -1.0 0.0 0.0 0.0
3 -0.6667 0.0 1.8333 0.5 -1.0 0.0 0.0
4 -1.0 -1.0 0.5 2.5 -1.0 0.0 0.0
5 0.0 0.0 -1.0 -1.0 2.0 0.0 0.0
6 0.0 0.0 0.0 0.0 0.0 0.0 0.0
7 0.0 0.0 0.0 0.0 0.0 0.0 0.0
Loop Iteration 6
u
1.000 1.000 1.000 1.000 1.125 1.250 0.875
v
1.000 1.000 0.866 0.707 0.707 0.707 0.354
A-1
1 2 3 4 5 6 7
1 2.8333 0.5 -0.6667 -0.5 0.0 -1.0 0.0
2 0.5 1.5 0.0 -1.0 0.0 0.0 0.0
3 -0.6667 0.0 1.8333 0.5 -1.0 0.0 0.0
4 -0.5 -1.0 0.5 3.0 -1.0 -1.0 0.0
5 0.0 0.0 -1.0 -1.0 2.0 0.0 0.0
6 -1.0 0.0 0.0 -1.0 0.0 2.0 0.0
7 0.0 0.0 0.0 0.0 0.0 0.0 0.0
Loop Iteration 7
u
1.000 1.000 1.000 1.000 1.125 1.250 1.281
v
1.000 1.000 0.866 0.707 0.707 0.707 0.637
A-1
1 2 3 4 5 6 7
1 2.3333 0.5 -0.6667 -0.5 0.0 -1.0 0.0
2 0.5 1.5 0.0 -1.0 0.0 0.0 0.0
3 -0.6667 0.0 1.8333 0.5 -1.0 0.0 0.0
4 -0.5 -1.0 0.5 3.0 -1.0 -1.0 0.0
5 0.0 0.0 -1.0 -1.0 2.6154 0.6154 -1.2308
6 -1.0 0.0 0.0 -1.0 0.6154 2.6154 -1.2308
7 0.0 0.0 0.0 0.0 -1.2308 -1.2308 2.4615
References