Wednesday, April 13, 2011

Small change to optim.phylo.ls()

I just made a small change to the least-squares phylogeny inference function optim.phylo.ls() (v0.3) in which I test if the input matrix is an object of class "dist" and if so, convert it to a matrix, i.e.:

if(class(D)=="dist") D<-as.matrix(D)

This is useful because the {ape} function dist.dna() actually creates a lower-triangular distance matrix object, that will not work with my function [although the conversion is easy, as evident above].

1 comment: