Hi Laura.

Unfortunately, this is not implemented in phytools; however there is a workaround which is to attach a tip with a terminal edge length of zero to an internal node. I have described this here:

http://blog.phytools.org/2014/06/constraining-internal-node-values-using.html

Unfortunately, although this works fine with make.simmap - for ace & rerootingMethod you will also have to resolve the polytomy that attaching a tip to a node will have created. You can do this using multi2di. Note that the specific resolution will not affect your ancestral state reconstruction; however you will end up with an extra node! I am working on fixing this for rerootingMethod.

Hopefully this is helpful. All the best, Liam

Liam J. Revell, Assistant Professor of Biology
University of Massachusetts Boston
web: http://faculty.umb.edu/liam.revell/
email: liam.rev...@umb.edu
blog: http://blog.phytools.org

On 6/16/2015 10:19 AM, Jackson, Laura Marie wrote:
Hi All,



I am trying to do ancestral state reconstruction in R using the packages {ape} 
and {phytools}, but these two packages do not seem to handle reconstruction to 
include data at internal nodes.


I was able to run the code for ancestral reconstruction using {Phytools} using 
a sample tree with 6 terminal tips and 3 internal node names. But, the 
reconstruction using this package is not representing internal node states.


I also tried using {ape}, but this package will not run the function due to 
differences between the number of terminal tips and the data (additional data 
for internal nodes).


Do these packages not support this function? I have attached my matrix and tree 
files for reference.


I have used the following script for {phytools}:


simmap <- make.simmap(phylo, matrix, nsim=100)

cols <- cols(�blue�, �red�); names(cols) <- c(�present�, �absent�)

plotSimmap(simmap[[1]], lwd=3, fsize=1, cols)

add.simmap.legend(leg=sort(unique(matrix)), colors=cols, fsize=1)



And the following for {ape}:


anc <- ace(matrix, phylo, type=�d�)


*Which gives an error of "length of phenotypic and phylogenetic data do not
match", that I am guessing is due to the data for the internal node taxa.


Any help with this would be greatly appreciated!

-Laura


---
Laura Jackson
PhD Student
Department of Biology
185 Churchill Haines
University of South Dakota
414 E. Clark St.
Vermillion SD 57069-1746
Email: laura.jack...@usd.edu<mailto:laura.jack...@usd.edu>



        [[alternative HTML version deleted]]



_______________________________________________
R-sig-phylo mailing list - R-sig-phylo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-phylo
Searchable archive at http://www.mail-archive.com/r-sig-phylo@r-project.org/


_______________________________________________
R-sig-phylo mailing list - R-sig-phylo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-phylo
Searchable archive at http://www.mail-archive.com/r-sig-phylo@r-project.org/

Reply via email to