用邻接矩阵聚类 - r

时间:2014-03-13 10:19:57

标签: r

我有一个类型的邻接矩阵:

IDvariant   Amp-Lib1-100913_L1308034_IonXpress-10_TMAP.vcf      Amp-Lib1-100913_L1308034_IonXpress-10_TMAP_2.vcf    Amp-Lib1-100913_L1308034_IonXpress-10_TMAP_3.vcf

3496    1   1   0

3497    1   1   0

3498    1   1   0

3501    0   1   0

3502    0   1   0

...

列名中的样本名称,行名称中的变体ID,如果样本有变量,则为1,否则为0。

我想计算距离此矩阵的距离并绘制一个"群集树"和R的热图。

我按照以下步骤进行:

require(vegan)
data=read.table('adjacency_matrix.txt', header=T, row.names=1)
dist=vegdist(data, method='jaccard')
fit=hclust(dist, method='average')
png(filename='cluster_tree.png')
plot(fit, main='Clustering with Jaccard distance')
dev.off()

我得到一张崩溃的图表。我没有权利发布图片,否则我会展示。

如果有人可以帮助我,请提前谢谢。

0 个答案:

没有答案