Populations and haplotype networks

Please update ‘haplotypes’ package to version 1.1

 
install.packages("haplotypes")
require("haplotypes") 

1-Read your DNA data in fasta format, in this example, system file ‘example.fas’ was used.

f<-system.file("example.fas",package="haplotypes")
x<-read.fas(file=f)

2- Infer haplotypes from DNA sequences, in this example, indels are coded separately following the simple indel coding method. They can be coded as a fifth state character or as missing. Conduct statistical parsimony analysis with %95 connection limit. Again indels are coded following the simple indel coding method.

h<-haplotypes::haplotype(x,indels="s")
p<-parsimnet(x,indels="s")

3-Define your populations, in this example it is randomly generated (change set.seed for different results).

#randomly generated populations
pop<-c("pop1","pop2","pop3","pop4","pop5","pop6","pop7","pop8")
set.seed(5)
pops<-sample(pop,nrow(x),replace=TRUE)

4-Plot pies with default parameters

pieplot(p,h,1, pops)

Please see help file for more examples…

?pieplot