A tool for downloading AlphaFold structures using UniProt IDs or FASTA files
Project description
AlphaFoldFetch
AlphaFoldFetch is a small command-line tool for downloading AlphaFold structure files from UniProt accessions or UniProt-style FASTA files.
It is built for quick one-off downloads and simple batch workflows:
- pass one ID, many IDs, FASTA files, or stdin
- download PDB, CIF, or both
- optionally gzip the saved files
- tune concurrency for larger jobs
Benchmark
Local benchmark against the AlphaFold Homo sapiens proteome with 47,172 gzipped structures (pdb + cif).
Install
Run once with uvx:
uvx --from AlphaFoldFetch affetch P11388
Or install the affetch command:
uv tool install AlphaFoldFetch
AlphaFoldFetch requires Python 3.11 or newer.
Quick Start
Download the default outputs for one UniProt accession:
affetch P11388
Download several accessions:
affetch P11388 Q01320 P41516
Write files to an existing directory:
mkdir -p structures
affetch -o structures P11388
Download an uncompressed PDB only:
affetch -f p P11388
Read IDs from stdin:
printf "P11388\nQ01320\n" | affetch -
Usage
affetch [OPTIONS] UNIPROT...
Arguments:
UNIPROT...: UniProt IDs, FASTA files, or-for stdin
Common options:
--output,-o: output directory, default: current directory--file-type,-f: any combination ofp,c, andz, default:pcz--model,-m: AlphaFold model version, default:6--n-sync: concurrent download requests, default:50--n-save: file writes submitted per batch, default:500
Input Rules
AlphaFoldFetch accepts:
- UniProt accessions like
P11388 - strings that contain a valid UniProt accession
- FASTA files ending in
.fasta,.fas,.fa, or.faa -to read whitespace-separated input from stdin
FASTA parsing only keeps validated UniProt IDs from header lines.
Output Rules
The --file-type option is a compact set of letters:
p: save PDB filesc: save CIF filesz: gzip the selected outputs
The default value is pcz, so affetch P11388 downloads gzipped PDB and CIF files for AlphaFold model 6:
AF-P11388-F1-model_v6.pdb.gz
AF-P11388-F1-model_v6.cif.gz
Examples:
-f p: uncompressed PDB only-f c: uncompressed CIF only-f pc: uncompressed PDB and CIF-f pz: gzipped PDB only-f cz: gzipped CIF only
The output directory must already exist. IDs without an available AlphaFold file are skipped.
FASTA Files
Download structures from one or more UniProt FASTA files:
affetch UP000005640_9606.fasta
affetch plant_pgks.fasta mammalian_pgks.fasta bacterial_pgks.fasta
Only header lines are scanned for UniProt accessions.
Pipelines
From an AlphaFold DB search results CSV:
tail -n +2 results-csv.csv | while IFS='-' read -r f1 f2 f3; do echo $f2; done | affetch -
From getSequence:
getseq human top2a, mouse top2a, rat top2a | affetch -
Remember to pass - when reading IDs from stdin.
More Information
- Documentation: https://mansanlab.github.io/alphafoldfetch/
- Issues: https://github.com/mansanlab/alphafoldfetch/issues
Credits
Inspired by getSequence.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file alphafoldfetch-1.0.2.tar.gz.
File metadata
- Download URL: alphafoldfetch-1.0.2.tar.gz
- Upload date:
- Size: 7.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5e39c9ea40a55f3d0eff332c2f1c5d8eea77fd7a84b8609802a75eb954e145de
|
|
| MD5 |
5bc82c68fe469782beb7b2df06ca1f20
|
|
| BLAKE2b-256 |
caf7266880617b3c9934ca05674b337dc82900b71c15c12dcd2ccffe34992016
|
Provenance
The following attestation bundles were made for alphafoldfetch-1.0.2.tar.gz:
Publisher:
publish.yml on mansanlab/alphafoldfetch
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
alphafoldfetch-1.0.2.tar.gz -
Subject digest:
5e39c9ea40a55f3d0eff332c2f1c5d8eea77fd7a84b8609802a75eb954e145de - Sigstore transparency entry: 1510721149
- Sigstore integration time:
-
Permalink:
mansanlab/alphafoldfetch@d8e168b0b75986aec8ebd31b892f39e3bc59f95a -
Branch / Tag:
refs/tags/v1.0.2 - Owner: https://github.com/mansanlab
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@d8e168b0b75986aec8ebd31b892f39e3bc59f95a -
Trigger Event:
push
-
Statement type:
File details
Details for the file alphafoldfetch-1.0.2-py3-none-any.whl.
File metadata
- Download URL: alphafoldfetch-1.0.2-py3-none-any.whl
- Upload date:
- Size: 7.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c265d308e23f3de8df9874ac09be871cc891c265a6c1fde620f46b1b9cabd46d
|
|
| MD5 |
534b8aab9bf7b51936b8e82ebb3cc4ef
|
|
| BLAKE2b-256 |
b56d2cde3eb0414a2ae187ebe3b08d8cd9a19146f6cb39caabda5c71dcd187e4
|
Provenance
The following attestation bundles were made for alphafoldfetch-1.0.2-py3-none-any.whl:
Publisher:
publish.yml on mansanlab/alphafoldfetch
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
alphafoldfetch-1.0.2-py3-none-any.whl -
Subject digest:
c265d308e23f3de8df9874ac09be871cc891c265a6c1fde620f46b1b9cabd46d - Sigstore transparency entry: 1510721236
- Sigstore integration time:
-
Permalink:
mansanlab/alphafoldfetch@d8e168b0b75986aec8ebd31b892f39e3bc59f95a -
Branch / Tag:
refs/tags/v1.0.2 - Owner: https://github.com/mansanlab
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@d8e168b0b75986aec8ebd31b892f39e3bc59f95a -
Trigger Event:
push
-
Statement type: