Skip to content

Fix PDB and mmCIF input directory parsing - #873

Open
sixty-66 wants to merge 1 commit into
sokrypton:mainfrom
sixty-66:fix/structure-input-directories
Open

sixty-66 wants to merge 1 commit into
sokrypton:mainfrom
sixty-66:fix/structure-input-directories

Conversation

@sixty-66

@sixty-66 sixty-66 commented Nov 9, 2026

Copy link
Copy Markdown

get_queries() accepts PDB and mmCIF files in an input directory, but those branches raise UnboundLocalError because protein is only imported in the single-file branch. Import it lazily in the directory's structure-file branch as well.

After appending a structure query, continue to the next file. Otherwise the parser falls through to the FASTA logic and accesses seqs, which is either unbound or left over from a preceding FASTA file.

Add regression tests under the existing tests/ directory that call the input module directly and use the repository's existing structure fixtures. They cover PDB/mmCIF directories, uppercase extensions, and mixed FASTA/structure directories in both filename orders. No model weights or network service are needed.

Validation on Windows / Python 3.12.12 / alphafold-colabfold 2.3.23 / Biopython 1.85:

  • python -m pytest tests/test_input.py -q -p no:cacheprovider: 8 passed. All eight fail with UnboundLocalError before the fix.
  • A separate local compatibility check against existing FASTA/A3M directory fixtures confirms their expected results and that neither path imports the optional AlphaFold package. Existing single-file PDB/mmCIF parsing also passes with the real parser. This check is outside the repository and is not an added upstream test.
  • The new test module passes Black 23.1.0; git diff --check passes.

The full repository suite, GPU inference and upstream CI have not been run. No existing issue is linked; the failure was found while inspecting directory input handling.

Import the structure parser in the directory branch and stop structure inputs from falling through to FASTA processing. Cover real structure fixtures and mixed directory traversal orders.
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.

1 participant