Contenido principal

seqneighjoin

Construct phylogenetic tree using neighbor-joining method

    Description

    PhyloTree = seqneighjoin(Distances) computes a phylogenetic tree object from pairwise distances between the species or products, using the neighbor-joining method.

    PhyloTree = seqneighjoin(Distances,Method) specifies a method to compute the distances of the new nodes to all other nodes at every iteration. The general expression to calculate the distances between the new node, n, after joining i and j and all other nodes (k), is given by

    D(n,k) =  a*D(i,k) + (1-a)*D(j,k) - a*D(n,i) - (1-a)*D(n,j)

    This expression is guaranteed to find the correct tree with additive data (minimum variance reduction).

    PhyloTree = seqneighjoin(Distances,Method,Names) passes a list of names (such as species or products), to label the leaf nodes in the phylogenetic tree object.

    example

    PhyloTree = seqneighjoin(___,Reroot=RerootValue) specifies whether to reroot PhyloTree. When PhyloTree is false, seqneighjoin excludes rerooting the resulting tree, which is useful for observing the original linkage order followed by the algorithm. By default seqneighjoin reroots the resulting tree using the midpoint method.

    Examples

    collapse all

    Create an array of structures representing a multiple alignment of amino acids:

    seqs = fastaread('pf00002.fa');

    Measure the Jukes-Cantor pairwise distances between sequences.

    distances = seqpdist(seqs,'method','jukes-cantor','indels','pair');

    Use the output argument distances, a vector containing biological distances between each pair of sequences, as an input argument to seqneighjoin.

    Build the phylogenetic tree for the multiple sequence alignment using the neighbor-joining algorithm. Specify the method to compute the distances of the new nodes to all other nodes.

    phylotree = seqneighjoin(distances,'equivar',seqs)
        Phylogenetic tree object with 32 leaves (31 branches)
    

    View the phylogenetic tree:

    view(phylotree)

    Figure Phylogenetic Tree 1 contains an axes object and other objects of type uigridlayout, uimenu. The axes object contains 69 objects of type line. One or more of the lines displays its values using only markers

    Input Arguments

    collapse all

    Biological distances between pairs of sequences, specified as a matrix or vector, such as returned by the seqpdist function.

    Data Types: double

    Method to compute the distances between nodes, specified as "equivar" or "firstorder".

    • "equivar" — Assumes equal variance and independence of evolutionary distance estimates (a = 1/2), such as in the original neighbor-joining algorithm by Saitou and Nei, JMBE (1987) or as in Studier and Keppler, JMBE (1988).

    • "firstorder" — Assumes a first-order model of the variances and covariances of evolutionary distance estimates, with 'a' being adjusted at every iteration to a value between 0 and 1, such as in Gascuel, JMBE (1997).

    Data Types: char | string

    List of names, specified as one of these values:

    • Vector of structures with the fields Header and Name

    • Cell array of character vectors or string vector

    The number of elements must equal the number of samples used to generate the pairwise distances in Distances.

    Data Types: struct | string | cell

    Control to reroot PhyloTree, specified as a true or false. When this value is false, seqneighjoin excludes rerooting the resulting tree, which is useful for observing the original linkage order followed by the algorithm. By default seqneighjoin reroots the resulting tree using the midpoint method.

    Data Types: logical

    Output Arguments

    collapse all

    Biological distances between pairs of sequences, returned as a phytree object.

    References

    [1] Saitou, N., and M. Nei. The neighbor-joining method: A new method for reconstructing phylogenetic trees. Molecular Biology and Evolution 4(4) (1987): 406–425.

    [2] Gascuel, O. BIONJ: An improved version of the NJ algorithm based on a simple model of sequence data. Molecular Biology and Evolution 14 (1997): 685–695.

    [3] Studier, J.A., and K.J. Keppler. A note on the neighbor-joining algorithm of Saitou and Nei. Molecular Biology and Evolution 5(6) (1988): 729–731.

    Version History

    Introduced before R2006a