# Deflated preconditioned conjugate gradient method for solving single-step BLUP models efficiently

Jérémie Vandenplas, Herwin Eding, Mario P. L. Calus, Cornelis Vuik

► To cite this version:

Jérémie Vandenplas, Herwin Eding, Mario P. L. Calus, Cornelis Vuik. Deflated preconditioned conjugate gradient method for solving single-step BLUP models efficiently. Genetics Selection Evolution, 2018, 50 (1), pp.51. 10.1186/s12711-018-0429-3. hal-02405270

HAL Id: hal-02405270

https://hal.science/hal-02405270

Submitted on 11 Dec 2019

HAL is a multi-disciplinary open access
archive for the deposit and dissemination of sci-
entific research documents, whether they are pub-
lished or not. The documents may come from
teaching and research institutions in France or
abroad, or from public or private research centers.

L'archive ouverte pluridisciplinaire HAL, est
destinée au dépôt et à la diffusion de documents
scientifiques de niveau recherche, publiés ou non,
émanant des établissements d'enseignement et de
recherche français ou étrangers, des laboratoires
publics ou privés.

<figure><img src="image_1.png" /></figure>
<figure><img src="image_2.png" /></figure>

# Deflated preconditioned conjugate gradient method for solving single-step BLUP models efficiently

Jérémie Vandenplas<fnref n="1" />*, Herwin Eding², Mario P. L. Calus<fnref n="1" /> and Cornelis Vuik³

## Abstract

**Background:** The single-step single nucleotide polymorphism best linear unbiased prediction (ssSNPBLUP) method, such as single-step genomic BLUP (ssGBLUP), simultaneously analyses phenotypic, pedigree, and genomic information of genotyped and non-genotyped animals. In contrast to ssGBLUP, SNP effects are fitted explicitly as random effects in the ssSNPBLUP model. Similarly, principal components associated with the genomic information can be fitted explicitly as random effects in a single-step principal component BLUP (ssPCBLUP) model to remove noise in genomic information. Single-step genomic BLUP is solved efficiently by using the preconditioned conjugate gradient (PCG) method. Unfortunately, convergence issues have been reported when solving ssSNPBLUP by using PCG. Poor convergence may be linked with poor spectral condition numbers of the preconditioned coefficient matrices of ssSNPBLUP. These condition numbers, and thus convergence, could be improved through the deflated PCG (DPCG) method, which is a two-level PCG method for ill-conditioned linear systems. Therefore, the first aim of this study was to compare the properties of the preconditioned coefficient matrices of ssGBLUP and ssSNPBLUP, and to document convergence patterns that are obtained with the PCG method. The second aim was to implement and test the efficiency of a DPCG method for solving ssSNPBLUP and ssPCBLUP.

**Results:** For two dairy cattle datasets, the smallest eigenvalues obtained for ssSNPBLUP (ssPCBLUP) and ssGBLUP, both solved with the PCG method, were similar. However, the largest eigenvalues obtained for ssSNPBLUP and ssPCBLUP were larger than those for ssGBLUP, which resulted in larger condition numbers and in slow convergence for both systems solved by the PCG method. Different implementations of the DPCG method led to smaller condition numbers, and faster convergence for ssSNPBLUP and for ssPCBLUP, by deflating the largest unfavourable eigenvalues.

**Conclusions:** Poor convergence of ssSNPBLUP and ssPCBLUP when solved by the PCG method are related to larger eigenvalues and larger condition numbers in comparison to ssGBLUP. These convergence issues were solved with a DPCG method that annihilates the effect of the largest unfavourable eigenvalues of the preconditioned coefficient matrix of ssSNPBLUP and of ssPCBLUP on the convergence of the PCG method. It resulted in a convergence pattern, at least, similar to that of ssGBLUP.

<footnote>*Correspondence: jeremie.vandenplas@wur.nl</footnote>

<footnote n="1">¹ Animal Breeding and Genomics Centre, Wageningen UR Livestock Research, P.O. Box 338, 6700 AH Wageningen, The Netherlands
Full list of author information is available at the end of the article</footnote>
## Background

In general, genomic data for livestock animals include several thousand single nucleotide polymorphisms (SNPs), which are used in genetic evaluations to obtain genomic estimated breeding values [1–3]. Currently, the method of choice that simultaneously combines phe-notypic and pedigree information of genotyped and non-genotyped animals with genomic information of genotyped animals is the so-called single-step genomic best linear unbiased prediction (ssGBLUP) [3]. ssGBLUP includes genomic information by combining genomic and pedigree relationships into a combined genomic-pedigree relationship matrix [3–5]. However, a major inconvenience of ssGBLUP is that the inverse of a dense genomic relationship matrix (G) is required, which can be computed up to approximately 100,000 genotyped animals on current computers [6]. Thus, some methods were proposed to approximate the inverse of G, such as the algorithm for proven and young animals (APY) [6], or to compute its inverse implicitly based on singular value decomposition (SVD) [7] or on the Woodbury decomposition [8]. Another approach to avoid the computation of the inverse of G, or even G itself, is to fit the SNP effects explicitly, or principal components obtained from a SVD of the genotype matrix, as random effects in the model. Several equivalent models were proposed in the literature that enable simultaneous modelling of genotyped and non-genotyped animals as in ssGBLUP [2, 7, 9–13]. Equivalent models that directly estimate SNP effects as random effects [2, 9–13] will hereafter be referred to as single-step SNPBLUP (ssSNPBLUP). It has been suggested that the dimension of SNP-based models can be considerably reduced by applying random regression to principal components (PC) of the SNP genotypes, and that the remaining noise of genomic information can be ignored [14]. To our knowledge, a linear system of equations of single-step principal component BLUP (ssPCBLUP) has never been solved with the PCG method for large datasets.

The ssGBLUP, ssSNPBLUP and ssPCBLUP models have linear systems of equations with sparse and symmetric positive (semi-)definite (SPSD) coefficient matrices. Thus, the preconditioned conjugate gradient (PCG) method is the primary choice as iterative solver for solving linear systems of ssGBLUP, ssSNPBLUP [11, 15–17], and of ssPCBLUP. The PCG method belongs to the family of conjugate gradient (CG) methods that are a realization of an orthogonal projection technique onto the Krylov subspace, which is generated by the initial residual and the system matrix (e.g., the preconditioned coefficient matrix) to which the CG method is applied [17]. The convergence rate of CG methods is bounded as a function of the spectral condition number of the system matrix,

which is the ratio between the largest and smallest eigenvalues of the system matrix [17]. Preconditioning ensures faster convergence of the PCG method, compared to the CG method. Unfortunately, in contrast to ssGBLUP, convergence issues with the PCG method applied to ssSNPBLUP have been reported [11, 18], which we have also experienced in our initial analyses. Furthermore, we experienced similar convergence issues with ssPCBLUP in our initial analyses.

Taskinen et al. [11] suggested that convergence problems may be due to a poor spectral condition number of the system matrix of ssSNPBLUP. Thus, to achieve faster convergence, improvement of this spectral condition number is needed and can be obtained through methods that have been developed for ill-conditioned linear systems of equations. One such method is the deflated PCG method, which is a two-level PCG method for ill-conditioned linear systems [19–21]. The DPCG method has resulted in good performance in other contexts than genetic evaluations [22–24], and possesses interesting properties, such as its relatively easy implementation in current software based on a PCG method and its favourable properties for parallel computing [22]. To our knowledge, the DPCG method has never been applied in linear mixed models, whether for genetic evaluations or other purposes. Thus, the first aim of this study was to compare the properties of the system matrices of ssGBLUP of the ssSNPBLUP model that was proposed by Mantysaari and Stranden [13], and to relate this to observed convergence patterns obtained with the PCG method. Our second aim was to implement the DPCG method and test its feasibility for solving ssSNPBLUP in large genetic evaluation models, and its re-parametrization into a ssPCBLUP model.

## Methods

The first part of this section describes the ssSNPBLUP model that was proposed by Mantysaari and Stranden [13] and its re-parametrization into a ssPCBLUP model. The second part describes the CG, PCG, and DPCG methods. The last part describes the datasets used for comparing the properties of the system matrices of the different models, and for testing the DPCG method.

### A ssSNPBLUP model

In this study, we investigate the ssSNPBLUP model that was proposed by Mantysaari and Stranden [13] and is similar to the so-called hybrid model proposed by Fernando et al. [10]. This ssSNPBLUP model fits three types of additive genetic effects: SNP and residual polygenic effects for genotyped animals, and additive genetic effects for non-genotyped animals. Originally derived as a univariate ssSNPBLUP model, we (readily) extended
this to a multivariate ssSNPBLUP model for t traits. In the following, $I_t$ is an identity matrix with size equal to the number of traits t, and the subscripts g and n refer to genotyped and non-genotyped animals, respectively. A standard multivariate mixed model for ssSNPBLUP can be written as:

$$y = Xb + \begin{bmatrix} W_n & 0 & 0 \\ 0 & W_g & W_g M_z \end{bmatrix} \begin{bmatrix} u_n \\ a_g \\ g \end{bmatrix} + e, \quad (1)$$

where y is the vector of records, b is the vector of fixed effects, $u_n$ is the vector of additive genetic effects for non-genotyped animals, $a_g$ is the vector of residual polygenic effects for genotyped animals, g is the vector of SNP effects, and e is the vector of residuals. The matrices X, $W_n$, and $W_g$ are incidence matrices relating records to the corresponding effects. Without loss of generality, the matrix Z contains the SNP genotypes (coded as 0 for one homozygous genotype, 1 for the heterozygous genotype,

or 2 for the alternate homozygous genotype) centered by their observed means, and $M_z = I_t \otimes Z$.

Additive genetic effects for the genotyped animals for t traits, $u_g$, can be computed as $u_g = a_g + M_zg$. We assume a multivariate normal distribution for the additive genetic effects $u_n$, the residual polygenic effects $a_g$, and the SNP effects g, with a mean equal to zero and

covariance matrix $\Sigma$, $\begin{bmatrix} u_n \\ a_g \\ g \end{bmatrix} \sim MVN(\begin{bmatrix} 0 \\ 0 \\ 0 \end{bmatrix}, \Sigma)$. The

inverse of $\Sigma$ required for the mixed model equations associated with Eq. (1), can be derived from the inverse of the (co)variance matrix associated with the vector $\begin{bmatrix} u_n \\ u_g \\ g \end{bmatrix}$,

$var(\begin{bmatrix} u_n \\ u_g \\ g \end{bmatrix})$, proposed by Liu et al. [12] as follows [13]:

