Skip to content

Commit b5c5db4

Browse files
committed
Compute linkage using the square form of the consensus matrix
1 parent 8df7010 commit b5c5db4

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

nimfa/examples/all_aml.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,7 @@
107107
from warnings import warn
108108

109109
from scipy.cluster.hierarchy import linkage, leaves_list
110+
from scipy.spatial.distance import squareform
110111
import numpy as np
111112

112113
import nimfa
@@ -170,7 +171,7 @@ def reorder(C):
170171
:type C: `numpy.ndarray`
171172
"""
172173
Y = 1 - C
173-
Z = linkage(Y, method='average')
174+
Z = linkage(squareform(Y), method='average')
174175
ivl = leaves_list(Z)
175176
ivl = ivl[::-1]
176177
return C[:, ivl][ivl, :]

nimfa/examples/medulloblastoma.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@
9898
from warnings import warn
9999

100100
from scipy.cluster.hierarchy import linkage, leaves_list
101+
from scipy.spatial.distance import squareform
101102
import numpy as np
102103

103104
import nimfa
@@ -160,7 +161,7 @@ def reorder(C):
160161
:type C: `numpy.ndarray`
161162
"""
162163
Y = 1 - C
163-
Z = linkage(Y, method='average')
164+
Z = linkage(squareform(Y), method='average')
164165
ivl = leaves_list(Z)
165166
ivl = ivl[::-1]
166167
return C[:, ivl][ivl, :]

0 commit comments

Comments
 (0)