A novel recursive algorithm for the calculation of the detailed identity coefficients

A recursive algorithm to calculate the fifteen detailed coefficients of identity is introduced. Previous recursive procedures based on the generalized coefficients of kinship provided the detailed coefficients of identity under the assumption that the two individuals were not an ancestor of each other. By using gametic relationships to include three, four or two pairs of gametes, we can obtain these coefficients for any pair of individuals. We have developed a novel linear transformation that allows for the calculation of pairwise detailed identity coefficients for any pedigree given the gametic relationships. We illustrate the procedure using the well-known pedigree of Julio and Mencha, which contains 20 Jicaque Indians of Honduras, to calculate their detailed coefficients. The proposed algorithm can be used to calculate the detailed identity coefficients of two or more individuals with any pedigree relationship.


Background
The 15 detailed states of identity were first described by Harris [1] and Gillois [2]. Throughout this paper, they will be referred to identity coefficients as described by Cockerham [3].
To circumvent the absence of recurrence rules to obtain identity coefficients, Karigl [4], following the rules for generalized kinship coefficients [1,3], obtained identity coefficients using a triangular linear transformation. This transformation provided the 9 condensed identity coefficients for any pair of individuals, but the 15 detailed identity coefficients can only be calculated using Karigl's method under the assumption that neither of the two individuals is an ancestor of the other. To obtain generalized kinship coefficients, Lange and Sinsheimer [5] described an alternative way, which can calculate the detailed coefficients of identity without this limitation. Unfortunately, the implementation of the latter method is not a triangular linear transformation.
An alternative to using multiple kinship coefficients is the use of multiple gametic relationships. These relationships, called chromosome pedigrees by Donnelly [6], have been succesfully used to account for dominance in linear Correspondence: garcia@inia.es Departamento de Mejora Genética, Instituto Nacional de Investigación Agraria, Ctra. de La Coruña km. 7.5, 28040 Madrid, Spain models [7][8][9]. Here, we use these multiple gametic relationships to develop a new method to calculate the 15 detailed identity coefficients.

Generalized gametic relationships
The coancestry between two individuals X and Y , φ XY , is usually calculated following simple recurrence rules. These rules can be implemented using tabular methods or languages with recursive function support. To calculate the whole set of coancestries for a given pedigree, only two formulae are required [10]: where F and M are the father and the mother of individual X, respectively. These equations operate successively over pairs (X, Y ) where X is assumed to be more recent than Y . Let x and x be the paternally and maternally inherited copies at a given locus carried by individual X and y and y the corresponding copies carried by individual Y . The coancestry between X and Y can then be written as: where ≡ stands for identical by descent (IBD). Analogous relationships have been described for gametes [6] as ψ ab = P (a ≡ b) and recurrence rules have been developed for their pairwise relationships [6,7]: where a and b denote two gametes in the pedigree. Both g and h are the direct ancestral gametes of a, that is, the gametes of the father or the mother if a is a paternal or maternal gamete, respectively. Although Equations (1) and (2) are closely related, they have different interpretations.
We use the three-way (ψ abc ), the four-way (ψ abcd ) and the two-pair (ψ ab,cd ) gametic relationships as counterparts of the conventional generalized kinship coefficients [4]. These generalized gametic relationships correspond to the probability of three or four gametes to be IBD. Note that these multiple gametic relationships correspond to multiple gametic identities, regardless of the identity by descent with other gametes. For instance, for individuals X and Y , whose paternally and maternally inherited gametes are described above, ψ ab,cd is the probability that gametes a and b are IBD and simultaneously c and d are also IBD. For instance, for individuals X and Y , The recursive formulae for the whole set of multiple gametic relationships are For an easier implementation, Equation (3) can be summarized in a simple set of rules 1. In any n-way relationship, merge groups sharing a given gamete, that is, ψ ab,ac = ψ abac 2. In any n-way relationship, discard repeated gametes, i.e. ψ aabc = ψ abc or ψ aa,bc = ψ a,bc . 3. Given that the probability of a gamete to be IBD to itself is 1, discard groups of identity including a single gamete, i.e. ψ a,bc = ψ bc . 4. Identities with a single gamete are 1 and identities with two or more founder gametes at the same group are 0. 5. Calculate ψ aθ = 1 2 ψ gθ + ψ hθ , where θ stands for any identity pattern and a for a gamete of the youngest individual. For instance ψ ab,cd = 1 2 ψ gb,cd + ψ hb,cd or ψ abc = 1 2 ψ gbc + ψ hbc .
As long as these rules are correct and regardless of the number of gametes involved, they can be used to calculate identities involving more than two individuals.

The detailed identity coefficients
The 15 detailed coefficients of identity for individuals X and Y can be calculated from the generalized gametic relationships by a simple linear transformation. We will consider the 15 partitions or identity states as described by Gillois [2] and Jacquard [11], i.e., The detailed identity coefficients δ i are the probabilities of each state S i for a given pair of individuals.
Generalized kinships [4] are a linear transformation of the pairwise detailed identity coefficients. For instance, ψ xx yy requires the state S 1 to be true, then we can write ψ xx yy = δ 1 . Similarly, ψ xx y requires either S 1 or S 2 to be true and therefore ψ xx y = δ 1 + δ 2 , and so on for all ψ. A set of 15 equalities is defined to set up the following linear system of equations.  1 1 1 1 1 1 1 1 1 1 1 1 1 1  The coefficient matrix in Equation (4) is triangular and is equivalent to formula (8) in [4]. Nevertheless, the right hand side here includes the generalized gametic relationships instead of their kinship counterparts.

An example: the detailed identity coefficients of the Jicaque Indians
We reanalyzed the pedigree of the Jicaque indians Julio and Mencha [12] presented in Figure 1 and previously analyzed in [4,11,13]. Previous analyses have focused on the identity coefficients between Julio and Mencha and between two of their progeny. Table 1 shows these results and those of two other pairs: Julio vs. one of their progeny and Mencha vs. one of their progeny.
Program source codes written in Fortran 90 and examples are available at https://github.com/agarcor21/ IdentityCoefficients.

Discussion
The identity by descent of two gametes [6][7][8][9] is conceptually simpler than the kinship between individuals because it avoids any random sampling of genes. Although the number of gametes is larger than the number of individuals, its simple definition results in more intuitive recursive formulae and easier calculations.
Here, we have provided a novel method to derive the detailed identity coefficients [1,2]. Karigl derived a simple transformation to calculate these coefficients from the multiple kinship coefficients, which provided the 15 identity coefficients when the individuals were not ancestordescendant related. Lange and Sinsheimer [5] first provided exact equations for these 15 coefficients without any assumption. Depending on the purpose of the study, researchers have used 7 or 9 condensed identity coefficients. For instance, in order to apply the identity coefficients to dominance models, 7 condensed coefficients can be used [8,9]. To our knowledge, the algorithm proposed in [9] has never been used to calculate the 15 detailed coefficients, but the formulas presented in their paper could be used to obtain them in a direct way.
We have proposed using multiple gametic relationships to calculate the 15 detailed identity coefficients. The linear transformation in this paper is similar to equation 8 of Karigl's approach [4]. Reordering the rows in Equation (4) to follow Karigl's pattern [4], both formulae only differ on the right hand side. Note that the meaning of both formulae is rather different.
The procedure presented here has been successfully implemented on small pedigrees. In large data sets, the number of calls to the recursive function will depend on the number of generations and the structure of the pedigree. Implementing the procedure in such scenarios is beyond our goal, but path counting or graph theorybased methods [14,15] have been developed to improve the computing efficiency of this calculation.