Skip to main content
ARS Home » Northeast Area » Beltsville, Maryland (BARC) » Beltsville Agricultural Research Center » Animal Genomics and Improvement Laboratory » AGIL_Software » MTDFREML » Practice

Practice
headline bar

Practice Problems

The practice zip file contains examples of data files, input (also referred to as answer) files, and output files for the MTDFREML programs. The zip file also contains a PowerPoint file, MTDF_Practice, that includes input and batch files as well as some helpful hints. All of these examples use Karin Meyer's mouse data and pedigree files. 
Included in the zip file are three sets of files, corresponding to the three analyses:

The pedigree file, Mouse.ped, includes three columns, representing animal, sire, and dam IDs in columns 1, 2, and 3. The data file, Mouse.dat, includes 7 integer variables and 3 real numbers on each row of data. There are three fixed effects in the model: generation, sex, and litter size, from integer variables 4, 5, and 6, respectively. The trait analyzed in this example is body weight from column 2 of the real data columns. There are no missing observations, but a logical missing value would be zero. There are 329 animals in the pedigree (see MTDF56 to confirm this), and the animal ID is contained in the first integer column.

The pedigree information in the second analysis is the same as that used in the first analysis. The second model. The factors are the same for both traits included in this analysis. The same data file, Mouse.dat, will be used in the second exercise. There same three fixed effects are included in the model for each trait: generation, sex, and litter size, from integer variables 4, 5, and 6, respectively. The same trait is analyzed in this example, body weight from column 2 of the real data columns. The second trait included in this analysis is feed intake.  Again, there are no missing observations, but a logical missing value would be zero for the new trait, feed intake. In addition to the random animal effect for each trait, a maternal genetic effect is estimated for each trait. This maternal genetic effect is fit as a "second" animal effect and associated with dam ID in the second integer field. Finally, a maternal permanent environmental effect is fit as an uncorrelated random effect that is also linked by dam ID.

The final model fit is a model fitting solely fixed effects. This is accomplished by creating a pedigree with a single individual We accomplish this by adding a column of ones and a column of zeros to the original pedigree file as columns 4 and 5, respectively. The resulting file is named Mouse.p10. Similarly, columns of ones and zeros were added to the Mouse.dat file between the original third and fourth columns. This new data file is named Mouse.d10. To create the single animal pedigree, the user simply indicates that the animal ID is stored in the column of ones (column 4) and the sire and dam are both coded as zero (column 5). The resulting pedigree has a single animal, coded as animal 1. Consequently, the relationship matrix, is a 1-by-1 matrix with a value of one. When specifying the "animal" effect, the user uses the column of ones as the animal ID. The solutions to the random effects in a set of mixed model equations have a unique property - they must sum to zero, or in this situation, the single solution must be zero, which means that the animal effect does not affect the likelihood. This can be shown to be an equivalent model to the strictly fixed effect model. The fixed effects are the same as the previous two models: generation, sex, and litter size, from integer variables 6, 7, and 8, respectively. Remember that two additional columns were added to this data file. The same trait is analyzed in this example, body weight from column 2 of the real data columns. When you have obtained solutions to the mixed models, confirm that the "animal" effect solution is truly zero. You can verify that the solutions to the fixed effects are unaffected by changing the variance components.

For each of the analyses a set of answer files are included that can be used as a guide for providing answers interactively. These input files can also be used along with an attached batch file that enable rapid semi-automated analysis of that model. For each of the three scenarios, four answer files are provided. First, for each analysis, an answer file is included for MTDFNRM that will construct the inverse of the numerator relationship matrix (A-1). Next, an input file is provided for MTDFPREP that provides model description, and an answer file that provides starting values for the variance component estimation and iteration constraints for MTDFRUN is included. Finally, an input file is provided to obtain sets of inverse blocks, sampling variances, contrasts and standard errors of contrasts,  and expectations of fixed effects.
The DOS/Windows convention of executable.exe < input.txt (e.g., mtdfnrm<mousenrm.in) means that the executable mtdfnrm[.exe] (providing the .exe file extension is optional) using the mousenrm.in file to respond to questions asked and input required when running mtdfnrm.exe. Otherwise, answers must be entered manually (i.e., typed) in response to questions.

 

 

File Name Description

Location: {Root of Zip file}
MTDF_Practice.pptx Answer/input files and some helpful hints

Location: .\Input
Mouse.ped Pedigree file with columns: Animal, Sire, Dam
Mouse.dat Data file with columns: Animal, Sire, Dam, Generation, Sex, Litter Size (Integer), Litter Number, Litter Size (Real), Body Wt, Feed Intake
Mouse.p10 Pedigree file; Animal, Sire, Dam, Ones, Zeros
Mouse.d10 Data file with columns: Animal, Sire, Dam, Ones, Zeros, Generation, Sex, Litter Size (Integer), Litter Number, Litter Size (Real), Body Wt, Feed Intake

