4.4 An Applet for general matrix handling and calculating relationship and inbreeding

The relationship and inbreeding, and the inversion part of the matrix method has been programmed by Nils Toft and Thomas Nejsum Madsen, respectively, whereas the general matrix part has been borrowed from Bryan Lewis's General Matrix Applet where also the general instructions to the applet can be found.

If you see this you can't run the applet.
chose Options | Network Preferences | Languages | Enable Java

Matrices are just defined by line length and number of lines. To edit data in the data field is very troublesome as the return key can not be used for giving a new line as it works as pressing the eval. button. For larger sets of data use notepad or any other editor. Move the data to the input area by means of the clip board using ctrl-ins (copy) and shift-ins (insert).


Example:
Example of calculating inbreeding where the columns in the matrix shown below are animal, sire and dam, where the oldest animals should appear first. The pedigree are converted in the 'a' matrix as done below (0 means unknown parent):
animal sire dam
---------------
 a =
 1     0   0
 2     1   0
 3     1   0
 4     1   0
 5     2   3
 6     4   3
 7     5   6

Take these data including (a=) in the clip board and transfer them to input window and there after press the 'evaluate' button and the matrix should appear in the result window.
There after use in the input window:

      rel = :tabular(a)
and press the 'evaluate' button

The rel relationship matrix will appear in the result window and will look as shown below. Number of digits can be set, replacing the 6 with 3 will change the number of digits to 3.

        Relationship matrix  1+F (inbreeding) in the diagonal 
         rel =
             1.000    0.500   0.500   0.500   0.500   0.500   0.500
             0.500    1.000   0.250   0.250   0.625   0.250   0.437
             0.500    0.250   1.000   0.250   0.625   0.625   0.625
             0.500    0.250   0.250   1.000   0.250   0.625   0.437
             0.500    0.625   0.625   0.250   1.125   0.437   0.781
             0.500    0.250   0.625   0.625   0.437   1.125   0.781
             0.500    0.437   0.625   0.437   0.781   0.781   1.218
The inbreeding for each animal is given by its diagonal element minus one, i.e. the last three animals are inbred with an inbreeding coefficient of 0.125, 0.125 and 0.218 respectively.
The identifying numbers of each animal can be any number, as long as the oldest animals appear first in the list. When defining the base (oldest) generation both parents are set as zeros (0 = unknown).

If you are interested in the inbreeding coefficient, only, you run the inbred procedure as follow:

      inb = :inbred(a)
you will have the following, in the results window, with animal number and inbreeding coefficient:
	Animal   F (inbreeding) 
      inb =
 	1.000	 0.000	
 	2.000	 0.000	
 	3.000	 0.000	
 	4.000	 0.000	
 	5.000	 0.125	
 	6.000	 0.125	
 	7.000	 0.218	

For inverting the relationship matrix use the command:

        reli = :invert(rel)
Which put the inverse relationship matrix in the output window
Below is shown a hand calculated example with the two general formula in use.
The relationship between two animals is the average relationship between the oldest and the others two parents.
and the inbreeding of an individual is half the relationship between the two parents.

For your own data put them in the matrix 'a' and repeat the process:


Questions:
In the pedigree shown below the individuals have been assigned the numbers from 1 to 11.
Animal Sire Dam  , where 0 means unknown
    1     0   0
    2     0   0
    3     0   0
    4     0   0
    5     0   0
    6     2   1
    7     5   4
    8     7   3
    9     7   6
   10     7   8
   11     10  9

Calculate the inbreeding coefficient for the individuals No 10 and 11, and calculate the additive relationship coefficient between individual 11 and all others in the pedigree. The data set to be used for the calculations is given above.

What would be the inbreeding coefficient after 5 generation of full sib mating?


Back to the other applets or back to inbreeding theory. back to inbreeding theory (danish).