Closed theo-allnutt-bioinformatics closed 12 months ago
Worked it out:
outg<-'outgroup_spp_name'
c<-0
for (x in tree1$tip.label){
c=c+1
if (x==outg){rootnum1<-c}
}
print(rootnum1)
tree1<-reroot(tree1, rootnum1,position=0.5*tree1$edge.length[which(tree1$edge[,2]==rootnum1)])
rootedge.to.singleton(tree1)
Terrific.
Hi,
I want to reroot a tree using a tip label (species name) but 'reroot' requires the tip number, not label. Is there a way to get the tip number of a tip label?
Thanks,
Theo