phylogenetic tree color tip as cultivar

83 views
Skip to first unread message

Mohamad Ali El Chami

unread,
Jun 13, 2022, 7:14:58 AM6/13/22
to poppr
Hi to all , 

I am runing a phylogenetic analysis for a tree specie using microsatlites marker . The tree is " nj " using aboot function. 

I would like to color the edge of the tree or the individuals according to cultivars on my excel sheet and to add also a legend for the colors  . Any help?  I tied to use  " plot.phylo: Plot Phylogenies " to manipulate the tree but I could not know how to do it correctly. 

Thanks in advance 

Zhian Kamvar

unread,
Jun 14, 2022, 8:41:50 PM6/14/22
to Mohamad Ali El Chami, poppr
Hello,

We cover this situation in the populations structure chapter of Population Genetics in R: https://grunwaldlab.github.io/Population_Genetics_in_R/Pop_Structure.html

In general, you will create a vector of colors per population, subset it with the population assignments of each sample, and then pass that vector to plot.phylo in the tip.color parameter

hope that helps.

Best,
Zhian

--
You received this message because you are subscribed to the Google Groups "poppr" group.
To unsubscribe from this group and stop receiving emails from it, send an email to poppr+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/poppr/57e49068-c4c4-4abc-8087-4146557a3355n%40googlegroups.com.

Mohamad Ali El Chami

unread,
Jun 21, 2022, 2:03:33 PM6/21/22
to po...@googlegroups.com, Zhian Kamvar
Thanks a lot. I made the tree and I tried to color the individuals !!!

I had another issue please if you can help ; 

So  when I made the tree with a bootstrap using aboot function with this code   ( phylo<-aboot(obj, dist = nei.dist, sample = 67, tree = "nj", cutoff = 50, quiet = TRUE) I got the value on the branches but when I want to plot this using the plot.phylo to color parameter with the code ( plot.phylo(phylo,cex = 0.6,font = 10, adj = 0, tip.color = cols[obj$pop],
           label.offset = 0.0125) I lost the bootstrap value and the tree is quite different from the one made with aboot , any explanation why the two trees are not the same  and how to get the bootstrap value back, I tried to use the code  ( nodelabels(phylo$node.label,
           adj = c(1.3, -0.5), frame = "n",cex = 0.5,
           font = 3, xpd=T) . Is it for bootstrapping ? when i used it I am getting some value on some branches but the value have like 10 numbers after the coma like ( 50.987634783837)


Thanks a lot for your help and for all these good packages. 
Reply all
Reply to author
Forward
0 new messages