Utilities¶
Structures¶
fetch_structure
¶
Return a local path to a PDB structure, downloading it if needed.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
identifier
|
str
|
A local file path, a 4-character PDB id (RCSB), or a UniProt accession (AlphaFold DB). |
required |
source
|
(auto, file, rcsb, afdb)
|
Where to fetch from; 'auto' infers it from the identifier. |
'auto'
|
version
|
str
|
AFDB model version (default 'v4'; its coordinates are carried forward by later AFDB releases, so this stays the stable default). |
'v6'
|
frag
|
int
|
AFDB fragment number (1 for all but very long proteins). |
1
|
cache_dir
|
str or None
|
|
None
|
Source code in makeshift/utils/structures.py
detect_source
¶
Infer where a structure identifier should be fetched from: 'file' if it's an existing path 'rcsb' for a PDB id, 'afdb' for a UniProt accession Raises if it matches neither pattern (pass source= explicitly).
Source code in makeshift/utils/structures.py
Datasets¶
fetch
¶
fetch(name: str, url: Optional[str] = None, sha256: Optional[str] = None, cache_dir: Optional[Path] = None, overwrite: bool = False) -> Path
Download, verify, cache, and extract a dataset zip.
Three ways to call it:
-
Registered dataset — pass a
namefrom the DATASETS registry::fetch("SHP2_NSH2_CPMG")
-
Arbitrary dataset — pass a
url(and optionallysha256);nameis used as the cache folder::fetch("my_set", url="https://.../my_set.zip", sha256="...")
-
A URL directly as
name— the cache folder is derived from the URL::fetch("https://.../my_set.zip")
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
A registered dataset name, a cache-folder name (with |
required |
url
|
str
|
Direct download URL. Overrides the registry; required for datasets not in DATASETS. |
None
|
sha256
|
str
|
Expected hex digest for integrity verification. Falls back to the registry value for registered datasets; skipped if not available. |
None
|
cache_dir
|
Path
|
Root cache directory. Defaults to ~/.makeshift/datasets/. |
None
|
overwrite
|
bool
|
If True, re-download even if already cached. |
False
|
Returns:
| Type | Description |
|---|---|
Path
|
Directory containing the extracted dataset files. |
Source code in makeshift/utils/datasets.py
list_datasets
¶
Reference tables¶
tables
¶
get_random_coil
¶
Random coil chemical shifts (Wishart & Sykes 1994). Returns {residue: {atom: float}}.
Source code in makeshift/data/tables.py
get_panav_distns
¶
PANAV reference distributions. Returns {residue: {ss: {atom: (mean, std)}}}.
Source code in makeshift/data/tables.py
get_bmrb_stats
¶
BMRB full-database statistics. Returns {residue: {atom: (mean, std)}}.
Source code in makeshift/data/tables.py
get_c_prime_rc
¶
C' random coil values (Wishart et al. 1995). Returns {residue: float}.