guix-commits
[Top][All Lists]
Advanced

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

03/03: gnu: r-mpo-db: Include HPO sqlite database.


From: guix-commits
Subject: 03/03: gnu: r-mpo-db: Include HPO sqlite database.
Date: Fri, 3 Nov 2023 16:49:54 -0400 (EDT)

rekado pushed a commit to branch r-updates
in repository guix.

commit 18ca4948a5c1f3e4bddff56dd577b1d24f9bf927
Author: Ricardo Wurmus <rekado@elephly.net>
AuthorDate: Fri Nov 3 21:49:18 2023 +0100

    gnu: r-mpo-db: Include HPO sqlite database.
    
    * gnu/packages/bioconductor.scm (r-mpo-db)[arguments]: Bypass fetching of 
the
    database from the internet when in build environment.
    [native-inputs]: Add MPO.sqlite.
    
    Change-Id: Ic7228322b89ce78a85a9bd5ffbd985ccd906d268
---
 gnu/packages/bioconductor.scm | 37 ++++++++++++++++++++++++-------------
 1 file changed, 24 insertions(+), 13 deletions(-)

diff --git a/gnu/packages/bioconductor.scm b/gnu/packages/bioconductor.scm
index 85a2b8d087..b15a856fb9 100644
--- a/gnu/packages/bioconductor.scm
+++ b/gnu/packages/bioconductor.scm
@@ -167,21 +167,32 @@ It retrieves this data from the Genome Aggregation 
Database
     (arguments
      (list
       #:phases
-      '(modify-phases %standard-phases
-         ;; Needed for annotationhub
-         (add-after 'unpack 'set-HOME
-           (lambda _
-             (setenv "HOME" "/tmp")))
-         (add-after 'unpack 'avoid-internet-access
-           (lambda _
-             (setenv "GUIX_BUILD" "yes")
-             (substitute* "R/zzz.R"
-               (("ah <- suppressMessages\\(AnnotationHub\\(\\)\\)" m)
-                (string-append
-                 "if (Sys.getenv(\"GUIX_BUILD\") == \"yes\") { return(TRUE); 
}; " m))))))))
+      #~(modify-phases %standard-phases
+          (add-after 'unpack 'avoid-internet-access
+            (lambda* (#:key inputs #:allow-other-keys)
+              (let* ((cache (string-append #$output "/share/MPO.db/cache"))
+                     (file (string-append cache "/118299")))
+                (mkdir-p cache)
+                (copy-file #$(this-package-native-input "MPO.sqlite") file)
+                (substitute* "R/zzz.R"
+                  (("ah <- suppressMessages\\(AnnotationHub\\(\\)\\)" m)
+                   (string-append
+                    "if (Sys.getenv(\"NIX_BUILD_TOP\") == \"\") { " m " };"))
+                  (("dbfile <- ah.*" m)
+                   (string-append
+                    "if (Sys.getenv(\"NIX_BUILD_TOP\") != \"\") { dbfile <- \""
+                    file "\";} else { " m " }\n")))))))))
     (propagated-inputs
      (list r-annotationdbi r-annotationhub r-biocfilecache r-dbi))
-    (native-inputs (list r-knitr))
+    (native-inputs
+     `(("r-knitr" ,r-knitr)
+       ("MPO.sqlite"
+        ,(origin
+           (method url-fetch)
+           (uri "https://annotationhub.bioconductor.org/fetch/118299";)
+           (file-name "MPO.sqlite")
+           (sha256
+            (base32 
"12rf5dpnjrpw55bgnbn68dni2g0p87nvs9c7mamqk0ayafs61zl0"))))))
     (home-page "https://github.com/YuLab-SMU/MPO.db";)
     (synopsis "set of annotation maps describing the Mouse Phenotype Ontology")
     (description



reply via email to

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