about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--README.org9
-rw-r--r--gn/packages/genenetwork.scm86
-rw-r--r--gn/packages/python.scm153
-rw-r--r--gn/packages/ruby.scm3
-rw-r--r--gn/services/genenetwork.scm58
5 files changed, 253 insertions, 56 deletions
diff --git a/README.org b/README.org
index 1d51aaf..d11f3c6 100644
--- a/README.org
+++ b/README.org
@@ -1,8 +1,13 @@
 * guix-bioinformatics
 
 Bioinformatics packages for GNU Guix that are used in
-http://genenetwork.org/.  See [[https://github.com/pjotrp/guix-notes/blob/master/HACKING.org][Guix notes]] for installing and hacking
-GNU Guix.
+http://genenetwork.org/ and some other places.  See [[https://gitlab.com/pjotrp/guix-notes/blob/master/HACKING.org][Guix notes]] for
+installing and hacking GNU Guix. Other channels of bioinformatics
+interest can be found at
+
+1. https://github.com/BIMSBbioinfo
+2. https://github.com/UMCUGenetics/guix-additions
+3. https://github.com/ekg/guix-genomics
 
 To easily use the packages from this repo, simply add it to your
 `channels` list in ~/.config/guix/channels.scm as described
diff --git a/gn/packages/genenetwork.scm b/gn/packages/genenetwork.scm
index 232e4f7..8696db0 100644
--- a/gn/packages/genenetwork.scm
+++ b/gn/packages/genenetwork.scm
@@ -7,6 +7,7 @@
   #:use-module (guix download)
   #:use-module (guix git-download)
   #:use-module (guix build-system cargo)
+  #:use-module (guix build-system gnu)
   #:use-module (guix build-system python)
   #:use-module (guix build-system trivial)
   #:use-module (gnu packages)
@@ -18,6 +19,7 @@
   #:use-module (gnu packages crates-io)
   #:use-module (gnu packages compression)
   #:use-module (gnu packages databases)
+  #:use-module (gnu packages ghostscript)
   #:use-module (gnu packages python)
   #:use-module (gnu packages python-crypto)
   #:use-module (gnu packages python-science)
@@ -28,10 +30,12 @@
   #:use-module (gnu packages vim)
   #:use-module (gnu packages web)
   #:use-module (gnu packages xml)
+  #:use-module (gnu packages wget)
   #:use-module (gn packages bioinformatics)
   #:use-module (gn packages crates-io)
   #:use-module (gn packages elixir)
   #:use-module (gn packages gemma)
+  #:use-module (gn packages graphviz)
   #:use-module (gn packages javascript)
   #:use-module (gn packages phewas)
   #:use-module (gn packages python)
@@ -588,3 +592,85 @@ written in C")
      (synopsis "Full genenetwork services")
      (description "Genenetwork installation sumo.")
      (license license:agpl3+))))