$$\begin{align*}
\Sigma^{-1} &= \left( \text{var} \left( \begin{bmatrix} u_n \\ a_g \\ g \end{bmatrix} \right) \right)^{-1} = \left( \text{var} \left( \begin{bmatrix} I & 0 & 0 \\ 0 & I & -M_z \\ 0 & 0 & I \end{bmatrix} \begin{bmatrix} u_n \\ u_g \\ g \end{bmatrix} \right) \right)^{-1} \\
&= \begin{bmatrix} I & 0 & 0 \\ 0 & I & -M_z \\ 0 & 0 & I \end{bmatrix} \text{var} \left( \begin{bmatrix} u_n \\ u_g \\ g \end{bmatrix} \right) \begin{bmatrix} I & 0 & 0 \\ 0 & I & 0 \\ 0 & -M'_z & I \end{bmatrix}^{-1} \\
&= \begin{bmatrix} I & 0 & 0 \\ 0 & I & 0 \\ 0 & -M'_z & I \end{bmatrix}^{-1} \left( \text{var} \left( \begin{bmatrix} u_n \\ u_g \\ g \end{bmatrix} \right) \right)^{-1} \begin{bmatrix} I & 0 & 0 \\ 0 & I & -M_z \\ 0 & 0 & I \end{bmatrix}^{-1} \\
&= \begin{bmatrix} I & 0 & 0 \\ 0 & I & 0 \\ 0 & M'_z & I \end{bmatrix} \left( \text{var} \left( \begin{bmatrix} u_n \\ u_g \\ g \end{bmatrix} \right) \right)^{-1} \begin{bmatrix} I & 0 & 0 \\ 0 & I & M_z \\ 0 & 0 & I \end{bmatrix} \\
&= \begin{bmatrix} G_0^{-1} \otimes A^{nn} & G_0^{-1} \otimes A^{ng} & 0 \\ G_0^{-1} \otimes A^{gn} & G_0^{-1} \otimes A^{gg} + \frac{1}{w} G_0^{-1} \otimes A_{gg}^{-1} & -\frac{1}{w} G_0^{-1} \otimes A_{gg}^{-1} Z \\ 0 & -\frac{1}{w} G_0^{-1} \otimes Z' A_{gg}^{-1} & \frac{1}{w} G_0^{-1} \otimes Z' A_{gg}^{-1} Z + \frac{m}{1-w} G_0^{-1} \otimes I \end{bmatrix} \begin{bmatrix} I & 0 & 0 \\ 0 & I & M_z \\ 0 & 0 & I \end{bmatrix} \\
&= \begin{bmatrix} G_0^{-1} \otimes A^{nn} & G_0^{-1} \otimes A^{ng} & G_0^{-1} \otimes A^{ng} Z \\ G_0^{-1} \otimes A^{gn} & G_0^{-1} \otimes A^{gg} + \left(\frac{1}{w} - 1\right) G_0^{-1} \otimes A_{gg}^{-1} & G_0^{-1} \otimes (A^{gg} - A_{gg}^{-1}) Z \\ G_0^{-1} \otimes Z' A^{gn} & G_0^{-1} \otimes Z' (A^{gg} - A_{gg}^{-1}) & G_0^{-1} \otimes Z' (A^{gg} - A_{gg}^{-1}) Z + \frac{m}{1-w} G_0^{-1} \otimes I \end{bmatrix},
\end{align*}$$
$$ \text{where} \quad \begin{bmatrix} \mathbf{u}_n \\ \mathbf{a}_g \\ \mathbf{g} \end{bmatrix} = \begin{bmatrix} \mathbf{u}_n \\ \mathbf{u}_g - \mathbf{M}_z \mathbf{g} \\ \mathbf{g} \end{bmatrix} = \begin{bmatrix} \mathbf{I} & \mathbf{0} & \mathbf{0} \\ \mathbf{0} & \mathbf{I} & -\mathbf{M}_z \\ \mathbf{0} & \mathbf{0} & \mathbf{I} \end{bmatrix} \begin{bmatrix} \mathbf{u}_n \\ \mathbf{u}_g \\ \mathbf{g} \end{bmatrix}, $$

$$ \begin{bmatrix} \mathbf{I} & \mathbf{0} & \mathbf{0} \\ \mathbf{0} & \mathbf{I} & -\mathbf{M}_z \\ \mathbf{0} & \mathbf{0} & \mathbf{I} \end{bmatrix}^{-1} = \begin{bmatrix} \mathbf{I} & \mathbf{0} & \mathbf{0} \\ \mathbf{0} & \mathbf{I} & \mathbf{M}_z \\ \mathbf{0} & \mathbf{0} & \mathbf{I} \end{bmatrix}, \mathbf{G}_0^{-1} \text{ is the inverse of the} $$

$$ \text{(co)variance matrix among traits, } \mathbf{A}^{-1} = \begin{bmatrix} \mathbf{A}^{nn} & \mathbf{A}^{ng} \\ \mathbf{A}^{gn} & \mathbf{A}^{gg} \end{bmatrix} \text{ is} $$

the inverse of the pedigree relationship matrix, $\mathbf{A}_{gg}$ is the pedigree relationship matrix among genotyped animals, $w$ is the proportion of variance (due to additive genetic effects) considered as residual polygenic effects, and $m = 2 \sum p_i (1 - p_i)$ with $p_i$ being the allele frequency of the $i$ th SNP, and such that $var(\mathbf{g}) = \frac{1-w}{m} \mathbf{G}_0 \otimes \mathbf{I}$.

Knowing that $\mathbf{A}_{gg}^{-1} = \mathbf{A}^{gg} - \mathbf{A}^{gn}(\mathbf{A}^{nn})^{-1}\mathbf{A}^{ng}$, and after some algebra to avoid the computation of $\mathbf{A}_{gg}^{-1}$ to form $\mathbf{\Sigma}^{-1}$, we obtain:

ship matrix modified for considering the residual polygenic effects [3, 5].

### A ssPCBLUP model

Due to linkage disequilibrium between SNPs, a small number of PC of the centered genotype matrix $\mathbf{Z}$ likely explain most of the genomic variation, while the remaining PC associated with small eigenvalues may reflect noise in the genomic information [14, 25]. Principal components of $\mathbf{Z}$ can be obtained by SVD:

$$ \mathbf{Z} = \mathbf{USV}^T, $$

where $\mathbf{U}$ and $\mathbf{V}$ are unitarian matrices with the left and right singular vectors of $\mathbf{Z}$, respectively; and $\mathbf{S}$ is a diagonal matrix with non-negative diagonal elements known as singular values (i.e., square roots of the eigenvalues of $\mathbf{ZZ}^T$ and $\mathbf{Z}^T\mathbf{Z}$). The matrix $\mathbf{US}$ is known as the PC score matrix.

$$ \begin{aligned} \mathbf{\Sigma}^{-1} &= \begin{bmatrix} \mathbf{G}_0^{-1} \otimes \mathbf{A}^{nn} & \mathbf{G}_0^{-1} \otimes \mathbf{A}^{ng} & \mathbf{G}_0^{-1} \otimes \mathbf{A}^{ng}\mathbf{Z} \\ \mathbf{G}_0^{-1} \otimes \mathbf{A}^{gn} & \frac{1}{w}\mathbf{G}_0^{-1} \otimes \mathbf{A}^{gg} + (1 - \frac{1}{w})\mathbf{G}_0^{-1} \otimes \mathbf{Q} & \mathbf{G}_0^{-1} \otimes \mathbf{QZ} \\ \mathbf{G}_0^{-1} \otimes \mathbf{Z}^T\mathbf{A}^{gn} & \mathbf{G}_0^{-1} \otimes \mathbf{Z}^T\mathbf{Q} & \mathbf{G}_0^{-1} \otimes \mathbf{Z}^T\mathbf{QZ} + \frac{m}{1-w}\mathbf{G}_0^{-1} \otimes \mathbf{I} \end{bmatrix} \\ &= \begin{bmatrix} \mathbf{\Sigma}^{11} & \mathbf{\Sigma}^{12} & \mathbf{\Sigma}^{13} \\ \mathbf{\Sigma}^{21} & \mathbf{\Sigma}^{22} & \mathbf{\Sigma}^{23} \\ \mathbf{\Sigma}^{31} & \mathbf{\Sigma}^{32} & \mathbf{\Sigma}^{33} \end{bmatrix}, \end{aligned} $$

$$ \text{where } \mathbf{Q} = \mathbf{A}^{gn}(\mathbf{A}^{nn})^{-1}\mathbf{A}^{ng}. $$

The linear system of mixed model equations of ssSN-PBLUP is as follows:

Removing the noise can be performed by fitting explicitly only the PC associated with the largest eigenvalues

$$ \begin{bmatrix} \mathbf{X}'\mathbf{R}^{-1}\mathbf{X} & \mathbf{X}'_n\mathbf{R}_n^{-1}\mathbf{W}_n & \mathbf{X}'_g\mathbf{R}_g^{-1}\mathbf{W}_g \\ \mathbf{W}'_n\mathbf{R}_n^{-1}\mathbf{X}_n & \mathbf{W}'_n\mathbf{R}_n^{-1}\mathbf{W}_n + \mathbf{\Sigma}^{11} & \mathbf{\Sigma}^{12} \\ \mathbf{W}'_g\mathbf{R}_g^{-1}\mathbf{X}_g & \mathbf{\Sigma}^{21} & \mathbf{W}'_g\mathbf{R}_g^{-1}\mathbf{W}_g + \mathbf{\Sigma}^{22} \\ \mathbf{M}_z\mathbf{W}_g\mathbf{R}_g^{-1}\mathbf{X}_g & \mathbf{\Sigma}^{31} & \mathbf{M}_z\mathbf{W}_g\mathbf{R}_g^{-1}\mathbf{W}_g + \mathbf{\Sigma}^{32} \\ \mathbf{M}_z'\mathbf{W}_g\mathbf{R}_g^{-1}\mathbf{W}_g & \mathbf{\Sigma}^{33} & \mathbf{M}_z'\mathbf{W}_g\mathbf{R}_g^{-1}\mathbf{W}_g + \mathbf{\Sigma}^{33} \end{bmatrix} \begin{bmatrix} \hat{\mathbf{b}} \\ \hat{\mathbf{u}}_n \\ \hat{\mathbf{a}}_g \\ \hat{\mathbf{g}} \end{bmatrix} = \begin{bmatrix} \mathbf{X}'\mathbf{R}^{-1}\mathbf{y} \\ \mathbf{W}'_n\mathbf{R}_n^{-1}\mathbf{y} \\ \mathbf{W}_g\mathbf{R}_g^{-1}\mathbf{y} \\ \mathbf{M}_z'\mathbf{W}_g\mathbf{R}_g^{-1}\mathbf{y} \end{bmatrix}, \quad (2) $$

$$ \text{where } \mathbf{R}^{-1} = \begin{bmatrix} \mathbf{R}_n^{-1} & \mathbf{0} \\ \mathbf{0} & \mathbf{R}_g^{-1} \end{bmatrix} \text{ is the inverse of the residual} $$

(co)variance structure matrix.

This ssSNBLUP model is equivalent to the following ssGBLUP model:

