Introduction

This is Help for Pedigree Viewer versions 6.xx

Select topics from the pane to the left. If you cannot see the pane, click the “Show” button above.

Good Luck,

Brian and Sandy Kinghorn.


What Pedigree Viewer can do

Pedigree Viewer now does quite a lot more than just display pedigree diagrams – but that is still its default function.

The program reads your simple data file and displays the full pedigree structure on the screen. Each individual is represented by its identity, its name, or by its value for any of the traits/fields in the data file.

You can display a large pedigree of thousands of individuals all on the screen at the one time. Data are overlapped on the screen for such large pedigrees, but in one mode an individual's information is highlighted as the mouse cursor passes over. You can ask to find an individual(s) by identity, or by merit or merit range for a given trait. You can choose which field(s) fields to display. You can choose to display only relatives (of chosen degree) of the individual clicked. With one more click you can then organise the pedigree picture to be most clear for just those individuals.

Individuals of high merit can be shaded more brightly, giving quick access to those with high merit. You can also zoom into interesting parts of the pedigree, change the font displaying data, check for logical errors, alter the display of pedigree links and make other manipulations to give a suitable display, and print the result.

Inbreeding coefficients, coancestry between individuals and BLUP estimates of breeding value can be calculated and added to the list of displayable data.

The Mate Selection function lets you select which individuals to breed from, and the pattern of mate allocation, aiming to give the best outcome in terms of factors such as maintenance of genetic diversity and high rates of genetic change.

The program can be useful for navigating around a pedigreed data set to get a feel for its structure and any problems it might contain. Embryo transfer matings are usually easy to spot. By shading fields and possibly sorting horizontally, phenotypic and EBV trends can be quite noticeable.

[Not yet implemented in version 6.0 (but working in version 5.5b): The program also reads Gedcom files (*.ged), as generated by popular Family Tree programs, and displays the full pedigree structure on the screen. Each individual is represented by full name, or by another field such as Sex, Birth Date or Inbreeding level.]

The program runs under Microsoft Windows versions later than 3.1, including Vista.95 and Windows NT.


Opening a Gedcom file

[This function is not yet implemented in version 6.0 (but working in version 5.5b)]

Click on File/Open Gedcom file, then double click on the file to be opened.

Your Gedcom file must first be exported from your Family Tree Program.


Opening a Pedigree file

Pedigree files must have one of two permitted extension: *.ped and *.txt

Click on File/Open Pedigree file, then double click on the file to be opened. The program proceeds to display the pedigree.

Some example pedigree files are provided, and there is separate help under Data file preparation.

Open file using a command line argument

At the command prompt, enter for example “pedigree example.ped” to launch PV with the corresponding pedigree file opened immediately.


Pedigree Links

If pedigree links are shown, then, by default, red links emanate downwards from male parents and yellow links from females. For bisexual parents that self fertilise, selfing links are orange.

Colours can be changed, and dotted lines can be used.


Use of the mouse

If the Zoom tool is not currently activated, then you can use the mouse to select a part-pedigree:

Click left button on an individual to display the pedigree just for it, its parents, and its progeny.

Click right button on an individual to additionally show the parents and progeny of its parents and progeny.

Hold down numeric key ‘N’ then Click left button on an individual to show it and all relatives up to degree N. You cannot use the numeric keypad for this operation. Accepted values of N are 1 to 9.

Shift-Click-Left on an individual to show it and all its direct ancestors.

Ctrl-Click-Left on an individual to show it and all its direct descendants.

Ctrl-Shift-Click-Left on an individual to show it and all its direct ancestors plus all its direct descendants.

Ctrl-Shift-Click-Right on an individual to show it and all connected individuals, but note that this is a slow process for pedigrees containing more than a few thousand individuals.

Additionally: hold the Alt key down to accumulate your selections.

If you are viewing a large pedigree and have difficulty clicking on the individual desired, you can either use the Find button, followed by menu item View/Relatives, or, you can click as closely as you can, then use the [image] [image] buttons to move left and/or right until you land on the correct individual. The currently selected Proband is displayed in the toolbar activity text box.

Click on Optimise Pedigree to clean up the display of your chosen part-pedigree.


Buttons in the toolbar

[Click on them with the left mouse button]

Open a new file

Show the input file reading window. This shows the number of fields, which fields are numeric versus alphanumeric, warnings and errors. The input file is parsed character-by-character to detect conditions and problems.

Choose which fields to display for each individual displayed. A small dialog box contains a checkbox for each field. Any number of fields can be displayed. Just check the boxes you desire.

Open a key as a quick aid to relate print color to the fields displayed.

Collapse the pedigree diagram to the left, giving equal horizontal spacing between individuals for each tier.

Spread pedigree diagram across the window for each tier.

Control automatic updating of the full pedigree display.

Click [image] to cancel automatic updating. Left-Click [image] to manually update the pedigree diagram. Right-click [image] to invoke automatic updating. [Note: Selection of part-pedigrees always involves automatic updating of the display].

Adjust the margins around the pedigree diagram by clicking on this button:

L & R Click to increase left and right margins

Additionally hold Shift to decrease margins

Additionally hold Alt to alter top and bottom rather than left and right margins

To reset all margins hold Ctrl and Left Click

Optimise the part-pedigree that you have selected. This alters the placement of individuals on the screen to simplify the picture. See Details.

Display whole pedigree. This restores whole pedigree after selecting just some individuals with the mouse. Note: Inbreeding coefficients and BLUP EBVs are lost after pressing this button. [This tool does not cause unzooming].

Shade merit fields/Remove shading. Shading causes any numeric field displayed (typically trait merit, but not numeric identities or index numbers) to be shaded on a grey scale. The minimum merit is black (but the value 0 is not counted when finding the minimum) and the maximum is bright white. This feature helps find individuals of exceptional merit in large data sets. Typically use with Sort Left to Right.

Move left one individual: If you are viewing a large pedigree and have difficulty clicking on the animal desired, you can either use the 'Find' button (with the appropriate field currently displayed), followed by menu item View/Relatives, or, you can click as closely as you can, then use the 'L' and 'R' buttons to move left and/or right until you land on the correct individual.

