test(rf3): add MSA input tests#364
Open
woodsh17 wants to merge 2 commits into
Open
Conversation
Checkpoint-free tests pinning the ColabFold-style a3m format rf3 expects at inference, parsed via atomworks parse_a3m. A self-documenting minimal a3m fixture exercises the query row, lowercase insertion stripping, gap columns, and TaxID header parsing (the key that drives multimer MSA pairing). Doubles as executable documentation of a valid rf3 MSA input.
Feed pre-computed MSAs through rf3 fold across chain counts (monomer, homodimer, heteromer) and both input modes (JSON msa_path and CIF _msa_paths_by_chain_id). Inputs are short synthetic sequences with hand-built a3m files so the suite folds quickly on CPU; the heteromer uses a distinct a3m per chain with a shared TaxID to form a genuine paired MSA. Multi-chain cases assert iptm > 0. Two tests pin the raise_if_missing_msa_for_protein_of_length_n guard: it errors when a long protein lacks an MSA and stays quiet when present. Adds msa_fold_dir and msa_present_flag_dir fixtures and an assert_valid_plddt helper to the integration conftest.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds tests for the MSA (multiple sequence alignment) input that rf3 accepts at
inference. There was no coverage of the MSA input path and no example that
documents the expected
.a3mformat.Layer 1 — a3m format-contract unit tests (checkpoint-free).
models/rf3/tests/test_msa_format.pypins the ColabFold-style.a3mformatand how
atomworks.parse_a3mreads it, using a small self-documentingfixture (query + 3 homologs) that exercises every parsing rule:
(N, L)with the query as row 0 and uniform column width;-gaps are kept as columns;TaxID=taxonomy IDs are parsed from headers (the key that pairs homologsacross chains for multimers), including the query sentinel and the
empty-header case;
Layer 2 — end-to-end fold integration tests (checkpoint-gated).
models/rf3/tests/integration/test_msa_fold.pyfeeds pre-computed MSAsthrough
rf3 foldacross chain counts (monomer / homodimer / heteromer) andboth input modes (JSON
msa_pathand CIF_msa_paths_by_chain_id):msa_path;_msa_paths_by_chain_id;iptm > 0;form a genuine paired MSA), asserts
iptm > 0;raise_if_missing_msa_for_protein_of_length_nguard: errors when aprotein above the length threshold has no MSA, and stays quiet when present.
A
msa_fold_dirfixture batches the four folds into one model load;msa_present_flag_dirand anassert_valid_plddthelper are added alongside.Test data
All inputs use short synthetic sequences (~12 residues) with hand-built a3m
files: these tests exercise MSA format and plumbing, not structure quality, so
a real complex — which is far slower on CPU — is unnecessary. The CIF-mode
input was generated by folding the synthetic monomer once and attaching the
_msa_paths_by_chain_idheader (the same construction as the existing*_from_file.cifinputs).