RENUM - data preparation program for sire and animal models (preliminary documentation) I. Misztal, University of Illinois E-mail address: ignacy@uiuc.edu, tel. (217) 244-3164 last correction:, 11-25-97. Disclaimer This program was developed for my own research. It is believed to be reasonably free of serious errors, but few attempts have been made to make it resistant to errors in parameter and input files. Please use it at your own risk. It is expected, however, that the use of this program will be acknowledged in publications, to which it contributed. Summary Renum renumbers effects consecutively starting from 1, for programs that require consecutive ordering. Supported are data files with free format, with fields separated by spaces. Animal fields can be alphanumeric up to 16 characters; all other fields must be numeric up to 9 digit long. Two or more fields can be merged into one, and levels with fewer than a given number of observations can be eliminated. The reordering preserves the original order for all except nonanimal fields, The animal fields are reordered with animals with records first. If year of birth is provided, animals and their parents can be verified on the basis of given generation intervals. The program can assign the unknown parent groups for unknown parents of animals. RENUM 1. Recodes single or multiple fields into consecutive numbers, 2. recodes the animals for the animal model: a) validates animals and parents based on their year of birth (if available) b) removes most noncontributing animals, c) can assign unknown parent groups for unknown parents and noncontributing animals d) assign consecutive numbers in the following order: animals with records, animals with pedigrees, other animals, unknown parent groups, e) provides a sample parameter file for program JAA (and related programs). Names of data files and parameters to the program are entered interactively. The data files should be in free format, where fields are separated by space(s). Animals can have up to 16 characters, other fields should be numeric with 9 decimal digits at the most. Upon return, the program returns the following files: 1. renumbered data file 2. renumber information for nonanimal factors 3. (if animal effect) pedigree file with the following fields: a) animal number (from 1) b) parent 1 number or unknown parent group number for parent 1 c) parent 2 number or unknown parent group number for parent 2 d) 3 minus number of known, noneliminated parents e) known or estimated year of birth (0 if not provided) f) number of known, not necessarily contributing parents g) number of records (before elimination due to other effects) h) number of progeny (incl. noncontributing animals) i) original animal id 4. message file renum.msg 5. sample parameter file for program JAA, renum.jaa Data and pedigree files The program expects free format input, where input fields are separated by one or more spaces. Fixed format will be accepted if fields are still separated by commas. Animals are treated as alphanumeric strings of up to 12 characters, while the other fields must be numeric with at most 9 digits. Missing animals in the pedigree file should be coded as one or more zeroes. There is no distinction between sires and cows. Therefore they should have separate codes. Year of birth should be between 0 and 99. All input files are read to a maximum line length of 120. Parameters Parameters to the program can be input either interactively or through a parameter file using the redirection. Characters after the # and blank lines are treated as comments. Memory requirements The program needs about 50 bytes of memory per animal. The size of memory, in bytes, is determined by parameter maxmem. Its value of equal to 100000 is sufficient for approximately 2000 animals. Computing environment The program is written in FORTRAN-77 with extensions, and was tested on a PC with the Microsoft Fortran compiler ver. 5.0, and on a Sun workstation running a SUN Fortran complier ver. 1.4. The program uses variables longer then 6 characters, and therefore might not work with compilers that truncate all variables to 6 characters. Also, the program does not work with compilers that cannot pass integer arrays as character strings. This includes Watcom Fortran 9.0. Bugs The option to eliminate levels with less than a minimum number of observations works correctly without but not with pedigrees. If elimination of animals with deleted observations is desired, the program should be run twice: first for all effects except the animals, and second time for the animals. All IDs starting with 0 are treated as missing. Example Data file (DATFILE) cow herd year season value ---------------------------------- red 254 87 2 254 yellow 254 87 2 300 green5 300 89 1 201 yellow 300 89 1 254 Pedigree file (PEDFILE) animal sire dam year_of_birth ------------------------------ red high 0 84 yellow low red 87 high 111 222 80 low 111 0 81 Execution on a PC c:\>renum RENUM - renumbering tool has capacity to renumber up to approximately 1799 animals and 2000 other levels input data file? datfile output data file? r1 printout data name? r2 give positions of colums to be renumbered into single factor, 0 ends 2 3 4 4 0 give minimum number of observations per level for each factor, 0 if all observations retained 0 give positions of columns to pass unchanged 5 give position of animal in data file, 0 if none 1 name of the pedigree file pedfile name of the output pedigree file? r3 positions of animal, sire, dam and year of birth 1 2 3 4 give years to separate unknown parent groups, or 0 82 86 give minumum, average, and maximum generation interval 2 4 6 Is it a repeatability model? (1=yes/0=no) 0 Is maternal effect present (1=yes/0=no) 0 data files read to 120 column only Example parameter file for program JAA was stored in file renum.jaa Summaries and messages were stored in file renum.msg c:\>type r1 1 2 1 254 1 2 2 300 2 1 3 201 2 1 2 254 c:\>type r2 records 4 factor renumbered level # original levels ------------------------------------------------------------ 1 : 2 3 4 1 2 254 87 2 2 2 300 89 1 2 : 4 1 2 1 2 2 2 c:\>type r3 1 4 8 2 83 1 1 1 red 2 5 1 1 87 2 2 0 yellow 4 6 7 2 80 2 0 1 high 5 6 7 2 81 1 0 1 low 3 7 7 3 0 0 1 0 green5 6 7 7 3 76 0 0 2 111 c:\>type renum.msg input data file: datfile output data file: r1 input pedigree file: pedfile output pedigree file: r3 data records: 4 original levels: 4 levels after cutting: 4 Renumbered factors factor levels 1 2 2 2 missing pedigree or missing year of birth in animal:green5 Animal factor summary pedigree records: 4 animals found: 7 animals eliminated: 1 repeated pedigrees: 0 Consecutive number assignment animals with records 1 - 3 parents with pedigree record 4 - 5 parents without pedigree record 6 - 6 unknown parent groups 7 - 9 Unknown parent group allocation group no. consecutive no # years 1 7 4 0- 82 2 8 1 83- 86 3 9 0 87- Example parameter file for program JAA was stored in file renum.jaa c:\>type renum.jaa r1 r3 jaaout 3 4 .70 10 1 2 .00 2 2 .00 3 9 -2.00 3 3 50 Parameter file The parameter below can be used for RENUM by using the redirection under DOS, OS/2 or Unix type systems by: renum