guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

42/47: gnu: python-hicexplorer: Make compatible with latest scipy.


From: guix-commits
Subject: 42/47: gnu: python-hicexplorer: Make compatible with latest scipy.
Date: Wed, 10 Jan 2024 14:53:01 -0500 (EST)

rekado pushed a commit to branch wip-python-science
in repository guix.

commit 68315b8c5141c0d3da4c38e9a2dd02a2edea8fde
Author: Ricardo Wurmus <rekado@elephly.net>
AuthorDate: Wed Jan 10 14:39:12 2024 +0100

    gnu: python-hicexplorer: Make compatible with latest scipy.
    
    * gnu/packages/bioinformatics.scm (python-hicexplorer)[arguments]: Add
    'scipy-compatibility phase.
    
    Change-Id: I31e9058b7fd4ff9245837d5f1cd145b569ec35ad
---
 gnu/packages/bioinformatics.scm | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/bioinformatics.scm b/gnu/packages/bioinformatics.scm
index 7aed014a52..1df76d4d55 100644
--- a/gnu/packages/bioinformatics.scm
+++ b/gnu/packages/bioinformatics.scm
@@ -17088,7 +17088,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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]