Table of Contents

APY in BLUPF90 programs

APY

The algorithm for proven and young is used to generate a sparse representation of $\mathbf{G}^{-1}$, allowing ssGBLUP evaluations for millions of genotyped animals Misztal (2016). With the APY algorithm, animals are designated as core or noncore, and the computing resources to create the inverse of $\mathbf{G}$ are reduced by inverting only a portion of that matrix for core animals.

Computing the number of core animals

Run preGSf90 (or any BLUPF90 software that computes breeding values or variance components) with clean files (after quality control) to compute the number of eigenvalues explaining 98% of the variance of $\mathbf{G}$ Pocrnic et al. (2016). This is done through singular value decomposition. You will need to add the following options:

  OPTION no_quality_control

This option turns off all quality control.

  OPTION snp_svd stop

This option computes the singular value decomposition, squares the singular values to obtain eigenvalues, and stops the program after the calculations. The program will output something like this:

              All EVs incl.zero    Positive EVs excl.zero
 EIG 90%                    4380                   4380
 EIG 95%                    7494                   7494
 EIG 98%                   13030                  13030
 EIG 99%                   17842                  17842

Here, the number of eigenvalues explaining 98% is 13030, so this will be the number of core animals in APY. To avoid running this step frequently, the number explaining 99% of the variance of G can be used (i.e., 17842).

Creating an XrefID file with an indicator for core and noncore

Assuming your SNP file name is snp.dat_clean, you can edit the snp.dat_clean_XrefID or you can create a new XrefID file. Make sure you do not change the order of genotyped animals. The XrefID should have the same order as the SNP file. If a new XrefID file is created, e.g., APY_XrefID, use the following:

 OPTION SNP_file filename xrefidname

Where filename is the name of the SNP file and xrefidname is the name of the new XrefID that contains an extra column of core and noncore indicator.

$\mathbf{APY}$ $\mathbf{G}^{-1}$ Options

 OPTION apy Type Position Condition

Type: integer
1: Replaces the regular $\mathbf{G}^{-1}$ with $\mathbf{APY}$ $\mathbf{G}^{-1}$ .
2: Creates 2 dense blocks and 1 vector of APY $\mathbf{G}^{-1}$. Some options will be ignored.

Position: integer
Column number in the XrefID file to specify the core and noncore indicator for each genotyped animal.

Condition: character
Description of the condition for core (proven) or noncore animals (young).
General form:

(proven|young)(.ge.|.gt.|.eq.|.ne.|.lt.|.le.)(integer number)

No spaces between words are allowed.

Examples:

$\mathbf{A}_{22}^{-1}$ Options

The “noA22directinv” option can avoid creating the whole $\mathbf{A}_{22}$ and its inverse. Instead, this option creates 3 sub matrices of $\mathbf{A}^{-1}$ via the Henderson's (and Quaas) method.

  OPTION noA22directinv 1

This option still needs the diagonal elements of $\mathbf{A}_{22}^{-1}$. You can control the computing method for the diagonals with an option:

 OPTION whichA22iDiag Type Argument(s)

Examples

 OPTION whichA22iDiag 1
 OPTION whichA22iDiag 2 nelements
 OPTION whichA22iDiag 3
 OPTION whichA22iDiag 4 nrounds
 OPTION whichA22iDiag 5 nrounds nelements

The recommended option is

  OPTION whichA22iDiag 4 1000

Because this option produced almost the same solutions as ones from Type=1, in a faster way.

Summary of options needed for APY

Using the most efficient implementation of APY and assuming the core animals are coded as 10 in the XrefID with core and noncore indicator

OPTION apy 2 3 proven.eq.10
OPTION noA22directinv 1
OPTION whichA22iDiag 4 1000

Saving and reading the matrices

For the type-1$\mathbf{APY}$ $\mathbf{G}^{-1}$, you can use “saveGInverse” and “readGInverse” for input/output the matrix. For the type-2 $\mathbf{APY}$ $\mathbf{G}^{-1}$, special options are required for the input/output:

  OPTION saveApyGInverse
  OPTION saveApyGInverse filename
  OPTION readApyGInverse
  OPTION readApyGInverse filename

The default file name is ApyGi. If you want to save the file with a different name, replace the filename statement with the desired name.

Limitations