BACKGROUND
the estimation of evolutionary distances between gene/protein sequences is one of the most important problems in molecular evolution.
in particular, it lies at the heart of most phylogenetic tree construction methods.
the estimation of such distances is a two step process: first, homologous characters are identified, then the distances are estimated from the character substitution patterns.
the most accurate matching of homologous characters is obtained by multiple sequence alignments .
indeed, by considering all sequences simultaneously, msas yield a consistent and in principle optimal grouping of the homologous characters.
unfortunately, msas are hard to compute optimally , and thus are in practice computed using heuristics.
alternatively, the sequences can be analyzed exclusively on the basis of pairs of sequences, using an algorithm such as smith-waterman  <cit>  that yields optimal pairwise alignments .
this approach is often taken by large-scale comparative genomics analysis such as mips, oma or roundup  <cit> , which analyze the sequences pairwise due to computational constraints.
once the homologous characters are identified, the second step of distance estimation can proceed.
the method of choice is a maximum likelihood  estimation based on some model of evolution.
there too, the distances can either be estimated simultaneously from all sequences using a combination of tree topology inference and joint optimization of all branches, or pairwise, by estimating the distances between every pair of sequences.
joint estimation requires msas, while pairwise distance estimation can be done from either opas or from the pairwise alignments induced by an msa .
fig.
<dig> provides an overview of the different approaches.
in all cases, the estimation of evolutionary distances is subject to inference uncertainty, which is commonly quantified by their variances and covariances.
indeed, the distance variance information can be used to build confidence intervals around the estimate; covariances of pairs of distances can be used to build the confidence intervals of combinations of distances.
examples of applications include generalized least squares  phylogenetic tree building  <cit>  construction of confidence sets of trees  <cit> , test for monophyly using likelihood ratios  <cit> , comparison of evolutionary distances for orthology inference  <cit> , or distance-based lateral gene transfer detection  <cit>
variance estimates are provided by ml theory in both joint and pairwise distances estimation.
however, ml theory only provides covariance estimates if all distances are estimated jointly.
covariance estimates for distances computed from ipas in the context of specific parametric substitution models have been reported by hasegawa et al.
<cit>  and bulmer  <cit> , and were generalized by susko  <cit>  to all markovian models of evolution.
furthermore, the covariance of distances from ipas can also be estimated  through bootstrapping  <cit> .
as for the covariance of distances obtained from opas, the main difficulty in computing them is that, since sequence pairs are aligned individually, they usually have inconsistencies in their inference of the homologous characters .
thus, the alignments cannot be partitioned in consistent "columns" of characters, and neither susko's method nor resampling approaches such as bootstrapping can be applied.
indeed, in the case of analyses relying exclusively on pairwise comparison and distance estimation, i.e.
where no msa computation can be afforded, we are not aware of any previously published estimator for the covariance of distances estimates from pairwise alignments.
we have shown in a previous article  <cit>  a numerical approximation for the constrained case of the covariance of two opa distances involving a common sequence , for empirical substitution models such as pam or jtt.
in this article, we present an estimator for the covariance of ml distances estimated from opas that works on triplets and quartets of sequences.
this solves the problem of sets of sequences of arbitrary size, because each covariance involves at most four sequences at a time.
thus, the full covariance matrix is naturally obtained through quartet analysis.
we analyze the performances of the estimator in terms of bias and variance.
finally, we compare the results obtained on triplets of sequences to our previous work.
RESULTS
in the following, we present and analyze the performances of the estimator for the covariance of two distances.
for this purpose, it is informative to analyze the results separately for the following three different underlying topological relations, illustrated in fig.
2:
case of dependence
the two distances are estimated between four distinct sequences, and they have some evolution in common .
with such an evolutionary history, the two distances estimates covary positively.
case of independence
the two distances are estimated between four distinct sequences, but they have no evolution in common .
this case is informative, because a central assumption in most evolutionary models is that evolution on different branches is independent  <cit> .
with no branch in common, the distances should not covary  <cit> .
thus, such a topology can be used to test the estimators as negative control.
case of triplet
the two distances involve a common sequence, and have some evolution in common.
this case is of special interest, because we have previously presented an alternate estimator for this particular case using a different approach  <cit> .
thus, we can compare our results to this approach, hereafter called "the numerical approximation".
note that the covariances are estimated using the same algorithm in all three cases: we only distinguish them from each another for the purpose of this analysis.
to assess the performance of the covariance estimator, it was compared against the monte carlo covariance estimator.
in short, each point shown in the figures was obtained from  <dig>  sets of sequences mutated along a random quartet subtree of the tree of life .
that way, the evaluation is based on tree samples that are distributed as closely as possible to real biological data.
to account for gene families with varying rates, each quartet was scaled with a random factor uniformly distributed between  <dig>  and  <dig>  note that results corresponding to very large distance constitute extreme cases; for instance, when sequences are  <dig> pam units apart, each position has, on average, mutated  <dig>  times.
fig.
3a shows the mean of our estimator versus the monte carlo estimator in nine scatterplots arising from combining the topologies mentioned above  with three different sequence lengths .
in the case of dependence, the first row, we see that our estimator lies in about 80% of the cases within the 95% confidence interval of the monte carlo estimator.
in the case of independence, both estimators are close to zero, though our estimator shows a minor upward bias in some cases.
the third row gives the result of both the covariance estimator introduced here, as well as the numerical approximation from our previous study  <cit> .
here, we see that though the former performs well in cases of lower covariance values, it shows a clear downward bias in cases of larger covariances.
the numerical approximation does not present any apparent sign of bias, which is hardly surprising, given that it was obtained through regression.
what is however surprising, is that, given its simple structure, it performs better than the covariance estimator, which takes into account more data and is backed by a more detailed model.
it is instructive to compare the absolute bias of the covariance estimator to the well-known ml variance estimator .
as can be seen in fig.
3b, the ml variance is also biased for high variance values.
we conjecture that this is mainly due to mis-aligned positions, which cause model violations in the parameter estimation.
this problem is also likely to affect the covariance estimator.
even more directly, the ml variance estimator is a factor in the expression of the covariance estimator , so any error in the ml variance is propagated to the covariance estimator.
at this point, improving the ml estimator for cases of high divergence is likely to require better alignments, or an explicit modeling of the mis-aligned positions, which is beyond the scope of the present work.
further, to put the bias of the covariance estimator into perspective, we compared it to the standard deviation of the estimator.
fig.
<dig> presents the bias and standard deviation as function of the average number of anchors for sequence length of  <dig>  the anchors are the positions that are consistently aligned in the opas involved .
both bias and standard deviation strongly depend on the fraction of anchors, which can be thought of as a measure of alignment quality.
fig.
<dig> depicts the dependency between percentage of anchors and average distance.
as one would expect, the fraction of anchors decreases as divergence increases.
for a fraction of anchor positions below 60%, the average of the two distances involved in the covariance computation is always greater than  <dig> pam.
in fig.
<dig>  we first consider the bias and standard deviation for the case of dependence.
when the fraction of anchor positions is above 60% , the bias is far smaller than the standard deviation, and is therefore likely to have little negative impact in practice.
in the case of triplets, the bias exceeds the standard deviation already when the fraction of anchors is about 80%.
the ml variance estimator has this transition around 75% of anchors.
in the case of independence, where we expect our covariance estimator to be zero, its bias is always much smaller than its standard deviation .
most applications of the covariance estimator involve the covariance matrix.
let a^ be an approximation to the matrix a. we refer to ||aˆ−a||2||a|| <dig> as the relative error in a^, where ||·|| <dig> denotes the two-norm.
fig.
<dig> shows the relative error of the  <dig> ×  <dig> variance-covariance matrices computed with the ml variance estimator in the diagonal entries and our covariance estimator in the off-diagonal entries, and the same  <dig> ×  <dig> matrices with only diagonal entries.
the plots show that for the dependence case the the matrices with both covariance and ml variance estimators have a equal or lower relative error than the matrices with the ml variance only, except for a few cases in the region with a high fraction of anchors.
in the triplet case, the variance-covariance matrices have always lower error then variance matrices.
finally, in the case of independence, the matrices with covariance do not always have lower relative error, but this is expected, because the true covariance is null in this special case.
CONCLUSIONS
we have presented a method to estimate the covariances of distances estimated from pairwise alignments.
it does not require the construction of msas, which are hard to compute and therefore are only approximated in practice.
furthermore, it does not rely on phylogenetic trees as it is the case with covariance estimation from joint ml, or in covariance estimation methods that model the covariances as a function of shared branch lengths  <cit> .
tree building is not only a costly process, but is also subject to inference errors.
the accuracy of our estimator is comparable to the ml variance estimator.
both estimators are biased but in both cases the bias is, for distances below  <dig> pam, far smaller than their standard deviation.
the bias of the covariance estimator  becomes worse with declining percentage of anchors.
these biases arise because the alignment positions under scrutiny do not constitute an unbiased subsample of the true homologous positions.
note that misaligned positions are likely to affect distances from msas too.
a solution to this problem would lead to better distance estimates in the first place.
in the meanwhile, it is probably best to issue a warning if the percentage of anchors falls below some threshold.
the estimation of evolutionary distances is a very important process in molecular evolution, and therefore the covariance estimator presented here will be of use for various applications, such as the construction of gls trees on opa distances, the construction of confidence sets of trees based on the gls test statistic, relative-rate tests, distance-based lateral gene transfer detection, and in general in any process that needs to estimate confidence of distance combinations.

 the estimation of evolutionary distances between gene/protein sequences is one of the most important problems in molecular evolution. in particular, it lies at the heart of most phylogenetic tree construction methods. the estimation of such distances is a two step process: first, homologous characters are identified, then the distances are estimated from the character substitution patterns. the most accurate matching of homologous characters is obtained by multiple sequence alignments. indeed, by considering all sequences simultaneously, msas yield a consistent and in principle optimal grouping of the homologous characters. unfortunately, msas are hard to compute optimally, and thus are in practice computed using heuristics. alternatively, the sequences can be analyzed exclusively on the basis of pairs of sequences, using an algorithm such as smith-waterman that yields optimal pairwise alignments. this approach is often taken by large-scale comparative genomics analysis such as mips, oma or roundup, which analyze the sequences pairwise due to computational constraints. once the homologous characters are identified, the second step of distance estimation can proceed. the method of choice is a maximum likelihood estimation based on some model of evolution. there too, the distances can either be estimated simultaneously from all sequences using a combination of tree topology inference and joint optimization of all branches, or pairwise, by estimating the distances between every pair of sequences. joint estimation requires msas, while pairwise distance estimation can be done from either opas or from the pairwise alignments induced by an msa. fig. provides an overview of the different approaches. in all cases, the estimation of evolutionary distances is subject to inference uncertainty, which is commonly quantified by their variances and covariances. indeed, the distance variance information can be used to build confidence intervals around the estimate; covariances of pairs of distances can be used to build the confidence intervals of combinations of distances. examples of applications include generalized least squares phylogenetic tree building construction of confidence sets of trees, test for monophyly using likelihood ratios, comparison of evolutionary distances for orthology inference, or distance-based lateral gene transfer detection variance estimates are provided by ml theory in both joint and pairwise distances estimation. however, ml theory only provides covariance estimates if all distances are estimated jointly. covariance estimates for distances computed from ipas in the context of specific parametric substitution models have been reported by hasegawa et al. and bulmer, and were generalized by susko to all markovian models of evolution. furthermore, the covariance of distances from ipas can also be estimated through bootstrapping. as for the covariance of distances obtained from opas, the main difficulty in computing them is that, since sequence pairs are aligned individually, they usually have inconsistencies in their inference of the homologous characters. thus, the alignments cannot be partitioned in consistent "columns" of characters, and neither susko's method nor resampling approaches such as bootstrapping can be applied. indeed, in the case of analyses relying exclusively on pairwise comparison and distance estimation, i.e. where no msa computation can be afforded, we are not aware of any previously published estimator for the covariance of distances estimates from pairwise alignments. we have shown in a previous article a numerical approximation for the constrained case of the covariance of two opa distances involving a common sequence, for empirical substitution models such as pam or jtt. in this article, we present an estimator for the covariance of ml distances estimated from opas that works on triplets and quartets of sequences. this solves the problem of sets of sequences of arbitrary size, because each covariance involves at most four sequences at a time. thus, the full covariance matrix is naturally obtained through quartet analysis. we analyze the performances of the estimator in terms of bias and variance. finally, we compare the results obtained on triplets of sequences to our previous work.  in the following, we present and analyze the performances of the estimator for the covariance of two distances. for this purpose, it is informative to analyze the results separately for the following three different underlying topological relations, illustrated in fig. 2: case of dependence the two distances are estimated between four distinct sequences, and they have some evolution in common. with such an evolutionary history, the two distances estimates covary positively. case of independence the two distances are estimated between four distinct sequences, but they have no evolution in common. this case is informative, because a central assumption in most evolutionary models is that evolution on different branches is independent. with no branch in common, the distances should not covary. thus, such a topology can be used to test the estimators as negative control. case of triplet the two distances involve a common sequence, and have some evolution in common. this case is of special interest, because we have previously presented an alternate estimator for this particular case using a different approach. thus, we can compare our results to this approach, hereafter called "the numerical approximation". note that the covariances are estimated using the same algorithm in all three cases: we only distinguish them from each another for the purpose of this analysis. to assess the performance of the covariance estimator, it was compared against the monte carlo covariance estimator. in short, each point shown in the figures was obtained from sets of sequences mutated along a random quartet subtree of the tree of life. that way, the evaluation is based on tree samples that are distributed as closely as possible to real biological data. to account for gene families with varying rates, each quartet was scaled with a random factor uniformly distributed between and note that results corresponding to very large distance constitute extreme cases; for instance, when sequences are pam units apart, each position has, on average, mutated times. fig. 3a shows the mean of our estimator versus the monte carlo estimator in nine scatterplots arising from combining the topologies mentioned above with three different sequence lengths. in the case of dependence, the first row, we see that our estimator lies in about 80% of the cases within the 95% confidence interval of the monte carlo estimator. in the case of independence, both estimators are close to zero, though our estimator shows a minor upward bias in some cases. the third row gives the result of both the covariance estimator introduced here, as well as the numerical approximation from our previous study. here, we see that though the former performs well in cases of lower covariance values, it shows a clear downward bias in cases of larger covariances. the numerical approximation does not present any apparent sign of bias, which is hardly surprising, given that it was obtained through regression. what is however surprising, is that, given its simple structure, it performs better than the covariance estimator, which takes into account more data and is backed by a more detailed model. it is instructive to compare the absolute bias of the covariance estimator to the well-known ml variance estimator. as can be seen in fig. 3b, the ml variance is also biased for high variance values. we conjecture that this is mainly due to mis-aligned positions, which cause model violations in the parameter estimation. this problem is also likely to affect the covariance estimator. even more directly, the ml variance estimator is a factor in the expression of the covariance estimator, so any error in the ml variance is propagated to the covariance estimator. at this point, improving the ml estimator for cases of high divergence is likely to require better alignments, or an explicit modeling of the mis-aligned positions, which is beyond the scope of the present work. further, to put the bias of the covariance estimator into perspective, we compared it to the standard deviation of the estimator. fig. presents the bias and standard deviation as function of the average number of anchors for sequence length of the anchors are the positions that are consistently aligned in the opas involved. both bias and standard deviation strongly depend on the fraction of anchors, which can be thought of as a measure of alignment quality. fig. depicts the dependency between percentage of anchors and average distance. as one would expect, the fraction of anchors decreases as divergence increases. for a fraction of anchor positions below 60%, the average of the two distances involved in the covariance computation is always greater than pam. in fig. we first consider the bias and standard deviation for the case of dependence. when the fraction of anchor positions is above 60%, the bias is far smaller than the standard deviation, and is therefore likely to have little negative impact in practice. in the case of triplets, the bias exceeds the standard deviation already when the fraction of anchors is about 80%. the ml variance estimator has this transition around 75% of anchors. in the case of independence, where we expect our covariance estimator to be zero, its bias is always much smaller than its standard deviation. most applications of the covariance estimator involve the covariance matrix. let a^ be an approximation to the matrix a. we refer to ||aˆ−a||2||a|| as the relative error in a^, where ||·|| denotes the two-norm. fig. shows the relative error of the × variance-covariance matrices computed with the ml variance estimator in the diagonal entries and our covariance estimator in the off-diagonal entries, and the same × matrices with only diagonal entries. the plots show that for the dependence case the the matrices with both covariance and ml variance estimators have a equal or lower relative error than the matrices with the ml variance only, except for a few cases in the region with a high fraction of anchors. in the triplet case, the variance-covariance matrices have always lower error then variance matrices. finally, in the case of independence, the matrices with covariance do not always have lower relative error, but this is expected, because the true covariance is null in this special case.  we have presented a method to estimate the covariances of distances estimated from pairwise alignments. it does not require the construction of msas, which are hard to compute and therefore are only approximated in practice. furthermore, it does not rely on phylogenetic trees as it is the case with covariance estimation from joint ml, or in covariance estimation methods that model the covariances as a function of shared branch lengths. tree building is not only a costly process, but is also subject to inference errors. the accuracy of our estimator is comparable to the ml variance estimator. both estimators are biased but in both cases the bias is, for distances below pam, far smaller than their standard deviation. the bias of the covariance estimator becomes worse with declining percentage of anchors. these biases arise because the alignment positions under scrutiny do not constitute an unbiased subsample of the true homologous positions. note that misaligned positions are likely to affect distances from msas too. a solution to this problem would lead to better distance estimates in the first place. in the meanwhile, it is probably best to issue a warning if the percentage of anchors falls below some threshold. the estimation of evolutionary distances is a very important process in molecular evolution, and therefore the covariance estimator presented here will be of use for various applications, such as the construction of gls trees on opa distances, the construction of confidence sets of trees based on the gls test statistic, relative-rate tests, distance-based lateral gene transfer detection, and in general in any process that needs to estimate confidence of distance combinations. 
