Last chance! 50% off unlimited learning
Sale ends in
snpgdsHCluster(dist, sample.id=NULL, need.mat=TRUE, hang=0.25)
snpgdsDiss
,
an object of "snpgdsIBSClass" from snpgdsIBS
, or
a square matrix for dissimilarityhclust
need.mat = TRUE
hclust
to perform hierarchical cluster
analysis, using method="average"
.
snpgdsIBS
, snpgdsDiss
,
snpgdsCutTree
# open an example dataset (HapMap)
genofile <- snpgdsOpen(snpgdsExampleFileName())
pop.group <- read.gdsn(index.gdsn(genofile, "sample.annot/pop.group"))
pop.group <- as.factor(pop.group)
pop.level <- levels(pop.group)
diss <- snpgdsDiss(genofile)
hc <- snpgdsHCluster(diss)
rv <- snpgdsCutTree(hc)
rv
# call 'plot' to draw a dendrogram
plot(rv$dendrogram, leaflab="none", main="HapMap Phase II")
# the distribution of Z scores
snpgdsDrawTree(rv, type="z-score", main="HapMap Phase II")
# draw dendrogram
snpgdsDrawTree(rv, main="HapMap Phase II",
edgePar=list(col=rgb(0.5,0.5,0.5, 0.75), t.col="black"))
# close the file
snpgdsClose(genofile)
Run the code above in your browser using DataLab