Skip to content

[codex] Reuse existing monomer features in default TrueMultimer mode#609

Merged
DimaMolod merged 3 commits intomainfrom
codex/fix-465-truemultimer-existing-msa
Apr 9, 2026
Merged

[codex] Reuse existing monomer features in default TrueMultimer mode#609
DimaMolod merged 3 commits intomainfrom
codex/fix-465-truemultimer-existing-msa

Conversation

@DimaMolod
Copy link
Copy Markdown
Collaborator

@DimaMolod DimaMolod commented Apr 9, 2026

Summary

This PR fixes the default non-clustered TrueMultimer path so it can reuse precomputed monomer feature pickles instead of requiring fresh MSAs.

Closes #465.

Root Cause

process_multimeric_features() always created a fresh MonomericObject and ran the full AF2 feature pipeline, even when a monomer feature pickle for the original FASTA entry already existed in the output directory. As a result, default TrueMultimer still required the original MSA inputs and database access just to replace template features.

What Changed

  • add a TrueMultimer reuse path for the default non-clustered mode
  • load an existing monomer feature pickle from <output_dir>/<protein>.pkl or <output_dir>/<protein>.pkl.xz when available
  • replace only the template features using extract_multimeric_template_features_for_single_chain
  • preserve the stored MSA and paired/all-seq features from the existing pickle
  • keep the previous full-pipeline behavior as a fallback when no reusable source pickle exists
  • add regression coverage for both .pkl and .pkl.xz source pickles

Validation

  • PYTHONPATH=/tmp/ap_pyshim:$PYTHONPATH conda run -n AlphaPulldown python -m pytest -q test/integration/test_create_individual_features.py -k 'reuses_existing_source_pickle or process_multimeric_features or create_and_save_monomer_objects'
  • PYTHONPATH=/tmp/ap_pyshim:$PYTHONPATH conda run -n AlphaPulldown python -m pytest -q test/integration/test_create_individual_features.py

Note: the temporary PYTHONPATH shim was only needed on this workstation to work around local AlphaFold/Biopython version mismatches during test collection. It is not part of the repo changes.

@DimaMolod DimaMolod marked this pull request as ready for review April 9, 2026 14:32
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 55af0f777f

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread alphapulldown/scripts/create_individual_features.py
@DimaMolod DimaMolod merged commit 098792f into main Apr 9, 2026
6 checks passed
@DimaMolod DimaMolod deleted the codex/fix-465-truemultimer-existing-msa branch April 9, 2026 14:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Do not require MSAs for the TrueMultimer default mode

1 participant