snpgdsDrawTree | R Documentation |
To draw a dendrogram or the distribution of Z scores
snpgdsDrawTree(obj, clust.count=NULL, dend.idx=NULL,
type=c("dendrogram", "z-score"), yaxis.height=TRUE, yaxis.kinship=TRUE,
y.kinship.baseline=NaN, y.label.kinship=FALSE, outlier.n=NULL,
shadow.col=c(rgb(0.5, 0.5, 0.5, 0.25), rgb(0.5, 0.5, 0.5, 0.05)),
outlier.col=rgb(1, 0.50, 0.50, 0.5), leaflab="none",
labels=NULL, y.label=0.2, ...)
obj |
an object returned by |
clust.count |
the counts for clusters, drawing shadows |
dend.idx |
the index of sub tree, plot obj$dendrogram[[dend.idx]], or NULL for the whole tree |
type |
"dendrogram", draw a dendrogram; or "z-score", draw the distribution of Z score |
yaxis.height |
if TRUE, draw the left Y axis: height of tree |
yaxis.kinship |
if TRUE, draw the right Y axis: kinship coefficient |
y.kinship.baseline |
the baseline value of kinship; if NaN, it is the
height of the first split from top in a dendrogram; only works when
|
y.label.kinship |
if TRUE, show 'PO/FS' etc on the right axis |
outlier.n |
the cluster with size less than or equal to
|
shadow.col |
two colors for shadow |
outlier.col |
the colors for outliers |
leaflab |
a string specifying how leaves are labeled. The default
|
labels |
the legend for different regions |
y.label |
y positions of labels |
... |
Arguments to be passed to the method |
The details will be described in future.
None.
Xiuwen Zheng
snpgdsCutTree
# open an example dataset (HapMap)
genofile <- snpgdsOpen(snpgdsExampleFileName())
pop.group <- as.factor(read.gdsn(index.gdsn(
genofile, "sample.annot/pop.group")))
pop.level <- levels(pop.group)
diss <- snpgdsDiss(genofile)
hc <- snpgdsHCluster(diss)
# close the genotype file
snpgdsClose(genofile)
# split
set.seed(100)
rv <- snpgdsCutTree(hc, label.H=TRUE, label.Z=TRUE)
# draw dendrogram
snpgdsDrawTree(rv, main="HapMap Phase II",
edgePar=list(col=rgb(0.5,0.5,0.5, 0.75), t.col="black"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.