1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2018 Konrad Hinsen <konrad.hinsen@fastmail.net>
3 ;;; Copyright © 2018 Kei Kebreau <kkebreau@posteo.net>
4 ;;; Copyright © 2018 Efraim Flashner <efraim@flashner.co.il>
5 ;;; Copyright © 2018 Tobias Geerinckx-Rice <me@tobias.gr>
7 ;;; This file is part of GNU Guix.
9 ;;; GNU Guix is free software; you can redistribute it and/or modify it
10 ;;; under the terms of the GNU General Public License as published by
11 ;;; the Free Software Foundation; either version 3 of the License, or (at
12 ;;; your option) any later version.
14 ;;; GNU Guix is distributed in the hope that it will be useful, but
15 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
16 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 ;;; GNU General Public License for more details.
19 ;;; You should have received a copy of the GNU General Public License
20 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
22 (define-module (gnu packages chemistry)
23 #:use-module (guix packages)
24 #:use-module (guix utils)
25 #:use-module ((guix licenses) #:prefix license:)
26 #:use-module (guix download)
27 #:use-module (guix git-download)
28 #:use-module (gnu packages)
29 #:use-module (gnu packages algebra)
30 #:use-module (gnu packages boost)
31 #:use-module (gnu packages compression)
32 #:use-module (gnu packages documentation)
33 #:use-module (gnu packages gl)
34 #:use-module (gnu packages gv)
35 #:use-module (gnu packages maths)
36 #:use-module (gnu packages pkg-config)
37 #:use-module (gnu packages python)
38 #:use-module (gnu packages python-xyz)
39 #:use-module (gnu packages qt)
40 #:use-module (gnu packages xml)
41 #:use-module (guix build-system cmake)
42 #:use-module (guix build-system gnu)
43 #:use-module (guix build-system python))
45 (define-public avogadro
53 (url "https://github.com/cryos/avogadro.git")
56 (base32 "0258py3lkba85qhs5ynancinyym61vlp0zaq9yrfs3hhnhpzv9n2"))
57 (file-name (git-file-name name version))
59 (search-patches "avogadro-eigen3-update.patch"
60 "avogadro-python-eigen-lib.patch"
61 "avogadro-boost148.patch"))))
62 (build-system cmake-build-system)
66 (list "-DENABLE_GLSL=ON"
67 (string-append "-DPYTHON_LIBRARIES="
68 (assoc-ref %build-inputs "python")
70 (string-append "-DPYTHON_INCLUDE_DIRS="
71 (assoc-ref %build-inputs "python")
74 (package-version python))))
76 (modify-phases %standard-phases
77 (add-after 'unpack 'patch-python-lib-path
78 (lambda* (#:key outputs #:allow-other-keys)
79 ;; This is necessary to install the Python module in the correct
81 (substitute* "libavogadro/src/python/CMakeLists.txt"
82 (("^EXECUTE_PROCESS.*$") "")
83 (("^.*from sys import stdout.*$") "")
84 (("^.*OUTPUT_VARIABLE.*")
85 (string-append "set(PYTHON_LIB_PATH \""
86 (assoc-ref outputs "out")
89 (package-version python))
90 "/site-packages\")")))
92 (add-after 'install 'wrap-program
93 (lambda* (#:key inputs outputs #:allow-other-keys)
94 ;; Make sure 'avogadro' runs with the correct PYTHONPATH.
95 (let* ((out (assoc-ref outputs "out")))
98 (assoc-ref outputs "out")
100 ,(version-major+minor
101 (package-version python))
103 (getenv "PYTHONPATH")))
104 (wrap-program (string-append out "/bin/avogadro")
105 `("PYTHONPATH" ":" prefix (,(getenv "PYTHONPATH")))))
108 `(("doxygen" ,doxygen)
109 ("pkg-config" ,pkg-config)))
114 ("openbabel" ,openbabel)
116 ("python-numpy" ,python2-numpy)
117 ("python-pyqt" ,python2-pyqt-4)
118 ("python-sip" ,python2-sip)
121 (home-page "https://avogadro.cc")
122 (synopsis "Advanced molecule editor")
124 "Avogadro is an advanced molecule editor and visualizer designed for use
125 in computational chemistry, molecular modeling, bioinformatics, materials
126 science, and related areas. It offers flexible high quality rendering and a
127 powerful plugin architecture.")
128 (license license:gpl2+)))
130 (define-public domainfinder
132 (name "domainfinder")
137 (uri (string-append "https://bitbucket.org/khinsen/"
138 "domainfinder/downloads/DomainFinder-"
142 "1z26lsyf7xwnzwjvimmbla7ckipx6p734w7y0jk2a2fzci8fkdcr"))))
143 (build-system python-build-system)
145 `(("python-mmtk" ,python2-mmtk)))
150 (home-page "http://dirac.cnrs-orleans.fr/DomainFinder")
151 (synopsis "Analysis of dynamical domains in proteins")
152 (description "DomainFinder is an interactive program for the determination
153 and characterization of dynamical domains in proteins. It can infer dynamical
154 domains by comparing two protein structures, or from normal mode analysis on a
155 single structure. The software is currently not actively maintained and works
156 only with Python 2 and NumPy < 1.9.")
157 (license license:cecill-c)))
165 (uri (string-append "http://www.inchi-trust.org/download/"
166 (string-join (string-split version #\.) "")
170 "081pcjx1z5jm23fs1pl2r3bccia0ww8wfkzcjpb7byhn7b513hsa"))
171 (file-name (string-append name "-" version ".zip"))))
172 (build-system gnu-build-system)
174 '(#:tests? #f ; no check target
176 (modify-phases %standard-phases
177 (delete 'configure) ; no configure script
178 (add-before 'build 'chdir-to-build-directory
179 (lambda _ (chdir "INCHI_EXE/inchi-1/gcc") #t))
180 (add-after 'build 'build-library
182 (chdir "../../../INCHI_API/libinchi/gcc")
185 (lambda* (#:key inputs outputs #:allow-other-keys)
186 (let* ((out (assoc-ref outputs "out"))
187 (bin (string-append out "/bin"))
188 (doc (string-append out "/share/doc/inchi"))
189 (include-dir (string-append out "/include/inchi"))
190 (lib (string-append out "/lib/inchi"))
191 (inchi-doc (assoc-ref inputs "inchi-doc"))
192 (unzip (string-append (assoc-ref inputs "unzip")
196 (with-directory-excursion "INCHI_EXE/bin/Linux"
197 (rename-file "inchi-1" "inchi")
198 (install-file "inchi" bin))
199 ;; Install libraries.
200 (with-directory-excursion "INCHI_API/bin/Linux"
201 (for-each (lambda (file)
202 (install-file file lib))
203 (find-files "." "libinchi\\.so\\.1\\.*")))
204 ;; Install header files.
205 (with-directory-excursion "INCHI_BASE/src"
206 (for-each (lambda (file)
207 (install-file file include-dir))
208 (find-files "." "\\.h$")))
209 ;; Install documentation.
211 (invoke unzip "-j" "-d" doc inchi-doc)
218 (uri (string-append "http://www.inchi-trust.org/download/"
219 (string-join (string-split version #\.) "")
223 "1id1qb2y4lwsiw91qr2yqpn6kxbwjwhjk0hb2rwk4fxhdqib6da6"))
224 (file-name (string-append name "-" version ".zip"))))))
225 (home-page "https://www.inchi-trust.org")
226 (synopsis "Utility for manipulating machine-readable chemical structures")
228 "The @dfn{InChI} (IUPAC International Chemical Identifier) algorithm turns
229 chemical structures into machine-readable strings of information. InChIs are
230 unique to the compound they describe and can encode absolute stereochemistry
231 making chemicals and chemistry machine-readable and discoverable. A simple
232 analogy is that InChI is the bar-code for chemistry and chemical structures.")
233 (license (license:non-copyleft
235 "See LICENCE in the distribution."))))
237 (define with-numpy-1.8
238 (package-input-rewriting `((,python2-numpy . ,python2-numpy-1.8))))
240 (define-public nmoldyn
247 (uri (string-append "https://bitbucket.org/khinsen/"
248 "nmoldyn3/downloads/nMOLDYN-"
252 "1mvmz3lkr217kdrd8cvdr1d82y58wp1403c9rnd943mijgq8xb5a"))))
253 (build-system python-build-system)
255 `(("python-matplotlib" ,(with-numpy-1.8 python2-matplotlib))
256 ("python-scientific" ,python2-scientific)
260 `(("python-mmtk" ,python2-mmtk)))
263 #:tests? #f ; No test suite
265 (modify-phases %standard-phases
266 (add-before 'build 'create-linux2-directory
268 (mkdir-p "nMOLDYN/linux2")))
269 (add-before 'build 'change-PDF-viewer
270 (lambda* (#:key inputs #:allow-other-keys)
271 (substitute* "nMOLDYN/Preferences.py"
272 ;; Set the paths for external executables, substituting
274 ;; There is also vmd_path, but VMD is not free software
275 ;; and Guix contains currently no free molecular viewer that
276 ;; could be substituted.
277 (("PREFERENCES\\['acroread_path'\\] = ''")
278 (format "PREFERENCES['acroread_path'] = '~a'"
280 (("PREFERENCES\\['ncdump_path'\\] = ''")
281 (format "PREFERENCES['ncdump_path'] = '~a'"
283 (("PREFERENCES\\['ncgen_path'\\] = ''")
284 (format "PREFERENCES['ncgen_path'] = '~a'"
286 (("PREFERENCES\\['task_manager_path'\\] = ''")
287 (format "PREFERENCES['task_manager_path'] = '~a'"
288 (which "task_manager")))
289 ;; Show documentation as PDF
290 (("PREFERENCES\\['documentation_style'\\] = 'html'")
291 "PREFERENCES['documentation_style'] = 'pdf'") ))))))
292 (home-page "http://dirac.cnrs-orleans.fr/nMOLDYN/")
293 (synopsis "Analysis software for Molecular Dynamics trajectories")
294 (description "nMOLDYN is an interactive analysis program for Molecular Dynamics
295 simulations. It is especially designed for the computation and decomposition of
296 neutron scattering spectra, but also computes other quantities. The software
297 is currently not actively maintained and works only with Python 2 and
299 (license license:cecill)))
301 (define-public openbabel
307 (uri (string-append "mirror://sourceforge/" name "/" name "/"
308 version "/" name "-" version ".tar.gz"))
311 "1z3d6xm70dpfikhwdnbzc66j2l49vq105ch041wivrfz5ic3ch90"))
313 (search-patches "openbabel-fix-crash-on-nwchem-output.patch"))))
314 (build-system cmake-build-system)
317 (list "-DOPENBABEL_USE_SYSTEM_INCHI=ON"
318 (string-append "-DINCHI_LIBRARY="
319 (assoc-ref %build-inputs "inchi")
320 "/lib/inchi/libinchi.so.1")
321 (string-append "-DINCHI_INCLUDE_DIR="
322 (assoc-ref %build-inputs "inchi") "/include/inchi"))
323 #:test-target "test"))
325 `(("pkg-config" ,pkg-config)))
331 (home-page "http://openbabel.org/wiki/Main_Page")
332 (synopsis "Chemistry data manipulation toolbox")
334 "Open Babel is a chemical toolbox designed to speak the many languages of
335 chemical data. It's a collaborative project allowing anyone to search, convert,
336 analyze, or store data from molecular modeling, chemistry, solid-state
337 materials, biochemistry, or related areas.")
338 (license license:gpl2)))