Sign inSign up

jysgro/colabfold_pip

By jysgro

•Updated almost 2 years ago

Image
0

432

jysgro/colabfold_pip repository overview

To be run on an HTcondor system (but can run also even on local macOS just on CPU)

docker run -it --rm -v "${PWD}":/workdir -w /workdir jysgro/colabfold_pip:v1.5.4_cudnn_py9_pip_ub2204

Note: on Biochem Linux server, the Shell script needs to re-install hh-suite.

MORE INFO ADDED LATER

⁠Dockerfile

# Use a CUDA-enabled base image from NVIDIA with Ubuntu 20.04
# FROM nvidia/cuda:11.8.0-cudnn8-devel-ubuntu20.04
# FROM nvidia/cuda:11.8.0-cudnn8-runtime-ubuntu20.04
FROM nvidia/cuda:11.8.0-cudnn8-devel-ubuntu22.04

# Set environment variables to automatically accept prompts
ENV DEBIAN_FRONTEND=noninteractive

# Update the package list and install dependencies for Python and GCC
RUN apt-get update && \
apt-get install -y \
software-properties-common \
build-essential \
wget nano cmake git \
curl && \
apt-get clean

# Add the repository for Python 3.9 and GCC 9
RUN add-apt-repository -y ppa:deadsnakes/ppa && \
add-apt-repository -y ppa:ubuntu-toolchain-r/test && \
apt-get update

# Install Python 3.9.20 and GCC 9
RUN apt-get install -y \
python3.9=3.9.20* \
python3.9-distutils \
gcc-9 \
g++-9 && \
apt-get clean

# Set Python 3.9 as the default Python version
RUN update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.9 1 && \
update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-9 1 && \
update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-9 1

# Install pip for Python 3.9
RUN wget https://bootstrap.pypa.io/get-pip.py && \
python3.9 get-pip.py && \
rm get-pip.py

# Install colabfold version 1.5.4
RUN pip install colabfold==1.5.4

# Install AlphaFold
RUN pip install colabfold[alphafold]

# hhsuite is required but is missing from the other install
# Install hhsuite from source
RUN git clone https://github.com/soedinglab/hh-suite.git && \
    cd hh-suite && \
    mkdir build && \
    cd build && \
    cmake .. && \
    make -j 4 && \
    make install && \
    export PATH="$(pwd)/bin:$(pwd)/scripts:$PATH" && \
    cd ../.. && \
    rm -rf hh-suite

#####################################################
# ALSO: from  https://github.com/openmm/openmm-setup
# Alternatively you can install from source code. OpenMM Setup is a Python application. 
# It requires the following software to be installed:
#
#    OpenMM: http://openmm.org/
#    PDBFixer: https://github.com/pandegroup/pdbfixer
#    Flask: http://flask.pocoo.org/

# Install OpenMM, now possible with pip:
RUN pip install openmm

# Install pdbfixer from source
RUN git clone https://github.com/openmm/pdbfixer.git && \
    cd pdbfixer && \
    python3 setup.py install && \
    cd .. && \
    rm -rf pdbfixer

# HOWEVER some fixing is needed to make this visible to python.
# Simple hard coded option would be:
# ENV PYTHONPATH $PYTHONPATH:/usr/lib/python3.9/site-packages/pdbfixer-1.9.0-py3.9.egg
# But when asked, Copilot suggested a method to be
#  "more flexible and less dependent on specific version numbers."

# Find and set the pdbfixer path dynamically using an intermediate file
RUN find /usr/lib/python3.9/site-packages -name "pdbfixer-*egg*" > /tmp/pdbfixer_path.txt && \
    PDBFIXER_PATH=$(head -n 1 /tmp/pdbfixer_path.txt) && \
    echo "PDBFIXER_PATH=$PDBFIXER_PATH" && \
    if [ -n "$PDBFIXER_PATH" ]; then \
        echo "export PYTHONPATH=\$PYTHONPATH:$PDBFIXER_PATH" >> /etc/profile && \
        export PYTHONPATH=$PDBFIXER_PATH:$PYTHONPATH; \
    fi && \
    rm /tmp/pdbfixer_path.txt

# Set the PYTHONPATH environment variable
ENV PYTHONPATH /usr/lib/python3.9/site-packages:$PYTHONPATH

# WE ARE NOW READY FOR FLASK

# Install Flask:
# blinker already installed in start image and interfere with
# pip installation
# The script cleanup_blinker.sh was written
# by Copilot and should remain within the new image.

COPY cleanup_blinker.sh /usr/local/bin/cleanup_blinker.sh
RUN chmod +x /usr/local/bin/cleanup_blinker.sh

# Run the cleanup script
RUN /usr/local/bin/cleanup_blinker.sh

# Install Flask
RUN pip install Flask

#####################################################
# To be able to check requirements
RUN pip install pipdeptree
# Use with "pipdeptree -p colabfold"
#####################################################


# Verify installations
RUN python3 --version && \
gcc --version && \
pip show colabfold

# Set default shell to bash
SHELL ["/bin/bash", "-c"]

# End of Dockerfile

Tag summary

Content type

Image

Digest

sha256:eac153c87…

Size

6.3 GB

Last updated

almost 2 years ago

docker pull jysgro/colabfold_pip:v1.5.4_bcc3