Drawing a phylogenetic tree

39 Views Asked by At

I am trying to plot a phylogenetic tree (nexus file from 10k trees) using the ape package.

However, when trying to plot said tree, it always says that there are too few tips

> plot.phylo(primatetree)
NULL
Warning message:
In plot.phylo(primatetree) : found fewer than 2 tips in the tree

I also get the following-

> primatetree
100 phylogenetic trees

As I understand it should list the number of tips and nodes too, and should just be one tree as opposed to 100?

I'm not sure if anyone has experience with "10k trees" but I haven't found the guidance on the page particularly helpful.

1

There are 1 best solutions below

0
Thomas Guillerme On

From the code you shared it looks like primatetree is a "multiPhylo" object, i.e. a list of multiple trees (100 in you case).

class(primatetree)
# Should be: [1] "multiPhylo"

You can select individual trees by indexing them. For example to access the first tree you can use:

my_first_tree <- primatetree[[1]]
class(my_first_tree)
# Should be: [1] "phylo"
plot(my_first_tree)