diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..20af6b2 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,65 @@ +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 +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 && \ + apt-get clean && \ + rm -rf /var/lib/apt/lists/* + +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 + +RUN git clone https://github.com/clMathLibraries/clFFT.git && \ + cd clFFT/src && \ + cmake . && \ + make && \ + make install + +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']|" \ + setup.py && \ + python2.7 setup.py install + +ENTRYPOINT [ "powerfit" ] diff --git a/README.md b/README.md index 1b97ebb..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. + +A docker container comprised of PowerFit and its CPU/GPU +dependencies can be created for your compute platform as follows -### Linux + 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,7 +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. - ## Usage After installing PowerFit the command line tool *powerfit* should be at your @@ -126,6 +131,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 @@ -153,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 @@ -170,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 @@ -190,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 @@ -212,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 | @@ -223,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