Location: .\Input\Mouse
MouseNRM.in Answer file for running mouse pedigree using MTDFNRM.exe
MousePRP.in Answer file for running MTDFPREP.exe. This input file provides the number of animals in pedigree reported in output from MTDFNRM (in MTDF56)
MouseRUN.in Answer file used in the first run of MTDFRUN.exe
MouseRUN.SE Answer file to use after assumed convergence to continue to use the VCE with option 4 to obtain F- and t- statistics, SEP, expected values of solutions for levels of fixed factors, etc.
Mouse.bat Batch file showing program sequence, replacement of hand input with answer files, and saving output files to prevent MTDFREML standard output files from being overwritten

Location: .\Result\Mouse
MTDF56.1 Output file from MTDFNRM. This output information is needed to provide the number of animals in the pedigree file (needed in MTDFPREP)
MTDF66.1 Output file with summary of information provided by MTDFPREP
MTDF4.1 Renamed MTDF4 file updated with new estimates of variance components (see batch file), can be used as written by completed MTDFREML run or can be modified to restart (see batch file)
MTDF76.1 First set of solutions. Save to compare -2logL with restart
MTDF4.2 Answer file updated (from MTDF4.1) with new estimates of variances
MTDF67.2 Output file with F- and t- statistics and expected values
MTDF76.2 Second set of solutions to compare -2logL with previous or next start
MTDF77.2 Solution file for fixed effects
MTDF78.2 EBV for all animals in pedigree file (two EBV per animal corresponding to direct and maternal genetic effects)
MTDF54 (not shown, will have VCE when VCE are too big for formats used to write MTDF76)
MTDF72 (not shown, will have EBV, SEP, rTI, and inbreeding coefficient if answer is yes to that question-see MouseRUN.SE2 for such an answer file)

Location: .\Input\Two
MouseNRM.in Answer file for running mouse pedigree using MTDFNRM.exe
MousePRP.in2 Answer file for running MTDFPREP.exe for two-trait model
MouseRUN.in2 Answer file used in the first run of MTDFRUN.exe for two-trait model
MouseRUN.SE2 Answer file to use after assumed convergence to continue to use the VCE with option 4 to obtain F- and t- statistics, SEP, expected values of solutions for levels of fixed factors, etc. for two-trait analysis
MouseTwo.bat Batch file showing program sequence, replacement of hand input with answer files, and saving output files to prevent MTDFREML standard output files from being overwritten for two-trait analysis

Location: .\Result\Two
MTDF56_Two.1 Output file from MTDFNRM. This output information is needed to provide the number of animals in the pedigree file (needed in MTDFPREP)
MTDF66_Two.1 Output file with summary of information provided by MTDFPREP
MTDF4_Two.1-5 Renamed MTDF4 files updated with new estimates of variance components, and used as written by completed MTDFREML run to restart (see batch file)
MTDF76_Two.1-5 Sets of likelihood evaluations. Compare -2logL with restart
MTDF67_Two.5 Sets of inverse blocks, sampling variances, contrasts and standard errors of contrasts, expectations of fixed effects. See MouseRUN.SE2
MTDF77.5 Solution file for fixed effects
MTDF78.5 EBV for all animals in pedigree file (two EBV per animal corresponding to direct and maternal genetic effects for each of the two traits)

Location: .\Input\Fix
MouseNRM.fix Answer file for creating a single animal pedigree using MTDFNRM.exe
MousePRP.fix Answer file for running MTDFPREP.exe for a fixed-effects only model
MouseRUN.fix Answer file used in the first run of MTDFRUN.exe for the fixed-effects model
MouseRUN.fse Answer file to Sets of inverse blocks, sampling variances, contrasts and standard errors of contrasts, expectations of fixed effects for fixed-effects model.
MouseFix.bat Batch file to completely run the fixed-effects model, saving output files to prevent MTDFREML standard output files from being overwritten

Location: .\Result\Fix
MTDF56.fix Output file from MTDFNRM. Confirm the pedigree contains a single animal
MTDF66.fix Output file with summary of information provided by MTDFPREP. Again, confirm the pedigree contains a single animal
MTDF4.fix Renamed MTDF4 files updated with new estimates of variance components. Not used.
MTDF76.fix Iteration for variance components
MTDF67.fix Sets of inverse blocks, sampling variances, contrasts and standard errors of contrasts, expectations of fixed effects. See MouseRUN.SE2
MTDF77.fix Solution file for fixed effects - this is why we ran this analysis! Note that these solutions (and any estimable function) do NOT depend on the variance components provided!
MTDF78.fix EBV for single animals in pedigree. Confirm the value of the animal effect is ZERO!