I'm trying to use haploNet function of {pegas} to plot a haplotype network, but i`m having trouble putting equal haplotypes from different populations in a same piechart. I can build a haplotype net with the following script:
x <- read.dna(file="x.fas",format="fasta")
h <- haplotype(x)
net <- haploNet(h)
plot(net)
I'd like to set in the dnabin data the label of the original population of each taxa, so i could have piecharts of different colors (of haplotypes from different populations) in the resulting network. I'd like also to remove overlapping circles in the resulting haplotype network.
Thanks for any help!
An example:
> data(woodmouse)
> x <- woodmouse[sample(15, size = 110, replace = TRUE), ]
> h <- haplotype(x)
> net <- haploNet(h)
> plot(net, size=attr(net, "freq"), scale.ratio = 2, cex = 0.8)
This script is used to build an haplotype network using {pegas}. The bigger circles represent much more haplotypes of some type. I`d like to know how I could set in the dnabin matrix the origin of the haplotypes, so they would appear with different colors in the network.
dnabin matrix
? What are the populations in your sample? Again, being as specific as possible as to what the desired output should be. Are you sure these functions calculate the values you wish to plot? Try to explain that data to some one unfamiliar with the package (becausepegas
doesn't seem to be a very common one here) because often users can modify a plotting function to create whatever you want, as long as you are very specific about what you want and where the data is coming from. I still think this question is lacking in sufficient detail to be answerable. – MrFlick Sep 10 '14 at 1:47