if (FALSE) {
data("dna.obj")
x<-dna.obj
### Method for signature 'Parsimnet'.
## Statistical parsimony with 95
p<-parsimnet(x)
p
## Plotting with default parameters.
plot(p)
## Displaying vertex labels of intermediate haplotypes.
plot(p, inter.labels=TRUE)
## Interactively adjusting vertex positions.
plot(p, interactive=TRUE)
## Interactively adjusting and saving vertex positions.
p<-parsimnet(x)
#saving vertex positions as x,y coordinates.
coo<-plot(p,interactive=TRUE)
#reuse saved coordinates.
plot(p,coord=coo)
## Adjusting vertex sizes.
plot(p, vertex.cex=c(rep(3,nrow(p@d[[1]]))))
# different sizes for haplotypes and intermediates
plot(p, vertex.cex=c(rep(3,p@nhap),rep(1,c(nrow(p@d[[1]])-p@nhap))))
## Adjusting vertex colors
# different color for haplotypes and intermediates
plot(p, vertex.col=c(rep("magenta",p@nhap),rep("deepskyblue3",c(nrow(p@d[[1]])-p@nhap))))
## Statistical parsimony with 98
p<-parsimnet(x,prob=.99)
p
#plot the first network
plot(p,net=1)
#plot the second network
plot(p,net=2)
#plot the third network. It is a single vertex.
plot(p,net=3)
}
Run the code above in your browser using DataLab