The Hadamard transform can be used to estimate
phylogenetic trees from molecular data.
Phylogenetics is the subfield of
evolutionary biology focused on understanding the relationships among organisms. A Hadamard transform applied to a vector (or matrix) of site pattern frequencies obtained from a DNA
multiple sequence alignment can be used to generate another vector that carries information about the tree topology. The invertible nature of the phylogenetic Hadamard transform also allows the calculation of site likelihoods from a tree topology vector, allowing one to use the Hadamard transform for
maximum likelihood estimation of phylogenetic trees. However, the latter application is less useful than the transformation from the site pattern vector to the tree vector because there are other ways to calculate site likelihoods that are much more efficient. However, the invertible nature of the phylogenetic Hadamard transform does provide an elegant tool for mathematic phylogenetics. The mechanics of the phylogenetic Hadamard transform involve the calculation of a vector \gamma(T) that provides information about the topology and branch lengths for tree T using the
site pattern vector or matrix s(T). \gamma(T) = H^{-1}(\ln(Hs(T))) where H is the Hadamard matrix of the appropriate size. This equation can be rewritten as a series of three equations to simplify its interpretation: \begin{align} r &= H s(T) \\ \rho &= \ln r \\ \gamma(T) &= H^{-1}\rho \end{align} The invertible nature of this equation allows one to calculate an expected site pattern vector (or matrix) as follows: s(T)=H^{-1}(\exp(H\gamma(T))) We can use the Cavender–Farris–
Neyman (CFN) two-state
substitution model for DNA by encoding the
nucleotides as binary characters (the
purines A and G are encoded as R and the
pyrimidines C and T are encoded as Y). This makes it possible to encode the multiple sequence alignment as the site pattern vector s(T) that can be converted to a tree vector \gamma(T), as shown in the following example: The example shown in this table uses the simplified three equation scheme and it is for a four taxon tree that can be written as ((A,B),(C,D)); in
newick format. The site patterns are written in the order ABCD. This particular tree has two long terminal branches (0.2
transversion substitutions per site), two short terminal branches (0.025 transversion substitutions per site), and a short internal branch (0.025 transversion substitutions per site); thus, it would be written as ((A:0.025,B:0.2):0.025,(C:0.025,D:0.2)); in newick format. This tree will exhibit
long branch attraction if the data are analyzed using the
maximum parsimony criterion (assuming the sequence analyzed is long enough for the observed site pattern frequencies to be close to the expected frequencies shown in the s(T)=H^{-1}\rho column). The long branch attraction reflects the fact that the expected number of site patterns with index 6 -- which support the tree ((A,C),(B,D)); -- exceed the expected number of site patterns that support the true tree (index 4). Obviously, the invertible nature of the phylogenetic Hadamard transform means that the tree vector means that the tree vector \gamma(T) corresponds to the correct tree. Parsimony analysis after the transformation is therefore
statistically consistent, as would be a standard maximum likelihood analysis using the correct model (in this case the CFN model). Note that the site pattern with 0 corresponds to the sites that have not changed (after encoding the nucleotides as purines or pyrimidines). The indices with asterisks (3, 5, and 6) are "parsimony-informative", and. the remaining indices represent site patterns where a single taxon differs from the other three taxa (so they are the equivalent of terminal branch lengths in a standard maximum likelihood phylogenetic tree). If one wishes to use nucleotide data without recoding as R and Y (and ultimately as 0 and 1) it is possible to encode the site patterns as a matrix. If we consider a four-taxon tree there are a total of 256 site patterns (four nucleotides to the 4th power). However, symmetries of the
Kimura three-parameter (or K81) model allow us to reduce the 256 possible site patterns for DNA to 64 patterns, making it possible to encode the nucleotide data for a four-taxon tree as an 8 × 8 matrix in a manner similar to the vector of 8 elements used above for transversion (RY) site patterns. This is accomplished by recoding the data using the
Klein four-group: As with RY data, site patterns are indexed relative to the base in the arbitrarily chosen first taxon with the bases in the subsequent taxa encoded relative to that first base. Thus, the first taxon receives the bit pair (0,0). Using those bit pairs one can produce two vectors similar to the RY vectors and then populate the matrix using those vectors. This can be illustrated using the example from Hendy et al. (1994),). If we consider the site pattern AAGG it would to binary pattern 0000 for the second element of the Klein group bit pair and 0011 for the first element. in this case binary pattern based on the first element first element corresponds to index 3 (so row 3 in column 0; indicated with a single asterisk in the table). The site patterns GGAA, CCTT, and TTCC would be encoded in the exact same way. The site pattern AACT would be encoded with binary pattern 0011 based on the second element and 0001 based on the first element; this yields index 1 for the first element and index 3 for the second. The index based on the second
Klein group bit pair is multiplied by 8 to yield the column index (in this case it would be column 24) The cell that would include the count of AACT site patterns is indicated with two asterisks; however, the absence of a number in the example indicates that the sequence alignment include no AACT site patterns (likewise, CCAG, GGTC, and TTGA site patterns, which would be encoded in the same way, are absent). == Other applications ==