You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

289 lines
14 KiB

  1. ;; Bioinformatics module
  2. (define-module (gn past genenetwork1)
  3. #:use-module ((guix licenses) #:prefix license:)
  4. #:use-module (guix packages)
  5. #:use-module (guix utils)
  6. #:use-module (guix download)
  7. #:use-module (guix git-download)
  8. #:use-module (guix build-system cargo)
  9. #:use-module (guix build-system gnu)
  10. #:use-module (guix build-system python)
  11. #:use-module (guix build-system trivial)
  12. #:use-module (guix graph)
  13. #:use-module (guix scripts graph)
  14. #:use-module (guix store)
  15. #:use-module (guix gexp)
  16. #:use-module (gnu packages)
  17. #:use-module (gnu packages base)
  18. #:use-module (gnu packages bioconductor)
  19. #:use-module (gnu packages bioinformatics)
  20. #:use-module (gnu packages bootstrap)
  21. #:use-module (gnu packages check)
  22. #:use-module (gnu packages cran)
  23. #:use-module (gnu packages crates-io)
  24. #:use-module (gnu packages compression)
  25. #:use-module (gnu packages databases)
  26. #:use-module (gnu packages ghostscript)
  27. #:use-module (gnu packages graphviz)
  28. #:use-module (gnu packages parallel)
  29. #:use-module (gnu packages python)
  30. #:use-module (gnu packages python-check)
  31. #:use-module (gnu packages python-crypto)
  32. #:use-module (gnu packages python-science)
  33. #:use-module (gnu packages python-web)
  34. #:use-module (gnu packages python-xyz)
  35. #:use-module (gnu packages rdf)
  36. #:use-module (gnu packages scheme)
  37. #:use-module (gnu packages statistics)
  38. #:use-module (gnu packages version-control)
  39. #:use-module (gnu packages vim)
  40. #:use-module (gnu packages web)
  41. #:use-module (gnu packages wget)
  42. #:use-module (gnu packages xml)
  43. #:use-module (past packages python)
  44. #:use-module (past packages web)
  45. #:use-module (gn packages bioinformatics)
  46. #:use-module (gn packages twint)
  47. #:use-module (gn packages databases)
  48. #:use-module (gn packages elixir)
  49. #:use-module (gn packages gemma)
  50. #:use-module (gn packages javascript)
  51. #:use-module (gn packages phewas)
  52. #:use-module (gn packages python)
  53. #:use-module (gn packages python24)
  54. #:use-module (gn packages statistics)
  55. #:use-module (gn packages web)
  56. #:use-module (srfi srfi-1))
  57. (define-public python2-qtlreaper
  58. (let ((commit "442c217b90393380a8634ff8636b44992f5c53dd"))
  59. (package
  60. (name "python2-qtlreaper")
  61. (version (string-append "1.11-gn2-" (string-take commit 7) ))
  62. (source (origin
  63. (method git-fetch)
  64. (uri (git-reference
  65. ;; (url "https://github.com/genenetwork/genenetwork2.git")
  66. (url "https://github.com/pjotrp/QTLreaper.git")
  67. (commit commit)))
  68. (file-name (string-append name "-" (string-take commit 7)))
  69. (sha256
  70. (base32
  71. "1rrbm1ap2zzyjxmrs9aa1d18sgiba5dhj1fmkl7wmab06jv3j1hm"))))
  72. (build-system python-build-system)
  73. (arguments
  74. `(#:python ,python-2
  75. #:tests? #f)) ; no 'setup.py test' really!
  76. (home-page "http://qtlreaper.sourceforge.net/")
  77. (synopsis "Scan expression data for QTLs")
  78. (description
  79. "Batch-oriented version of WebQTL. It requires, as input,
  80. expression data from members of a set of recombinant inbred lines and
  81. genotype information for the same lines. It searches for an
  82. association between each expression trait and all genotypes and
  83. evaluates that association by a permutation test. For the permutation
  84. test, it performs only as many permutations as are necessary to define
  85. the empirical P-value to a reasonable precision. It also performs
  86. bootstrap resampling to estimate the confidence region for the
  87. location of a putative QTL.")
  88. (license license:gpl2+))))
  89. (define-public python24-qtlreaper
  90. (let ((commit "442c217b90393380a8634ff8636b44992f5c53dd"))
  91. (package
  92. (name "python24-qtlreaper")
  93. (version (git-version "1.11" "gn1" commit))
  94. (source (origin
  95. (method git-fetch)
  96. (uri (git-reference
  97. ;; (url "https://github.com/genenetwork/genenetwork2.git")
  98. (url "https://github.com/pjotrp/QTLreaper.git")
  99. (commit commit)))
  100. (file-name (git-file-name name version))
  101. (sha256
  102. (base32
  103. "1rrbm1ap2zzyjxmrs9aa1d18sgiba5dhj1fmkl7wmab06jv3j1hm"))))
  104. (build-system python-build-system)
  105. (arguments
  106. `(#:python ,python-2.4
  107. #:phases
  108. (modify-phases %standard-phases
  109. (add-after 'unpack 'make-max-markername-size-larger
  110. (lambda _
  111. (substitute* "Src/dataset.c"
  112. (("512") "2048"))
  113. #t))
  114. (replace 'check
  115. (lambda* (#:key inputs outputs #:allow-other-keys)
  116. (add-installed-pythonpath inputs outputs)
  117. (invoke "python" "test/runtest.py"))))))
  118. (native-inputs
  119. `(("python24-setuptools" ,python24-setuptools)))
  120. (home-page "http://qtlreaper.sourceforge.net/")
  121. (synopsis "Scan expression data for QTLs")
  122. (description
  123. "Batch-oriented version of WebQTL. It requires, as input,
  124. expression data from members of a set of recombinant inbred lines and
  125. genotype information for the same lines. It searches for an
  126. association between each expression trait and all genotypes and
  127. evaluates that association by a permutation test. For the permutation
  128. test, it performs only as many permutations as are necessary to define
  129. the empirical P-value to a reasonable precision. It also performs
  130. bootstrap resampling to estimate the confidence region for the
  131. location of a putative QTL.")
  132. (license license:gpl2+))))
  133. (define-public genenetwork1
  134. (let ((commit "acf65ac9ae4be395c07c1629758f7408bf4eab5f") ; June 3, 2020
  135. (revision "2"))
  136. (package
  137. (name "genenetwork1")
  138. (version (git-version "0.0.0" revision commit))
  139. (source (origin
  140. (method git-fetch)
  141. (uri (git-reference
  142. (url "https://github.com/genenetwork/genenetwork1.git")
  143. (commit commit)))
  144. (file-name (git-file-name name version))
  145. (sha256
  146. (base32
  147. "0xmmmjyvh80yd8b0cjrwpdmxl8k9zj5ly65r2g9aygx74njsp4fi"))))
  148. (build-system gnu-build-system)
  149. (native-inputs
  150. `(("ghostscript" ,ghostscript)
  151. ("graphviz" ,graphviz)
  152. ("wget" ,wget)))
  153. (propagated-inputs
  154. `(("python" ,python-2.4)
  155. ("httpd-with-mod-python" ,httpd22-with-mod-python)
  156. ("python-direct" ,python24-direct-gn)
  157. ("python-htmlgen-GN1" ,python24-htmlgen-GN1)
  158. ("python-json-GN1" ,python24-json-GN1)
  159. ("python-mysqlclient" ,python24-mysqlclient)
  160. ("python-numarray" ,python24-numarray)
  161. ("python-piddle" ,python24-piddle)
  162. ("python-pp-GN1" ,python24-pp-GN1)
  163. ("python-pyx" ,python24-pyx)
  164. ("python-pyxlwriter" ,python24-pyxlwriter)
  165. ("python-qtlreaper" ,python24-qtlreaper)
  166. ("python-rpy2" ,python24-rpy2)
  167. ("python-svg-GN1" ,python24-svg-GN1)))
  168. (arguments
  169. `(#:tests? #f ; no tests
  170. #:phases
  171. (modify-phases %standard-phases
  172. (delete 'configure)
  173. (delete 'build)
  174. (add-after 'patch-generated-file-shebangs 'patch-more-files
  175. (lambda* (#:key inputs #:allow-other-keys)
  176. (let ((piddle (assoc-ref inputs "python-piddle")))
  177. (substitute* "web/webqtl/networkGraph/networkGraphUtils.py"
  178. (("/usr/local/bin/neato") (which "neato"))
  179. (("/usr/local/bin/circo") (which "circo"))
  180. (("/usr/local/bin/twopi") (which "twopi"))
  181. (("/usr/local/bin/fdp") (which "fdp"))
  182. (("ps2pdf") (which "ps2pdf")))
  183. (substitute* "web/webqtl/maintainance/addRif.py"
  184. (("rm ") (string-append (which "rm") " "))
  185. (("wget ") (string-append (which "wget") " "))
  186. (("gunzip") (which "gunzip")))
  187. (substitute* "web/webqtl/misc/editHtmlPage.py"
  188. (("/bin/cp") (which "cp")))
  189. (substitute* "web/webqtl/geneWiki/AddGeneRIFPage.py"
  190. (("touch") (which "touch")))
  191. (substitute* '("web/webqtl/maintainance/addRif.py"
  192. "web/webqtl/networkGraph/networkGraphPage.py"
  193. "web/webqtl/utility/svg.py")
  194. (("/usr/bin/(env )?python") (which "python")))
  195. (substitute* "web/webqtl/base/webqtlConfigLocal.py"
  196. (("PythonPath.*")
  197. (string-append "PythonPath = '" (which "python") "'\n"))
  198. (("PIDDLE_FONT_PATH.*/lib")
  199. (string-append "PIDDLE_FONT_PATH = '" piddle "/lib"))))
  200. #t))
  201. (add-after 'patch-generated-file-shebangs 'changes-for-deployed-service
  202. (lambda* (#:key outputs #:allow-other-keys)
  203. (let ((out (assoc-ref outputs "out")))
  204. (substitute* "web/webqtl/base/webqtlConfigLocal.py"
  205. ;; Where GN1 is located: (GNROOT)
  206. (("/gnshare/gn") out)
  207. ;; Where the database is located: (sql_host)
  208. (("tux01.uthsc.edu") "127.0.0.1"))
  209. (substitute* '("web/webqtl/maintainance/QTL_Reaper_cal_lrs.py")
  210. (("128\\.169\\.5\\.59") "localhost"))
  211. ;; This directory (TMPDIR) is expected to be writable by apache.
  212. ;; /tmp is private inside the container.
  213. (symlink "/tmp" "web/tmp")
  214. ;; IMGDIR is expected to be writable.
  215. (symlink "/tmp" "web/image")
  216. (system "chmod 0777 web/tmp")
  217. ;; More writable locations:
  218. (substitute* (list "web/webqtl/collection/ExportSelectionDetailInfoPage.py"
  219. "web/webqtl/pairScan/DirectPlotPage.py"
  220. "web/webqtl/updateTrait/DataUpdatePage.py"
  221. "web/webqtl/utility/Plot.py")
  222. (("/gnshare/gn/web/debug_file.txt") "/tmp/debug_file.txt"))
  223. ;; We mount the genotypes folder (GENODIR) in the OS-config and
  224. ;; provide the symlink to that location from the package.
  225. ;; And now the directory is magically available!
  226. (symlink "/gnshare/gn/web/genotypes" "web/genotypes")
  227. (substitute* "web/webqtl/base/webqtlConfig.py"
  228. (("http://www.genenetwork.org") "http://gn1-test.genenetwork.org"))
  229. ;; Inside the gn1 container, there's some conflict when
  230. ;; importing the user module, therefore, as a hack, rename
  231. ;; user to useralt
  232. (mkdir "web/webqtl/useralt")
  233. (copy-recursively "web/webqtl/user" "web/webqtl/useralt")
  234. (substitute* '("web/webqtl/main.py")
  235. (("from user import") "from useralt import"))
  236. #t)))
  237. (add-after 'unpack 'use-local-links
  238. (lambda _
  239. (substitute* '("web/javascript/menu_items.js"
  240. "web/webqtl/maintainance/updateMenuJS.py")
  241. (("http://(www|gn1).genenetwork.org") ""))
  242. ;; Move this file out of the way while patching files.
  243. (rename-file "web/infoshare/manager/MDB-Free/index.html"
  244. "web/infoshare/manager/MDB-Free/index.htm")
  245. (substitute* (cons*
  246. "web/webqtl/base/indexBody.py"
  247. "web/webqtl/submitTrait/BatchSubmitPage.py"
  248. (find-files "web" "\\.html"))
  249. ((".*base href.*") "")
  250. (("(HREF|href)=\\\"http://(www.)?genenetwork.org")
  251. "href=\""))
  252. ;; Move this file back to its original location.
  253. (rename-file "web/infoshare/manager/MDB-Free/index.htm"
  254. "web/infoshare/manager/MDB-Free/index.html")
  255. (substitute* (cons*
  256. "web/humanCross.html"
  257. "web/webqtl/base/indexBody.py"
  258. "web/whats_new.html"
  259. (find-files "web/dbdoc" "\\.html"))
  260. (("src=\\\"http://www.genenetwork.org") "src=\""))
  261. #t))
  262. (replace 'install
  263. (lambda* (#:key outputs #:allow-other-keys)
  264. (copy-recursively "." (assoc-ref outputs "out"))
  265. #t)))))
  266. (home-page "http://www.genenetwork.org/webqtl/main.py")
  267. (synopsis
  268. "Combined database and data analysis software resource for systems genetics")
  269. (description "GeneNetwork is a group of linked data sets and tools used to
  270. study complex networks of genes, molecules, and higher order gene function and
  271. phenotypes. GeneNetwork combines more than 25 years of legacy data generated by
  272. hundreds of scientists together with sequence data (SNPs) and massive
  273. transcriptome data sets (expression genetic or eQTL data sets). The
  274. @dfn{quantitative trait locus} (QTL) mapping module that is built into GN is
  275. optimized for fast on-line analysis of traits that are controlled by
  276. combinations of gene
  277. variants and environmental factors. GeneNetwork can be used to study humans,
  278. mice (BXD, AXB, LXS, etc.), rats (HXB), Drosophila, and plant species (barley
  279. and Arabidopsis). Most of these population data sets are linked with dense
  280. genetic maps (genotypes) that can be used to locate the genetic modifiers that
  281. cause differences in expression and phenotypes, including disease susceptibility.")
  282. (license license:agpl3+))))