Glad to see you figured it out, but I'm still a bit worried that your read.tree seems to give an unrooted tree. I don't think it's due to differences in reading from file versus command line:
> tree=read.tree(file="tree.nh")
> tree
Phylogenetic tree with 4 tips and 3 internal nodes.
Tip labels: [1] "AMEM" "AARA" "AGAP" "" Node labels: [1] ""
"AMEC" "AQUA"
Rooted; includes branch lengths.
What version of ape are you using?
> sessionInfo()
R version 3.2.3 Patched (2015-12-22 r69809)
Platform: x86_64-suse-linux-gnu (64-bit)
Running under: openSUSE 13.1 (Bottle) (x86_64)
locale:
[1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C
[3] LC_TIME=en_US.UTF-8 LC_COLLATE=en_US.UTF-8
[5] LC_MONETARY=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8
[7] LC_PAPER=en_US.UTF-8 LC_NAME=C
[9] LC_ADDRESS=C LC_TELEPHONE=C
[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] ape_3.4
loaded via a namespace (and not attached):
[1] nlme_3.1-126 grid_3.2.3 lattice_0.20-33
That tree shows up as rooted for me:
I got the same as Fanli.gcb when i ran on Ape too. Plot the tree, you will see if its rooted or not. Maybe there is a problem with function to check rooting or something.
This is very strange. I am still getting:
When I plotted it is still not rooted. I tried to read in the tree independently from the same information I have given you and I still got the above message, using no arguments other than file for read.tree. The fact that two of you got the same means there's something wrong my end, though I am not sure what it might be.
Ok I think I know what my issue is. I was using read.tree(file = "filename") which seems to result in an unrooted tree. You guys did read.tree(), and then entered tree details on the next line, as fanli.gcb already showed. However, how can I do this if I need to read in 7000 files? To be clear, I am talking about the difference between this:
Which produces an unrooted tree, and this:
Which produces the rooted tree. What I need to know is how to achieve the latter tree when reading in multiple files?