Skip to content

Commit

Permalink
Compute linkage using the square form of the consensus matrix
Browse files Browse the repository at this point in the history
  • Loading branch information
marinkaz committed Mar 26, 2015
1 parent 8df7010 commit b5c5db4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion nimfa/examples/all_aml.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@
from warnings import warn

from scipy.cluster.hierarchy import linkage, leaves_list
from scipy.spatial.distance import squareform
import numpy as np

import nimfa
Expand Down Expand Up @@ -170,7 +171,7 @@ def reorder(C):
:type C: `numpy.ndarray`
"""
Y = 1 - C
Z = linkage(Y, method='average')
Z = linkage(squareform(Y), method='average')
ivl = leaves_list(Z)
ivl = ivl[::-1]
return C[:, ivl][ivl, :]
Expand Down
3 changes: 2 additions & 1 deletion nimfa/examples/medulloblastoma.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@
from warnings import warn

from scipy.cluster.hierarchy import linkage, leaves_list
from scipy.spatial.distance import squareform
import numpy as np

import nimfa
Expand Down Expand Up @@ -160,7 +161,7 @@ def reorder(C):
:type C: `numpy.ndarray`
"""
Y = 1 - C
Z = linkage(Y, method='average')
Z = linkage(squareform(Y), method='average')
ivl = leaves_list(Z)
ivl = ivl[::-1]
return C[:, ivl][ivl, :]
Expand Down

0 comments on commit b5c5db4

Please sign in to comment.