4

我正在使用 R 对我命名为“tissuedata”的矩阵进行聚类。我有一个使用以下代码生成的 hclust 对象:

    TissueDist<-dist(tissuedata, method="euclidean")
    TissueClust<-hclust(TissueDist, method='complete')

现在我想从 TissueClust 中打印出行名,同时保留聚集行的顺序。有什么建议么?

以下是“组织数据”矩阵可能包含的内容的示例:

                                          Brain      Bone    Breast      Lung Ovary  Pancreas      HeLa
    17271422_17271984_ENSG00000026025 -3.266758  0.000000 -3.215719 -5.248721     0 -2.891329 -3.718194
    17272608_17272709_ENSG00000026025 -4.304518 -4.560667 -3.359868  0.000000     0 -3.108627 -4.227678
    17272632_17272709_ENSG00000026025 -4.188425 -4.444906 -3.243362  0.000000     0 -2.992122 -4.111259
    17272649_17272709_ENSG00000026025 -3.984628 -4.338187 -3.104413  0.000000     0 -2.791452 -3.828157
    17275586_17275681_ENSG00000026025 -3.278478 -3.932706 -2.903414 -4.480172     0 -2.781268 -3.423038
    17276692_17276817_ENSG00000026025 -3.355184 -4.351640 -3.009279  0.000000     0 -3.231431 -4.194499
    17276692_17276850_ENSG00000026025 -3.456211 -4.453457 -3.110306  0.000000     0 -3.332458 -4.294992
    17277845_17277888_ENSG00000026025 -3.842749 -4.195861 -2.661506  0.000000     0 -2.373369 -3.436403
    17277845_17277908_ENSG00000026025 -4.005683 -4.358526 -2.824233  0.000000    -1 -2.536096 -3.599131
4

1 回答 1

6

我不确定我是否正确理解了这个问题......

# $labels gives orginal ordering form matrix
TissueClust$labels

# $order gives the permutation of the original observations
# see ?hclust detail section
TissueClust$order

# not sure, but are you looking for this?
TissueClust$labels[c(TissueClust$order)]

hth

于 2013-08-05T17:54:43.190 回答