docker – python: can’t open file ‘/home/administrator/alphafold/run_alphafold.py’: [Errno 2] No such file or directory

I’m trying to run docker for alphafold but it says that there is no ‘/home/administrator/alphafold/run_alphafold.py’ in the directory even if it does exist

Code I’m trying to run

python3 docker/run_docker.py \
--fasta_paths=your_protein.fasta \
--max_template_date=2022-01-01 \
--data_dir=/data8/Alphafold_database\
--output_dir=/data8/Alphafold_output_dir

OBS: this is just a test to know if docker is working (your_protein.fasta doesn’t really exist)

What it returns

(base) administrator@LPgru:~$ python3 docker/run_docker.py \
--fasta_paths=your_protein.fasta \
--max_template_date=2022-01-01 \
--data_dir=/data8/Alphafold_database\
--output_dir=/data8/Alphafold_output_dir
I0525 20:56:32.069198 140690356790336 run_docker.py:116] Mounting /data8/Alphafold_output_dir -> /mnt/fasta_path_0
I0525 20:56:32.069264 140690356790336 run_docker.py:116] Mounting /data8/Alphafold_output_dir -> /mnt/uniref90_database_path
I0525 20:56:32.069294 140690356790336 run_docker.py:116] Mounting /data8/Alphafold_output_dir -> /mnt/mgnify_database_path
I0525 20:56:32.069319 140690356790336 run_docker.py:116] Mounting /data8/Alphafold_output_dir -> /mnt/data_dir
I0525 20:56:32.069343 140690356790336 run_docker.py:116] Mounting /data8/Alphafold_output_dir -> /mnt/template_mmcif_dir
I0525 20:56:32.069365 140690356790336 run_docker.py:116] Mounting /data8/Alphafold_output_dir -> /mnt/obsolete_pdbs_path
I0525 20:56:32.069388 140690356790336 run_docker.py:116] Mounting /data8/Alphafold_output_dir -> /mnt/pdb70_database_path
I0525 20:56:32.069410 140690356790336 run_docker.py:116] Mounting /data8/Alphafold_output_dir -> /mnt/uniref30_database_path
I0525 20:56:32.069432 140690356790336 run_docker.py:116] Mounting /data8/Alphafold_output_dir -> /mnt/bfd_database_path
I0525 20:56:32.378198 140690356790336 run_docker.py:258] python: can't open file '/home/administrator/alphafold/run_alphafold.py': [Errno 2] No such file or directory

run_alphafold.py exists

(base) administrator@LPgru:~$ cd /home/administrator/alphafold/
(base) administrator@LPgru:~/alphafold$ ls
afdb  alphafold  CONTRIBUTING.md  database  docs  imgs  LICENSE  notebooks  README.md  requirements.txt  run_alphafold.py  run_alphafold_test.py  scripts  setup.py

Dockerfile


    # Copyright 2021 DeepMind Technologies Limited
    #
    # Licensed under the Apache License, Version 2.0 (the "License");
    # you may not use this file except in compliance with the License.
    # You may obtain a copy of the License at
    #
    #      http://www.apache.org/licenses/LICENSE-2.0
    #
    # Unless required by applicable law or agreed to in writing, software
    # distributed under the License is distributed on an "AS IS" BASIS,
    # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    # See the License for the specific language governing permissions and
    # limitations under the License.
    
    ARG CUDA=11.1.1
    FROM nvidia/cuda:${CUDA}-cudnn8-runtime-ubuntu18.04
    # FROM directive resets ARGS, so we specify again (the value is retained if
    # previously set).
    ARG CUDA
    
    # Use bash to support string substitution.
    SHELL ["/bin/bash", "-o", "pipefail", "-c"]
    
    RUN apt-get update \
        && DEBIAN_FRONTEND=noninteractive apt-get install --no-install-recommends -y \
            build-essential \
            cmake \
            cuda-command-line-tools-$(cut -f1,2 -d- <<< ${CUDA//./-}) \
            git \
            hmmer \
            kalign \
            tzdata \
            wget \
        && rm -rf /var/lib/apt/lists/* \
        && apt-get autoremove -y \
        && apt-get clean
    
    # Compile HHsuite from source.
    RUN git clone --branch v3.3.0 https://github.com/soedinglab/hh-suite.git /tmp/hh-suite \
        && mkdir /tmp/hh-suite/build \
        && pushd /tmp/hh-suite/build \
        && cmake -DCMAKE_INSTALL_PREFIX=/opt/hhsuite .. \
        && make -j 4 && make install \
        && ln -s /opt/hhsuite/bin/* /usr/bin \
        && popd \
        && rm -rf /tmp/hh-suite
    
    # Install Miniconda package manager.
    RUN wget -q -P /tmp \
      https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh \
        && bash /tmp/Miniconda3-latest-Linux-x86_64.sh -b -p /opt/conda \
        && rm /tmp/Miniconda3-latest-Linux-x86_64.sh
    
    # Install conda packages.
    ENV PATH="/opt/conda/bin:$PATH"
    RUN conda install -qy conda==4.13.0 \
        && conda install -y -c conda-forge \
          openmm=7.7.0 \
          cudatoolkit==${CUDA_VERSION} \
          pdbfixer \
          pip \
          python=3.8 \
          && conda clean --all --force-pkgs-dirs --yes
    
    COPY . /home/administrator/alphafold
    RUN wget -q -P /home/administrator/alphafold/alphafold/common \
      https://git.scicore.unibas.ch/schwede/openstructure/-/raw/7102c63615b64735c4941278d92b554ec94415f8/modules/mol/alg/src/stereo_chemical_props.txt
    
    # Install pip packages.
    RUN pip3 install --upgrade pip --no-cache-dir \
        && pip3 install -r /home/administrator/alphafold/docker/requirements.txt --no-cache-dir \
        && pip3 install --upgrade --no-cache-dir \
          jax==0.3.25 \
          jaxlib==0.3.25+cuda11.cudnn805 \
          -f https://storage.googleapis.com/jax-releases/jax_cuda_releases.html
    
    # Add SETUID bit to the ldconfig binary so that non-root users can run it.
    RUN chmod u+s /sbin/ldconfig.real
    
    # We need to run `ldconfig` first to ensure GPUs are visible, due to some quirk
    # with Debian. See https://github.com/NVIDIA/nvidia-docker/issues/1399 for
    # details.
    # ENTRYPOINT does not support easily running multiple commands, so instead we
    # write a shell script to wrap them up.
    WORKDIR /home/administrator/alphafold
    RUN echo $'#!/bin/bash\n\
    ldconfig\n\
    python /home/administrator/alphafold/run_alphafold.py "$@"' > /home/administrator/run_alphafold.sh \
      && chmod +x /home/administrator/run_alphafold.sh
    ENTRYPOINT ["/home/administrator/run_alphafold.sh"]

Read more here: Source link