Structure and recycling
Use this sub-skill for residue-level coordinate prediction, invariant point
attention (IPA) refinement, confidence output, recycling between model passes,
or template/extra-MSA inputs that should feed the structure path. The operating
contract is the alphafold2_pytorch.Alphafold2 API in distribution version
0.4.32.
Route first
- Read the API reference for verified structure
flags, input shapes, return precedence, precision, and the exact
Recyclables contract.
- Read the workflows for tiny coordinate,
confidence, auxiliary-output, recycling, template, and extra-MSA recipes.
- Read troubleshooting for missing structure
dependencies, CUDA allocation failures, shape/device problems, stale README
options, and unsupported external refinement assumptions.
- Run the bundled coordinate smoke for a
deterministic, download-free CPU check. Use its optional
--device only
after the requested backend can allocate memory.
Operating rules
- Construct
Alphafold2(..., predict_coords=True). Supply integer seq of
shape (B, N), boolean residue mask of shape (B, N), and normally an
integer msa of shape (B, M, N) with a matching boolean msa_mask.
Omitting msa creates a one-row MSA from seq, but still requires mask.
- At this version, coordinate output is exactly
(B, N, 3): one XYZ point
per residue. Do not reinterpret it as backbone, side-chain, or all-atom
coordinates.
structure_module_depth counts IPA refinement iterations and
structure_module_heads is passed to IPABlock. Although accepted by the
constructor, structure_module_dim_head is not forwarded to the current
IPA block and is not a verified active width control.
- Use
return_confidence=True for (coords, confidence), where confidence is
raw learned-head output of shape (B, N, 1). Use
return_aux_logits=True for (coords, ReturnValues). Auxiliary output wins
if both flags are true, so confidence is then not returned separately.
- Capture recycling state with both
return_aux_logits=True and
return_recyclables=True; then pass ret.recyclables into a compatible
second call. Validate all three recyclable fields for shape, device,
finiteness, and detachment first. Recycling is explicit per call and is not
a guarantee of better coordinates.
- Treat templates and extra MSA as feature tensors that feed the trunk before
structure refinement, not as file paths or direct coordinate outputs. Follow
the conservative current-version recipes because the extra-MSA branch has a
documented implementation defect.
- Reject stale README-only arguments including
atoms,
structure_module_type, structure_module_dim,
structure_module_refinement_iters, and
predict_real_value_distances. The current API does not expose selectable
SE3/EN/EGNN structure modules or atom-expanded output.
Route core distogram/angle configuration to
core-model, coordinate metrics and post-processing to
utilities, and pretrained external wrappers to
embeddings. Full data acquisition, training,
checkpoint download, atom building, PDB production, and external relaxation
remain outside this sub-skill.
1---2name: structure-and-recycling3description: "Guide coordinate prediction, IPA structure refinement, confidence4 and recyclable outputs, and optional template or extra-MSA inputs that feed5 structure refinement in alphafold2-pytorch 0.4.32."6disable-model-invocation: true7metadata:8 source: https://skillmd.com/skills/vectorspacelab/structure-and-recycling9 disco-role: operating10license: MIT11---1213# Structure and recycling1415Use this sub-skill for residue-level coordinate prediction, invariant point16attention (IPA) refinement, confidence output, recycling between model passes,17or template/extra-MSA inputs that should feed the structure path. The operating18contract is the `alphafold2_pytorch.Alphafold2` API in distribution version190.4.32.2021## Route first2223- Read [the API reference](references/api-reference.md) for verified structure24 flags, input shapes, return precedence, precision, and the exact25 `Recyclables` contract.26- Read [the workflows](references/workflows.md) for tiny coordinate,27 confidence, auxiliary-output, recycling, template, and extra-MSA recipes.28- Read [troubleshooting](references/troubleshooting.md) for missing structure29 dependencies, CUDA allocation failures, shape/device problems, stale README30 options, and unsupported external refinement assumptions.31- Run the bundled [coordinate smoke](scripts/coordinate_smoke.py) for a32 deterministic, download-free CPU check. Use its optional `--device` only33 after the requested backend can allocate memory.3435## Operating rules36371. Construct `Alphafold2(..., predict_coords=True)`. Supply integer `seq` of38 shape `(B, N)`, boolean residue `mask` of shape `(B, N)`, and normally an39 integer `msa` of shape `(B, M, N)` with a matching boolean `msa_mask`.40 Omitting `msa` creates a one-row MSA from `seq`, but still requires `mask`.412. At this version, coordinate output is exactly `(B, N, 3)`: one XYZ point42 per residue. Do not reinterpret it as backbone, side-chain, or all-atom43 coordinates.443. `structure_module_depth` counts IPA refinement iterations and45 `structure_module_heads` is passed to `IPABlock`. Although accepted by the46 constructor, `structure_module_dim_head` is not forwarded to the current47 IPA block and is not a verified active width control.484. Use `return_confidence=True` for `(coords, confidence)`, where confidence is49 raw learned-head output of shape `(B, N, 1)`. Use50 `return_aux_logits=True` for `(coords, ReturnValues)`. Auxiliary output wins51 if both flags are true, so confidence is then not returned separately.525. Capture recycling state with both `return_aux_logits=True` and53 `return_recyclables=True`; then pass `ret.recyclables` into a compatible54 second call. Validate all three recyclable fields for shape, device,55 finiteness, and detachment first. Recycling is explicit per call and is not56 a guarantee of better coordinates.576. Treat templates and extra MSA as feature tensors that feed the trunk before58 structure refinement, not as file paths or direct coordinate outputs. Follow59 the conservative current-version recipes because the extra-MSA branch has a60 documented implementation defect.617. Reject stale README-only arguments including `atoms`,62 `structure_module_type`, `structure_module_dim`,63 `structure_module_refinement_iters`, and64 `predict_real_value_distances`. The current API does not expose selectable65 SE3/EN/EGNN structure modules or atom-expanded output.6667Route core distogram/angle configuration to68[core-model](../core-model/SKILL.md), coordinate metrics and post-processing to69[utilities](../utilities/SKILL.md), and pretrained external wrappers to70[embeddings](../embeddings/SKILL.md). Full data acquisition, training,71checkpoint download, atom building, PDB production, and external relaxation72remain outside this sub-skill.