data("dna.obj")
x<-dna.obj
h<-haplotypes::haplotype(x)
### Statistical parsimony with 95% connection limit
p<-parsimnet(x)
#randomly generated populations
pop<-c("pop1","pop2","pop3","pop4","pop5","pop6","pop7","pop8")
set.seed(5)
pops<-sample(pop,nrow(x),replace=TRUE)
## Plotting with default parameters.
pieplot(p,h,1, pops)
## Change colors for the populations.
#8 colors for 8 populations
cols<-colors()[c(30,369,552,558,538,642,142,91)]
pieplot(p,h,1, pops,col=cols)
## Expanding pie charts and intermediate vertices.
pieplot(p,h,1, pops,rex=2)
## Adjusting intermediate vertex sizes.
pieplot(p,h,1, pops, vertex.cex=rep(0.2, nrow(p@d[[1]])-p@nhap))
## Expanding pie charts and intermediate vertices, adjusting intermediate vertex sizes.
pieplot(p,h,1, pops,rex=2, vertex.cex=rep(0.1, nrow(p@d[[1]])-p@nhap))
## Adjusting radius of pie charts.
pieplot(p,h,1, pops,radius=rep(1, p@nhap))
if (FALSE) {
## Interactively adjusting vertex positions.
pieplot(p,h,1, pops, interactive=TRUE)
}
### Multiple networks with 99% connection limit.
p<-parsimnet(x,prob=.99)
## Plotting first network with default parameters.
pieplot(p,h,1, pops)
## Change colors for the populations.
#8 colors for 8 populations
cols<-colors()[c(30,369,552,558,538,642,142,91)]
pieplot(p,h,1, pops,col=cols)
Run the code above in your browser using DataLab