toNewick function

convert representation of phylogenetic tree as a moment L-matrix to Newick form

convert representation of phylogenetic tree as a moment L-matrix to Newick form

function converts a tree in moment format to Newick format.

The input can be an L-matrix object, a square LL matrix, or an LL matrix in reduced upper-triangular (vector) form.

The toNewick function sets its list output to class L-Newick, which has 55 components, including the tree in Newick format.

toNewick(L, type = NULL, tip.label = NULL)

Arguments

  • L: L can be an L-matrix object, a square LL matrix, or an LL matrix in reduced upper-triangular (vector) form.
  • type: if L is not a L-matrix object, either 'square' or 'ut' as listed above
  • tip.label: Character vector containing labels for tips. If null, labels default to "a"-"z" it at most 26; otherwise, 3-letter labels of the form "aaa", "aab",...

Details

An L-matrix object is a list with 5 components: "L" is the L-matrix in square form. "L.ut" is the L-matrix in upper-triangular form. "Newick" is the Newick representation of the tree. "tip.label" is the character vector of tip labels. "tip.label.n" is the number of tips.

Returns

a Newick representation of the phylogenetic tree corresponding to the input

References

K Phillips, Symbolic Computation of the Central Moments of the Multivariate Normal Distribution, Journal of Statistical Software, 2010.

J. Felsenstein, The Newick tree format, 1990, http://evolution.genetics.washington.edu/phylip/newicktree.html

P.W. Diaconis and S. Holmes, Matchings and Phylogenetic Trees, Proc. Natl. Acad. Sci., 1998, 95(25), 14600-14602

Author(s)

Kem Phillips kemphillips@comcast.net

See Also

functions toMoment and toMatching

Examples

# create a Newick object exam.Newick <- "(((a,b),c),d);" # convert to a moment L-matrix exam.moment <- toMoment(exam.Newick) # convert back to Newick format backto.Newick <- toNewick(exam.moment)
  • Maintainer: Kem Phillips
  • License: GPL
  • Last published: 2020-02-05

Useful links