summary refs log tree commit diff
path: root/gnu
diff options
context:
space:
mode:
authorRicardo Wurmus <rekado@elephly.net>2024-01-10 14:39:12 +0100
committerRicardo Wurmus <rekado@elephly.net>2024-01-16 12:44:36 +0100
commitcda0f029d6542b81e0a019299ff0c59d01eb2af1 (patch)
tree3f5efc5a6b1d4d0b2cddc06fb794b594abb1f3b2 /gnu
parent3ce25c212f4bc86d0ceeebd2d668590dbc780249 (diff)
downloadguix-cda0f029d6542b81e0a019299ff0c59d01eb2af1.tar.gz
gnu: python-hicexplorer: Make compatible with latest scipy.
* gnu/packages/bioinformatics.scm (python-hicexplorer)[arguments]: Add
'scipy-compatibility phase.

Change-Id: I31e9058b7fd4ff9245837d5f1cd145b569ec35ad
Diffstat (limited to 'gnu')
-rw-r--r--gnu/packages/bioinformatics.scm13
1 files changed, 12 insertions, 1 deletions
diff --git a/gnu/packages/bioinformatics.scm b/gnu/packages/bioinformatics.scm
index 36dbad592e..c05ca19022 100644
--- a/gnu/packages/bioinformatics.scm
+++ b/gnu/packages/bioinformatics.scm
@@ -17147,7 +17147,18 @@ the HiCExplorer and pyGenomeTracks packages.")
                                "general/test_hicHyperoptDetectLoopsHiCCUPS.py"
                                "general/test_hicAggregateContacts.py"
                                "general/test_hicInterIntraTAD.py")
-                  (("^memory =.*") "memory = 1\n"))))))))
+                  (("^memory =.*") "memory = 1\n")))))
+          ;; This is fixed in version 3.7.3, but we cannot upgrade yet as we
+          ;; don't have Pandas 2.
+          (add-after 'unpack 'scipy-compatibility
+            (lambda _
+              (substitute* "hicexplorer/hicAverageRegions.py"
+                (("from scipy.sparse import csr_matrix, save_npz, lil_matrix")
+                 "from scipy.sparse import csr_matrix, save_npz, lil_matrix, coo_matrix")
+                (("summed_matrix = np.array\\(summed_matrix\\)")
+                 "summed_matrix = coo_matrix(summed_matrix)")
+                (("data = summed_matrix\\[np.nonzero\\(summed_matrix\\)\\]")
+                 "data = summed_matrix.toarray()[np.nonzero(summed_matrix)]")))))))
     (propagated-inputs
      (list python-biopython
            python-cleanlab-1