Singularity recipe for AlphaFold, with example Slurm job script.
This splits off my pull request google-deepmind/alphafold#166
Disclaimer: this project is not affiliated with DeepMind.
N.B. google-deepmind/alphafold#510 (comment)
A prebuilt image is hosted on cloud.sylabs.io: https://cloud.sylabs.io/library/prehensilecode/alphafold_singularity/alphafold
Singularity.def
which is the recipe to build the Singularity image. This is a port of the Dockerfile provided by AlphaFold.run_singularity.py
which is a port of therun_docker.py
script provided by AlphaFold. It is a wrapper to provide a friendly interface for running the container.
Check out this repo into the top of the alphafold source tree to a directory called singularity
:
$ cd alphafold-v2.x.x
$ git clone https://github.com/prehensilecode/alphafold_singularity singularity
To use, first install the Python requirements:
$ python3 -m pip install -r singularity/requirements.txt
Then, build the Singularity image:
$ sudo singularity build alphafold.sif singularity/Singularity.def
If your /tmp
directory is small, you may need to set the SINGULARITY_TMPDIR
environment variable to a directory on a filesystem with more free space.
My builds have consumed up to 15 GiB of space. The resulting image file may be up to 10 GiB.
To run, modify the $ALPHAFOLD_SRC/singularity/run_singularity.py
and change the
section marked USER CONFIGURATION
. At the least, you will need to modify the values
of:
singularity_image
- absolute path to thealphafold.sif
Singularity image
E.g.
#### USER CONFIGURATION ####
# AlphaFold Singularity image.
singularity_image = Client.load(os.path.join(os.environ['ALPHAFOLD_DIR'], 'alphafold.sif'))
See the example job script example_slurm_job.sh