From 74ab8bbfa4673a79d57c391d3d14efb64d8a50d7 Mon Sep 17 00:00:00 2001 From: maurerv Date: Fri, 13 Oct 2023 18:27:37 +0200 Subject: [PATCH 1/9] Added Dockerfile --- Dockerfile | 68 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 68 insertions(+) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..c91da59 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,68 @@ +FROM ubuntu:18.04 + +ENV LD_LIBRARY_PATH=/usr/local/lib64 +ENV CLFFT_DIR=/src/clFFT +ENV CLFFT_LIB_DIRS=/usr/local/lib64 +ENV CLFFT_INCL_DIRS=/src/clFFT/src/include +ENV CL_INCL_DIRS=/usr/local/include +ENV LD_LIBRARY_PATH=/usr/local/lib64:/usr/local/lib + +RUN apt-get update --fix-missing && \ + apt-get install -y \ + python2.7 \ + python2.7-dev \ + git \ + wget \ + gcc \ + g++ \ + libfftw3-dev \ + libfftw3-doc \ + libfreetype6-dev \ + pkg-config \ + libopenblas-dev \ + gfortran \ + python-scipy \ + python-numpy \ + time \ + cmake \ + make \ + opencl-headers \ + ocl-icd-opencl-dev \ + libboost-all-dev \ + pocl-opencl-icd + + +RUN mkdir src && \ + cd /src && \ + wget https://bootstrap.pypa.io/pip/2.7/get-pip.py && \ + python2 get-pip.py && \ + python2.7 -mpip install Cython==0.29.33 pyfftw==0.12.0 pybind11 setuptools && \ + python2.7 -mpip install numpy==1.16.6 pyopencl==2020.2 install backports.weakref==1.0.post1 + +RUN cd /src && \ + git clone https://github.com/clMathLibraries/clFFT.git && \ + cd clFFT/src && \ + cmake . && \ + make && \ + make install + +RUN cd /src && \ + git clone https://github.com/haddocking/powerfit && \ + cd powerfit && \ + python2.7 setup.py install + +RUN cd /src && \ + git clone https://github.com/geggo/gpyfft.git && \ + export LD_LIBRARY_PATH=/usr/local/lib64 && \ + export CLFFT_DIR=/src/clFFT && \ + export CLFFT_LIB_DIRS=/usr/local/lib64 && \ + export CLFFT_INCL_DIRS=/src/clFFT/src/include && \ + export CL_INCL_DIRS=/usr/local/include && \ + export LD_LIBRARY_PATH=/usr/local/lib64:/usr/local/lib && \ + cd gpyfft && \ + sed -i \ + -e "s|CLFFT_DIR = r'/home/gregor/devel/clFFT'|CLFFT_DIR = '/src/clFFT'|" \ + -e "s|CL_INCL_DIRS = \['/opt/AMDAPPSDK-3.0/include'\]|CL_INCL_DIRS = ['/usr/local/include']|" \ + setup.py && \ + python2.7 setup.py install + From 8d4ef2976f1b90aef72d7fd20b246732629448d4 Mon Sep 17 00:00:00 2001 From: Valentin Maurer <43959863+maurerv@users.noreply.github.com> Date: Sat, 14 Oct 2023 20:06:48 +0200 Subject: [PATCH 2/9] Update README.md --- README.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/README.md b/README.md index 1b97ebb..47e2f42 100644 --- a/README.md +++ b/README.md @@ -111,6 +111,16 @@ install a Python distribution with NumPy and Scipy included such as bash shell shipped with *git* and follow the general instructions written above. +### Docker + +First install [docker](https://docs.docker.com/engine/install/) by following the +instructions. + +A docker container comprised of powerfit and its necessary dependencies can be +created for the linux/amd64 platform as follows + + docker build -t powerfit --platform linux/amd64 -f Dockerfile . + ## Usage @@ -126,6 +136,11 @@ cross-correlation score on a single CPU-core. During the search, *powerfit* will update you about the progress of the search if you are using it interactively in the shell. +Running powerfit in a docker container named powerfit on data located at +a hypothetical `/path/to/data` on your machine can be done as follows: + + docker run --rm -v /path/to/data:/data powerfit \ + powerfit /data/ /data/ -d /data ### Options From 1c32de1ceb1a8815785323a849dcf0989c2251cd Mon Sep 17 00:00:00 2001 From: Valentin Maurer <43959863+maurerv@users.noreply.github.com> Date: Sat, 14 Oct 2023 20:08:13 +0200 Subject: [PATCH 3/9] Update README.md --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 47e2f42..1a04319 100644 --- a/README.md +++ b/README.md @@ -116,8 +116,8 @@ above. First install [docker](https://docs.docker.com/engine/install/) by following the instructions. -A docker container comprised of powerfit and its necessary dependencies can be -created for the linux/amd64 platform as follows +A docker container comprised of PowerFit and its necessary CPU/GPU +dependencies can be created for the linux/amd64 platform as follows docker build -t powerfit --platform linux/amd64 -f Dockerfile . @@ -136,7 +136,7 @@ cross-correlation score on a single CPU-core. During the search, *powerfit* will update you about the progress of the search if you are using it interactively in the shell. -Running powerfit in a docker container named powerfit on data located at +Running PowerFit in a docker container named powerfit on data located at a hypothetical `/path/to/data` on your machine can be done as follows: docker run --rm -v /path/to/data:/data powerfit \ From adb99a7f6244babd6f73023f71118fc1fba0d07c Mon Sep 17 00:00:00 2001 From: maurerv Date: Sun, 15 Oct 2023 00:18:02 +0200 Subject: [PATCH 4/9] Cleaned Dockerfile --- Dockerfile | 29 +++++++++++------------------ 1 file changed, 11 insertions(+), 18 deletions(-) diff --git a/Dockerfile b/Dockerfile index c91da59..26a47a7 100644 --- a/Dockerfile +++ b/Dockerfile @@ -29,36 +29,29 @@ RUN apt-get update --fix-missing && \ opencl-headers \ ocl-icd-opencl-dev \ libboost-all-dev \ - pocl-opencl-icd + pocl-opencl-icd && \ + apt-get clean && \ + rm -rf /var/lib/apt/lists/* +WORKDIR /src -RUN mkdir src && \ - cd /src && \ - wget https://bootstrap.pypa.io/pip/2.7/get-pip.py && \ +RUN wget https://bootstrap.pypa.io/pip/2.7/get-pip.py && \ python2 get-pip.py && \ - python2.7 -mpip install Cython==0.29.33 pyfftw==0.12.0 pybind11 setuptools && \ - python2.7 -mpip install numpy==1.16.6 pyopencl==2020.2 install backports.weakref==1.0.post1 + python2.7 -mpip install \ + Cython==0.29.33 pyfftw==0.12.0 pybind11 setuptools \ + numpy==1.16.6 pyopencl==2020.2 backports.weakref==1.0.post1 -RUN cd /src && \ - git clone https://github.com/clMathLibraries/clFFT.git && \ +RUN git clone https://github.com/clMathLibraries/clFFT.git && \ cd clFFT/src && \ cmake . && \ make && \ make install -RUN cd /src && \ - git clone https://github.com/haddocking/powerfit && \ +RUN git clone https://github.com/haddocking/powerfit && \ cd powerfit && \ python2.7 setup.py install -RUN cd /src && \ - git clone https://github.com/geggo/gpyfft.git && \ - export LD_LIBRARY_PATH=/usr/local/lib64 && \ - export CLFFT_DIR=/src/clFFT && \ - export CLFFT_LIB_DIRS=/usr/local/lib64 && \ - export CLFFT_INCL_DIRS=/src/clFFT/src/include && \ - export CL_INCL_DIRS=/usr/local/include && \ - export LD_LIBRARY_PATH=/usr/local/lib64:/usr/local/lib && \ +RUN git clone https://github.com/geggo/gpyfft.git && \ cd gpyfft && \ sed -i \ -e "s|CLFFT_DIR = r'/home/gregor/devel/clFFT'|CLFFT_DIR = '/src/clFFT'|" \ From 045ed9795cecc122d730216b201b59ca0fbb0a1f Mon Sep 17 00:00:00 2001 From: Valentin Maurer <43959863+maurerv@users.noreply.github.com> Date: Sun, 15 Oct 2023 00:28:55 +0200 Subject: [PATCH 5/9] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 1a04319..df99c13 100644 --- a/README.md +++ b/README.md @@ -137,7 +137,7 @@ will update you about the progress of the search if you are using it interactively in the shell. Running PowerFit in a docker container named powerfit on data located at -a hypothetical `/path/to/data` on your machine can be done as follows: +a hypothetical `/path/to/data` on your machine can be done as follows docker run --rm -v /path/to/data:/data powerfit \ powerfit /data/ /data/ -d /data From 487230eda3654e47404b456685fd90c96a0c0864 Mon Sep 17 00:00:00 2001 From: Valentin Maurer <43959863+maurerv@users.noreply.github.com> Date: Sun, 15 Oct 2023 00:31:36 +0200 Subject: [PATCH 6/9] Update README.md --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index df99c13..b80b5a0 100644 --- a/README.md +++ b/README.md @@ -116,10 +116,10 @@ above. First install [docker](https://docs.docker.com/engine/install/) by following the instructions. -A docker container comprised of PowerFit and its necessary CPU/GPU -dependencies can be created for the linux/amd64 platform as follows +A docker container comprised of PowerFit and its CPU/GPU +dependencies can be created for your compute platform as follows - docker build -t powerfit --platform linux/amd64 -f Dockerfile . + docker build -t powerfit -f Dockerfile . ## Usage From b67d4be5af071e6eb9afa2c2cb4cfe2e6b17bc6e Mon Sep 17 00:00:00 2001 From: Rodrigo V Honorato Date: Mon, 16 Oct 2023 11:20:33 +0200 Subject: [PATCH 7/9] use tagged powerfit version --- Dockerfile | 54 +++++++++++++++++++++++++++++------------------------- 1 file changed, 29 insertions(+), 25 deletions(-) diff --git a/Dockerfile b/Dockerfile index 26a47a7..4baccbe 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,7 @@ FROM ubuntu:18.04 +ARG POWERFIT_VERSION=v2.1.0 + ENV LD_LIBRARY_PATH=/usr/local/lib64 ENV CLFFT_DIR=/src/clFFT ENV CLFFT_LIB_DIRS=/usr/local/lib64 @@ -9,27 +11,27 @@ ENV LD_LIBRARY_PATH=/usr/local/lib64:/usr/local/lib RUN apt-get update --fix-missing && \ apt-get install -y \ - python2.7 \ - python2.7-dev \ - git \ - wget \ - gcc \ - g++ \ - libfftw3-dev \ - libfftw3-doc \ - libfreetype6-dev \ - pkg-config \ - libopenblas-dev \ - gfortran \ - python-scipy \ - python-numpy \ - time \ - cmake \ - make \ - opencl-headers \ - ocl-icd-opencl-dev \ - libboost-all-dev \ - pocl-opencl-icd && \ + python2.7 \ + python2.7-dev \ + git \ + wget \ + gcc \ + g++ \ + libfftw3-dev \ + libfftw3-doc \ + libfreetype6-dev \ + pkg-config \ + libopenblas-dev \ + gfortran \ + python-scipy \ + python-numpy \ + time \ + cmake \ + make \ + opencl-headers \ + ocl-icd-opencl-dev \ + libboost-all-dev \ + pocl-opencl-icd && \ apt-get clean && \ rm -rf /var/lib/apt/lists/* @@ -38,8 +40,8 @@ WORKDIR /src RUN wget https://bootstrap.pypa.io/pip/2.7/get-pip.py && \ python2 get-pip.py && \ python2.7 -mpip install \ - Cython==0.29.33 pyfftw==0.12.0 pybind11 setuptools \ - numpy==1.16.6 pyopencl==2020.2 backports.weakref==1.0.post1 + Cython==0.29.33 pyfftw==0.12.0 pybind11 setuptools \ + numpy==1.16.6 pyopencl==2020.2 backports.weakref==1.0.post1 RUN git clone https://github.com/clMathLibraries/clFFT.git && \ cd clFFT/src && \ @@ -49,13 +51,15 @@ RUN git clone https://github.com/clMathLibraries/clFFT.git && \ RUN git clone https://github.com/haddocking/powerfit && \ cd powerfit && \ + git checkout ${POWERFIT_VERSION} && \ python2.7 setup.py install RUN git clone https://github.com/geggo/gpyfft.git && \ cd gpyfft && \ sed -i \ - -e "s|CLFFT_DIR = r'/home/gregor/devel/clFFT'|CLFFT_DIR = '/src/clFFT'|" \ - -e "s|CL_INCL_DIRS = \['/opt/AMDAPPSDK-3.0/include'\]|CL_INCL_DIRS = ['/usr/local/include']|" \ + -e "s|CLFFT_DIR = r'/home/gregor/devel/clFFT'|CLFFT_DIR = '/src/clFFT'|" \ + -e "s|CL_INCL_DIRS = \['/opt/AMDAPPSDK-3.0/include'\]|CL_INCL_DIRS = ['/usr/local/include']|" \ setup.py && \ python2.7 setup.py install +ENTRYPOINT [ "powerfit" ] \ No newline at end of file From a3e28fb80feaedb35faff340ffba3e3bc3d702b7 Mon Sep 17 00:00:00 2001 From: Rodrigo V Honorato Date: Mon, 16 Oct 2023 11:20:59 +0200 Subject: [PATCH 8/9] update docker installation to account for version --- README.md | 44 +++++++++++++++++--------------------------- 1 file changed, 17 insertions(+), 27 deletions(-) diff --git a/README.md b/README.md index b80b5a0..5d03d3a 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,6 @@ further be hardware-accelerated by leveraging multi-core CPU machines out of the box or by GPU via the OpenCL framework. PowerFit is Free Software and has been succesfully installed and used on Linux and MacOSX machines. - ## Requirements Minimal requirements for the CPU version: @@ -44,7 +43,6 @@ Recommended for installation * git * pip - ## Installation If you already have fulfilled the requirements, the installation should be as @@ -58,8 +56,18 @@ If you are starting from a clean system, follow the instructions for your particular operating system as described below, they should get you up and running in no time. +### Docker + +First install [docker](https://docs.docker.com/engine/install/) by following the +instructions. -### Linux +A docker container comprised of PowerFit and its CPU/GPU +dependencies can be created for your compute platform as follows + + docker build -t haddocking/powerfit:v2.1.0 -f Dockerfile . + docker run haddocking/powerfit:v2.1.0 + +### Linux Linux systems usually already include a Python2.7 distribution. First make sure the Python header files, NumPy, SciPy, and *git* are available by @@ -67,7 +75,7 @@ opening up a terminal and typing for Debian and Ubuntu systems sudo apt-get install python-dev python-numpy python-scipy git -If you are working on Fedora, this should be replaced by +If you are working on Fedora, this should be replaced by sudo yum install python-devel numpy scipy git @@ -75,7 +83,6 @@ Sit back and wait till the compilation and installation is finished. Your system is now prepared, follow the general instructions above to install **PowerFit**. - ### MacOSX First install [*git*](https://git-scm.com/download) by following the @@ -85,7 +92,7 @@ instructions on their website, or using a package manager such as *brew* Next install [*pip*](https://pip.pypa.io/en/latest/installing.html), the Python package manager, by following the installation instructions on the -website or open a terminal and type +website or open a terminal and type sudo easy_install pip @@ -101,7 +108,6 @@ Installing pyFFTW for faster CPU version can be done as follows using *brew* brew install fftw sudo pip install pyfftw - ### Windows First install *git* for Windows, as it comes with a handy bash shell. Go to @@ -111,17 +117,6 @@ install a Python distribution with NumPy and Scipy included such as bash shell shipped with *git* and follow the general instructions written above. -### Docker - -First install [docker](https://docs.docker.com/engine/install/) by following the -instructions. - -A docker container comprised of PowerFit and its CPU/GPU -dependencies can be created for your compute platform as follows - - docker build -t powerfit -f Dockerfile . - - ## Usage After installing PowerFit the command line tool *powerfit* should be at your @@ -168,7 +163,6 @@ and write out the top 15 solutions Note that all options can be combined except for the `-g` and `-p` flag: calculations are either performed on the CPU or GPU. - ### Output When the search is finished, several output files are created @@ -185,7 +179,6 @@ correlation score found during the rotational search. * *powerfit.log*: a log file, including the input parameters with date and timing information. - ## Creating an image-pyramid The use of multi-scale image pyramids can signicantly increase the speed of @@ -205,21 +198,19 @@ To see the other options type image-pyramid --help - ## Licensing If this software was useful to your research, please cite us -**G.C.P. van Zundert and A.M.J.J. Bonvin**. +**G.C.P. van Zundert and A.M.J.J. Bonvin**. Fast and sensitive rigid-body fitting into cryo-EM density maps with PowerFit. *AIMS Biophysics* 2, 73-87 (2015). - For the use of image-pyramids and reliability measures for fitting, please cite -**G.C.P van Zundert and A.M.J.J. Bonvin**. +**G.C.P van Zundert and A.M.J.J. Bonvin**. Defining the limits and reliability of rigid-body fitting in cryo-EM maps using -multi-scale image pyramids. +multi-scale image pyramids. *J. Struct. Biol.* 195, 252-258 (2016). Apache License Version 2.0 @@ -227,8 +218,6 @@ Apache License Version 2.0 The elements.py module is licensed under MIT License (see header). Copyright (c) 2005-2015, Christoph Gohlke - - ## Tested platforms | Operating System| CPU single | CPU multi | GPU | @@ -238,5 +227,6 @@ Copyright (c) 2005-2015, Christoph Gohlke |Windows | Yes | Fail | No | The GPU version has been tested on: + * NVIDIA GeForce GTX 680 and AMD Radeon HD 7730M for Linux * NVIDIA GeForce GTX 775M for MacOSX 10.10 From a8acea65d40ff061bb5262e70e0b4fd3264388f4 Mon Sep 17 00:00:00 2001 From: Rodrigo V Honorato Date: Mon, 16 Oct 2023 11:23:14 +0200 Subject: [PATCH 9/9] typo --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 4baccbe..20af6b2 100644 --- a/Dockerfile +++ b/Dockerfile @@ -62,4 +62,4 @@ RUN git clone https://github.com/geggo/gpyfft.git && \ setup.py && \ python2.7 setup.py install -ENTRYPOINT [ "powerfit" ] \ No newline at end of file +ENTRYPOINT [ "powerfit" ]