Skip to content

Instantly share code, notes, and snippets.

@kaczmarj
Last active October 19, 2021 18:00
Show Gist options
  • Save kaczmarj/3c021dcec73678cbbbcba7122a4e4721 to your computer and use it in GitHub Desktop.
Save kaczmarj/3c021dcec73678cbbbcba7122a4e4721 to your computer and use it in GitHub Desktop.

How to use ColabFold on Elzar

This guide demonstrates how to use Sergey's ColabFold notebooks on Cold Spring Harbor's Elzar cluster. The instructions can also be extended to any cluster that has a GPU and Singularity installed.

These instructions were only tested with Jakub Kaczmarzyk's AlphaFold2_advanced_notcolab.ipynb notebook, which is a minor modification of Sergey's original AlphaFold2_advanced.ipynb notebook. Even Amber relaxation is tested.

❗❗❗IMPORTANT: after finishing your work, be sure to terminate the GPU process. To do this, you can shutdown the jupyter notebook (this is not equivalent to closing the tab, you need to go to Kernel->Shutdown). And quit the singularity process as well. Exit the qrsh job when you are finished.

  1. Get onto Elzar and request a GPU node.

    ssh USERNAME@bamdev1.cshl.edu
    qrsh -l gpu=1 -l m_mem_free=16G
    
  2. Get the AlphaFold2_advanced_notcolab.ipynb notebook.

    git clone --depth 1 --branch add/docker https://github.com/kaczmarj/ColabFold.git
    

    In terms of AlphaFold2, this notebook is identical to Sergey's original AlphaFold2_advanced.ipynb notebook. The changes are in environment setup. The original notebook downloads various python packages and optionally installs conda and some system packages. It is not always possible to install these packages on shared systems, especially system packages. In addition, containers are read-only, and we would like to deploy this environment in a container. So the container includes all of the software that is installed in the setup steps of the original notebook. The AlphaFold2_advanced_notcolab.ipynb notebook removes those steps and also removes some Google Colab-specific imports, which will not work outside of Colab.

  3. Run Jupyter Notebook through Singularity

    singularity run --contain --nv --bind $(pwd):/work --pwd /work \
      /grid/koo/home/kaczmar/containers/kaczmarj_colabfold-testing.sif \
        --port 12340
    

    This will bind mount the current directory onto /work in the container. It also starts the notebook on port 12340. You can choose a different port, but you should remember which port you used. This is important for SSH tunneling.

  4. Forward the port from Elzar to your local machine

    ssh -NfL 12340:bamgpu04:12340 USERNAME@bamdev1.cshl.edu
    

    The first port 12340 is the port on your local machine. bamgpu04 is the hostname of whichever node you are on. You can check this value by running hostname on Elzar. The second port 12340 is the port on which Jupyter is running. It is convenient to use the same port on both sides, because then you can click the link the Jupyter Notebook displays (the one with 127.0.0.1:PORT etc.) without having to change anything.

  5. Navigate to Jupyter Notebook in your browser (click the link that Jupyter Notebook displays in the terminal).

  6. In the notebook browser, navigate to ColabFold/beta.

  7. Start the notebook AlphaFold2_advanced_notcolab.ipynb (should be in ColabFold/beta).

  8. Enter your sequence of choice in the notebook, and run all of the cells.

  9. Run all cells, and enjoy your output.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment