guix-commits
[Top][All Lists]
Advanced

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

31/57: gnu: Add python-cyvcf2.


From: guix-commits
Subject: 31/57: gnu: Add python-cyvcf2.
Date: Mon, 22 Apr 2024 05:36:30 -0400 (EDT)

rekado pushed a commit to branch master
in repository guix.

commit 78d24b78d36a333576a7a32c03a191eff4e449f4
Author: Alexis Simon <alexis.simon@runbox.com>
AuthorDate: Thu Apr 18 11:10:22 2024 +0200

    gnu: Add python-cyvcf2.
    
    * gnu/packages/bioinformatics.scm (python-cyvcf2): New variable.
    
    Co-authored-by: Ricardo Wurmus <rekado@elephly.net>
    Change-Id: I0db07e7b5840f5c1f5c68512ffabb3d6b39ab95c
---
 gnu/packages/bioinformatics.scm | 53 +++++++++++++++++++++++++++++++++++++++++
 1 file changed, 53 insertions(+)

diff --git a/gnu/packages/bioinformatics.scm b/gnu/packages/bioinformatics.scm
index c2e9f209bc..1bc451715c 100644
--- a/gnu/packages/bioinformatics.scm
+++ b/gnu/packages/bioinformatics.scm
@@ -25,6 +25,7 @@
 ;;; Copyright © 2021 Felix Gruber <felgru@posteo.net>
 ;;; Copyright © 2022, 2023 Navid Afkhami <navid.afkhami@mdc-berlin.de>
 ;;; Copyright © 2022 Antero Mejr <antero@mailbox.org>
+;;; Copyright © 2024 Alexis Simon <alexis.simon@runbox.com>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -1916,6 +1917,58 @@ from high-throughput single-cell RNA sequencing 
(scRNA-seq) data.")
 and sequence consensus.")
     (license license:expat)))
 
+(define-public python-cyvcf2
+  (package
+    (name "python-cyvcf2")
+    (version "0.30.28")
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/brentp/cyvcf2";)
+             (commit (string-append "v" version))))
+       (file-name (git-file-name name version))
+       (sha256
+        (base32 "16yhfax509zyip8kkq2b0lflx5bdq5why7d785ayrqyzzq2rxqkk"))
+       (modules '((guix build utils)))
+       (snippet
+        ;; Delete bundled library
+        '(delete-file-recursively "htslib"))))
+    (build-system pyproject-build-system)
+    (arguments
+     (list
+      #:phases
+      #~(modify-phases %standard-phases
+          (add-before 'check 'build-extensions
+            (lambda _
+              ;; Cython extensions have to be built before running the tests.
+              (invoke "python" "setup.py" "build_ext" "--inplace")))
+          (add-after 'unpack 'fix-setup
+            (lambda* (#:key inputs #:allow-other-keys)
+              (substitute* "setup.py"
+                (("^htslib_include_dirs =.*")
+                 (string-append "htslib_include_dirs = [\""
+                                #$(this-package-input "htslib") 
"/include\"]\n"))
+                (("lib_name = \"libhts.so\"")
+                 (string-append "lib_name = \""
+                                (search-input-file inputs "lib/libhts.so.3")
+                                "\"\n")))))
+          (add-before 'build 'use-system-htslib-package
+            (lambda _
+              (setenv "CYTHONIZE" "1")
+              (setenv "CYVCF2_HTSLIB_MODE" "EXTERNAL"))))))
+    (inputs (list curl htslib libdeflate openssl zlib))
+    (native-inputs (list python-cython python-pytest))
+    (propagated-inputs
+     (list python-click
+           python-coloredlogs
+           python-numpy))
+    (home-page "https://github.com/brentp/cyvcf2/";)
+    (synopsis "Fast vcf file parsing with Cython and htslib")
+    (description "Cyvcf2 is a Cython wrapper around htslib built for fast
+parsing of Variant Call Format (VCF) files.")
+    (license license:expat)))
+
 (define-public python-decoupler-py
   ;; This latest commit fixes a bug in test_omnip.py.
   (let ((commit "459b235348ddd9135217a3722d9dd1caa9a14ace")



reply via email to

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