|
| 1 | +# CF-random Docker Image |
| 2 | + |
| 3 | +This Docker image provides a containerized environment for CF-random, a tool for predicting alternative protein conformations and fold-switching proteins using AlphaFold2-based sequence association. |
| 4 | + |
| 5 | +## Source Information |
| 6 | + |
| 7 | +**Repository**: https://github.com/ncbi/CF-random_software |
| 8 | +**Branch/Tag**: main |
| 9 | +**LocalColabFold**: https://github.com/YoshitakaMo/localcolabfold |
| 10 | +**Citation**: Lee, M., Schafer, J.W., Prabakaran, J. et al. Large-scale predictions of alternative protein conformations by AlphaFold2-based sequence association. Nat Commun 16, 5622 (2025). https://doi.org/10.1038/s41467-025-60759-5 |
| 11 | + |
| 12 | +## Description |
| 13 | + |
| 14 | +CF-random predicts alternative conformations and fold-switching proteins by sampling AlphaFold2 predictions with different multiple sequence alignments (MSAs). It integrates LocalColabFold for structure prediction and Foldseek for database searches. |
| 15 | + |
| 16 | +## Database Setup |
| 17 | + |
| 18 | +The image includes Foldseek but does NOT pre-download any databases. To use the blind mode or other database-dependent features, you need to download and mount the Foldseek databases. |
| 19 | + |
| 20 | +### Downloading AlphaFold2 Weights |
| 21 | + |
| 22 | +The image does NOT include pre-downloaded AlphaFold2 weights. Download them at first use: |
| 23 | + |
| 24 | +```bash |
| 25 | +docker run --rm -v /path/to/params:/params cf-random:latest \ |
| 26 | + python -m colabfold.download |
| 27 | +``` |
| 28 | + |
| 29 | +Then mount the params directory when running: |
| 30 | +```bash |
| 31 | +docker run -v /path/to/params:/params cf-random:latest ... |
| 32 | +``` |
| 33 | + |
| 34 | +### Downloading Foldseek Databases |
| 35 | + |
| 36 | +Before running the container, download the PDB database (or any other Foldseek database you need): |
| 37 | + |
| 38 | +```bash |
| 39 | +# Create a directory for databases on your host |
| 40 | +mkdir -p /path/to/databases |
| 41 | + |
| 42 | +# Download PDB database (this will take some time and requires ~50GB+) |
| 43 | +# Run this outside the container or mount the database directory |
| 44 | +docker run --rm -v /path/to/databases:/databases cf-random:latest \ |
| 45 | + foldseek databases PDB /databases/pdb /databases/tmp |
| 46 | +``` |
| 47 | + |
| 48 | +Alternatively, you can download databases using foldseek directly on your host system if you have it installed, then mount the directory into the container. |
| 49 | + |
| 50 | +## Usage Examples |
| 51 | + |
| 52 | +### Basic Help |
| 53 | + |
| 54 | +```bash |
| 55 | +docker run --rm cf-random:latest python /opt/cf-random/code/main.py --help |
| 56 | +``` |
| 57 | + |
| 58 | +### Fold-Switching Mode with GPU |
| 59 | + |
| 60 | +Predict fold-switching proteins with reference structures: |
| 61 | + |
| 62 | +```bash |
| 63 | +docker run --gpus all \ |
| 64 | + -v $(pwd)/data:/workspace/data \ |
| 65 | + -v $(pwd)/output:/workspace/output \ |
| 66 | + -w /workspace/data \ |
| 67 | + cf-random:latest \ |
| 68 | + python /opt/cf-random/code/main.py \ |
| 69 | + --fname 2oug_C-search/ \ |
| 70 | + --pdb1 2oug_C.pdb \ |
| 71 | + --pdb2 6c6s_D.pdb \ |
| 72 | + --option FS |
| 73 | +``` |
| 74 | + |
| 75 | +### Alternative Conformation Mode |
| 76 | + |
| 77 | +Predict alternative conformations: |
| 78 | + |
| 79 | +```bash |
| 80 | +docker run --gpus all \ |
| 81 | + -v $(pwd)/data:/workspace/data \ |
| 82 | + -v $(pwd)/output:/workspace/output \ |
| 83 | + -w /workspace/data \ |
| 84 | + cf-random:latest \ |
| 85 | + python /opt/cf-random/code/main.py \ |
| 86 | + --fname 5olw_A-search \ |
| 87 | + --pdb1 5olw_A.pdb \ |
| 88 | + --pdb2 5olx_A.pdb \ |
| 89 | + --option AC \ |
| 90 | + --nMSA 5 |
| 91 | +``` |
| 92 | + |
| 93 | +### Blind Mode with Foldseek Databases |
| 94 | + |
| 95 | +For blind mode, you need to mount the Foldseek databases: |
| 96 | + |
| 97 | +```bash |
| 98 | +docker run --gpus all \ |
| 99 | + -v $(pwd)/data:/workspace/data \ |
| 100 | + -v $(pwd)/output:/workspace/output \ |
| 101 | + -v /path/to/databases:/workspace/databases \ |
| 102 | + -w /workspace/data \ |
| 103 | + cf-random:latest \ |
| 104 | + python /opt/cf-random/code/main.py \ |
| 105 | + --pname Mad2_test \ |
| 106 | + --fname 2vfx_L-search/ \ |
| 107 | + --option blind |
| 108 | +``` |
| 109 | + |
| 110 | +### Using ColabFold Directly |
| 111 | + |
| 112 | +You can also use LocalColabFold directly: |
| 113 | + |
| 114 | +```bash |
| 115 | +docker run --gpus all \ |
| 116 | + -v $(pwd)/input:/workspace/input \ |
| 117 | + -v $(pwd)/output:/workspace/output \ |
| 118 | + -w /workspace \ |
| 119 | + cf-random:latest \ |
| 120 | + colabfold_batch \ |
| 121 | + /workspace/input \ |
| 122 | + /workspace/output \ |
| 123 | + --model-type ptm |
| 124 | +``` |
| 125 | + |
| 126 | +## Volume Mounts |
| 127 | + |
| 128 | +- **`/workspace/data`**: Directory for input files (MSA, PDB files, etc.) |
| 129 | +- **`/workspace/output`**: Directory for output files |
| 130 | +- **`/workspace/databases`**: Directory for Foldseek databases (if using blind mode) |
| 131 | +- **`/opt/cf-random/code`**: Directory containing CF-random Python scripts |
| 132 | + |
| 133 | +## Environment Variables |
| 134 | + |
| 135 | +- **`CONDA_DEFAULT_ENV=cf-random`**: The conda environment is already activated |
| 136 | +- **`PATH`**: Includes `/opt/conda/envs/cf-random/bin` where all tools are installed |
| 137 | + |
| 138 | +## GPU Support |
| 139 | + |
| 140 | +This image includes JAX with CUDA support. To use GPU acceleration: |
| 141 | + |
| 142 | +```bash |
| 143 | +docker run --gpus all ... |
| 144 | +``` |
| 145 | + |
| 146 | +Make sure you have the NVIDIA Docker runtime installed and your GPU drivers are up to date (CUDA 12.1+ required). |
| 147 | + |
| 148 | +## Input Requirements |
| 149 | + |
| 150 | +- **MSA files**: Should be in A3M format, typically in a subdirectory (e.g., `protein-search/0.a3m`) |
| 151 | +- **PDB files**: Should have a single chain, not multiple chains |
| 152 | +- **Reference PDBs**: For default modes (FS and AC), you need reference PDB files |
| 153 | +- **range_fs_pairs_all.txt**: Required for fold-switching mode to define residue ranges |
| 154 | + |
| 155 | +## Troubleshooting |
| 156 | + |
| 157 | +### Out of Memory Errors |
| 158 | + |
| 159 | +If you encounter GPU memory issues, try reducing the number of models or using a smaller batch size. |
| 160 | + |
| 161 | +### Database Not Found |
| 162 | + |
| 163 | +For blind mode, ensure you've downloaded the Foldseek databases and mounted them correctly to `/workspace/databases`. |
| 164 | + |
| 165 | +### MSA Format Issues |
| 166 | + |
| 167 | +Ensure your MSA files are in A3M format compatible with ColabFold. |
| 168 | + |
| 169 | +## Additional Tools |
| 170 | + |
| 171 | +The image also includes: |
| 172 | +- **colabfold_batch**: Main ColabFold batch prediction tool |
| 173 | +- **foldseek**: Fast and sensitive protein structure search |
| 174 | +- **kalign2**: Multiple sequence alignment tool |
| 175 | +- **mmseqs2**: Ultra-fast and sensitive sequence search |
| 176 | +- **pymol**: Molecular visualization (pymol-open-source) |
| 177 | + |
| 178 | +## License |
| 179 | + |
| 180 | +Please see the LICENSE.md file in the CF-random repository for licensing information. |
0 commit comments