haploNet computes a haplotype network. There is a plot method
and two conversion functions towards other packages.haploNet(h, d = NULL)
## S3 method for class 'haploNet':
print(x, ...)
## S3 method for class 'haploNet':
plot(x, size = 1, col = "black", bg = "white",
col.link = "black", lwd = 1, lty = 1, pie = NULL,
labels = TRUE, font = 2, cex = 1, scale.ratio = 1,
asp = 1, legend = FALSE, fast = FALSE, show.mutation = TRUE,
threshold = c(1, 2), ...)
## S3 method for class 'haploNet':
as.network(x, directed = FALSE, altlinks = TRUE, ...)
## S3 method for class 'haploNet':
as.igraph(x, directed = FALSE, use.labels = TRUE,
altlinks = TRUE, ...)"haplotype"."haploNet".pie = NULL), or the colours of
the slices of the pies; eventually recycled.FALSE by default. If TRUE, the user is asked
to click where to draw the legend.FALSE by default.threshold = 0, alternative links are not drawn
at all.FALSE by default).TRUE by default.plot.haploNet returns an object of class "haploNet" which is
a matrix where each row represents a link in the network, the first
and second columns give the numbers of the linked haplotypes, the
third column, named "step", gives the number of steps in this
link, and the fourth column, named "Prob", gives the
probability of a parsimonious link as given by Templeton et
al. (1992). There are three additional attributes: "freq", the
absolute frequencies of each haplotype, "labels", their labels,
and "alter.links", the alternative links of the network. as.network and as.igraph return objects of the
appropriate class.
dist.dna).
Users may specify their own distance with the argument d. There
is no check of labels, so the user must make sure that the distances
are ordered in the same way than the haplotypes.haplotype, haploFreq, replot,
diffHaplo, mst## generate some artificial data from 'woodmouse':
data(woodmouse)
x <- woodmouse[sample(15, size = 110, replace = TRUE), ]
h <- haplotype(x)
(net <- haploNet(h))
plot(net)
## symbol sizes equal to haplotype sizes:
plot(net, size = attr(net, "freq"), fast = TRUE)
plot(net, size = attr(net, "freq"))
plot(net, size=attr(net, "freq"), scale.ratio = 2, cex = 0.8)Run the code above in your browser using DataLab