From 895cf8278abab83032b1efb9e050134639491624 Mon Sep 17 00:00:00 2001 From: Ricardo Wurmus Date: Sat, 20 Oct 2018 19:29:37 +0200 Subject: [PATCH] gnu: python-pybedtools: Update to 0.7.10. * gnu/packages/bioinformatics.scm (python2-pybedtools): Update to 0.7.10. [arguments]: Disable broken tests. [propagated-inputs]: Replace bedtools with bedtools-2.26; add python-matplotlib, python-pysam, and python-pyyaml. [native-inputs]: Remove python-pyyaml; add kentutils, python-numpy, python-pandas, and python-six. (python-pybedtools): New variable. --- gnu/packages/bioinformatics.scm | 85 +++++++++++++++++++++++++++------ 1 file changed, 70 insertions(+), 15 deletions(-) diff --git a/gnu/packages/bioinformatics.scm b/gnu/packages/bioinformatics.scm index c5abe6755e..bb9bf00499 100644 --- a/gnu/packages/bioinformatics.scm +++ b/gnu/packages/bioinformatics.scm @@ -596,29 +596,54 @@ input/output delimiter. When the new functionality is not used, bioawk is intended to behave exactly the same as the original BWK awk.") (license license:x11))) -(define-public python2-pybedtools +(define-public python-pybedtools (package - (name "python2-pybedtools") - (version "0.6.9") + (name "python-pybedtools") + (version "0.7.10") (source (origin (method url-fetch) - (uri (string-append - "https://pypi.python.org/packages/source/p/pybedtools/pybedtools-" - version ".tar.gz")) + (uri (pypi-uri "pybedtools" version)) (sha256 (base32 - "1ldzdxw1p4y3g2ignmggsdypvqkcwqwzhdha4rbgpih048z5p4an")))) + "0l2b2wrnj85azfqgr0zwr60f7j58vlla1hcgxvr9rwikpl8j72ji")))) (build-system python-build-system) - (arguments `(#:python ,python-2)) ; no Python 3 support - (inputs - `(("python-matplotlib" ,python2-matplotlib))) + (arguments + `(#:phases + (modify-phases %standard-phases + ;; See https://github.com/daler/pybedtools/issues/261 + (add-after 'unpack 'disable-broken-tests + (lambda _ + ;; This test (pybedtools.test.test_scripts.test_venn_mpl) needs a + ;; graphical environment. + (substitute* "pybedtools/test/test_scripts.py" + (("def test_venn_mpl") + "def _do_not_test_venn_mpl")) + ;; Requires internet access. + (substitute* "pybedtools/test/test_helpers.py" + (("def test_chromsizes") + "def _do_not_test_chromsizes")) + ;; FIXME: these two fail for no good reason. + (substitute* "pybedtools/test/test1.py" + (("def test_issue_157") + "def _do_not_test_issue_157") + (("def test_to_dataframe") + "def _do_not_test_to_dataframe")) + #t))))) (propagated-inputs - `(("bedtools" ,bedtools) - ("samtools" ,samtools))) + ;; Tests don't pass with Bedtools 2.27.1. + ;; See https://github.com/daler/pybedtools/issues/260 + `(("bedtools" ,bedtools-2.26) + ("samtools" ,samtools) + ("python-matplotlib" ,python-matplotlib) + ("python-pysam" ,python-pysam) + ("python-pyyaml" ,python-pyyaml))) (native-inputs - `(("python-cython" ,python2-cython) - ("python-pyyaml" ,python2-pyyaml) - ("python-nose" ,python2-nose))) + `(("python-numpy" ,python-numpy) + ("python-pandas" ,python-pandas) + ("python-cython" ,python-cython) + ("python-nose" ,python-nose) + ("kentutils" ,kentutils) ; for bedGraphToBigWig + ("python-six" ,python-six))) (home-page "https://pythonhosted.org/pybedtools/") (synopsis "Python wrapper for BEDtools programs") (description @@ -628,6 +653,36 @@ pybedtools extends BEDTools by offering feature-level manipulations from with Python.") (license license:gpl2+))) +(define-public python2-pybedtools + (let ((pkg (package-with-python2 python-pybedtools))) + (package (inherit pkg) + (arguments + `(#:modules ((ice-9 ftw) + (srfi srfi-1) + (srfi srfi-26) + (guix build utils) + (guix build python-build-system)) + ;; See https://github.com/daler/pybedtools/issues/192 + ,@(substitute-keyword-arguments (package-arguments pkg) + ((#:phases phases) + `(modify-phases ,phases + (replace 'check + (lambda _ + (let ((cwd (getcwd))) + (setenv "PYTHONPATH" + (string-append cwd "/build/" + (find (cut string-prefix? "lib" <>) + (scandir (string-append cwd "/build"))) + ":" (getenv "PYTHONPATH")))) + ;; The tests need to be run from elsewhere... + (mkdir-p "/tmp/test") + (copy-recursively "pybedtools/test" "/tmp/test") + (with-directory-excursion "/tmp/test" + (invoke "nosetests" + ;; This test fails for unknown reasons + "--exclude=.*test_getting_example_beds")) + #t)))))))))) + (define-public python-biom-format (package (name "python-biom-format")