Skip to content

Commit

Permalink
Fixed gsva bug with dense
Browse files Browse the repository at this point in the history
  • Loading branch information
PauBadiaM committed Aug 8, 2024
1 parent 411fa7d commit 1f12c5b
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions decoupler/method_gsva.py
Original file line number Diff line number Diff line change
Expand Up @@ -291,9 +291,10 @@ def run_gsva(mat, net, source='source', target='target', kcdf='gaussian', mx_dif
# Remove repeated features
if issparse(m):
m = m.toarray()
msk = ~np.all(m == m[0, :], axis=0)
m = m[:, msk]
c = c[msk]
if m.shape[0] > 1:
msk = ~np.all(m == m[0, :], axis=0)
m = m[:, msk]
c = c[msk]

# Transform net
net = rename_net(net, source=source, target=target, weight=None)
Expand Down

0 comments on commit 1f12c5b

Please sign in to comment.