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>
5 ;;; This file is part of GNU Guix.
7 ;;; GNU Guix is free software; you can redistribute it and/or modify it
8 ;;; under the terms of the GNU General Public License as published by
9 ;;; the Free Software Foundation; either version 3 of the License, or (at
10 ;;; your option) any later version.
12 ;;; GNU Guix is distributed in the hope that it will be useful, but
13 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
14 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 ;;; GNU General Public License for more details.
17 ;;; You should have received a copy of the GNU General Public License
18 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
20 (define-module (gnu packages chemistry)
21 #:use-module (guix packages)
22 #:use-module ((guix licenses) #:prefix license:)
23 #:use-module (guix download)
24 #:use-module (gnu packages)
25 #:use-module (gnu packages algebra)
26 #:use-module (gnu packages boost)
27 #:use-module (gnu packages compression)
28 #:use-module (gnu packages documentation)
29 #:use-module (gnu packages gl)
30 #:use-module (gnu packages gv)
31 #:use-module (gnu packages maths)
32 #:use-module (gnu packages pkg-config)
33 #:use-module (gnu packages python)
34 #:use-module (gnu packages qt)
35 #:use-module (gnu packages xml)
36 #:use-module (guix build-system cmake)
37 #:use-module (guix build-system gnu)
38 #:use-module (guix build-system python))
40 (define-public avogadro
46 (uri (string-append "https://github.com/cryos/avogadro/archive/"
50 "02v4h6hi1m7ilv0apdf74a8l1cm6dxnxyqp0rdaidrp3i9pf6lv4"))
51 (file-name (string-append name "-" version ".tar.gz"))
53 (search-patches "avogadro-eigen3-update.patch"
54 "avogadro-python-eigen-lib.patch"
55 "avogadro-boost148.patch"))))
56 (build-system cmake-build-system)
60 (list "-DENABLE_GLSL=ON"
61 (string-append "-DPYTHON_LIBRARIES="
62 (assoc-ref %build-inputs "python")
64 (string-append "-DPYTHON_INCLUDE_DIRS="
65 (assoc-ref %build-inputs "python")
66 "/include/python2.7"))
68 (modify-phases %standard-phases
69 (add-after 'unpack 'patch-python-lib-path
70 (lambda* (#:key outputs #:allow-other-keys)
71 ;; This is necessary to install the Python module in the correct
73 (substitute* "libavogadro/src/python/CMakeLists.txt"
74 (("^EXECUTE_PROCESS.*$") "")
75 (("^.*from sys import stdout.*$") "")
76 (("^.*OUTPUT_VARIABLE.*")
77 (string-append "set(PYTHON_LIB_PATH \""
78 (assoc-ref outputs "out")
79 "/lib/python2.7/site-packages\")")))
81 (add-after 'install 'wrap-program
82 (lambda* (#:key inputs outputs #:allow-other-keys)
83 ;; Make sure 'avogadro' runs with the correct PYTHONPATH.
84 (let* ((out (assoc-ref outputs "out")))
87 (assoc-ref outputs "out")
88 "/lib/python2.7/site-packages:"
89 (getenv "PYTHONPATH")))
90 (wrap-program (string-append out "/bin/avogadro")
91 `("PYTHONPATH" ":" prefix (,(getenv "PYTHONPATH")))))
94 `(("doxygen" ,doxygen)
95 ("pkg-config" ,pkg-config)))
100 ("openbabel" ,openbabel)
102 ("python-numpy" ,python2-numpy)
103 ("python-pyqt" ,python2-pyqt-4)
104 ("python-sip" ,python2-sip)
107 (home-page "https://avogadro.cc")
108 (synopsis "Advanced molecule editor")
110 "Avogadro is an advanced molecule editor and visualizer designed for use
111 in computational chemistry, molecular modeling, bioinformatics, materials
112 science, and related areas. It offers flexible high quality rendering and a
113 powerful plugin architecture.")
114 (license license:gpl2+)))
116 (define-public domainfinder
118 (name "domainfinder")
123 (uri (string-append "https://bitbucket.org/khinsen/"
124 "domainfinder/downloads/DomainFinder-"
128 "1z26lsyf7xwnzwjvimmbla7ckipx6p734w7y0jk2a2fzci8fkdcr"))))
129 (build-system python-build-system)
131 `(("python-mmtk" ,python2-mmtk)))
136 (home-page "http://dirac.cnrs-orleans.fr/DomainFinder")
137 (synopsis "Analysis of dynamical domains in proteins")
138 (description "DomainFinder is an interactive program for the determination
139 and characterization of dynamical domains in proteins. It can infer dynamical
140 domains by comparing two protein structures, or from normal mode analysis on a
141 single structure. The software is currently not actively maintained and works
142 only with Python 2 and NumPy < 1.9.")
143 (license license:cecill-c)))
151 (uri (string-append "http://www.inchi-trust.org/download/"
152 (string-join (string-split version #\.) "")
156 "081pcjx1z5jm23fs1pl2r3bccia0ww8wfkzcjpb7byhn7b513hsa"))
157 (file-name (string-append name "-" version ".zip"))))
158 (build-system gnu-build-system)
160 '(#:tests? #f ; no check target
162 (modify-phases %standard-phases
163 (delete 'configure) ; no configure script
164 (add-before 'build 'chdir-to-build-directory
165 (lambda _ (chdir "INCHI_EXE/inchi-1/gcc") #t))
166 (add-after 'build 'build-library
168 (chdir "../../../INCHI_API/libinchi/gcc")
171 (lambda* (#:key inputs outputs #:allow-other-keys)
172 (let* ((out (assoc-ref outputs "out"))
173 (bin (string-append out "/bin"))
174 (doc (string-append out "/share/doc/inchi"))
175 (include-dir (string-append out "/include/inchi"))
176 (lib (string-append out "/lib/inchi"))
177 (inchi-doc (assoc-ref inputs "inchi-doc"))
178 (unzip (string-append (assoc-ref inputs "unzip")
182 (with-directory-excursion "INCHI_EXE/bin/Linux"
183 (rename-file "inchi-1" "inchi")
184 (install-file "inchi" bin))
185 ;; Install libraries.
186 (with-directory-excursion "INCHI_API/bin/Linux"
187 (for-each (lambda (file)
188 (install-file file lib))
189 (find-files "." "libinchi\\.so\\.1\\.*")))
190 ;; Install header files.
191 (with-directory-excursion "INCHI_BASE/src"
192 (for-each (lambda (file)
193 (install-file file include-dir))
194 (find-files "." "\\.h$")))
195 ;; Install documentation.
197 (invoke unzip "-j" "-d" doc inchi-doc)
204 (uri (string-append "http://www.inchi-trust.org/download/"
205 (string-join (string-split version #\.) "")
209 "1id1qb2y4lwsiw91qr2yqpn6kxbwjwhjk0hb2rwk4fxhdqib6da6"))
210 (file-name (string-append name "-" version ".zip"))))))
211 (home-page "https://www.inchi-trust.org")
212 (synopsis "Utility for manipulating machine-readable chemical structures")
214 "The @dfn{InChI} (IUPAC International Chemical Identifier) algorithm turns
215 chemical structures into machine-readable strings of information. InChIs are
216 unique to the compound they describe and can encode absolute stereochemistry
217 making chemicals and chemistry machine-readable and discoverable. A simple
218 analogy is that InChI is the bar-code for chemistry and chemical structures.")
219 (license (license:non-copyleft
221 "See LICENCE in the distribution."))))
223 (define with-numpy-1.8
224 (package-input-rewriting `((,python2-numpy . ,python2-numpy-1.8))))
226 (define-public nmoldyn
233 (uri (string-append "https://bitbucket.org/khinsen/"
234 "nmoldyn3/downloads/nMOLDYN-"
238 "1mvmz3lkr217kdrd8cvdr1d82y58wp1403c9rnd943mijgq8xb5a"))))
239 (build-system python-build-system)
241 `(("python-matplotlib" ,(with-numpy-1.8 python2-matplotlib))
242 ("python-scientific" ,python2-scientific)
246 `(("python-mmtk" ,python2-mmtk)))
249 #:tests? #f ; No test suite
251 (modify-phases %standard-phases
252 (add-before 'build 'create-linux2-directory
254 (mkdir-p "nMOLDYN/linux2")))
255 (add-before 'build 'change-PDF-viewer
256 (lambda* (#:key inputs #:allow-other-keys)
257 (substitute* "nMOLDYN/Preferences.py"
258 ;; Set the paths for external executables, substituting
260 ;; There is also vmd_path, but VMD is not free software
261 ;; and Guix contains currently no free molecular viewer that
262 ;; could be substituted.
263 (("PREFERENCES\\['acroread_path'\\] = ''")
264 (format "PREFERENCES['acroread_path'] = '~a'"
266 (("PREFERENCES\\['ncdump_path'\\] = ''")
267 (format "PREFERENCES['ncdump_path'] = '~a'"
269 (("PREFERENCES\\['ncgen_path'\\] = ''")
270 (format "PREFERENCES['ncgen_path'] = '~a'"
272 (("PREFERENCES\\['task_manager_path'\\] = ''")
273 (format "PREFERENCES['task_manager_path'] = '~a'"
274 (which "task_manager")))
275 ;; Show documentation as PDF
276 (("PREFERENCES\\['documentation_style'\\] = 'html'")
277 "PREFERENCES['documentation_style'] = 'pdf'") ))))))
278 (home-page "http://dirac.cnrs-orleans.fr/nMOLDYN/")
279 (synopsis "Analysis software for Molecular Dynamics trajectories")
280 (description "nMOLDYN is an interactive analysis program for Molecular Dynamics
281 simulations. It is especially designed for the computation and decomposition of
282 neutron scattering spectra, but also computes other quantities. The software
283 is currently not actively maintained and works only with Python 2 and
285 (license license:cecill)))
287 (define-public openbabel
293 (uri (string-append "mirror://sourceforge/" name "/" name "/"
294 version "/" name "-" version ".tar.gz"))
297 "1z3d6xm70dpfikhwdnbzc66j2l49vq105ch041wivrfz5ic3ch90"))
299 (search-patches "openbabel-fix-crash-on-nwchem-output.patch"))))
300 (build-system cmake-build-system)
303 (list "-DOPENBABEL_USE_SYSTEM_INCHI=ON"
304 (string-append "-DINCHI_LIBRARY="
305 (assoc-ref %build-inputs "inchi")
306 "/lib/inchi/libinchi.so.1")
307 (string-append "-DINCHI_INCLUDE_DIR="
308 (assoc-ref %build-inputs "inchi") "/include/inchi"))
309 #:test-target "test"))
311 `(("pkg-config" ,pkg-config)))
317 (home-page "http://openbabel.org/wiki/Main_Page")
318 (synopsis "Chemistry data manipulation toolbox")
320 "Open Babel is a chemical toolbox designed to speak the many languages of
321 chemical data. It's a collaborative project allowing anyone to search, convert,
322 analyze, or store data from molecular modeling, chemistry, solid-state
323 materials, biochemistry, or related areas.")
324 (license license:gpl2)))