our covariance estimator can be used together with the ml variance estimator to form covariance matrices. the estimator performs similarly to the ml variance estimator. the estimation of a distance between two biological sequences is a fundamental process in molecular evolution. knowledge of covariances improves any process that compares or combines distances, such as in generalized least-squares phylogenetic tree building, orthology inference, or lateral gene transfer detection. in large-scale analyses, it may be too costly to compute msas every time distances must be compared, and therefore a covariance estimator for distances estimated from pairs aligned independently is desirable. its performance is analyzed through extensive monte carlo simulations, and compared to the well-known variance estimator of ml distances.
 the estimation of a distance between two biological sequences is a fundamental process in molecular evolution. it is usually performed by maximum likelihood on characters aligned either pairwise or jointly in a multiple sequence alignment. estimators for the covariance of pairs from an msa are known, but we are not aware of any solution for cases of pairs aligned independently. in large-scale analyses, it may be too costly to compute msas every time distances must be compared, and therefore a covariance estimator for distances estimated from pairs aligned independently is desirable. knowledge of covariances improves any process that compares or combines distances, such as in generalized least-squares phylogenetic tree building, orthology inference, or lateral gene transfer detection.  in this paper, we introduce an estimator for the covariance of distances from sequences aligned pairwise. its performance is analyzed through extensive monte carlo simulations, and compared to the well-known variance estimator of ml distances. our covariance estimator can be used together with the ml variance estimator to form covariance matrices.  the estimator performs similarly to the ml variance estimator. in particular, it shows no sign of bias when sequence divergence is below pam units. above that distance, the covariances tend to be underestimated, but then ml variances are also underestimated. 