Phylogenetic tree in Adegenet
0
1
Entering edit mode
8.7 years ago
akang ▴ 110

I am using a R package called adegenet to plot the nj tree from plink files. In my plink file (input.raw) FID and IID are the same. So i have 3 questions here 1)Should FID be replaced with population name in the raw file? 2)Is there a way of providing population name separately in adegenet? 3)How can I color the clusters in a tree with different colours?

I did this

tre<-nj(D)
plot(tre, type = "unr", show.tip.lab = TRUE, cex=0.3, font=1, edge.col="Blue")

So all the edges turn blue. But i want edge color according to clusters. Is there a way?Ill appreciate any help.TIA!

Adegenet Phylogenetic Tree Plink • 2.8k views
ADD COMMENT
1
Entering edit mode

This is one way of doing it

  plot(tre, type = "unr", show.tip.lab = TRUE, cex=0.3, font=1, edge.col=c("Blue", "Red", "Green", "Yellow")[D$pop])
ADD REPLY

Login before adding your answer.

Traffic: 2679 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6