+
+(define-public genenetwork1
+  (let ((commit "19791ce6b3c38be8cbf9bc9cd3e95dbee14116c2") ; Aug 23, 2018
+        (revision "1"))
+    (package
+      (name "genenetwork1")
+      (version (git-version "0.0.0" revision commit))
+      (source (origin
+        (method git-fetch)
+        (uri (git-reference
+               (url "https://github.com/genenetwork/genenetwork1.git")
+               (commit commit)))
+        (file-name (git-file-name name version))
+        (sha256
+         (base32
+          "1s735dj8kf98gf5w58p10zzyc5766gn27j4j5yh07ksadg7h1kdi"))))
+      (build-system gnu-build-system)
+      (arguments
+       `(#:tests? #f ; no tests
+         #:phases
+         (modify-phases %standard-phases
+           (delete 'configure)
+           (delete 'build)
+           (add-after 'patch-generated-file-shebangs 'patch-more-files
+             (lambda* (#:key inputs #:allow-other-keys)
+               (let ((piddle (assoc-ref inputs "python-piddle")))
+                 (substitute* "web/webqtl/networkGraph/networkGraphUtils.py"
+                   (("/usr/local/bin/neato") (which "neato"))
+                   (("/usr/local/bin/circo") (which "circo"))
+                   (("/usr/local/bin/twopi") (which "twopi"))
+                   (("/usr/local/bin/fdp") (which "fdp"))
+                   (("ps2pdf") (which "ps2pdf")))
+                 (substitute* "web/webqtl/maintainance/addRif.py"
+                   (("rm ") (string-append (which "rm") " "))
+                   (("wget ") (string-append (which "wget") " "))
+                   (("gunzip") (which "gunzip")))
+                 (substitute* "web/webqtl/misc/editHtmlPage.py"
+                   (("/bin/cp") (which "cp")))
+                 (substitute* "web/webqtl/geneWiki/AddGeneRIFPage.py"
+                   (("touch") (which "touch")))
+                 (substitute* '("web/webqtl/maintainance/addRif.py"
+                                "web/webqtl/networkGraph/networkGraphPage.py"
+                                "web/webqtl/utility/svg.py")
+                   (("/usr/bin/python") (which "python"))
+                   (("/usr/bin/env python") (which "python")))
+                 (substitute* "web/webqtl/base/webqtlConfigLocal.py"
+                   (("PythonPath.*")
+                    (string-append "PythonPath = '" (which "python") "'\n"))
+                   (("PIDDLE_FONT_PATH.*/lib")
+                    (string-append "PIDDLE_FONT_PATH = '" piddle "/lib"))))
+               #t))
+           (add-before 'install 'replace-htaccess-file
+             (lambda _
+               (delete-file "web/webqtl/.htaccess")
+               #t))
+           (replace 'install
+             (lambda* (#:key outputs #:allow-other-keys)
+               (copy-recursively "." (assoc-ref outputs "out"))
+               #t)))))
+      (inputs
+       `(("ghostscript" ,ghostscript)
+         ("graphviz" ,graphviz-2.26)
+         ("python24" ,python-2.4)
+         ("python-piddle" ,python24-piddle)
+         ("wget" ,wget)))
+      (home-page "http://www.genenetwork.org/webqtl/main.py")
+      (synopsis
+       "Combined database and data analysis software resource for systems genetics")
+      (description "GeneNetwork is a group of linked data sets and tools used to
+study complex networks of genes, molecules, and higher order gene function and
+phenotypes.  GeneNetwork combines more than 25 years of legacy data generated by
+hundreds of scientists together with sequence data (SNPs) and massive
+transcriptome data sets (expression genetic or eQTL data sets).  The
+@dfn{quantitative trait locus} (QTL) mapping module that is built into GN is
+optimized for fast on-line analysis of traits that are controlled by
+combinations of gene
+variants and environmental factors.  GeneNetwork can be used to study humans,
+mice (BXD, AXB, LXS, etc.), rats (HXB), Drosophila, and plant species (barley
+and Arabidopsis).  Most of these population data sets are linked with dense
+genetic maps (genotypes) that can be used to locate the genetic modifiers that
+cause differences in expression and phenotypes, including disease susceptibility.")
+      (license license:agpl3+))))
diff --git a/gn/packages/python.scm b/gn/packages/python.scm
index b69dd91..60558a2 100644
--- a/gn/packages/python.scm
+++ b/gn/packages/python.scm
@@ -488,58 +488,107 @@ Python 3 support.")
 ; pinned QmZLWsPHLFTU3hWAfdTwj3RXFrS8Ma7KEixne1suWuYqeG recursively
 
 (define-public python2-htmlgen-gn ; guix obsolete
-(package
-  (name "python2-htmlgen-gn")
-  (version "2.2.2")
-  (source (origin
-           (method url-fetch)
-           ;; http://files.genenetwork.org/software/contrib/htmlgen-2.2.2-gn.tar.gz
-           (uri (string-append
-                 "http://ipfs.genenetwork.org/ipfs/QmZLWsPHLFTU3hWAfdTwj3RXFrS8Ma7KEixne1suWuYqeG/htmlgen-" version "-gn.tar.gz"))
-           (sha256
-            (base32
-             "1lwsk56rymhrma46cbyh3g64ksmq1vsih3qkrc2vh0lpba825y7r"))
-           ;;(patches (list
-           ;;          (search-patch "python2-htmlgen-Applied-Deb-patch.patch")
-           ;;          (search-patch "python2-htmlgen-Fix-test-for-random.patch")
-            ))
-  (build-system python-build-system)
-  (outputs '("out"))
-  (native-inputs
-   `(("make" ,gnu-make)
-     ))
-  (propagated-inputs
-   `(("python2" ,python-2)))
-  (arguments
-   `(#:phases (modify-phases %standard-phases
-     (replace 'build
-              (lambda _
-                (system* "python2" "-m" "compileall" ".")))
-     (replace 'install
-              (lambda* (#:key outputs #:allow-other-keys)
-                       (let* ((out (assoc-ref outputs "out"))
-                              (include (string-append out "/include"))
-                              (lib2 (string-append out "/lib/htmlgen"))
-                              (lib (string-append (assoc-ref %outputs "out") "/lib/python2.7/site-packages/htmlgen"))
-                              (pkgconfig (string-append out "/lib/pkgconfig"))
-                              (doc (string-append out "/share/doc")))
-                         ;; Install libs and headers.
-                         ;; (copy-file "HTMLgen.pyc" "HTMLgen2.pyc")
-                         (install-file "HTMLgen.pyc" lib)
-                         (install-file "HTMLgen2.pyc" lib)
-                         (install-file "imgsize.pyc" lib)
-                         (install-file "ImageH.pyc" lib)
-                         (install-file "ImagePaletteH.pyc" lib)
-                         (install-file "__init__.pyc" lib)
-              ))) ; install
-     ) ; phases
-     #:tests? #f))
-  (home-page
-    "https://packages.debian.org/unstable/python/python-htmlgen")
-  (synopsis "Genenetwork version of Python2 HTMLgen (defunkt
-project)")
-  (description #f)
-  (license #f)))
+  (package
+    (name "python2-htmlgen-gn")
+    (version "2.2.2")
+    (source (origin
+              (method url-fetch)
+              ;; http://files.genenetwork.org/software/contrib/htmlgen-2.2.2-gn.tar.gz
+              (uri (string-append
+                     "http://ipfs.genenetwork.org/ipfs/QmZLWsPHLFTU3hWAfdTwj3RXFrS8Ma7KEixne1suWuYqeG/htmlgen-" version "-gn.tar.gz"))
+              (sha256
+               (base32
+                "1lwsk56rymhrma46cbyh3g64ksmq1vsih3qkrc2vh0lpba825y7r"))
+              ;;(patches (list
+              ;;          (search-patch "python2-htmlgen-Applied-Deb-patch.patch")
+              ;;          (search-patch "python2-htmlgen-Fix-test-for-random.patch")
+              ))
+    (build-system python-build-system)
+    (arguments
+     `(#:python ,python-2
+       #:tests? #f
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'modernize-imports
+           (lambda _
+             (substitute* "HTMLgen.py"
+               (("whrandom") "random"))
+             (substitute* "HTMLcalendar.py"
+               (("import regex") "import re as regex"))
+             (substitute* "HTMLutil.py"
+               (("import string, regex") "import re as regex\nimport string"))
+             (substitute* "HTMLtest.py"
+               (("import string, regex, regsub") "import re as regex\nimport string")
+               (("regsub.split") "re.split"))
+             #t))
+         (replace 'build
+           (lambda _
+             (invoke "python" "-m" "compileall" ".")))
+         (replace 'check
+           (lambda* (#:key (tests? '()) #:allow-other-keys)
+             (if tests?
+               (invoke "python" "HTMLtest.py")
+               #t)))
+         (replace 'install
+           (lambda* (#:key outputs #:allow-other-keys)
+             (let* ((out (assoc-ref outputs "out"))
+                    (lib (string-append out "/lib/python2.7/site-packages/htmlgen/")))
+               ;; Install libs and headers.
+               (for-each (lambda (file)
+                           (install-file file lib))
+                         (find-files "." "\\.py[c]?$"))
+               #t))))))
+    (home-page "https://packages.debian.org/unstable/python/python-htmlgen")
+    (synopsis "Genenetwork version of Python2 HTMLgen (defunkt project)")
+    (description #f)
+    (license #f)))
+
+(define-public python2-htmlgen-2.2
+  (package
+    (name "python2-htmlgen-2.2")
+    (version "2.2.2")
+    (source (origin
+              (method url-fetch)
+              (uri (string-append "mirror://debian/pool/main/h/htmlgen/htmlgen_" version ".orig.tar.gz"))
+              (sha256
+               (base32
+                 "186kb434q6z84g31ysvzi4kcfcvl3pmm57k4jlng4ccgls94x6wb"))))
+    (build-system python-build-system)
+    (arguments
+     `(#:python ,python-2
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'modernize-imports
+           (lambda _
+             (substitute* "HTMLgen.py"
+               (("whrandom") "random"))
+             (substitute* "HTMLcalendar.py"
+               (("import regex") "import re as regex"))
+             (substitute* "HTMLutil.py"
+               (("import string, regex") "import re as regex\nimport string"))
+             (substitute* "HTMLtest.py"
+               (("import string, regex, regsub") "import re as regex\nimport string")
+               (("regsub.split") "re.split"))
+             #t))
+         (replace 'build
+           (lambda _
+             (invoke "python" "-m" "compileall" ".")))
+         (replace 'check
+           (lambda _
+             (invoke "python" "HTMLtest.py")))
+         (replace 'install
+           (lambda* (#:key outputs #:allow-other-keys)
+             (let* ((out (assoc-ref outputs "out"))
+                    (lib (string-append out "/lib/python2.7/site-packages/htmlgen/")))
+               ;; Install libs and headers.
+               (for-each (lambda (file)
+                           (install-file file lib))
+                         (find-files "." "\\.py[c]?$"))
+               #t))))))
+    (home-page "https://packages.debian.org/unstable/python/python-htmlgen")
+    (synopsis "Genenetwork version of Python2 HTMLgen (defunkt project)")
+    (description #f)
+    (license #f)))
 
 ; penguin2:~/tmp$ env IPFS_PATH=/export/ipfs/ ipfs add -r Imaging/
 ; added QmV8Rew1re8gBTLsaqMU4bd7euFUPEpjiD572mtoz6KhPn Imaging/Imaging-1.1.6-gn.tar.gz
diff --git a/gn/packages/ruby.scm b/gn/packages/ruby.scm
index 8dfb1d2..d24c451 100644
--- a/gn/packages/ruby.scm
+++ b/gn/packages/ruby.scm
@@ -48,8 +48,7 @@
               (method url-fetch)
               (uri (string-append
                     "http://ftp.tudelft.nl/apache/maven/maven-3/3.3.9/source/apache-maven-" version "-src.tar.gz"))
-              (sha256
-               (base32
+              (sha256               (base32
                 "1g0iavyb34kvs3jfrx2hfnr8lr11m39sj852cy7528wva1glfl4i"))))
     (build-system gnu-build-system)
     (home-page "http://ant.apache.org")
diff --git a/gn/services/genenetwork.scm b/gn/services/genenetwork.scm
new file mode 100644
index 0000000..0978cd2
--- /dev/null
+++ b/gn/services/genenetwork.scm
@@ -0,0 +1,58 @@
+(define-module (gn services genenetwork))
+
+(use-modules (gnu)
+             (gn packages genenetwork)
+             (gn packages python)
+             (gn packages web))
+(use-service-modules web)
+(use-package-modules python)
+
+(define %mod-python-path
+  (file-append mod-python "/lib/python2.7/site-packages"))
+
+(operating-system
+  (host-name "genenetwork")
+  (timezone "Etc/UTC")
+  (locale "en_US.utf8")
+
+  (bootloader (bootloader-configuration
+               (bootloader grub-bootloader)
+               (target "does-not-matter")))
+  (file-systems %base-file-systems)
+  ;; No firmware for VMs
+  (firmware '())
+
+  (packages (cons* python-2
+                   mod-python
+                   python2-qtlreaper
+                   python2-htmlgen-gn
+                   python2-json-GN1
+                   python2-piddle
+                   python2-pyx-GN1
+                   python2-pyxlwriter
+                   python2-svg-GN1
+                   %base-packages))
+
+  (services (list (service httpd-service-type
+                           (httpd-configuration
+                             (config
+                               (httpd-config-file
+                                 (server-name "www.genenetwork.org")
+                                 (document-root (file-append genenetwork "/web"))
+                                 (listen '("8811"))
+                                 (modules (cons*
+                                            (httpd-module
+                                              (name "python_module")
+                                              (file (file-append mod-python "/modules/mod_python.so")))
+                                            %default-httpd-modules))
+                                 (extra-config (list "\
+PythonPath \"sys.path+['" %mod-python-path "', '" (file-append genenetwork "/web/webqtl") "']\"
+<Directory " (file-append genenetwork "/web/webqtl") ">
+  SetHandler python-program
+  PythonHandler mod_python.publisher
+  PythonAutoReload Off
+</Directory>
+<Location /mpinfo>
+  SetHandler python-program
+  PythonHandler mod_python.testhandler
+</Location>")))))))))