Move right one individual. See above.

Zoom in. To zoom into part of either a full or part pedigree, first click on 'Zoom'. The mouse cursor changes to a cross-hair. Goto to top left of the area to zoom, hold down the left button, and then drag to the bottom right. When you release the button the selected area will expand to fill the screen, but font sizes will stay the same. You will see a thumbnail that shows what part of the full pedigree diagram you are zoomed in to. Left-Click the tiny buttons to move the selected area. Ctrl-Click to increase size on the corresponding side, and Shift-Click to decrease size (more zooming).

Unzoom to normal magnification.

Find. You can choose which field(s) to search, and you can search for a range of numeric values. You can then choose which of the found individuals to select. A circle is paced over all matching targets.

Lines, some arcs, arcs, no links shown: This button alters the nature of pedigree links shown. Using arcs rather than straight lines to connect individuals can be useful to give a less ambiguous display. 'Some arcs' gives arced links only where generations are not adjacent. 'No links shown' can be useful, together with a small font, for initial screening of very large pedigrees.

Set screen and/or printer colors. This gives you the opportunity to modify the screen and/or printer colors. Your chosen colors will prevail in future runs of the program, both for screen display and printing colors. You can chose to display all fields in the same color, if desired. Click “use factory defaults” as desired.

Edit Font type and size

Increase font size on the pedigree diagram

Decrease font size on the pedigree diagram


Optimise Pedigree and Trace Optimisation

The ‘Optimise pedigree’ button alters the placement of individuals on the screen to simplify the picture. [This can be a bit futile for large pedigrees where spaghetti on the screen is hard to avoid - in this case you can use the mouse to display components of the pedigree.] Selecting â€˜Trace optimisation' shows this process in action - but this is very slow for large pedigrees. However, you can deselect trace in the middle of an optimisation. The optimise tool is most useful when only a part pedigree (selected by mouse) is currently shown.


Menu items at the top of the screen

These are largely self-explanatory, and only some description is required here:


File Menu

Open Pedigree File: Use this to open a pedigree file. [For help, click Data file preparation.]

Open Gedcom File: Use this to open a Gedcom file. [Not yet available in version 6.xx. Use version 5.5b for this if needed].

You can save a part-pedigree in its own file as follows:

1. Use mouse clicks (but not while zooming) to display the animals desired.

2. Click Optimise Pedigree and wait for your part-pedigree to 'clean up'. You must carry out this step.

3. Select the File/Save menu, then choose a file extension.

Save sequential ID file (TXT for P.V.): This makes a tab-delimited text file with a .TXT extension. The file contains animal ID's renumbered sequentially from 1, and this includes base parents not originally listed as animals in the .PED file. Renumbered Sire and Dam ID's are included, together with original ID, and the other fields from the input file, plus inbreeding coefficients and BLUP EBVs if these have been calculated (see Run BLUP analysis). Many genetic evaluation/analysis programs require such a file, with sequential numbering of animals. You can also open this sequenced file in Pedigree Viewer.

Save sequential ID file (CSV for Excel): As above, except that this option produces a comma delimited file that can be opened in Excel.

