Subject: [PATCH] gnu: Add Eagle.

From: Raoul Jean Piere Bonnal <[email-masked]>
Date: Sat, 7 Jan 2023 15:39:20 +0100

---
 gnu/packages/bioinformatics.scm | 57 +++++++++++++++++++++++++++++++++
 1 file changed, 57 insertions(+)

diff --git a/gnu/packages/bioinformatics.scm b/gnu/packages/bioinformatics.scm
index 6e909773a7..3b9c135c2e 100644
--- a/gnu/packages/bioinformatics.scm
+++ b/gnu/packages/bioinformatics.scm
@@ -3547,6 +3547,63 @@ (define-public discrover
 of nucleic acid binding proteins.")
     (license license:gpl3+)))
 
+(define-public eagle
+  (let ((commit "b8b3ae205d5f9faf99f231fe7d02ae51eaca2f8b")
+        (revision "1"))
+    (package
+      (name "eagle")
+      (version "2.4.1")
+      (source
+       (origin
+         (method git-fetch)
+         (uri (git-reference
+               (url "https://github.com/poruloh/Eagle")
+               (commit commit)))
+         (file-name (git-file-name name version))
+         (sha256
+          (base32
+           "1pylmn3yqimq85fnqw7m702zqp4bw4bw60b2pf0xm2yh1w9grzss"))
+          (modules '((guix build utils)))
+          (snippet
+           '(begin
+              (substitute* "src/Makefile"
+                ;; replace BUILD_HOST and BUILD_TIME for deterministic build
+                (("BLAS_DIR = .*") "")
+                (("BOOST_INSTALL_DIR = .*") "")
+                (("HTSLIB_DIR = .*") "")
+                (("ZLIB_STATIC_DIR = .*") "")
+                (("LIBSTDCXX_STATIC_DIR = .*") "")
+                (("GLIBC_STATIC_DIR = .*") ""))))))
+      (properties `((upstream-name . "Eagle")))
+      (build-system gnu-build-system)
+      (arguments
+       `(#:tests? #f
+         #:parallel-build? #f
+         #:make-flags ,#~(list (string-append "-C" "src/"))
+         #:phases
+         (modify-phases %standard-phases
+           (delete 'configure)
+           (replace 'install
+             (lambda* (#:key outputs #:allow-other-keys)
+               ;; The package's Makefile doesn't provide and "install"
+               ;; rule so di it by ourselves.
+               (let ((bin (string-append (assoc-ref outputs "out")
+                                         "/bin")))
+                 (install-file "src/eagle" bin)))))))
+      (inputs
+       (list boost
+             openblas
+             htslib))
+      (home-page "https://alkesgroup.broadinstitute.org/Eagle/")
+      (synopsis "Statistical estimation of haplotypes from genotype data")
+      (description "Eagle estimates haplotype phase either within a genotyped
+cohort or using a phased reference panel.  It uses a very fast HMM-based algorithm
+that improves speed and accuracy over existing methods via two key ideas: a new data
+structure based on the positional Burrows-Wheeler transform and a rapid search
+algorithm that explores only the most relevant paths through the HMM.  It supports
+phasing sequence data with or without a reference and also supports phasing chrX.")
+      (license license:gpl3+))))
+
 (define-public eigensoft
   (package
     (name "eigensoft")

base-commit: 24ad9a9a48ca4f51505912224217a2a9688c7fa0
-- 
2.38.1