Nonadd
Programs for
Genetic Selection and Mating by Accounting for Nonadditive Genetic Inheritance
- 1990.
By Paul
VanRaden (research geneticist), Animal Genomics and Improvement Laboratory
(AGIL), USDA Agricultural Research Service, and by Ina Hoeschele (professor),
Department of Dairy Science, Virginia Polytechnic Institute.
Download nonadd.zip (32.9
KB)
CONTENTS OF
ZIPPED FILE:
nonadd.genetic.README
inbreedprev.dat - input to invers.f90
invers.dat - input to invers.f90
invers.ped - input to invers.f90
invers.f90
sortsum.sas
nonadd.f90
makefile
References
Hoeschele, I., and VanRaden, P.M. Rapid inversion of dominance relationship matrices for noninbred
populations by including sire by dam subclass effects. J. Dairy Sci. 74(2):557–569. 1991.
VanRaden,
P.M., and Hoeschele, I. Rapid inversion of additive by
additive relationship matrices by including sire-dam combination effects. J. Dairy Sci. 74(2):570–579. 1991.
VanRaden,
P.M., and Miller, R.H. Effects of nonadditive genetic interactions, inbreeding, and recessive
defects on embryo and fetal loss by seventy days. J. Dairy Sci. 89(7):2716–2721.
2006.
README file:
The above files should be in the same directory where
invers.f90, sortsum.sas,
and nonadd.f90 will be compiled and run.
MAKEFILE AND PROGRAM DOWNLOADS:
makefile - is used to compile invers.f90 and
nonadd.f90.
Put makefile, invers.f90, and
nonadd.f90 into the same directory.
Type 'make invers' and hit return.
make invers <return>
Type 'make nonadd' and hit return.
make nonadd <return>
The compile generates an invers
executable and a nonadd executable.
Run inver.f90 FIRST.
invers |tee invers.screen.output
<return>
OUPUTS from invers.f90:
invers.screen.output
addinv.coef
AxAinv.coef
dominv.coef
equation.list
inbreed.dat
recoded.dat
Run sortsum.sas SECOND.
sas sortsum.sas
<return>
Can use R instead of SAS.
OUPUTS from sortsum.sas:
sortsum.lst
sortsum.log
AxAinv.sum
dominv.sum
addinv.sum
recoded.srt
Run nonadd.f90 THIRD.
nonadd |tee nonadd.screen.output
<return>
OUTPUTS from nonadd.f90:
nonadd.screen.output
solutn.list
sca.list
nxtrun.list
- may not be written.
Fortran program - 1990, 2003, and 2025:
invers.f90 - computes the following:
0) Inbreeding
coefficients for all animals and subclasses
1) Inverse of A =
Relationship matrix among additive effects
(Sire-MGS MDL, Reduced AM, OR Animal Model)
2) Inverse of D =
Relationship matrix among dominance effects
(Sire X MGS or Sire X Dam subclass effects)
3) Inverse of U =
Relationship matrix among additive-by-
additive effects for animals and subclasses
Also: Recoded data
set with equation numbers for all effects
SAS program - 1990:
sortsum.sas - SAS program to sort and sum
outputs from invers.f90.
Fortran program - 1990 and 2025
nonadd.f90 - Fortran program for non-additive genetic models.
Computes estimates
of:
Additive,
dominance, and additive*additive genetic effects,
variance
components by tilde-hat approximation to REML, and
Sire-Dam or
Sire-Maternal Grandsire specific combining abilities
For:
Sire-Maternal
Grandsire models,
Sire-Dam (Reduced
Animal) models, and
Animal models.
Above introductory forward by Gary Fok (programmer), Animal
Genomics and Improvement Laboratory (AGIL),
USDA Agricultural Research Service (gary.fok@usda.gov)
-----------------------------------------------------------------
Dear Colleague:
This file contains
an example data set, example pedigree file,
and expected results from running Fortran programs invers.f90
and
nonadd.f90 (being sent to you in a zipped file).
Program invers.f90
computes inbreeding coefficients and inverses
of additive, dominance, and additive-by-additive relationship
matrices for sire-maternal grandsire, reduced animal, and
animal
models.
Program nonadd.f90
estimates these effects and variances
for all model options.
nonadd.f90 is
designed for large populations and data
sets; examples of populations already analyzed can be found
in
J. Dairy Sci. 75:2892, 74:1743, 74:1114, and 78:1168. Much of
the documentation on how to use invers.f90 and nonadd.f90 is
contained in the first lines of the source codes.
More detailed
descriptions of the algorithms used in
invers.f90 are in J. Dairy Sci. 74:557 and 74:570. More
detailed
description of the estimation of effects (by iteration on
data)
and variances (by tilde-hat approximation to REML) for sire-
maternal grandsire models is in J Dairy Sci. 74:1743.
Ignacy Misztal (ignacy@uga.edu) has new programs that should
be faster because they use iteration on data instead of
writing
inverse coefficents to a file and
use Method R for variances.
Let us know if you
have problems or unusual results with
invers.f90 and nonadd.f90. Good results were obtained with
livestock, horse, poultry, fish, and tree data so far.
Paul VanRaden
(paul.vanraden@usda.gov)
Ina Hoeschele (INAH@VT.EDU)
EXAMPLE PEDIGREE FILE (FORTRAN UNIT
10 input invers.ped for invers.f90):
ANIMAL SIRE DAM
BIRTH.YR
1000001 0 0 71
1000002 0 0 71
1000003 0 888888 72
1000004 999999 0 74
1000005 1000001 1000002 77
1000006 1000001 0 77
1000007 1000003 1000004 75
1000008 0 1000005 78
1000011 1000007 0 80
1000017 1000005 1000006 80
EXAMPLE DATA SET (FORTRAN UNIT 11
input invers.dat for invers.f90):
ANIMAL SIRE DAM
HERD.YR.SEAS Y
1000016 1000011 1000005
35010001 1.2 1.2
1000015 1000007 1000008
35010001 1.3 1.3
1000014 1000007 1000006
35010002 1.1 1.1
1000013 1000011 1000005
35010002 1.5 1.4
1000012 1000007 1000008
35010002 1.7 1.5
1000011 1000007 0
35010003 1.2 1.2
1000010 1000007 1000006
35010001 1.2 1.1
1000009 1000007 1000005
35010003 1.0 1.0
1000007 1000003 1000004
35010002 1.6 1.4
1000006 1000001 0
35010001 1.3 1.2
1000005 1000001 1000002
35010003 1.8 1.6
--------------------------------------------------------
OUTPUT EXPECTED FROM RUNNING
invers.f90 ON EXAMPLE DATA:
--------------------------------------------------------
OPTIONS SELECTED:
VARTYP MODTYP MAXSC
MAXAN MAXANC INBRED
WRTOUT
3.
2 200 300
20 1 2.
FIRST ANIMAL IN PED FILE AND ITS PARENTS
WERE 1000001 0 0
LAST ANIMAL IN PED FILE AND ITS PARENTS
WERE 1000017 1000005
1000006
10
ANIMALS WERE IN PEDIGREE FILE AND HASHED
0
ANCESTORS ADDED TO PEDIGREE LIST
2
ANCESTORS PROVIDED NO TIES AND WERE DROPPED
10
TOTAL ANIMALS IN PEDIGREE LIST
SIRE-DAM PEDIGREES WERE USED
(PEDTYP=1)
FIRST ANIMAL IN DATA FILE AND ITS PARENTS
WERE 1000016 1000011
1000005
LAST ANIMAL IN DATA FILE AND ITS PARENTS WERE 1000005
1000001
1000002 35010003 1.810000
0.6000000 0.0000000E+00
11
DATA RECORDS READ FROM UNIT 11
2
DATA RECORDS DROPPED BECAUSE PARENTS NOT FOUND
9
DIFFERENT ANIMALS HAD RECORDS IN DATA
7
NONPARENTS (ANMLS IN DATA BUT NOT IN PED FILE)
6
SIRE X DAM (OR S X MGS) SUBCLASSES WERE FILLED
9
INTRCTNS OF PARENTS WITH THEMSELVES WERE ADDED
21
ANCESTOR SUBCLASSES ADDED IN PASS
1
4
ANCESTOR SUBCLASSES ADDED IN PASS
2
0
ANCESTOR SUBCLASSES ADDED IN PASS
3
19
SUBCLASSES RETAINED OUT OF
40
8
DOM AND 19 AXA SUBCLASSES RETAINED
19
SUBCLASSES WRITTEN TO LIST OF EQ.(UNIT 20)
MAXIMUM ANCESTORS IN AN INDIVIDUAL PEDIGREE
WAS 13
MAXIMUM ANCESTORS AFTER REMOVING DUPLICATES
WAS 8
FRSTYR LASTYR AVE.INBREED PED.ANMLS
%UNK.PARENTS
71 75 0.00000 5
80.00
76 80 0.02500 5
30.00
11
DATA RECORDS READ FROM UNIT 11
9
RECODED DATA RECORDS WRITTEN TO UNIT 25
MAXIMUM INBREEDING FOR ANIMALS IN
DATA FILE WAS 0.00000
AVERAGE INBREEDING FOR ANIMALS IN
DATA FILE WAS 0.00000
PERCENT ANIMALS IN DATA WITH
NONZERO INBREEDING 0.00000
DIMENSION OF ADDITIVE INVERSE = 10
ADDITIVE INVERSE COEFS WRITTEN TO UNIT 21= 43
DIMENSION OF DOMINANCE INVERSE = 8
DOMINANCE INVERSE COEFS WRITTEN TO
UNIT 22= 35
DIMENSION OF ADDITIVE BY ADDITIVE
INVERSE = 29
ADD X ADD INVERSE COEFS WRITTEN TO
UNIT 23= 275
======================================================================
RECODED DATA SET (FORTRAN UNIT 25 input recoded.dat for invers.f90:
ANIMAL ADD. AND AXA
EQUATIONS AXA DOM
HERD-
ID ANIMAL SIRE
DAM SUBCLASS SUBCLASS YEAR-
Y
(MGS) SEASON
1000016 0 9 5 11 1
35010001 1. 0.
0.
1000015 0 7 8 12 2
35010001 1. 0.
0.
1000014 0 7 6 13 3
35010002 1. 0.
0.
1000013 0 9 5 11 1
35010002 2. 0.
0.
1000012 0 7 8 12 2
35010002 2. 0.
0.
1000010 0 7 6 13 3
35010001 1. 0.
0.
1000009 0 7 5 14 4
35010003 1. 0.
0.
1000007 7 3 4 0 5
35010002 2. 0.
0.
1000005 5 1 2 0 6
35010003 2. 1.
0.
========================================================================
LIST OF EQUATIONS(FORTRAN UNIT 20 input equation.list
for invers.f90:
ADD.EQN.# DOM.EQN.# AXA.EQN.#
ANIMAL SIRE DAM
INBREED.COEF.
0 1 11 0
1000011 1000005 0.0000
0 2 12 0
1000007 1000008 0.0000
0 3 13 0
1000006 1000007 0.0000
0 4 14 0
1000005 1000007 0.0000
0 5 15 0
1000003 1000004 0.0000
0 6 16 0
1000001 1000002 0.0000
0 0 17 0
1000011 1000007 25.0000
0 0 18 0
1000005 1000001 25.0000
0 0 19 0
1000005 1000002 25.0000
0 7 20 0
1000011 1000001 0.0000
0 0 21 0
1000003 1000007 25.0000
0 0 22 0
1000004 1000007 25.0000
0 0 23 0
1000005 1000008 25.0000
0 0 24 0
1000006 1000001 25.0000
0 8 25 0
1000007 1000001 0.0000
0 0 26 0
1000003 1000011 12.5000
0 0 27 0
1000004 1000011 12.5000
0 0 28 0
1000001 1000008 12.5000
0 0 29 0
1000008 1000002 12.5000
1 0 1
1000001 0 0
0.0000
2 0 2
1000002 0 0
0.0000
3 0 3
1000003 0 0
0.0000
4 0 4
1000004 0 0
0.0000
5 0 5
1000005 1000001 1000002
0.0000
6 0 6
1000006 1000001 0
0.0000
7 0 7
1000007 1000003 1000004
0.0000
8 0 8
1000008 0 1000005
0.0000
9 0 9
1000011 1000007 0
0.0000
10 0 10
1000017 1000005 1000006
12.5000
--------------------------------------------------------
OUTPUT EXPECTED FROM RUNNING
nonadd.f90 ON EXAMPLE DATA:
(nonadd.f90 CAN PROCESS ONLY ONE TRAIT AT
A TIME,
HERE THE FIRST TRAIT (FIRST COL OF Y
VALUES)
--------------------------------------------------------
nonadd.f90 Output
MODEL OPTIONS SELECTED:
VARTYP MODTYP ESTVAR
RELATD INBRED LITENV
3.
2 0. 1.
2 0
YMEAN: 1.35000
OTHER PARAMETER VALUES:
NAEQ NAEQ1 NDEQ
NDEQ1 NAAEQ NSBAA
NCOEF NFIL MAXANH
10
10 8 8
29 19 18
1 1000
ITERATION PARAMETERS:
MAXITV MAXITS CONVRG
RESTART
5
500 0.00100000 0.
STARTING VALUES:
SOLB XH2 D2
AA2 C2
0.00 0.08 0.06
0.00 0.00
FIRST DATA RECORD AS READ:
1000010 0 7 6 13 3
35010001 1.000000
29
RECORDS READ FROM UNIT 10
18
INBREEDING COEFFICIENTS STORED
solb sola1 sold1
solaa1 = 0.0000000E+00 0.0000000E+00 0.0000000E+00
0.0000000E+00 round 1
9 DATA RECORDS PROCESSED IN ROUND 1
3 HERD-YEAR-SEASONS IN DATA
solb sola1 sold1
solaa1 = 0.0000000E+00 0.0000000E+00 0.0000000E+00
0.0000000E+00 round 2
Converge A D 0.3120562
0.6023611
solb sola1 sold1
solaa1 = 0.0000000E+00 0.0000000E+00 2.1690151E-03
0.0000000E+00 round 3
Converge A D -1.0564718
-3.0331968
solb sola1 sold1
solaa1 = 0.0000000E+00 -6.7797874E-04
-3.9583654E-03
0.0000000E+00 round 4
Converge A D 0.9247031
1.5131657
solb sola1 sold1
solaa1 = 0.0000000E+00 1.3660651E-03
8.3551044E-04
0.0000000E+00 round 5
Converge A D -1.0591409
-1.8622954
REGRESSION ON INBREEDING IN
ROUND 5 IS:
0.0000
PROGRAM MADE 5
PASSES THROUGH THE DATA FILE
MAXIMUM AND MINIMUM VALUES FOR
ESTIMATED COMBINING ABILITIES INCLUDING INBREEDING ARE: 0.00150 -0.68672
AVERAGE POSITIVE AND NEGATIVE
ESTIMATED COMBINING ABILITIES INCLUDING INBREEDING ARE: 0.00062 -0.16455
MAXIMUM AND MINIMUM VALUES FOR
ESTIMATED COMBINING ABILITIES EXCLUDING INBREEDING ARE: 0.00150 -0.68672
AVERAGE POSITIVE AND NEGATIVE
ESTIMATED COMBINING ABILITIES EXCLUDING INBREEDING ARE: 0.00062 -0.16455
MAXIMUM AND AVERAGE NO.OF RECORDS
PER FILLED SIRE-DAM(MGS) DOMINANCE SUBCLASS ARE: 2.0
1.5
MAXIMUM AND AVERAGE NO.OF RECORDS
PER FILLED SIRE-DAM(MGS) ADD.-BY-ADD. SUBCLASS ARE: 2.0
1.8