Save image of pedigree diagram (BMP): This creates a bitmap file with a BMP extension, which can be imported to a report document. [Note: As an alternative route to including your pedigree display as part of another document, you can save the PV window to the clipboard by pressing the ‘Print Screen' button on your keyboard while holding down the Alt key (holding Alt restricts the region saved to the current window). Then you can paste the image into your word processor, or other application. This method transfers the whole window, so you might want to crop the image within the other application]


Tools menu

Zoom, UnZoom and Find tools: See Buttons near the top of the screen.

Shorten long links attempts to decrease the length of long links (three or more tiers vertical distance) between parents and their offspring progeny. This is not always very effective, because it may not be possible to logically draw the pedigree without some long links.

Vertical alignment aims to simplify the display by minimising the total length of pedigree links, but without the swapping of tiers that is carried out by “Shorten ling links”, above. This gives the same effect as the optimise pedigree button, except that if there is a part pedigree displayed, “Vertical alignment” operates on the whole pedigree, whereas “Optimise pedigree” operates on the part pedigree – therefore use the optimise button if you want the best display for a selected part-pedigree.

Highlight target: when selected, causes the record nearest to the mouse pointer to be highlighted. This is most useful with very large pedigrees, where individual values cannot otherwise be seen due to overlayed printing of values. Click when the desired identification or record of interest is highlighted, and relatives will be shown in a part pedigree. For different sets of relatives to be displayed for the same proband, proceed using the View/Relatives menu items, else you mak end up clicking on a different individual. When Highlight target is selected, mouse movement over the screen can be less smooth on slower computers.

Sort Left to Right: sorts the currently displayed merit field within tier from left (low) to right (high). For this to work you must first select the single merit field desired, but you can then select multiple fields for viewing. [Not yet implemented in Version 6.xx: You can save the sorted pedigree from the File/Save menu.]

Check for duplicate ID's: reports occurrences of individuals appearing more than once in the leftmost field in the pedigree file.

Check for bisexuality: reports situations in which an individual is listed as a sire, and also as a dam, whether for the same mating or not.

Coancestry is a feature to calculate the degree of relatedness of any two individuals. To use information on caoancertries to help make selection and mating decisions, see Mate Selection.

Inbreeding coefficients are calculated using BLUPRAMF.dll. A field for inbreeding coefficients is added if one does not already exist, with the exact name “Inbreeding”. The inbreeding field is accessible using the Field Chooser Button. However, this field is only populated by Pedigree Viewer after this menu item has been chosen, or after a BLUP run has been successfully completed (see below). Note: Inbreeding coefficients and BLUP EBVs are lost after pressing the [image] button. The inbreeding coefficient for an individual is the probability that the genes inherited from each parent are identical by descent.

Prune Pedigree: Use this tool to reduce the size of your pedigree input file. The result is saved to a new file, so you will not lose your original information. The pruning window will lead you to a chosen strategy.

Run BLUP analysis: This runs genetic evaluations for pedigreed animal or plant data. A window appears for choosing which field to choose as the numerical trait of interest – for which estimated breeding values will be calculated – and which fields should be fitted as fixed effects or as covariables for the analysis. You can also declare the prior estimate of heritability and the trait record which is a code for missing measurement (as zero is often a meaningful observation, you might use eg -9999 in your dataset to denote a missing value).. The single-trait reduced animal model BLUP analysis is run using BLUPRAMF.dll, and both estimates of breeding value and inbreeding coefficients are then imported to be added to the list of displayable data. Selecting the 'View Results' check box leads to a separate display of all results, including estimates of fixed effects and covariables. Note: Inbreeding coefficients and BLUP EBVs are lost after pressing the [image] button.

Mate Selection: Mate Selection brings together the tasks of selecting which individuals to select as parents, and the pattern of mate allocation that should be used. See Instructions.


View menu

Display Fields … Choose which fields to display for each individual displayed. A small dialog box contains a checkbox for each field. Any number of fields can be displayed. Just check the boxes you desire.

View Input file uses Window's Notepad.exe (as default, see Options menu below) to view and possibly edit the user-provided pedigree file. After editing, the pedigree file must be re-opened for any changes to take effect.

Reselect Proband Use this to bring focus back to the individual last selected – the Proband as listed in the textbox on the toolbar. This helps after reloading a large pedigree with the [image] button, where it is otherwise difficult to locate any individual directly without using the Find tool.

Relatives allows changes to be made to the type of relatives shown for the last 'clicked' individual, or Proband. [These operations can be carried out by using the mouse to click on the pedigree diagram (see Use of the mouse). However, the mouse can be difficult for large pedigrees where a small movement can result in clicking on a different unwanted individual at the second attempt.] Use the sub-menu items to choose what type of relatives to display for the current proband (which shown in the textbox in the toolbar). Hold down numeric key ‘N’ before selecting menu item ‘Nth degree’ relatives to show the proband and all relatives up to degree N (Notes: you must hold down the numeric key even before selecting the top-level View menu. Numeric keypad keys do not work for this operation. Accepted values of N are 1 to 9.).

View Statistics shows some key statistics for the currently opened file or the current part-pedigree if Optimise Pedigree has been invoked on a part-pedigree. The “Copy Statistics to Clipboard” button can be used to paste the results into another application (eg MS Word).

Colors gives you the opportunity to modify the screen and/or printer colors. Printer background and foreground colors are fixed as white and black respecively, but pedigree link colors can be changed. If you 'Save as default', then your chosen colors will prevail in future runs of the program, both for screen display and printing colors.


Help menu

Just click “Help Contents” for help, or simply hit the “F1” key.

Click “About Pedigree Viewer” to see what version you are using.


Data file preparation

The default data file extensions are PED, TXT and DAT (eg. Example.ped, Example.txt and Example.dat).

The minimum requirement is a text file with free format fields, for:

Individual_ID    Sire_ID    Dam_ID

- But with a single header line declaring the contents of all fields.

Fields can be delimited by commas or tabs or spaces. The program parses the header line to discover what delimiter is being used. Use only one type of delimiter throughout the file- commas OR tabs OR spaces.

Many spaces together is read as one field separator, whereas many commas together (or many tabs together) is read as many fields, with null fields between delimiters.

For space delimited files, any one record containing legitimate spaces must be bounded by double quotes eg. “Body weight”, and missing character information is represented as "".

An example file, using (multiple) spaces as delimiters:

ID SireID DamID “Body weight”

12 0 0 67

23 12 2 72

"Jim 2" 12 2 “Not much”

25 12 5 Heavy

"Young Fred"  "Jim 2" 5 69

Notice that these free-format fields can be numeric, alphanumeric, or a mixture of both - each field can contain both numeric and character records. Additional fields can be added, and the program detects these, making check boxes in the Field Chooser for you to view the contents of these fields.

Here is the same file, but with commas as delimiters

ID, SireID, DamID, Body weight

12,0,0,67

23,12,2,72

Jim 2,12,2,Not much

25,12,5,78,Heavy

Young Fred,Jim 2,5,69

For all fields, leading and trailing spaces are ignored. Character fields are case sensitive, such that "bert" and "Bert" are recognised as different individuals. These fields are detected by the program, which then disables the facility for shading on merit for these fields.

The program detects the number of records (lines) in the data file.

Unknown parents are denoted as 0 or # or * or . or as a null string, “”. Base parents not included as individuals (for example the individual above with ID = 2, Jim’s father), are recognised and entered in the pedigree. If an individual's parent appears as an individual in the file, then it should ideally appear before (above) the individual in the file, as this marginally improves the speed of loading the file. However, Pedigree Viewer will automatically re-order the pedigree file as required.

Missing numerical trait information should be give as a decimal point (.), as the value 0 will be taken as an observed value.

You can save a part-pedigree in its own file as follows:

1. Use mouse clicks (not zoom) to display the individuals desired.

2. Click Optimise Pedigree and wait for your part-pedigree to 'clean up'. You must carry out this step.

3. Select the File/Save menu item [Yet to be invoked in Version 6.xx], then choose a file extension.


Mate Selection

Overview

Mate Selection brings together the tasks of selecting which individuals to select as parents, and the pattern of mate allocation that should be used.

This is done in a manner that gives appropriate balance in achieving diverse objectives relating, for example, to genetic change in key traits, managing genetic diversity, paying attention to progeny inbreeding and progeny trait distributions, which individuals to collect semen or oocytes/embryos from, and keeping operating costs at a desired level.

See Brief Notes on Mate Selection for further general description, and see the help topics that follow for instructions.

Click Here for instructions on running MateSel.

Note

This tool is based on MateSel, written by Brian Kinghorn. Pedigree Viewer uses core MateSel functionality, but many of the customisable and advanced functions are not available through this version of Pedigree Viewer.


Instructions for MatSel

Getting started quickly

An example Pedigree Viewer input file called Matesel.txt is included in your installation. You can use this file to try out MateSel. Open it in Pedigree Viewer, then start at “Invoking MateSel”, below.

Data file requirements

MateSel uses a standard Pedigree Viewer input file. However, there are three required fields:

1. A field called “Index”. This should contain the selection index value for each individual, which will typically be a multi-trait BLUP index value or other similar selection index value that is a measure of genetic merit across traits. It can be simply the EBV for the single trait of interest.

2. A field called “Cand” or “Candidate” or “CandStat”. This should contain a zero (“0”) for individuals that are not candidates for selection, and a one (“1”) for individuals that are candidates for selection. However, if any individual has a number that is greater than one, then for the whole dataset, these numbers reflect the maximum number of matings permissible for each candidate. If none of these numbers are greater than one, then the maximum number of matings permissible is the same for each candidate of the same sex, and are read for each sex from the file “InpOneGroup.txt” in the same directory as “Pedigree.exe”.

3. A field called “Sex” or “Gender” that shows the sex of individuals, with “0” or “f” for female and “1” or “m” for male. These values are inconsequential for non-candidates.

The fields names noted above are not case-sensitive.

You should include individuals that are not candidates but that are ancestors of candidates if you want to account for coancestry when managing genetic diversity.

Invoking MateSel

Simply select “Mate Selection” from the Tools menu. A new window will appear, ready to run MateSel for the currently loaded pedigree file.

How MateSel finds the best mating set

Such problems can be solved using Evolutionary Computation (EC), and adaptations of Differential Evolution (DE, Storn and Price 1997) have been used for this. See detailed notes for more information.

Parameters and settings

Balance Strategy: This relates to management of the balance between genetic gain (predicted index value in progeny) and parental coancestry, whose outcome is illustrated in the graph to the upper right of the MateSel window.

0 | Weighting l on coancestry: xG + l*xAx/2 | This is the simplest approach, but it offers little control – adding other issues can have a big impact on the balance between gain and coancestry. Set l at textbox “Weight on xAx/2”
1 | Hard constraint on coancestry | This maintains the solution at or below a given value of parental coancestry. Set the limit at textbox “Max permissible xAx/2”. You should specify a value that is greater than the minimum value – this is the minimum value on the horizontal axis of the Frontier Graph, that only appears after “Run” has been clicked.
2 | Soft constraint on coancestry | As above, except that exceeding the limit by a small amount is permitted, but heavily penalised. This can help with speed of convergence.
3 | Hard constraint on Target Degrees | This maintains the solution at or “above”* a given value of Target Degrees (TD, see below). In fact, this component simply aims to “maximise gain”*, but also severely penalises solutions that break the TD constraint. * For TD > 45 degrees, substitute “below” and “minimise coancestry” respectively.
4 | Soft constraint on Target Degrees | As above, except that undercutting the limit is permitted, but heavily penalised beyond a 2 degree deviation. This can help with speed of convergence.
5 | Project to Target Degrees line | This aims for a solution that is most deviated from the origin when projected to the TD line. [Hold a ruler perpendicular to the TD line and move it out to where it last coincides with the frontier – that is where a solution should go with no other issues included.] For non-circular frontier shapes, this projected point can be outside the frontier, with the solution exploiting the prevailing shape of the frontier to maximise the index implied by the TD line.
6 | Projection plus deviation penalty | As above, except that a weighting is applied against deviations of more than 5 degrees from the TD line. [Note: Some danger of settling on a local optimum. You can check this by moving to strategy 5, waiting for good convergence, then change back to strategy 6]

[For all Balance Strategies other than strategy 0, progeny index (xG) is scaled on a range of 0, at 90 degrees, to 1, at the point on the frontier where the TD line or the constrained coancestry line intersect with the frontier. This renders xG independent from the trait(s) used, such that the weightings used for other issues (such as progeny inbreeding) have a more consisted impact across different datasets.]

Textboxes

Weight on xAx/2: This is weighting value l, which is only invoked for Balance Strategy 0.

Max permissible xAx/2: This is the limit on parental coancestry, which is only used in Balance Strategies 1 and 2.

Target Degrees (TD): [See Frontier Graph below] TD is used to target a relationship between Genetic Gain (Progeny Index, xG) and parental coancestry (xAx/2). It is only used for Balance Strategies 3 to 6.

Weight on progeny F: This the weighting value used to penalise inbreeding (F) in the progeny that derive from the matings to be made. Use a negative value to put downward pressure on short-term inbreeding. Suggestion: start with a value of -1. [Note that this has little impact on long-term inbreeding. In fact if you aim for high progeny inbreeding the program will usually seek many males as parents in order to achieve widespread full-sib mating, and this increases effective population size so that long-term inbreeding goes down. The importance of progeny inbreeding is often exaggerated.]

Progeny F threshold: This is the value of progeny inbreeding that you prefer not to exceed for any individual mating.

Weight on F threshold: This is the weighting applied for breaking of the Progeny F threshold. The criterion to which it is applied is the mean across all matings of the squared deviation from half of the threshold for maying that break the threshold. Suggestion: if you use this feature, start with a value of -1.

Matings to be made: This is the number of matings to be made. It is typically the number of breeding females, but for IVF matings it is the number of oocytes fertilized. [Under Grouping, the numbers of matings is calculated from grouping information provided.]

The following options are only shown after clicking the button “Show more parameters”:

NRM limit: [Use only if needed, else leave at zero] For large problems you can speed up operation by setting to zero any numerator relationship value (between two individuals) that is below this value. Elements with a value of zero are not addressed in calculating x’Ax, and so setting low values to zero speeds up operation.

NRM generations: This is the number of generations back from each candidate in the supplied pedigree that is used in the calculation of relationships between individuals. Fewer generation gives faster calculation of relationships at the start of the program, and probably faster operation thereafter due to a higher proportion of relationship values that are perceived to be zero. [Note: You can also invoke this reduction in Pedigree Viewer, using Prune Pedigree on the Tools Menu, whereby you can save your pruned file.]

Grouping: [Grouping is fixed at False in the code released with Pedigree Viewer.] When available, this feature gives ability to define group membership for each candidate, set mating numbers for each group, set mating permissions on a male group by female group basis, and other grouping functions.

Frontier degree gap: This is the gap between points generated to draw the frontier of possible responses in Index and Coancestry.

Frontier 0 degree generations: The number of generations of the Differential Evolution algorithm to be used to generate the 0 degree point, which reflects full emphasis on high Progeny Index. [This is only used when Grouping = True, else a truncation selection approach is used.]

Frontier 90 degree generations: The number of generations of the Differential Evolution algorithm to be used to generate the 90 degree point, which reflects full emphasis on low Coancestry.

Frontier xx degree generations: The number of generations of the Differential Evolution algorithm to be used to generate each intermediate degree point.

Target % converged: This is a component of the overall stopping criterion. The percentage of the currently predicted asymptotic maximum fitness that has been reached is calculated each time a better solution is found, and also each 1000 generations. When the value in this textbox is exceeded, then this component criterion has been met. [Note that it can latterly be no longer met if the predicted asymptote increases sufficiently.] See Convergence Diagnosis of Convergence for details.

% since last change: This component criterion is met if there has not been a better solution over the last x% generations of the last generation when there was an improvement in DE algorithm fitness.

No change generations: This component criterion is met if there has not been a better solution over the last x generations.

Minimum generations: This is the absolute minimum number of generation that has to be completed before an stopping of the DE algorithm.

Maximum generations: This is the maximum number of generation that the algorithm will run for. However, this number can be overrun if “Do not stop till “Stop” clicked” is checked.

Buttons

Run: Click this button to start a run.

Update: Click this button to interrupt the run and inject new settings made in Balance Strategy and/or the textboxes above.

Pause: Click this button to pause a run.

Print Matings: Click this button to print matings from the current solution to the file OutMatings.txt. Notepad is used to display this file.

Stop: Click this button to stop a run and print matings. Matings will be found both on the MateSel console and in the file OutMatings.txt.

Close: Click this button to close the MateSel window.

The MateSel console

The console output at the bottom of the MateSel window shows progress. At any stage you can click the Copy button at the bottom-right of the console, then paste the contents into Notepad or a word processor.

Much of the MateSel program is written in Fortran, which gives good speed. This can be seen in three parts:

1. Preparation

Reading data

Processing candidates and groups

Calculation of relationships

2. Frontier point calculations

The first point is at 0 degrees and the second at 90 degrees. These are required for scaling to make correct trigonometric calculations for the remaining points, which progress from 90 towards 0 degrees. If insufficient generations have been provided for convergence, the frontier can be exceeded during the main run. When this happens, the frontier is re-calculated.

3. The main run

Results for the best solution in each generation are shown in the following fields:

Gen | The total number of generations since the start of the main run
NewGen | The number of generations since the last update of parameters/conditions
Sires | The number of sires involved in the current solution
xG | The population average Progeny Index
xAx/2 | The parental coancestry
Deg | The degrees on the frontier graph for the current solution (marked by a blue circled cross).
MeanF | The mean progreny inbreeding coefficient
MaxF | The inbreeding coefficient of the most inbred progeny
Fitness | The value of the current solution on the prevailing objective function, across issues
Conv% | The perceive percentage converged (as described above)
Seconds | The number of seconds since the start of the main run.

The Frontier Graph

This graph shows the most extreme responses possible when all emphasis is shared by just two component objectives: Progeny Index (xG) and Parental Coancestry (xAx/2).

The favourable direction is towards the top left. The frontier line is drawn between points that are found by running the DE algorithm multiple times, each with a different relative emphasis on each of these issues. [In fact it is run to target solutions that are graphically closest to calculated points on the graph.]

The “origin” is at the bottom right, and a web of 10-degree spacing is drawn for orientation. In the diagram below the current solution is sitting on the frontier at 25 degrees (using Balance Strategy 3). The red trail shows the pathway that the algorithm has made during convergence.

In the next diagram, strong emphasis has been placed on progeny inbreeding, and some compromise has resulted in both lower Progeny Index and higher Coancestry:

For TD <= 45 degrees the TD line is green in color, as shown in these diagrams, whence Balance Strategies 3 and 4 aim to increase gain while keeping the solution above the chosen Target Degrees (to the left/below the TD line, as in the diagram above).

For TD > 45 degrees a magenta color is shown to illustrate that Balance Strategies 3 and 4 operate differently – here they aim to minimise coancestry while keeping the solution below the chosen Target Degrees (to the right/above the TD line).

The Progeny Inbreeding Graph

This graph plots the value of the inbreeding coefficients of the progeny that would arise from the matings in the best solution, graphed over generations of the DE algorithm. The mean inbreeding coefficient (Fbar) is shown in red. And the inbreeding coefficient for the most highly inbred individual (Fmax) is shown in green.

This graph shows the impact of changing settings in the textboxes “Weight on progeny F”, “Progeny F threshold” and “Weight on F threshold”. The first of these mostly impacts on the red line and the last two mostly impact on the green line. The value of “Progeny F threshold” is shown by a horizontal grey line, unless it is above the current scale for F.

Output

Output files are of the form Out____.txt in the same directory as Pedigree.exe.

Summary results are in OutSummary.txt

Mating results are printed to the file Outmatings.txt. There is one line per mating, with fields as follows:

SireID | The male to use as the sire of this mating
DamID | The female to use as the dam of this mating
GrpS | The sire’s group
GrpD | The dam’s group
IndexS | The Index value of the sire
IndexD | The Index value of the dam
F | The inbreeding coefficient of the progeny from this mating
<Other fields> | Marker genotypes and backup sires are listed if these features are available and specified.

Mating results are also shown on the MateSel console at the end of a MateSel run. You can click the Copy button at the bottom-right of the console, then paste the contents into Notepad or a word processor. The mating list at the bottom of the console is tab-delimited, so that you can select and copy it in Notepad, then paste it directly into a spreadsheet.


Diagnosis of convergence

When will we ever get there? The trouble is that for most practical problems we would not know when we have arrived.

With some searching around the region of the current solution we might be able to detect that we are either at or very close to an optimum. But it could be a local optimum, with a valley to be crossed to get to the global optimum.

In practical situations, we have to stop evolving and accept the result at some stage. In most cases it is not critical to find the exact best solution – one that is pretty close to that will be sufficient – a “satisficing solution”. “Satisficing is a decision-making strategy which attempts to meet criteria for adequacy, rather than to identify an optimal solution” http://en.wikipedia.org/wiki/Satisficing .

Criteria for stopping

There are many ways of deciding when there has been sufficient convergence. This chapter suggests a small number of approaches for accepting convergence. Some or all of these can be applied simultaneously in practice. They are listed in the order that they appear in the demonstration program that will be used for illustration:

Criterion 1: The solution must exceed a specified percentage of the current predicted asymptotic maximum solution. This is described below.

Criterion 2: No improvement over the last pnc percent of nlast generations, where nlast is the last generation in which the best solution improved on the best solution in the previous generation, and pnc is a percentage. It can be >100%.

It is sensible to make pnc a function of nlast. For example, if we fixed pnc at 20%, then we would say “Stop!” at generation 12 if the last improvement was at generation 10. This is not sensible, whereas we would say “Stop!” at generation 24,000 if the last improvement was at generation 20,000. This is more sensible. Here is a suggestion that ‘tunes’ pnc to 20,000 generations:

pnc(corrected) = pnc* sqrt (20,000/nlast)

If we use this, then we would say “Stop!” at generation 100 if the last improvement was at generation 10 – more sensible.

Criterion 3: No improvement for a specified fixed number of generations. This is an extra safeguard against premature stopping.

Criterion 4: No fewer than nmin generations in total.

Criterion 5: No more than nmax generations in total.

The actual decision to stop can depend on meeting various combinations of these criteria, as described later.

A predicted asymptotic maximum solution

The concept is quite simple here. Fit a non-linear regression of best solution in each improved generation against generation number, and use this to predict the asymptotic maximum solution. An ‘improved generation’ here is one in which the best solution is better that that in the previous generation. However, in practice we should include the most recent generation, even if it does not give an improvement.

The non-linear fit is a bit of an art, because we never have a “correct” model for the form of the non-linear function to be used. You might find a better recipe – but here is one that has worked well for me:

Sg = Smax*(1 - e^(-k.g^b ) ) + error

where Sg is the best solution at generation g, Smax is the asymptotic maximum solution, k is a rate constant, and b is a bender of the exponential function, which I treat as a fixed constant. I find that b=½ or 1 has been reasonable – choose a value that seems to give a good fit for your own scenario, easily seen if you have graphic output, as below. Smax and k are to be found to give the best fit to the data (g and Sg), probably by minimizing Sum(Sg - Sghat)^2. The fit is facilitated by forcing the regression to pass through both the origin and the last point. This defines Smax for a given k, such that we only have one degree of freedom to adjust (k) to minimize Sum(Sg - Sghat)^2.

Because the fit of the curve is most critical towards the asymptote, I only use (or ‘track’) the last nTrackJumps = 8 number of improvements (or ‘jumps’), plus the origin, in the exponential fit. The most recent generation tested can be an exception here – it may not constitute a jump, and as generation number increases with no further jump in fitness, the predicted asymptote reduces to approach this stable fitness value.

Example

The next diagram shows an example of the convergence module that is attached to the DE_Demo program. In this example run, convergence is deemed to have been achieved in generation 44, and generation 30 is the last generation in which an improvement in fitness occurred.

Note that there are nTrackJumps = 8 red points in addition to the red point at the origin. These 9 points have been used to make the exponential fit (the green curve) and hence the asymptotic prediction of maximum fitness (the green line at Fitness = -1).

Note also that four component criteria have been met – four ticks under “Met”. Looking at the last column of tick boxes, you can see that “Total generations” is the only individual criterion that on its own will stop the program (when Generation = nmax = 100 is reached). However, in this case nmax is not reached, because all other criteria have been met. In the case of “Percent since last change”, the target value has been scaled to:

pnc(corrected) = pnc* sqrt (nmax/nlast) = 25 * sqrt(100/30) = 45.6%

“Percent converged” is rounded up to 100% from a value >= 99.9995%. Such figures can give false confidence, which is why a mix of criteria is important.

The first three criteria are volatile, in that they can be met, and then not met as evolution progresses, because of the finding of new better solutions. This is why scaling of the “Percent since last change” criterion is important, to help avoid premature stopping.

NB: When changing the objective function (“Changing the goal posts”) on the fly, be sure to reset the generation counter for the purposes of diagnosing convergence.

No guarantee!!

There is no guarantee that convergence has been truly met, unless you know the maximum from an algebraic approach or an exhaustive search. What can help is to observe the best solution achieved, and realize (if true) that it has all the properties that you think it should have – that you are satisfied with it. That it is a “Satisficing Solution”.


Brief notes on Mate Selection

Mate Selection is the simultaneous choice of individuals to select for breeding and the pattern of mate allocation. The output is a mating list.

The outcome of this process is aimed at a balanced achievement across a range of objectives, or desires, including direction and magnitude of genetic change for different traits, avoidance of genetic defects, avoidance of progeny inbreeding, managing longer-term genetic diversity, managing costs (eg movement of animals; costs of seedstock or semen), use of reproductive boosting (eg. superovulation), and a range of logistical constraints on what is practical to implement.

What follows is taken from Section 5 of: Kinghorn B. P., R. Banks, C. Gondro, V. D. Kremer, S. A. Meszaros, S. Newman, R. K. Shepherd, R. D. Vagg and J. H. J. van der Werf (2008). Strategies to exploit genetic variation while maintaining diversity. In: Adaptation and fitness in animal populations. J. H. J. van der Werf, R. Frankham, H. -U. Graser and C. Gondro. Berlin, Springer. 260pp

A key task for breeding programs within populations is to balance the relative emphasis on genetic gain and maintenance of diversity. This has now been done quite widely in the context of an objective function that includes measures of genetic merit and coancestry among selected parents. Wray and Goddard (1994) and Brisbane and Gibson (1994) included negative weighting on animal relationships in selection indices in order to help control the rate of inbreeding, and hence genetic diversity. Meuwissen (1997) formalized the optimisation of animal contributions, differentiating a function that includes genetic merit and animal coancestries, while handling some constraints, and accommodating individual contribution constraints in an iterative manner. Hinrichs et al. (2006) have improved speed in this method considerably, and Pong-Wong and Woolliams (2007) have illustrated a method that handles individual contribution constraints directly, and thus gives a guaranteed optimal solution.

The results from such methods generally give optimal contributions as proportions on a continuous scale. The practitioner uses these to help make selections and allocate numbers of matings to each breeding animal. This represents a powerful way to allocate more matings to higher-EBV animals in a manner that properly manages genetic diversity.

Progressive breeding programs are motivated by many other issues in addition to genetic gain and diversity, including progeny inbreeding, connection between herds, management of genetic marker frequencies and genotypes, multi-stage selection, various types of costs, and various logistical constraints. For such cases, contributions can be specified in numbers of matings to be allocated, and indeed the actual mate allocation set (e.g. Kinghorn 2000), but the optimal solution must be discovered, rather than derived, due to the complexity of the resulting objective function (Kinghorn and Shepherd, 1999). Such problems can be solved using Evolutionary Computation (EC), and adaptations of Differential Evolution (DE, Storn and Price 1997) have been used for this. For the reader who is unfamiliar with this type of algorithm, Evolutionary Computation is a broad field of research in optimization methods loosely based on biological evolutionary processes such as mutation, crossing over and selection. The central idea behind EC is to create populations of candidate solutions of a problem and evolve these populations by selection based on an objective function which emulates natural selection (Bäck 2003).

The key to making this work relates to how the problem is presented to the solving algorithm. Kinghorn and Shepherd (1999) show how a vector of numbers can be transformed to derive a pattern of animal selection and mate allocation – Mate Selection. This makes the optimisation problem simple – the DE algorithm has only to find the vector of numbers that maximizes the objective function.

For each mating set tested, the component outcomes evaluated constitute the overall Mate Selection Index (MSI). Each component should be evaluated on the same scale, typically the scale of the breeding objective in units of, for example, dollars profit per breeding female per year. The MSI is a function of the selections and mate allocations chosen across all mating individuals in the population - it is used to form a mating set for the specified number of matings in the breeding program. The MSI can include predicted genetic merit in progeny, long-term inbreeding as reflected by parental coancestry, progeny inbreeding, heterosis (if relevant) and various costs and logistical constraints associated with the breeding program (Banks 2000; Kinghorn 2000). The objective function can be changed (variables added or deleted) to suit the desired outcomes of the breeder if the breeding objective changes or constraints arise. An example objective function is:

Components of this MSI are described in Table 2.

Table 2. Component definitions of a sample mate selection index (MSI)

Item | Definition
x | A vector of number of matings to be made for each candidate over both sexes
G | A vector of genetic merit containing selection index values for candidates
M | Total number of matings to be made – usually the number of breeding females
l | Weighting factor (typically negative) to discourage low effective population sizes
A | The numerator relationship matrix for candidates
f | Weighting on predicted progeny inbreeding
F | Predicted progeny mean inbreeding
c | Weighting on predicted progeny mean crossbred value
C | Predicted progeny crossbreeding value
cost | Cost of the mating policy implied by x

Comprehensive use of a Mate Selection Tool (MST) involves decision making at various stages of the life cycle, including selection/culling at various juvenile and adult stages, selections for main round matings and, in some cases, selection of sires for backup matings. Ideally, the MST will accommodate all members of the population, across different groups, including putative embryos in utero, immature juveniles, virgin females and pregnant females, as well as candidates for active matings. This helps to accommodate overlapping generations, and to account for contributions already made as reflected by juveniles and embryos in the analysis – sires that have already been used extensively will be somewhat inhibited from further use.

To implement such a scheme, there is a requirement to constrain the solution such that animals can only be allocated to members of the opposite sex that are in an appropriate group, with the two key groups being the male and female active mating groups (although these may be sub-grouped in turn, for example by location). One way to handle such complex grouping constraints is to penalize non-conforming solutions in the objective function. However, this has proved to result in slow computation speed, as most evolutionary pressure is used up maintaining legality of solutions. A method has now been developed to translate a vector of numbers to a legal mate selection solution that satisfies complex constraints, not previously handled by Kinghorn and Shepherd (1999), related to grouping and mate allocation among groups. This has resulted in considerably higher speed, giving much increased flexibility.

Part of the need for high speed in such MSTs relates to the need to explore the solution space to find a result that gives a satisfactory balance among the wide range of issues that can be represented in the objective function. It is difficult to be economically rational across issues such as level and cost of migration, pattern of trait distributions, marker genotype frequencies and number of mating paddocks required. Experience shows that iterations of quickly finding an optimal solution for the prevailing objective function followed by adjustments to weighting factors and/or thresholds set in the objective function gives the practitioner a good feel for the trade-offs involved in putting differential emphasis on component objectives. In decision-making theory these solutions are sometimes referred to as satisficing – they are optimal given all of the information at hand. This leads to some understanding of what can be achieved, and acceptance of a final mate selection solution. In practice, there is a trade-off between what rigorous scientific effort might determine to be the “best” overall direction, and the direction that is chosen by the practitioner. The latter has the advantage that it is in fact implemented, and not left hanging as a mere recommendation. In addition, of course, scientific method gets well implemented ‘around’ the constraints and weightings applied by the practitioner - for example, the theory of optimal contributions (Meuwissen, 1997) is invoked, given the prevailing constraints.

Breeding decisions are made on a frequent basis in the pig and poultry industries and so this discovery process needs to be captured in a manner permitting essentially automatic running of the MST with little or no user intervention. This can be achieved using algorithms to maintain certain key outcomes, such as keeping the relationship between parental coancestry and predicted progeny merit within a narrow trajectory, so that other issues cannot displace the final solution from that path. This is analogous to a desired gains selection index (e.g. Brascamp 1984), but where the ratio of gains between two traits (issues in the MST case) is softly constrained within certain bounds. Overall response surfaces can be very flat – giving good opportunity to move one issue in a favourable direction, with little compromise in other key issues.

MSTs that are available include Ani-Mate (Amer, www.abacusbio.co.nz/products.html), TGRM and X’Aim (X’Prime, www.xprime.com.au), GENCONT/OCSELECT (Meuwissen, 2002; Hinrichs et al., 2006) and EVA (Berg et al., 2006). [And MateSel in Pedigree Viewer!] Tools such as these are now being used in breeding programs for sheep, beef and dairy cattle, pigs, poultry and other species.

Implementation level ranges from providing target numbers of matings for each candidate animal, with the aim of maximizing genetic gain at a defined rate of inbreeding, through to dictation of all stages of selection, culling, semen collection, mate allocation and backup matings, with comprehensive attention to the full prevailing range of technical and operational constraint issues. More complete implementations take a considerable amount of setting-up. However, once established they provide for routine optimal implementation of progressive breeding programs. They also constitute an appropriately competitive framework for implementation of new technical opportunities, such as reproductive boosting, targeting pools of opposing homozygotes for nominated genetic markers, or engineering extra genetic variation in key traits well before the physical splitting of a breeding line.

Look ahead mating strategies (Hayes et al 2002, Shepherd and Woolliams, 2004) have been proposed, aiming to exploit non-additive components some generations ahead. This includes the setting up of “investment matings” (such as F1 crosses) in order to capitalize on “realization matings” (such as 3-breed cross using F1 females). This constitutes short-term management of genetic variation for longer term gains. A simulated example has been given by Li et al. (2006) where an MST operating on cohorts rather than individuals was implemented for simultaneous decision making over generations, resulting in the setting up of divergent lines to exploit dominance at known loci. This approach has the potential to give tactical targeting of a suitable route through genotypic changes across multiple interacting loci, should we ever have sufficient understanding of the genotypic effects involved.

References

Banks, R., 2000. Genetic improvement in the animal breeding industries. Chapter 21 in “Animal Breeding – Use of New Technologies”, Kinghorn, B.P., Van der Werf, J.H.J. and Ryan, M. (Eds.). The Post Graduate Foundation in Veterinarian Science of the University of Sydney. ISBN 0 646 38713 8.

Bäck, T., Ed, 2003. Handbook of Evolutionary Computation. Institute of Physics Publishing, Bristol.

Berg, P., Nielsen, J. and Sørensen, M.K. 2006. EVA: Realized and predicted optimal genetic contributions. Proc. 8th World Congress on Genetics Applied to Livestock Production [CD-ROM communication 27-09].

Brisbane, J. R., and Gibson, J. P., 1994. Balancing selection response and rate of inbreeding by including genetic relationships in selection decisions. Proc. 5th World Congr. Genet. Appl. Livest. Prod. (Guelph) 19:135-138.

Hayes, B.J., Shepherd, R.K and Newman, S., 2002. Look ahead mate selection strategies for multi-breed populations. Animal Science 74:13-24.

Hinrichs, D., Wetten, M. and Meuwissen, T.H.E., 2006. An algorithm to compute optimal genetic contributions in selection programs with large numbers of candidates. J. Anim Sci. 84:3212-3218.

Kinghorn, B.P. 2000. The tactical approach to implementing breeding programs. Chapter 22 in “Animal Breeding – Use of New Technologies”, Kinghorn, B.P., Van der Werf, J.H.J. and Ryan, M. (eds.). The Post Graduate Foundation in Veterinarian Science of the University of Sydney. ISBN 0 646 38713 8. Pages 291-308.

Kinghorn, B.P. and Shepherd, R.K., 1999. Mate selection for the tactical implementation of breeding programs. Assoc. Advmt. Anim. Breed. Genet. 13:130-133.

Kinghorn, B.P., Meszaros S.A. and Vagg, R.D., 2002. Dynamic tactical decision systems for animal breeding. Proceedings of the 7th World Congress on Genetics Applied to Livestock Production. 33: 179-186.

Li, Y., van der Werf, J.H.J. and Kinghorn, B.P., 2006. Optimisation of a crossing system using mate selection. Genetics, Selection, Evolution. 38:147-165

Meuwissen, T.H.E., 1997. Maximizing the response of selection with a predefined rate of inbreeding. J. Anim Sci. 75: 934-940

Meuwissen, T.H.E., 2002. GENCONT: An operational tool for controlling inbreeding in selection and conservation schemes. Proc. 7th World Congress on Genetics Applied to Livestock Production. 28:769-770

Meuwissen, T.H.E., and Sonesson, A.K., 1998. Maximizing the response of selection with predefined rate of inbreeding: Overlapping generations. J. Anim. Sci. 76: 2575–2583.

Pong-Wong, R. and Woolliams J.A., 2007. Optimisation of contribution of candidate parents to maximize genetic gain and restricting inbreeding using semi-definite programming. Genet. Sel. Evol. 39:3-25

Shepherd, R.K. and Woolliams, J.A., 2004. Minimising inbreeding in small populations by rotational mating with frozen semen. Genet. Res., Camb. 84:87–93.

Wray, N. R. and Goddard, M.E., 1994. Increasing long term response to selection. Genet. Sel. Evol. 26:431-459


Pedigree Viewer program limits

Fields: between 3 (ID SireID DamID) and 1,000,000. (Ask for more if needed!)

File size: Limited by physical plus virtual memory.


Availability of Pedigree Viewer

Download Pedigree Viewer by starting at http://metz.une.edu.au/~bkinghor/pedigree.htm

The version of Pedigree Viewer downloaded from this page is free.