diff --git a/decoupler/method_gsva.py b/decoupler/method_gsva.py index 32570ce..04455f6 100644 --- a/decoupler/method_gsva.py +++ b/decoupler/method_gsva.py @@ -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)