$npx -y skills add adaptyvbio/protein-design-skills --skill foldseekStructure similarity search with Foldseek. Use this skill when: (1) Finding similar structures in PDB/AFDB databases, (2) Structural homology search, (3) Database queries by 3D structure, (4) Finding remote homologs not detected by sequence, (5) Clustering structures by similarit
| 1 | # Foldseek Structure Search |
| 2 | |
| 3 | ## Prerequisites |
| 4 | |
| 5 | | Requirement | Minimum | Recommended | |
| 6 | |-------------|---------|-------------| |
| 7 | | Python | 3.8+ | 3.10 | |
| 8 | | RAM | 8GB | 16GB | |
| 9 | | Disk | 10GB | 50GB (for local databases) | |
| 10 | |
| 11 | ## How to run |
| 12 | |
| 13 | **Note**: Foldseek can run locally or via web server. No GPU required. |
| 14 | |
| 15 | ### Option 1: Web Server (Quick; rate-limited, use sparingly) |
| 16 | ```bash |
| 17 | # Upload structure to web server |
| 18 | curl -X POST "https://search.foldseek.com/api/ticket" \ |
| 19 | -F "q=@query.pdb" \ |
| 20 | -F "database[]=afdb50" \ |
| 21 | -F "database[]=pdb100" |
| 22 | ``` |
| 23 | |
| 24 | ### Option 2: Local installation |
| 25 | ```bash |
| 26 | # Install Foldseek |
| 27 | conda install -c conda-forge -c bioconda foldseek |
| 28 | |
| 29 | # Search PDB |
| 30 | foldseek easy-search query.pdb /path/to/pdb100 results.m8 tmp/ |
| 31 | |
| 32 | # Search AlphaFold DB |
| 33 | foldseek easy-search query.pdb /path/to/afdb50 results.m8 tmp/ |
| 34 | ``` |
| 35 | |
| 36 | ### Option 3: Python API |
| 37 | ```python |
| 38 | import subprocess |
| 39 | import pandas as pd |
| 40 | |
| 41 | def foldseek_search(query_pdb, database, output="results.m8"): |
| 42 | """Run Foldseek search.""" |
| 43 | subprocess.run([ |
| 44 | "foldseek", "easy-search", |
| 45 | query_pdb, database, output, "tmp/", |
| 46 | "--format-output", "query,target,pident,alnlen,evalue,bits" |
| 47 | ]) |
| 48 | return pd.read_csv(output, sep="\t", |
| 49 | names=["query", "target", "pident", "alnlen", "evalue", "bits"]) |
| 50 | ``` |
| 51 | |
| 52 | ## Key parameters |
| 53 | |
| 54 | | Parameter | Default | Description | |
| 55 | |-----------|---------|-------------| |
| 56 | | `--min-seq-id` | 0.0 | Minimum sequence identity | |
| 57 | | `-e` | 0.001 | E-value threshold | |
| 58 | | `--alignment-type` | 2 | 0=3Di, 1=TM, 2=3Di+AA | |
| 59 | | `--max-seqs` | 1000 | Max hits to pass through prefilter; reducing this affects sensitivity | |
| 60 | |
| 61 | ## Databases |
| 62 | |
| 63 | | Database | Description | Size | |
| 64 | |----------|-------------|------| |
| 65 | | `pdb100` | PDB chains | ~340K structures | |
| 66 | | `afdb50` | AlphaFold DB clustered at 50% sequence identity | ~53M structures | |
| 67 | | `swissprot` | SwissProt structures | ~540K structures | |
| 68 | | `cath50` | CATH domains | ~50K domains | |
| 69 | |
| 70 | ## Output format |
| 71 | |
| 72 | ``` |
| 73 | # results.m8 (tabular) |
| 74 | query target pident alnlen evalue bits |
| 75 | query 1abc_A 85.2 120 1e-45 180.5 |
| 76 | query 2def_B 72.1 115 1e-32 145.2 |
| 77 | ``` |
| 78 | |
| 79 | ## Sample output |
| 80 | |
| 81 | ### Successful run |
| 82 | ``` |
| 83 | $ foldseek easy-search query.pdb pdb100 results.m8 tmp/ |
| 84 | # results.m8 columns: query target pident alnlen mismatch gapopen qstart qend tstart tend evalue bits |
| 85 | query 1abc_A 85.2 120 ... 1e-45 180.5 |
| 86 | query 2def_B 72.1 115 ... 1e-32 145.2 |
| 87 | ``` |
| 88 | |
| 89 | Hit identities and E-values above are placeholders; foldseek does not print the |
| 90 | `[INFO]` lines shown by some other tools. |
| 91 | |
| 92 | ## Decision tree |
| 93 | |
| 94 | ``` |
| 95 | Should I use Foldseek? |
| 96 | │ |
| 97 | ├─ What are you searching? |
| 98 | │ ├─ By 3D structure → Foldseek ✓ |
| 99 | │ ├─ By sequence → Use BLAST (uniprot skill) |
| 100 | │ └─ Both → Run both, compare results |
| 101 | │ |
| 102 | └─ What do you need? |
| 103 | ├─ Find structural homologs → Foldseek ✓ |
| 104 | ├─ Remote homolog detection → Foldseek ✓ |
| 105 | ├─ Structural clustering → Foldseek ✓ |
| 106 | └─ Functional annotation → Cross-reference with UniProt |
| 107 | ``` |
| 108 | |
| 109 | ## Common use cases |
| 110 | |
| 111 | ### Find similar designs |
| 112 | ```bash |
| 113 | # Compare your design to PDB |
| 114 | foldseek easy-search design.pdb pdb100 similar_natural.m8 tmp/ |
| 115 | ``` |
| 116 | |
| 117 | ### Novelty check |
| 118 | ```bash |
| 119 | # Ensure design is novel (low similarity to known) |
| 120 | foldseek easy-search design.pdb afdb50 novelty.m8 tmp/ |
| 121 | |
| 122 | # Novel if: top hit identity < 30% |
| 123 | ``` |
| 124 | |
| 125 | ### Scaffold search |
| 126 | ```bash |
| 127 | # Find scaffolds for motif grafting |
| 128 | foldseek easy-search motif.pdb pdb100 scaffolds.m8 tmp/ \ |
| 129 | --min-seq-id 0.0 -e 10 |
| 130 | ``` |
| 131 | |
| 132 | --- |
| 133 | |
| 134 | ## Verify |
| 135 | |
| 136 | ```bash |
| 137 | wc -l results.m8 # Number of hits |
| 138 | ``` |
| 139 | |
| 140 | --- |
| 141 | |
| 142 | ## Troubleshooting |
| 143 | |
| 144 | **No hits**: Lower e-value threshold, try larger database |
| 145 | **Too many hits**: Increase min-seq-id threshold |
| 146 | **Slow search**: Use smaller database |
| 147 | |
| 148 | ### Error interpretation |
| 149 | |
| 150 | | Error | Cause | Fix | |
| 151 | |-------|-------|-----| |
| 152 | | `Database not found` | Wrong path | Check database location | |
| 153 | | `Invalid PDB` | Malformed structure | Validate PDB format | |
| 154 | | `Out of memory` | Large database | Use more RAM or web server | |
| 155 | |
| 156 | --- |
| 157 | |
| 158 | **Next**: Download hits with `pdb` skill → use for scaffold design. |