aboutsummaryrefslogtreecommitdiff
path: root/gn/packages/mouse-longevity.scm
blob: 7b00f4c567d714bf4bd063f65fbbeb7a4e4caf22 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
;;; guix-bioinformatics --- Bioinformatics packages for GNU Guix
;;; Copyright © 2024 jgart <jgart@dismail.de>
;;;
;;; This file is part of guix-bioinformatics.
;;;
;;; genenetwork-machines is free software: you can redistribute it
;;; and/or modify it under the terms of the GNU General Public License
;;; as published by the Free Software Foundation, either version 3 of
;;; the License, or (at your option) any later version.
;;;
;;; genenetwork-machines is distributed in the hope that it will be
;;; useful, but WITHOUT ANY WARRANTY; without even the implied
;;; warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
;;; See the GNU General Public License for more details.
;;;
;;; You should have received a copy of the GNU General Public License
;;; along with genenetwork-machines.  If not, see
;;; <https://www.gnu.org/licenses/>.

(define-module (gn packages mouse-longevity)
  #:use-module (guix)
  #:use-module (gnu)
  #:use-module (gnu services shepherd)
  #:use-module (gn services rshiny)
  #:use-module (guix git-download)
  #:use-module (guix modules)
  #:use-module (guix records)
  #:use-module (srfi srfi-1)
  #:use-module (ice-9 match)
  #:use-module (gnu packages cran)
  #:use-module (gnu packages statistics)
  #:use-module ((guix licenses) #:prefix license:)
  #:use-module (guix build-system trivial)
  #:use-module ((gnu packages admin) #:select (shepherd))
  #:use-module ((gnu packages web) #:select (nginx)))

(define-public mouse-longevity-app
  (let ((commit "7f8198195d68341242132911f15971c137797e61")
        (revision "0"))
    (package
      (name "mouse-longevity-app")
      (version (git-version "0.0.0" revision commit))
      (source (origin
                (method git-fetch)
                (uri (git-reference
                      (url "https://github.com/Dashbrook/Mouse_Longevity_app/")
                      (commit commit)))
                (file-name (git-file-name name version))
                (sha256
                 (base32 "1wvda7h737dyrz1zv796666v0rndalfd8gxl3964x6qgcsgprcsf"))))
      (build-system trivial-build-system)
      (arguments
       (list #:modules '((guix build utils))
             #:builder
             #~(begin
                 (use-modules (guix build utils))
                 (let* ((source    (assoc-ref %build-inputs "source"))
                        (targetdir (string-append #$output "/share/" #$name))
                        (app       (string-append #$output "/bin/" #$name))
                        (Rbin      (search-input-file %build-inputs "/bin/Rscript")))
                   (copy-recursively source targetdir)
                   (mkdir-p (string-append #$output "/bin"))
                   (call-with-output-file app
                     (lambda (port)
                       (format port
                               "#!~a
library(shiny)
setwd(\"~a\")
runApp(launch.browser=0, port=3979)~%\n"
                               Rbin targetdir)))
                   (chmod app #o555)))))
      (propagated-inputs
       (list r
             r-ggplot2
             r-dplyr
             r-plotly
             r-shinyjs
             r-shiny))
      (home-page "https://github.com/Dashbrook/Mouse_Longevity_app/")
      (synopsis "R shiny app to visualize mouse lifespan data")
      (description
       "This package provides an R shiny app to visualize mouse strain
longevity data.")
      (license license:gpl3+))))