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}.
get_rc_pre_pro
¶
Wishart et al. 1995 Table 5 — CA/CB/C' random coil when followed by Pro. Returns {residue: {atom: float}}.
Source code in makeshift/data/tables.py
get_rc_n_prev
¶
Wishart et al. 1995 Table 8 — 15N of Ala when preceded by each residue. Returns {prev_residue: float}. Used by LACS for the N i−1 correction.
Source code in makeshift/data/tables.py
get_csi_wishart
¶
Wishart CSI reference ranges. Returns {residue: {atom: (center, half_width)}}.
¹Hα from Wishart, Sykes & Richards (1992); ¹³Cα/β/′ from Wishart & Sykes
(1994). Oxidized Cys is stored under residue code CYSO.
Source code in makeshift/data/tables.py
get_talosn_rc_tables
¶
TALOS-N's own random-coil-adjustment tables (randcoil.tab, rcadj.tab, rcprev.tab, rcnext.tab, bundled with the TALOS-N binary) -- a different table system from RCI's own Schwarzinger tables above, used by TALOS-N's RCI-S2 module (RCI.cpp) to synthesize a value for atoms that were never observed (see makeshift.rci._talosn). Each is a DataFrame indexed by one-letter residue code (plus "c" for TALOS-N's own oxidized-Cys variant, its own >=34.0ppm CB threshold -- distinct from RCI's 35.0ppm one) with columns [N, CO, CA, CB, NH, HA]; NaN marks an atom with no defined value (Gly CB, Pro NH in randcoil only).
Returns a dict with keys: randcoil, rcadj, rcprev, rcnext.
Source code in makeshift/data/tables.py
get_rci_tables
¶
Lookup tables for the RCI (Random Coil Index) flexibility predictor.
neighbor_table selects which preceed/next-residue correction values
to use -- see RCI_NEIGHBOR_TABLES for the options and what they mean.
Each returned value is a DataFrame indexed by one-letter residue code
with columns [N, CO, CA, CB, NH, HA]; NaN marks an atom that has no
defined value for that residue (e.g. Gly CB, Pro N/NH).
Returns a dict with keys: random_coil, preceed_effect, next_effect, preceed_preceed_effect, next_next_effect.