$$ \mathbf{y} = \mathbf{X}\mathbf{b} + \begin{bmatrix} \mathbf{W}_n & \mathbf{0} \\ \mathbf{0} & \mathbf{W}_g \end{bmatrix} \begin{bmatrix} \mathbf{u}_n \\ \mathbf{u}_g \end{bmatrix} + \mathbf{e}, \quad (3) $$

$$ \text{with } \text{var}(\begin{bmatrix} \mathbf{u}_n \\ \mathbf{u}_g \end{bmatrix}) = \mathbf{G}_0^{-1} \otimes \begin{bmatrix} \mathbf{A}^{nn} & \mathbf{A}^{ng} \\ \mathbf{A}^{gn} & \mathbf{A}^{gg} + \mathbf{G}^{-1} - \mathbf{A}_{gg}^{-1} \end{bmatrix}, \text{ and} $$

$$ \text{where } \mathbf{G} = \left( \frac{1-w}{m} \mathbf{ZZ}' + w\mathbf{A}_{gg} \right) \text{ is the genomic relation-} $$

that explain most (e.g., 99%) of the genomic variation, instead of fitting SNP effects, into a ssPCBLUP model as follows [7, 14, 25]:

$$ \mathbf{y} = \mathbf{X}\mathbf{b} + \begin{bmatrix} \mathbf{W}_n & \mathbf{0} & \mathbf{0} \\ \mathbf{0} & \mathbf{W}_g & \mathbf{W}_g(\mathbf{I}_t \otimes \mathbf{T}) \end{bmatrix} \begin{bmatrix} \mathbf{u}_n \\ \mathbf{a}_g \\ \mathbf{v} \end{bmatrix} + \mathbf{e}, $$

where $\mathbf{v} = \mathbf{V}'\mathbf{g}$; and $\mathbf{T} = \mathbf{U}\hat{\mathbf{S}}$ with $\hat{\mathbf{S}}$ containing the largest singular values of $\mathbf{S}$ corresponding to the largest eigenvalues that explain, e.g. 99%, of the genomic variation.

The linear system of mixed model equations of ssPCBLUP has the same form as the linear system of mixed
model equations of ssSNPBLUP (2), except that Z is replaced by T in M<sub>Z</sub>, i.e. I<sub>t</sub> ⊗ Z by I<sub>t</sub> ⊗ T. It is also worth noting that the number of columns of T (which is the number of PC kept) is smaller than the number of columns of Z (which is the number of SNPs) due to rank reduction.

## Iterative solvers

The linear systems of mixed model equations of ssGBLUP, ssSNPBLUP, and ssPCBLUP have the form:

$$Cx = b,$$

where C is a SPSD coefficient matrix, x is the vector of solutions, and b is the right-hand-side.

Such linear systems of equations can be solved using direct methods [17]. A bottleneck of most of these methods is that they involve an explicit factorization of C. The resulting matrix factor is often dense and might require excessive amounts of memory and computation. Therefore, direct methods are usually too expensive and, in some cases, even impossible for large linear systems. Instead of direct methods, iterative methods, i.e. methods that use successive approximations to obtain more accurate solutions for a linear system at each iteration step, are more attractive. With iterative methods, both memory requirements and computing time can be reduced, especially if C is large and sparse. Within the class of iterative methods, the CG methods are the best choice, especially when C is SPSD [17].

<table><caption>**Table 1** Algorithm for preconditioned conjugate gradient (PCG) and deflated PCG (DPCG) methods for solving x in the linear system Cx = b using a preconditioner M</caption><tr><td>1</td><td>Select an initial guess x<sub>0</sub><br/>r<sub>init</sub> = b - Cx<sub>0</sub>; r<sub>0</sub> = ψr<sub>init</sub><br/>p<sub>-1</sub> = 0; τ<sub>-1</sub> = 1</td></tr><tr><td>2</td><td>for j = 0,..., until convergence</td></tr><tr><td>3</td><td>y<sub>j</sub> = M<sup>-1</sup>r<sub>j</sub></td></tr><tr><td>4</td><td>τ<sub>j</sub> = r'<sub>j</sub>y<sub>j</sub></td></tr><tr><td>5</td><td>β<sub>j</sub> = τ<sub>j</sub>/τ<sub>-1</sub></td></tr><tr><td>6</td><td>τ<sub>-1</sub> = τ<sub>j</sub></td></tr><tr><td>7</td><td>p<sub>j</sub> = y<sub>j</sub> + β<sub>j</sub>p<sub>j-1</sub></td></tr><tr><td>8</td><td>w<sub>j</sub> = ψCp<sub>j</sub></td></tr><tr><td>9</td><td>α<sub>j</sub> = r'<sub>j</sub>y<sub>j</sub>/p'<sub>j</sub>w<sub>j</sub></td></tr><tr><td>10</td><td>x<sub>j+1</sub> = x<sub>j</sub> + α<sub>j</sub>p<sub>j</sub></td></tr><tr><td>11</td><td>r<sub>j+1</sub> = r<sub>j</sub> - α<sub>j</sub>w<sub>j</sub></td></tr><tr><td>12</td><td>end</td></tr><tr><td>13</td><td>x<sub>final</sub> = v</td></tr></table>

For PCG: $\psi = I$, $v = x_{j+1}$; for DPCG: $\psi = P = I - CZ_d(Z'_d CZ_d)^{-1}Z'_d$, $v = Z_d(Z'_d CZ_d)Z'_d$ and $Z_d$ is a deflation-subspace matrix

For the PCG implementation: the equation in line 11 ($r_{j+1} = r_j - \alpha_j w_j$) was replaced by the equation $r_{j+1} = b - Ax_{j+1}$ at each 50 iterations [16]

## Conjugate gradient method and effective spectral condition number

The purpose of CG methods is to construct a sequence, {$\hat{x}_j$}, that satisfies $\hat{x}_{j+1} \in \hat{x}_0 + K_j(C, r_0)$, where $\hat{x}_0$ is a vector of starting solutions, $r_0 = b - C\hat{x}_0$, and $K_j(C, r_0)$ is the Krylov subspace $K_j$ equal to $K_j(C, r_0) = \text{span}\{r_0, Cr_0, C^2r_0, \dots, C^{j-1}r_0\}$. After $j+1$ iterations, the error is bounded by [17]:

$$\|x - \hat{x}_{j+1}\|_{A} \le 2 \|x - \hat{x}_{0}\|_{A} \left( \frac{\sqrt{\kappa(C)} - 1}{\sqrt{\kappa(C)} + 1} \right)^{j+1}, \quad (4)$$

where $x_A$ is the A-norm of x, defined as $\sqrt{x'Ax}$, $\kappa(C)$ is the effective spectral condition number of the coefficient matrix C and is defined as $\kappa(C) = \frac{\lambda_{max}}{\lambda_{min}}$ with $\lambda_{min} (\lambda_{max})$ being the smallest (largest) non-zero eigenvalue of C [26]. The more C is well-conditioned, the smaller is $\kappa(C)$, the smaller is the error bound, which is expected to result in faster convergence of the CG method [17]. It is worth noting that the convergence of the CG method does not depend only on $\kappa(C)$, since $\kappa(C)$ affects only the upper bound of the error (i.e., the worst convergence rate). Indeed, convergence also depends on the clustering of the eigenvalues of the system matrix, on the right-hand-side b, and on floating point rounding errors. These factors may lead to different convergence patterns for two different systems of equations with a similar $\kappa(C)$.

## Preconditioned conjugate gradient method

To improve the performance of the CG method, the linear system of equations, $Cx = b$, is transformed into an equivalent linear system of equations for which the resulting system matrix, i.e. the preconditioned coefficient matrix, has an effective spectral condition number smaller than $\kappa(C)$. This can be realized by preconditioning the linear system with a symmetric positive definite matrix M, called preconditioner. The resulting preconditioned linear system of equations can be written as follows [17]:

$$M^{-1}Cx = M^{-1}b. \quad (5)$$

The preconditioned linear system can be solved with the PCG method using the algorithm given in Table 1. Equation (4) for the error bound of the CG method also applies to the PCG method by replacing $\kappa(C)$ with $\kappa(M^{-1}C)$. Thus, the preconditioner M must be chosen such that $\kappa(M^{-1}C) \le \kappa(C)$. A general rule is that the preconditioner M approximates C to obtain eigenvalues that cluster around 1. The preconditioner M must be also chosen such that inexpensive costs are required for its construction and for the multiplication of its inverse $M^{-1}$, with a vector, as this operation is performed at each
iteration of the PCG method (Table 1). For linear systems of equations resulting from mixed models, such as models (1) and (3), a preconditioner M equal to the diagonal elements of C, i.e. M = diag(C), is widely used [11, 15, 16, 18, 27]. For multivariate analyses, M is usually defined as a block diagonal matrix [11, 15, 16, 18, 27].

## Deflated PCG method

The deflated PCG method is a two-level PCG method, which iteratively solves ill-conditioned linear systems of equations, i.e. linear systems of equations with a large effective spectral condition number [19–21]. Large effective spectral condition numbers are obtained when very small, or very large, or both, non-zero eigenvalues are present in the set of eigenvalues, called spectrum, of M⁻¹C. These very small or very large eigenvalues of a spectrum are called hereafter unfavourable eigenvalues. Deflation is used to annihilate the effect of the most unfavourable eigenvalues of the spectrum of M⁻¹C on the convergence of the PCG method by setting these unfavourable eigenvalues to 0 [20]. The deflation is performed by introducing a second-level preconditioner, P, also called deflation matrix, into the preconditioned linear system of equations, M⁻¹Cx = M⁻¹b, as follows [19–21]:

$$M^{-1}PCx_d = M^{-1}Pb,$$

where x_d is the vector of deflated solutions and is related to the vector of solutions x of the system of equations Cx = b as x = Z_dE⁻¹Z'_d b + P'x_d; the deflation matrix P is equal to P = I - CZ_dE⁻¹Z'_d; the matrix Z_d is the deflation-subspace matrix of rank k that contains k columns, called deflation vectors; and the matrix E = Z'_d CZ_d is a symmetric positive definite matrix, called Galerkin or coarse matrix [28], which can be easily computed and inverted, or factored if it is too large.

Because Eq. (4) for the error bound of the CG method also applies to the DPCG method by replacing κ(C) with κ(M⁻¹PC), choosing an adequate combination of M⁻¹P, i.e. choosing a deflation matrix P, and thus a deflation-subspace matrix Z_d, in combination with M, should yield faster convergence. Ideally, matrix Z_d should contain the eigenvectors corresponding to the unfavourable eigenvalues of M⁻¹C to achieve the fastest convergence [20–22]. However, obtaining and applying such eigenvectors is computationally intensive. Therefore, the deflation vectors of the deflation-subspace matrix Z_d should approximate the same space as the span of the unfavourable eigenvectors such that κ(M⁻¹PC) ≤ κ(M⁻¹C). The number (k) of deflation vectors should be chosen such that the deflation approach gives good results while the additional computational costs are limited as much

as possible. Indeed, the size (k) of the Galerkin matrix should be limited so that it can be stored in memory, and the computational costs associated with the multiplication of P = I - CZ_dE⁻¹Z'_d with a vector should be also limited because this operation is performed at each iteration of the DPCG method. For example, if k = 1, the computational costs are minimized since Z_d is a vector and E⁻¹ is a scalar. However, in this case, the DPCG method is expected to hardly improve the convergence pattern. Contrariwise, if k is equal to the number of equations of the linear system (i.e., k is large), then Z_d and E⁻¹ are square matrices with the same size as C. Furthermore, if Z_d is defined as an identity matrix, the DPCG method is equivalent to a direct solver, since E⁻¹ = C⁻¹, P = 0, and x = Z_dE⁻¹Z'_d b + P'x_d = C⁻¹b. In this case, the additional computational costs are equal to the costs of inverting C, and the DPCG method will converge in one iteration. The algorithm for the DPCG method is in Table 1.

## Definition of the deflation-subspace matrix for ssSNPBLUP and ssPCBLUP

The deflation vectors of the deflation-subspace matrix Z_d can be defined following several techniques based on, e.g., approximating eigenvectors [29], recycling information of previous Krylov subspaces [21], or subdomain deflation vectors [22]. All these approaches have their own advantages and disadvantages [20, 28]. For example, some advantages of the subdomain deflation approach are that Z_d is sparse, and that additional computations for the DPCG method (in comparison to the PCG method) can be implemented efficiently [22]. Due to these advantages and based on preliminary results, the deflation vectors of the deflation-subspace matrix Z_d were defined following the subdomain deflation approach in this study [22]. This approach divides the computational domain ℝⁿ (with x ∈ ℝⁿ) into k non-overlapping subdomains, with each i-th (i = 1, ..., k) subdomain corresponding to the i-th deflation vector. An entry of the deflation vector Z_d_i is equal to 1 if the corresponding entry is included in the i-th subdomain; otherwise the entry of Z_d_i is equal to 0. Therefore, each row of Z_d contains only one non-zero element. The subdomain deflation approach gives good results if k is large enough [22].

Multiple divisions of the computational domain of ssSNPBLUP (ssPCBLUP) into k non-overlapping subdomains are possible to define the required deflation-subspace matrix Z_d. The optimal division depends on the properties of the linear system of equations. For example, Vuik et al. [20] defined the subdomains based on the properties of the eigenvectors associated with the smallest eigenvalues of M⁻¹C for a class of layered problems with extreme contrasts in C. This approach
could not be extended to ssSNPBLUP because we were not able to identify which model terms were associated with the most unfavourable eigenvalues of $M^{-1}C$ (results not shown). However, based on the observation that fitting SNP effects explicitly led to an increase of the largest eigenvalues of $M^{-1}C$ for ssSNPBLUP, in comparison to ssGBLUP (see sections Results and Discussion), we hypothesized that grouping SNP effects in subdomains could enable the DPCG method to annihilate the effects of the most unfavourable eigenvalues. Thus, we divided the ssSNPBLUP domain per trait and then within trait as follows: (1) all effects associated with the same trait and other than the SNP effects were included in a separate subdomain; and (2) each set of $l$ randomly chosen SNP effects associated with the same trait were included in a separate subdomain. Following this division, the number of subdomains $k$, and therefore the rank of $Z_d$ and the size of the Galerkin matrix $E$, is equal to $k = (1 + \frac{n_{snp}}{l}) * t$, where $n_{snp}$ is the number of SNPs, and $\frac{n_{snp}}{l}$ is equal to the smallest integer greater than or equal to $\frac{n_{snp}}{l}$. It is also worth noting that the proposed division of the ssSNPBLUP domain with $l = 1$ SNP effect per subdomain leads to a system matrix $M^{-1}PC$ with zero entries for all equations associated with the SNP effects (see Additional file 1). Because the behaviour of the PCG method applied to ssPCBLUP was similar to that of the PCG method applied to ssSNPBLUP (see the Results section), we divided the ssPCBLUP domain with the same approach as for the ssSNPBLUP domain, except that each set of PC effects included $l$ consecutive PC effects, which were sorted following a descending order of their associated eigenvalues. In this study, four different deflation-subspace matrices for ssSNPBLUP (ssPCBLUP) were defined by means of sets of $l = 1, 5, 50$, and 200 SNP (PC) effects.

## Termination criteria

Because the PCG and DPCG methods are iterative methods, termination criteria must be defined to determine when the methods have reached convergence. In this study, $\frac{r_{j+1}}{b} \le \delta$ and $\frac{r_{dj+1}}{b} \le \delta$ were used as termination criteria for the PCG and DPCG methods, respectively, with $\|\cdot\|$ being the 2-norm, and $r_{dj+1}$ being the residual of the deflated system after $j + 1$ iterations. It has been shown that the residual of the PCG method is the same as the residual of the DPCG method [20]. Therefore, the two termination criteria are the same.

## Data and models

Two datasets, a reduced dataset and a field dataset, were provided by CRV BV (The Netherlands). To achieve the first aim of this study, the reduced dataset was used to compare properties of the system matrices ($M^{-1}C$ or

$M^{-1}PC$) of ssSNPBLUP and of ssGBLUP, and to relate this to observed convergence patterns. To achieve the second aim of this study, the field dataset was used to test the feasibility of the DPCG method for solving the linear system of equations associated with ssSNPBLUP and ssPCBLUP applied to large multi-trait datasets.

The reduced dataset and associated variance components were extracted from the Dutch single-step genomic evaluation from August 2017 for ovum pick-up (OPU) and embryo transfer of Holstein dairy cattle. After extraction of the OPU sessions, the data file included 61,592 OPU sessions from 4109 animals, and the pedigree included 37,021 animals. The genotypes of 6169 animals without phenotype were available. Bulls were genotyped using the Illumina 50 K SNP chip. Cows were genotyped using the Illumina 3 K chip and were imputed to 50 K density using a combination of the Phasebook software [30] and Beagle [31]. Because some currently used (own) libraries cannot handle sparse matrices with more than $2^{31}-1$ elements, and also to keep the system of equations at a reasonable size for subsequent analyses (e.g., for the computation of all eigenvalues), genotypes included 9994 segregating SNPs with a minor allele frequency higher than or equal to 0.01 and randomly sampled from (imputed) 50 K SNP genotypes. The univariate mixed model included random effects (additive genetic, permanent environmental, and residual), fixed co-variables (heterosis and recombination), and fixed cross-classified effects (herd-year, year-month, parity, age (in months), technician, assistant, interval, gestation, session, and protocol) [32].

The field dataset and associated variance components were from the 4-trait routine genetic evaluation of August 2017 for temperament and milking speed of dairy cattle for the Netherlands and the Flemish region in Belgium [33, 34]. Performance in both countries were considered as different traits, with genetic correlations between Flemish and Dutch traits higher than 0.85. The data file included 3882,772 records with a single record per animal. The pedigree included 6130,519 animals. The genotypes of 15,205 animals without phenotype and of 75,758 animals with phenotype were available. Animals were genotyped in the same manner as described above. After removing non-segregating SNPs and SNPs with a minor allele frequency lower than 0.01, genotypes included 37,995 segregating SNPs. The four-trait mixed model included random effects (additive genetic and residual), fixed co-variables (heterosis and recombination), and fixed cross-classified (herd × year × season at classification, age at classification, lactation stage at classification, milk yield and month of calving). More details on this genetic evaluation can be found in [33, 34].
For both datasets, genetic groups were removed from the pedigrees (for simplicity), the proportion *w* for residual polygenic effects was assumed to be equal to 0.05, and the centered genotype matrices *Z* for ssSNPBLUP and the matrices $G^{-1} - A_{gg}^{-1}$ for ssGBLUP were computed with the software calc_grm [35]. For the field dataset only, a matrix *T* that contained PC kept for ssPCBLUP was also computed using the software calc_grm. The number of PC kept was equal to the number of the largest eigenvalues that together explain 99% of the genomic variation.

## Statistical analyses

### Computation of eigenvalues and effective spectral condition numbers

Properties of the system matrices and convergence patterns of ssSNPBLUP and ssPCBLUP were compared to those of ssGBLUP. For the reduced dataset, the spectrum of the preconditioned coefficient matrix, $M^{-1}C$, of both ssGBLUP and ssSNPBLUP, and of the preconditioned deflated coefficient matrix, $M^{-1}PC$, of ssSNPBLUP with different deflation-subspace matrices, were computed using Intel(R) Math Kernel Library (MKL) 11.3.2 subroutines. For the field dataset, due to the large number of equations (> 10⁷), the smallest and largest positive eigenvalues of the different system matrices of ssSNPBLUP, and ssPCBLUP were approximated using the Lanczos method based on information obtained from the (D)PCG method [36, 37]. Performed with the (D)PCG method, the Lanczos method approximates the smallest and largest eigenvalues that influence the convergence. Because the null space of a system matrix never enters the iteration of the (D)PCG method, the corresponding zero eigenvalues do not influence the convergence and therefore are not approximated with the Lanczos method [20, 22, 38, 39]. It is also worth noting that the precision of the approximations of the eigenvalues may vary between analyses, which can partly explain the fact that the number of iterations to reach convergence may not be completely related with the associated effective spectral condition number. The different $\kappa(M^{-1}C)$ and $\kappa(M^{-1}PC)$ were thereafter computed to compare the different systems of equations.

### Solving ssSNPBLUP, ssPCBLUP, and ssGBLUP

Linear systems of equations of ssSNPBLUP, of ssPCBLUP, and of ssGBLUP, were solved by using the PCG method. Systems of ssSNPBLUP were also solved by using the DPCG method with sets of 1, 5, 50, and 200 randomly chosen SNP effects per subdomain for the reduced dataset, and with sets of 5, 50, and 200 randomly chosen SNP effects per subdomain for the field dataset. The set of 1 SNP effect per subdomain was not used for the field dataset due to a Galerkin matrix of size 155,980, which was

considered as too large for inversion. Similarly, systems of ssPCPBLUP were solved by using the DPCG method with sets of 1, 5, 50, and 200 consecutive PC effects per subdomain for the field dataset. For both the PCG and DPCG methods, the iterative process was run for a maximum of 10,000 iterations, or until termination criteria reached $\delta = 10^{-6}$. In addition, for both the PCG and DPCG methods, the preconditioner $M$ was equal to:

$$ M = \begin{bmatrix} M_{ff} & 0 \\ 0 & M_{rr} \end{bmatrix} = \begin{bmatrix} \operatorname{diag}(C_{ff}) & 0 \\ 0 & \operatorname{block} - \operatorname{diag}(C_{rr}) \end{bmatrix}, $$

where the subscripts *f* and *r* refer to the equations associated with fixed and random effects, respectively, and *block* - diag(*C*<sub>rr</sub>) is a block-diagonal matrix with blocks corresponding to equations for different traits within a level (e.g., an animal). For the field dataset, diagonal elements of $Q = A^{gn}(A^{nn})^{-1}A^{ng}$ were approximated using a Monte Carlo method [40, 41].

Linear systems of equations of ssSNPBLUP, of ssPCBLUP, and of ssGBLUP were solved by using a Fortran 2003 program exploiting BLAS and sparse BLAS routines and the parallel direct sparse solver PARDISO, all from the multi-threaded Intel Math Kernel Library 11.3.2, and OpenMP parallel computing. For the reduced dataset, the coefficient matrix *C* was held in memory using a compressed sparse row format, and the multiplication of *P* by a vector *v* required by the DPCG method, was performed as $Pv = v - [\Gamma[E^{-1}[Z'_{d}v]]]$, where the brackets

[·] indicate the order of the matrix-vector operations. The matrices $E^{-1}$ and $\Gamma = CZ_{d}$ were readily computed from the coefficient matrix *C* held in memory. These matrices were computed before starting the iterative process and held in memory. The number of OpenMP threads was limited to 3 for the reduced dataset.

For the field dataset, the coefficient matrix *C* was reconstructed using a matrix-free approach when required for its multiplication by a vector. The matrix $E^{-1}$ was held in memory. The computation of *E* was not

<table><caption>**Table 2** Comparison of estimates obtained with different models against estimates obtained with ssGBLUP using the PCG method</caption><thead><tr><th>Dataset</th><th>Model<sup>a</sup></th><th>Pearson correlation</th><th>Intercept<sup>b</sup></th><th>Regression coefficient<sup>b</sup></th></tr></thead><tbody><tr><td>Reduced dataset</td><td>ssSNPBLUP</td><td>&gt; 0.999</td><td>0.045</td><td>0.998</td></tr><tr><td rowspan="2">Field dataset</td><td>ssSNPBLUP</td><td>0.999</td><td>-0.001</td><td>0.997</td></tr><tr><td>ssPCBLUP</td><td>0.999</td><td>-0.001</td><td>0.998</td></tr></tbody></table>

<footnote><sup>a</sup> ssSNPBLUP was solved with the DPCG method with five SNP effects per subdomain; ssPCBLUP was solved with one PC effect per subdomain</footnote>

<footnote><sup>b</sup> Results from the regression of estimates of ssGBLUP on estimates of ssSNPBLUP or of ssPCBLUP</footnote>
as straightforward as for the reduced dataset because the coefficient matrix **C** was not held in memory. Therefore, the matrix **E** was computed following a suboptimal 4-step approach. The first step consisted of sequentially pre- and post-multiplying the coefficient matrix **C** by the first *t* deflation vectors of the deflation-subspace matrix **Z**<sub>d</sub>, i.e., the deflation vectors corresponding to the subdomains that included all effects associated with a same trait and other than the SNP effects. The second step consisted of computing each vector **Z'<sub>d,sub</sub>**<sub>**M**'<sub>z</sub><sub>**W**'<sub>g</sub><sub>**R**'<sub>g</sub></sub><sup>-1</sup><sub>**W**<sub>g</sub><sub>**M**<sub>z</sub><sub>**Z**<sub>d,o</sub></sub></sub></sub> sequentially with **Z**<sub>d,sub</sub> being a sub-matrix of **Z**<sub>d</sub> with the row entries corresponding to the SNP effects, and **Z**<sub>d,o</sub> being the *o*-th vector of **Z**<sub>d,sub</sub> with *o* = *t* + 1, ..., *k*. The third and fourth steps consisted of computing **Z'<sub>d,sub</sub>**<sub>(**G**<sub>0</sub><sup>-1</sup> ⊗ **Z**'<sub>QZ</sub>)**Z**<sub>d,sub</sub> and **Z'<sub>d,sub</sub>**<sub>(<sup>m</sup>&frasl;<sub>1-w</sub>**G**<sub>0</sub><sup>-1</sup> ⊗ **I**)</sub>**Z**<sub>d,sub</sub>, respectively, with the matrices **Z**'<sub>QZ</sub> and <sup>m</sup>&frasl;<sub>1-w</sub>**G**<sub>0</sub><sup>-1</sup> computed explicitly beforehand. Furthermore, because the matrix **Γ** = **C**Z<sub>d</sub> was too large to be held in memory for the field dataset, the multiplication of **P** by a vector **v** required by the DPCG method, was performed as **P****v** = **v** − [**C**<sub>(**Z**<sub>d</sub> ⊗ <sup>E<sup>-1</sup></sup>&frasl;<sub>(**Z'<sub>d</sub>**v))]</sub>]. Due to this latter implementation of the multiplication of **P** by **v**, each iteration of the DPCG method requires two matrix (C)-vector

products, instead of one matrix-vector product for the PCG method. The number of OpenMP threads was limited to 5 for the field dataset.

All real vectors and matrices were stored using double precision real numbers, except for the preconditioner, which was stored using single precision real numbers. All computations were performed on a computer with 528 GB and running RedHat 7.4 (x86_64) with an Intel Xeon E5-2667 (3.20 GHz) central processing unit processor with 32 cores. Main random access memory (RAM) and time requirements are reported for the field dataset. All reported times are indicative, because they may have been influenced by other jobs running simultaneously on the computer.

## Results

### Comparison of estimates of different single-step BLUP

Estimates for all fixed effects, additive genetic effects, and other possible random effects, of ssGBLUP solved with the PCG method, of ssSNPBLUP solved with the PCG and DPCG methods, and of ssPCBLUP solved with the PCG and DPCG methods, were (almost) the same after convergence was reached. For example, Pearson correlations of all estimates of ssGBLUP solved with the PCG

<figure><img src="image_3.png" /><figcaption>**Fig. 1** Eigenvalues of different preconditioned (deflated) coefficient matrices for the reduced dataset. Eigenvalues of the preconditioned coefficient matrices of ssGBLUP and of ssSNPBLUP, and of the preconditioned deflated coefficient matrix of ssSNPBLUP with one SNP effect per subdomain are depicted on a logarithm scale. All eigenvalues less than $10^{-11}$ were set to $10^{-11}$. Eigenvalues are sorted in ascending order</figcaption></figure>
<table><caption>**Table 3** Characteristics of preconditioned (deflated) coefficient matrices, and of PCG and DPCG methods for the reduced dataset</caption><thead><tr><th>Model</th><th>Method<sup>a</sup></th><th>Smallest eigenvalue</th><th>Largest eigenvalue</th><th>Effective condition number</th><th>Number of iterations</th><th>Total time<sup>b</sup></th><th>Time/iteration<sup>c</sup></th></tr></thead><tbody><tr><td>ssGBLUP</td><td>PCG</td><td>1.1 × 10<sup>-4</sup></td><td>11.9</td><td>1.1 × 10<sup>5</sup></td><td>270</td><td>11.3</td><td>0.05</td></tr><tr><td rowspan="5">ssSNPBLUP</td><td>PCG</td><td>1.1 × 10<sup>-4</sup></td><td>181.0</td><td>1.7 × 10<sup>6</sup></td><td>1475</td><td>688.2</td><td>0.46</td></tr><tr><td>DPCG (200)</td><td>1.1 × 10<sup>-4</sup></td><td>99.4</td><td>9.3 × 10<sup>5</sup></td><td>1221</td><td>570.5</td><td>0.47</td></tr><tr><td>DPCG (50)</td><td>1.1 × 10<sup>-4</sup></td><td>40.5</td><td>3.8 × 10<sup>5</sup></td><td>890</td><td>437.7</td><td>0.49</td></tr><tr><td>DPCG (5)</td><td>1.1 × 10<sup>-4</sup></td><td>6.4</td><td>6.0 × 10<sup>4</sup></td><td>331</td><td>170.1</td><td>0.49</td></tr><tr><td>DPCG (1)</td><td>1.1 × 10<sup>-4</sup></td><td>6.0</td><td>5.9 × 10<sup>4</sup></td><td>270</td><td>189.6</td><td>0.66</td></tr></tbody></table>

<figure><img src="image_4.png" /><figcaption>**Fig. 2** Termination criteria for the reduced dataset for ssGBLUP and ssSNPBLUP using the PCG method and for ssSNPBLUP using the DPCG method. Number of SNP effects per subdomain is within brackets</figcaption></figure>

method and the corresponding estimates of ssSNPBLUP solved with the DPCG method using 5 SNP effects per subdomain were higher than 0.999 for both the reduced and field datasets (Table 2) and (see Additional file 2: Figure S1). Regression of estimates of ssGBLUP on estimates of ssSNPBLUP solved with the DPCG method using 5 SNP effects per subdomain led to regression coefficients

close to 1 and intercepts close to 0 (Table 2). Similar results were obtained for ssPCBLUP solved with the DPCG method using 1 PC effect per subdomain for the field dataset (Table 2) and (see Additional file 2: Figure S2).

<footnote><sup>a</sup> Number of SNP effects per subdomain is within brackets</footnote>

<footnote><sup>b</sup> Wall clock time (s) for the iterative process</footnote>

<footnote><sup>c</sup> Average wall clock time (s) per iteration. Iterations computing the residual from the coefficient matrix for the PCG method were removed before averaging</footnote>
## Reduced dataset

For the reduced dataset, the number of equations was equal to 41,949 for ssGBLUP and to 51,943 for ssSNPB-LUP. Figure 1 shows the spectrum of $M^{-1}C$ of ssGBLUP and of ssSNPB-LUP, and the spectrum of $M^{-1}PC$ of ssSNPB-LUP with 1 SNP effect per subdomain. All eigenvalues less than $10^{-11}$ were assumed to be non-zero due to, for example, rounding errors, and therefore they were set to zero for subsequent analyses. Similar patterns for the different spectra were observed. The smallest non-zero eigenvalues of the different $M^{-1}C$ and $M^{-1}PC$ that influenced convergence, were equal to $1.1 \times 10^{-4}$, regardless of the model or the definition of subdomains. The largest eigenvalue of $M^{-1}C$ was equal to 12 for ssGBLUP, and 181 for ssSNPB-LUP (Table 3). When deflation was applied, the largest eigenvalue of $M^{-1}PC$ varied from 6 with 1 or 5 SNP effects per subdomain to 99 with 200 SNP effects per subdomain. Deflation of the largest eigenvalues of $M^{-1}C$ of ssSNPB-LUP can be also observed in Fig. 1. After deflation, the effective spectral condition number of ssSNPB-LUP decreased from $1.7 \times 10^6$ to between $5.9 \times 10^4$ with 1 SNP effect per subdomain and $9.3 \times 10^5$ with 200 SNP effects per subdomain.

Both the PCG and DPCG methods reached the termination criteria within 10,000 iterations, and converged to the same solutions for all linear systems of ssGBLUP and ssSNPB-LUP. When the PCG method was used, the number of iterations to reach convergence was more than 5 times larger for ssSNPB-LUP compared to ssGBLUP (Table 3; Fig. 2). However, when the DPCG method

with 1 SNP effect per subdomain was used, the number of iterations decreased by a factor 5, and was similar to the number of iterations needed for ssGBLUP. Five, 50 and 200 SNP effects per subdomain also led to a decrease of the number of iterations by a factor 4.3, 1.7 and 1.3, respectively (Table 3). Figure 2 depicts termination criteria by iteration for the PCG and DPCG methods. A flat pattern is observed for the PCG method applied to ssSNPB-LUP. The DPCG method allowed removing this flat pattern such that a pattern similar to that of ssGBLUP was observed.

Regarding the wall clock time per iteration, when the PCG method was applied, about 0.05 s and 0.46 s were needed for ssGBLUP and ssSNPB-LUP, respectively. The wall clock time for the iterative process to reach convergence, i.e. excluding the time needed for I/O operations and computations of different matrices (e.g., $Z$, $G^{-1} - A_{gg}^{-1}$, $E^{-1}$, $M^{-1}$), was about 11 s for ssGBLUP, and about 688 s for ssSNPB-LUP solved with the PCG method. When the DPCG method was applied, the time per iteration for ssSNPB-LUP slightly increased due to additional computations involving the deflation matrix $P$. However, the total time for the iterative process decreased to a minimum value of 170 s with 5 SNP effects per subdomain (Table 3).

## Field dataset

For the field dataset, the number of equations was larger than $25.8 \times 10^6$ for all systems of equations. In total, 13,803 largest eigenvalues of $Z$ explained 99%

<table><caption>**Table 4** Characteristics of preconditioned (deflated) coefficient matrices, and of PCG and DPCG methods for the field dataset</caption><thead><tr><th>Model</th><th>Method<sup>a</sup></th><th>Smallest eigenvalue</th><th>Largest eigenvalue</th><th>Effective condition number</th><th>Number of iterations<sup>b</sup></th><th>Total time<sup>c</sup></th><th>Time/iteration<sup>d</sup></th></tr></thead><tbody><tr><td>ssGBLUP</td><td>PCG</td><td>2.3 × 10<sup>-5</sup></td><td>5.1</td><td>2.2 × 10<sup>5</sup></td><td>729</td><td>3993</td><td>5.3 (0.4)</td></tr><tr><td rowspan="4">ssSNPB-LUP</td><td>PCG</td><td>3.7 × 10<sup>-5</sup></td><td>1751.9</td><td>4.7 × 10<sup>7</sup></td><td>10,000</td><td>52,683</td><td>4.4 (0.4)</td></tr><tr><td>DPCG (200)</td><td>1.2 × 10<sup>-5</sup></td><td>193.1</td><td>1.6 × 10<sup>7</sup></td><td>10,000</td><td>92,171</td><td>9.2 (1.4)</td></tr><tr><td>DPCG (50)</td><td>8.7 × 10<sup>-6</sup></td><td>29.9</td><td>3.4 × 10<sup>6</sup></td><td>6074</td><td>52,503</td><td>8.6 (2.4)</td></tr><tr><td>DPCG (5)</td><td>2.9 × 10<sup>-5</sup></td><td>4.8</td><td>1.7 × 10<sup>5</sup></td><td>748</td><td>7735</td><td>8.7 (0.3)</td></tr><tr><td rowspan="5">ssPCBLUP<sup>e</sup></td><td>PCG</td><td>1.2 × 10<sup>-5</sup></td><td>220.0</td><td>1.8 × 10<sup>7</sup></td><td>10,000</td><td>30,198</td><td>2.9 (0.2)</td></tr><tr><td>DPCG (200)</td><td>8.3 × 10<sup>-6</sup></td><td>113.3</td><td>1.4 × 10<sup>7</sup></td><td>10,000</td><td>58,280</td><td>5.8 (0.7)</td></tr><tr><td>DPCG (50)</td><td>7.7 × 10<sup>-6</sup></td><td>46.0</td><td>6.0 × 10<sup>6</sup></td><td>8541</td><td>55,388</td><td>6.5 (0.5)</td></tr><tr><td>DPCG (5)</td><td>8.0 × 10<sup>-6</sup></td><td>5.1</td><td>6.4 × 10<sup>5</sup></td><td>2686</td><td>15,063</td><td>5.6 (0.2)</td></tr><tr><td>DPCG (1)</td><td>9.6 × 10<sup>-4</sup></td><td>4.8</td><td>4.9 × 10<sup>4</sup></td><td>375</td><td>2402</td><td>6.3 (0.2)</td></tr></tbody></table>

<footnote><sup>a</sup> Number of SNP effects per subdomain is within brackets</footnote>

<footnote><sup>b</sup> A number of iterations equal to 10,000 means that the method failed to converge within 10,000 iterations</footnote>

<footnote><sup>c</sup> Wall clock time (s) for the iterative process</footnote>

<footnote><sup>d</sup> Average wall clock time (s) (SD within brackets) per iteration. Iterations computing the residual from the coefficient matrix for the PCG method were removed before averaging</footnote>

<footnote><sup>e</sup> The number of principal components retained was equal to 13,803</footnote>
<figure><img src="image_5.png" /><figcaption>**Fig. 3** Termination criteria for the field dataset for ssGBLUP and ssSNPBLUP using the PCG method and for ssSNPBLUP using the DPCG method. Number of SNP effects per subdomain is within brackets</figcaption></figure>

of the genomic variation. The smallest and largest non-zero eigenvalues that influenced the convergence were estimated using the Lanczos algorithm based on information obtained from the (D)PCG method. The smallest positive eigenvalues of the different $M^{-1}C$ and $M^{-1}PC$ were estimated between $7.7 \times 10^{-6}$ and $9.6 \times 10^{-4}$. The estimated largest eigenvalue of $M^{-1}C$ was equal to 5 for ssGBLUP, to 1752 for ssSNPBLUP, and to 220 for ssPCBLUP (Table 4). When deflation was applied, the estimated largest eigenvalue of $M^{-1}PC$ of ssSNPBLUP varied from 5 with 5 SNP effects per subdomain to 193 with 200 SNP effects per subdomain. Similar largest eigenvalues were obtained for ssPCBLUP when deflation was applied. After deflation, the effective spectral condition number of ssSNPBLUP decreased from $4.7 \times 10^7$ to between $1.7 \times 10^5$ with 5 SNP effects per subdomain and $1.6 \times 10^7$ with 200 SNP effects per subdomain (Table 4). For ssPCBLUP, the effective spectral condition number decreased from $1.8 \times 10^7$ to between $4.9 \times 10^4$ with 1 PC effect per subdomain and $1.4 \times 10^7$ with 200 PC effects per subdomain (Table 4). Only the PCG method for ssGBLUP, the DPCG method for ssSNPBLUP with 5 and 50 SNP effects per subdomain, and the DPCG method for ssPCBLUP with 1 to 50 PC effects per subdomain

converged within 10,000 iterations (Table 4; Figs. 3, 4). The other (D)PCG methods for ssSNPBLUP and for ssPCBLUP were stopped after 10,000 iterations. For ssSNPBLUP, the termination criteria at the 10,000-th iteration was equal to $8.0 \times 10^{-4}$ for the PCG method, and to $1.3 \times 10^{-5}$ for the DPCG method with 200 SNP effects per subdomain. For ssPCBLUP, the termination criteria at the 10,000-th iteration was equal to $3.9 \times 10^{-5}$ for the PCG method, and to $9.4 \times 10^{-6}$ for the DPCG method with 200 PC effects per subdomain (Table 4; Figs. 3, 4).

Regarding the wall clock time per iteration, when the PCG method was applied, about 5 s were needed for ssGBLUP and ssSNPBLUP, whereas about 3 s were needed for ssPCBLUP. When the DPCG method was applied for ssSNPBLUP (ssPCBLUP), the time per iteration increased to about 9 (6) s, regardless of the number of SNP (PC) effects per subdomain was used. The wall clock time for the iterative process to reach convergence, that is excluding the time needed for I/O operations and computations of different matrices (e.g., $Z$, $T$, $E^{-1}$, $M^{-1}$) was equal to 7735 s for ssSNPBLUP solved by the DPCG method with 5 SNP effects per subdomain, and to 2402 s for ssPCBLUP solved by the DPCG method with 1 PC effect per subdomain (Table 4). For comparison, the wall clock time for 10,000
<figure><img src="image_6.png" /><figcaption>**Fig. 4** Termination criteria for the field dataset for ssGBLUP and ssPCBLUP using the PCG method and for ssPCBLUP using the DPCG method. The number of principal components retained was equal to 13,803. Number of PC effects per subdomain is within brackets</figcaption></figure>

<table><caption>**Table 5** Computational costs for different matrices and for the software used for the field dataset</caption><thead><tr><th rowspan="2">Model</th><th rowspan="2">Method<sup>a</sup></th><th colspan="3">Galerkin matrix (E<sup>-1</sup>)</th><th>Dense matrix<sup>d</sup></th><th>G<sup>-1</sup> - A<sub>gg</sub><sup>-1</sup></th><th>Software peak memory<sup>e</sup></th></tr><tr><th>Size<sup>b</sup></th><th>GB</th><th>Time<sup>c</sup> (s)</th><th>GB</th><th>GB</th><th>GB</th></tr></thead><tbody><tr><td rowspan="4">ssGBLUP</td><td>PCG</td><td>-</td><td>-</td><td>-</td><td>-</td><td>63.1</td><td>70.2</td></tr><tr><td>PCG</td><td>-</td><td>-</td><td>-</td><td>26.4</td><td>-</td><td>34.0</td></tr><tr><td>DPCG (200)</td><td>764</td><td>0.004</td><td>2199</td><td>26.4</td><td>-</td><td>43.8</td></tr><tr><td>DPCG (50)</td><td>3044</td><td>0.071</td><td>2959</td><td>26.4</td><td>-</td><td>43.9</td></tr><tr><td rowspan="5">ssPCBLUP</td><td>DPCG (5)</td><td>30,400</td><td>7.1</td><td>9131</td><td>26.4</td><td>-</td><td>51.0</td></tr><tr><td>PCG</td><td>-</td><td>-</td><td>-</td><td>9.6</td><td>-</td><td>16.6</td></tr><tr><td>DPCG (200)</td><td>284</td><td>&lt;0.001</td><td>430</td><td>9.6</td><td>-</td><td>16.8</td></tr><tr><td>DPCG (50)</td><td>1112</td><td>0.009</td><td>663</td><td>9.6</td><td>-</td><td>16.8</td></tr><tr><td>DPCG(5)</td><td>11,048</td><td>0.9</td><td>1965</td><td>9.6</td><td>-</td><td>17.7</td></tr><tr><td></td><td>DPCG (1)</td><td>55,216</td><td>23.3</td><td>9630</td><td>9.6</td><td>-</td><td>40.6</td></tr></tbody></table>

iterations of the PCG method (i.e., the iterative process that never reached convergence) was equal to 52,683 s for ssSNPBLUP and to 30,198 s for ssPCBLUP.

Regarding RAM and time requirements for the field dataset during the solving process, the peak RAM was about 70 GB for ssGBLUP, about 34 GB for ssSNPBLUP,

<footnote><sup>a</sup> Number of SNP (PC) effects per subdomain is within brackets</footnote>

<footnote><sup>b</sup> The size of the Galerkin matrix is equal to the rank of the deflation-subspace matrix</footnote>

<footnote><sup>c</sup> Wall clock time required for the computation of the Galerkin matrix following a naive implementation, and computation of its inverse</footnote>

<footnote><sup>d</sup> The dense matrix is the centered genotype matrix Z for ssSNPBLUP and the matrix with principal components T for ssPCBLUP</footnote>

<footnote><sup>e</sup> The software peak memory is defined as the peak resident set size (VmHWM) obtained from the Linux/proc virtual file system</footnote>
and about 17 GB for ssPCBLUP, when the PCG method was used (Table 5). The peak RAM increased to a maximum of 51 GB when the DPCG method was used (Table 5). Most RAM was used for storing dense matrices (e.g., $G^{-1} - A_{gg}^{-1}$, T, Z, and some $E^{-1}$; Table 5). The time to compute the Galerkin matrix and its inverse ($E^{-1}$) using a suboptimal approach varied from 430 to 9630 s (Table 5). It is worth noting that the wall clock time required by calc_grm for the different computations and I/O operations, was equal to 17,071 s (using 7 threads) for the matrix $G^{-1} - A_{gg}^{-1}$, and 15,663 s (using 10 threads) for the matrix T. Times are indicative, because different jobs were run at the same time and different approaches were used for I/O operations.

## Discussion

The first aim of this study was to compare the properties of the system matrices of ssSNPBLUP and ssGBLUP, and to relate this to observed convergence patterns of ssSNPBLUP obtained with the PCG method. The second aim of this study was to implement and test the feasibility of a DPCG method for efficient solving of ssSNPBLUP and of ssPCBLUP. These aims are important initial steps in the development of an efficient large-scale genomic evaluation system that can handle hundreds of thousands of animals and probably will use ~50 K SNPs. As far as we know, this is the first time that effective spectral condition numbers were computed and that the DPCG method was used in the context of quantitative genetics and of linear mixed models. The obtained results showed that larger eigenvalues were obtained for the preconditioned efficient matrix $M^{-1}C$ when SNP effects were fitted explicitly in the model, in comparison to ssGBLUP. Since the smallest eigenvalues of $M^{-1}C$ of ssSNPBLUP were similar to those of $M^{-1}C$ of ssGBLUP, larger effective spectral condition numbers were obtained for ssSNPBLUP solved by the PCG method, in comparison to ssGBLUP. Thus, this increase of the largest eigenvalues can be associated with the slow convergence of the PCG method applied to ssSNPBLUP. Deflating the largest eigenvalues allowed faster convergence of the DPCG method applied to ssSNPBLUP. Interestingly, similar, or slightly improved, condition numbers and convergence patterns were obtained for ssPCBLUP, while noise in the genomic information was removed by fitting explicitly PC effects instead of SNP effects. These results can be explained by the fact that the eigenvalues associated with the matrix T and the corresponding eigenvalues associated with the centered genotype matrix Z are the same, and suggest that convergence issues with the PCG method are not (only) due to noise in the genomic information.

The proposed definition of the deflation(-subspace) matrix allows to remove the unfavourable largest

eigenvalues from the spectrum of the preconditioned coefficient matrix $M^{-1}C$ of ssSNPBLUP and of ssPCBLUP. However, the proposed definition of the deflation matrix did not affect, or very slightly, the rest of the spectrum of ssSNPBLUP, since the smallest eigenvalues remained similar among the different system matrices of ssSNPBLUP and of ssGBLUP. Similar results were obtained for ssPCBLUP. The deflation vectors spanned approximately the same space as the span of the eigenvectors corresponding to the largest eigenvalues of $M^{-1}C$ of ssSNPBLUP and of ssPCBLUP. The proposed definition of the deflation(-subspace) matrix allows smaller effective spectral condition numbers, and therefore better convergence, as expected from the theory. Decreasing the number of randomly chosen SNP effects per subdomain from 200 to 1 or 5 led to effective spectral condition numbers and convergence patterns for ssSNPBLUP similar to those for ssGBLUP. Based on our results and when fitting SNP effects, including 5 randomly chosen SNP effects per subdomain gave similar performance as including 1 SNP effect per subdomain. This similar performance depends probably on the properties of the genomic information, such as the amount of noise (or redundancy) in the genomic information, or the kind of effects fitted (e.g., SNP or PC effects). Indeed, when fitting PC effects, including 5 PC effects per subdomain gave worse performance than including 1 PC effect per subdomain, or even than including 5 SNP effects per subdomain (Table 4). It is worth noting that these results are interesting for ssSNPBLUP because they allow smaller Galerkin matrices, and therefore less memory use and lower computational costs. For ssPCBLUP, the size of the Galerkin matrices remained small thanks to the dimension reduction from SVD of Z.

Regarding computational costs, the proposed definition of the deflation matrix was based on a subdomain deflation approach, allowing cheap and efficient computations [22]. Ideally, the deflation-subspace matrix $Z_d$ should consist of eigenvectors associated with the unfavourable eigenvalues of $M^{-1}C$ [20–22]. However, the computation of these eigenvectors for large linear systems of equations can be very expensive, and these vectors might also be dense, leading to an increase of memory and expensive computations involving the deflation matrix P. Therefore, defining sparse deflation vectors that approximate the same space as the span of the unfavourable eigenvalues of $M^{-1}C$ is desirable, and can be obtained with the subdomain deflation approach described by Frank and Vuik [22]. This approach gave good performance in several fields [22–24], and leads to interesting properties. The deflation-subspace matrix $Z_d$ resulting from this approach is indeed sparse, is cheap to construct, involves a few additional and cheap computations, and
has favourable properties for parallel computing [22]. For example, the deflation-subspace matrix in our implementation is stored as a vector of size of the number of equations of the system, and each entry of this vector contains the identification number of the subdomain associated with the corresponding equation. Moreover, the Galerkin matrix **E** was held in memory as a dense matrix in our implementation, which is possible on current shared-memory computers when the numbers of SNPs and traits are reasonable. Holding the Galerkin matrix in memory also allows efficient parallel computing using Intel MKL subroutines. Furthermore, while a suboptimal approach was used in this study to compute the Galerkin matrix **E**, we expect its computation to be feasible within a limited amount of time and memory by taking further advantages of the symmetry of the coefficient matrix **C** and of the properties of the subdomain deflation approach.

Improvement of the current definition of the subdomains for ssSNPBLUP and ssPCBLUP could reduce further computational costs (i.e., time and memory requirements). The definition of subdomains used in this study was arbitrary, that is the number of SNP effects assigned to one subdomain was the same for each subdomain, and SNP effects assigned to one subdomain were randomly chosen. It would be worth investigating whether assignments of SNP effects to a subdomain based on properties of the SNP genotypes, such as linkage disequilibrium, could reduce the number of subdomains while maintaining, or decreasing, the obtained effective spectral condition numbers. Indeed, the current definition of subdomains could lead to too large Galerkin matrices for ssSNPBLUP with a large number of traits. Furthermore, for the field dataset, the current definition of subdomains did not allow to hold in memory the matrix **CZ**<sub>d</sub> for computation efficiency [22]. Instead, we had to perform the multiplication of **C** by a vector twice each DPCG iteration, leading to double wall clock times per DPCG iteration in comparison to the PCG method.

For large datasets, a matrix-free approach (that is our second implementation) allows to solve ssSNPBLUP and ssPCBLUP with a (D)PCG method on current computers and with limited amounts of RAM and of wall clock time. Indeed, large and dense matrices of the linear system of Eq. (2), such as $\mathbf{H}^{13} = \mathbf{G}_0^{-1} \otimes \mathbf{A}^{ng}\mathbf{Z}$ for ssSNPBLUP, are never computed explicitly. Instead, the matrix-free approach takes advantage of the fact that the (D)PCG method requires the multiplication of **C** by a vector. For example, the multiplication of $\mathbf{H}^{13}$ by a vector **d** is performed in three parts, i.e. $\mathbf{H}^{13}\mathbf{v} = \mathbf{G}_0^{-1} \otimes [\mathbf{A}^{ng}[\mathbf{Z}\mathbf{d}]]$ where the brackets $[\cdot]$ indicate the order of the matrix-vector operations. Also, when using a matrix-free approach, one of the largest computational costs of ssSNPBLUP (ssPCBLUP) solved with a (D)PCG method

is, most likely, the multiplication of **Z** (**T**) by a vector **d**. Thus, it is expected that the main computational costs of ssSNPBLUP and of ssPCBLUP will increase linearly with increasing numbers of genotyped animals. Such a linear increase of the computational costs is also observed for ssGBLUP using APY [6] or ssGTBLUP based on a Wood-bury decomposition of **G** [8].

While the solving process for ssPCBLUP seems to be more favourable than that for ssSNPBLUP in terms of memory and time requirements, the comparison between the two approaches should also consider additional computations, such as the SVD of the centered genotype matrix for ssPCBLUP. For the field dataset, the computational costs were quite substantial (i.e. > 15,000 s with 10 threads), and these will increase linearly with the number of genotyped animals and quadratically with the number of SNPs (assuming that the number of genotyped animals is larger than the number of SNPs). However, the time needed for SVD can be reduced by analysing different genome segments (e.g., chromosomes) in parallel [7]. For example, using an own Coarray Fortran program with 5 images (processes) using each 2 CPU, performing the SVD of 5 genome segments (of the same size) in parallel took 1276 s, and 16,662 PC were kept (instead of 13,803 PC kept with the SVD to the full genotype matrix). Performing the SVD on 5 genome segments instead of on the full genotype matrix, only marginally increased time and memory required for ssPCBLUP using the DPCG method with 1 PC per subdomain (results not shown). Therefore, further studies comparing computational costs for the whole process of ssPCBLUP, of ssSNPBLUP, but also of ssGBLUP and related methods (ssGBLUP using APY [6], and ssGTBLUP [8]) are needed. Such studies should consider costs of SVD, of computation of genomic relationship matrices, and of back-solving SNP effects from genomic estimated breeding values.

Because both PCG and DPCG methods are CG-based methods, the DPCG method can be easily implemented in current software based on the PCG method for other ssSNPBLUP (ssPCBLUP) models, or even for pedigree- and ssGBLUP models, for which convergence issues are observed. Modifications of existing PCG software would be mainly associated with the multiplication of $\mathbf{P} = \mathbf{I} - \mathbf{CZ}_d\mathbf{E}^{-1}\mathbf{Z}'_d$ by a vector, which can rely on existing code for the multiplication of **C** by a vector. Using the DPCG method with pedigree-BLUP or ssGBLUP could also improve their convergence patterns. For example, the number of iterations to solve the pedigree-BLUP of the field dataset decreased by about 30% (in comparison to the PCG method) after associating one subdomain with each of the 100 sires that had the largest progeny. While this approach could not be generalised to other available field datasets (results not shown), it seems worthwhile to
investigate the DPCG method in the pedigree- and ssGBLUP contexts for performing routine genetic evaluations with increasing datasets within a reasonable time.

## Conclusions

We showed that convergence issues observed with ssSNPBLUP and ssPCBLUP solved by the PCG method are related with larger eigenvalues and larger effective spectral condition numbers in comparison to ssGBLUP. These convergence issues of ssSNPBLUP and of ssPCBLUP were solved with a DPCG method, which is a two-level PCG method for ill-conditioned linear systems. As defined in this study, the DPCG method treats the largest unfavourable eigenvalues of the preconditioned coefficient matrix of ssSNPBLUP and of ssPCBLUP, and leads to a convergence pattern, which is at least similar to that of ssGBLUP.

## Additional files

**Additional file 1.** Derivation of a preconditioned deflated coefficient matrix. Description: Here we derive the preconditioned deflated coefficient matrix when the computational domain is divided such that some effects are included alone in a separate subdomain.

**Additional file 2: Figure S1.** Comparison of the estimates of ssGBLUP solved with the PCG method and of ssSNPBLUP solved with the DPCG method using five SNP effects per subdomain. Estimates are for all fixed effects and random additive genetic effects for the field dataset. **Figure S2.** Comparison of the estimates of ssGBLUP solved with the PCG method and of ssPCBLUP solved with the DPCG method using one PC effect per subdomain. Estimates are for all fixed effects and random additive genetic effects for the field dataset.

## Authors' contributions

JV conceived the experimental design, ran the tests, and wrote the programs and the first draft. HE prepared data. CV, MPLC, and HE provided valuable insights throughout the analysis and writing process. All authors read and approved the final manuscript.

## Author details

¹ Animal Breeding and Genomics Centre, Wageningen UR Livestock Research, P.O. Box 338, 6700 AH Wageningen, The Netherlands. ² CRV BV, Wassenaarweg 20, 6843 NW Arnhem, The Netherlands. ³ DIAM, TU Delft, Van Mourik Broekmanweg 6, 2628 XE Delft, The Netherlands.

## Acknowledgements

The use of the HPC cluster has been made possible by CAT-AgroFood (Shared Research Facilities Wageningen UR). Computational resources have been also provided by the Consortium des Équipements de Calcul Intensif (CÉCI), funded by the Fonds de la Recherche Scientifique de Belgique (F.R.S.-FNRS) under Grant No. 2.5020.11.

## Competing interests

The authors declare that they have no competing interests.

## Availability of data and materials

Not applicable.

## Consent for publication

Not applicable.

## Funding

This study was financially supported by the Dutch Ministry of Economic Affairs (TKI Agri & Food Project 16022) and the Breed4Food partners Cobb Europe, CRV, Hendrix Genetics and Topigs Norsvin.

## Publisher's Note

Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.

Received: 16 March 2018 Accepted: 25 October 2018

Published online: 03 November 2018

## References

1. Meuwissen THE, Hayes BJ, Goddard ME. Prediction of total genetic value using genome-wide dense marker maps. Genetics. 2001;157:1819-29.

2. Fernando RL, Dekkers JC, Garrick DJ. A class of Bayesian methods to combine large numbers of genotyped and non-genotyped animals for whole-genome analyses. Genet Sel Evol. 2014;46:50.

3. Legarra A, Christensen OF, Aguilar I, Misztal I. Single step, a general approach for genomic selection. Livest Sci. 2014;166:54-65.

4. Misztal I, Legarra A, Aguilar I. Computing procedures for genetic evaluation including phenotypic, full pedigree, and genomic information. J Dairy Sci. 2009;92:4648-55.

5. Christensen OF, Lund MS. Genomic prediction when some animals are not genotyped. Genet Sel Evol. 2010;42:2.

6. Misztal I. Inexpensive computation of the inverse of the genomic relationship matrix in populations with small effective population size. Genetics. 2016;202:401-9.

7. Ødegård J, Indahl U, Strandén I, Meuwissen THE. Large-scale genomic prediction using singular value decomposition of the genotype matrix. Genet Sel Evol. 2018;50:6.

8. Mäntysaari EA, Evans RD, Strandén I. Efficient single-step genomic evaluation for a multibreed beef cattle population having many genotyped animals. J Anim Sci. 2017;95:4728-37.

9. Legarra A, Ducrocq V. Computational strategies for national integration of phenotypic, genomic, and pedigree data in a single-step best linear unbiased prediction. J Dairy Sci. 2012;95:4629-45.

10. Fernando RL, Cheng H, Golden BL, Garrick DJ. Computational strategies for alternative single-step Bayesian regression models with large numbers of genotyped and non-genotyped animals. Genet Sel Evol. 2016;48:96.

11. Taskinen M, Mäntysaari EA, Strandén I. Single-step SNP-BLUP with on-the-fly imputed genotypes and residual polygenic effects. Genet Sel Evol. 2017;49:36.

12. Liu Z, Goddard M, Reinhardt F, Reents R. A single-step genomic model with direct estimation of marker effects. J Dairy Sci. 2014;97:5833-50.

13. Mäntysaari EA, Strandén I. Single-step genomic evaluation with many more genotyped animals. In: Proceedings of the 67th annual meeting of the european association for animal production (EAAP): 29 Aug-2 Sept 2016; Belfast. 2016.

14. Meuwissen THE, Indahl UG, Ødegård J. Variable selection models for genomic selection using whole-genome sequence data and singular value decomposition. Genet Sel Evol. 2017;49:94.

15. Strandén I, Lidauer M. Solving large mixed linear models using preconditioned conjugate gradient iteration. J Dairy Sci. 1999;82:2779-87.

16. Tsuruta S, Misztal I, Strandén I. Use of the preconditioned conjugate gradient algorithm as a generic solver for mixed-model equations in animal breeding applications. J Anim Sci. 2001;79:1166-72.

17. Saad Y. Iterative methods for sparse linear systems. 2nd ed. Philadelphia: Society for Industrial and Applied Mathematics; 2003.

18. Manzanilla-Pech CIV, Veerkamp RF, de Haas Y, Calus MPL, ten Napel J. Accuracies of breeding values for dry matter intake using nongenotyped animals and predictor traits in different lactations. J Dairy Sci. 2017;100:9103-14.

19. Nicolaides RA. Deflation of conjugate gradients with applications to boundary value problems. SIAM J Numer Anal. 1987;24:355-65.
20. Vuik C, Segal A, Meijerink JA. An efficient preconditioned CG method for the solution of a class of layered problems with extreme contrasts in the coefficients. J Comput Phys. 1999;152:385-403.

21. Saad Y, Yeung M, Erhel J, Guyomarc'h F. A deflated version of the conjugate gradient algorithm. SIAM J Sci Comput. 2000;21:1909-26.

22. Frank J, Vuik C. On the construction of deflation-based preconditioners. SIAM J Sci Comput. 2001;23:442-62.

23. MacLachlan SP, Tang JM, Vuik C. Fast and robust solvers for pressure-correction in bubbly flow problems. J Comput Phys. 2008;227:9742-61.

24. Ludwig E, Nabben R, Tang JM. Deflation and projection methods applied to symmetric positive semi-definite systems. Linear Algebra Appl. 2016;489:253-73.

25. Janss L, de Los Campos G, Sheehan N, Sorensen D. Inferences from genomic models in stratified populations. Genetics. 2012;192:693-704.

26. Nabben R, Vuik C. A comparison of deflation and the balancing preconditioner. SIAM J Sci Comput. 2006;27:1742-59.

27. Strandén I, Lidauer M. Parallel computing applied to breeding value estimation in dairy cattle. J Dairy Sci. 2001;84:276-85.

28. Diaz Cortes GB, Vuik C, Jansen JD. On POD-based deflation vectors for DPCG applied to porous media problems. J Comput Appl Math. 2018;330:193-213.

29. Burrage K, Erhel J, Pohl B, Williams A. A deflation technique for linear systems of equations. SIAM J Sci Comput. 1998;19:1245-60.

30. Druet T, Georges M. A Hidden Markov Model combining linkage and linkage disequilibrium information for haplotype reconstruction and quantitative trait locus fine mapping. Genetics. 2010;184:789-98.

31. Browning SR, Browning BL. Rapid and accurate haplotype phasing and missing-data inference for whole-genome association studies by use of localized haplotype clustering. Am J Hum Genet. 2007;81:1084-97.

32. Cornelissen MAMC, Mullaart E, Van der Linde C, Mulder HA. Estimating variance components and breeding values for number of oocytes and number of embryos in dairy cattle using a single-step genomic evaluation. J Dairy Sci. 2017;100:4698-705.

33. CRV Animal Evaluation Unit. Statistical indicators, E-15: Breeding value milking speed. 2017. https://www.crv4all-international.com/wp-content/uploads/2017/05/E_15_msn_apr-2017_EN.pdf. Accessed 15 March 2018.

34. CRV Animal Evaluation Unit. Management guides, E16: Breeding value-Temperament during milking. 2010. https://www.crv4all-international.com/wp-content/uploads/2016/03/E-16-Temperament.pdf. Accessed 15 March 2018.

35. Calus MPL, Vandenplas J. Calc_grm—a program to compute pedigree, genomic, and combined relationship matrices. Wageningen: Wageningen University and Research; 2016.

36. Paige CC, Saunders MA. Solution of sparse indefinite systems of linear equations. SIAM J Numer Anal. 1975;12:617-29.

37. Kaasschieter EF. A practical termination criterion for the conjugate gradient method. BIT Numer Math. 1988;28:308-22.

38. Kaasschieter EF. Preconditioned conjugate gradients for solving singular systems. J Comput Appl Math. 1988;24:265-75.

39. van der Sluis A, van der Vorst HA. The rate of convergence of conjugate gradients. Numer Math. 1986;48:543-60.

40. Masuda Y, Misztal I, Tsuruta S, Legarra A, Aguilar I, Lourenco DAL, et al. Implementation of genomic recursions in single-step genomic best linear unbiased predictor for US Holsteins with a large number of geno-typed animals. J Dairy Sci. 2016;99:1968-74.

41. Garcia-Cortes LA, Cabrillo C. A Monte Carlo algorithm for efficient large matrix inversion. Report No.: cs/0412107. 2004. http://arxiv.org/abs/cs/0412107. Accessed 15 March 2018.