## Read example FASTA file.
f<-system.file("example.fas",package="haplotypes")
# invalid character 'N' was replaced with '?' with a warning message
x<-read.fas(file=f)
# an object of class 'Dna'
x
## or load DNA Sequence data set.
data("dna.obj")
x<-dna.obj
if (FALSE) {
x
}
## Compute an absolute pairwise character difference matrix from DNA sequences.
# coding gaps using simple indel coding method
d<- distance(x,indels="sic")
if (FALSE) {
d
}
## Infer haplotypes using the 'Dna' object.
# coding gaps using simple indel coding method
h<-haplotype(x,indels="s")
if (FALSE) {
h
}
## Conduct statistical parsimony analysis with 95% connection limit.
#algortihmic method
if (FALSE) {
p<-parsimnet(x,prob=.95)
p
# plot network
plot(p)
}
## Plotting pie charts on the statistical parsimony network
if (FALSE) {
data("dna.obj")
x<-dna.obj
h<-haplotypes::haplotype(x)
## Statistical parsimony with 95
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)
}
Run the code above in your browser using DataLab