Skip to content

Raise FileExistsError if colabfold raw directory is found before performing colabfold alignments - #233

Merged
jnwei merged 1 commit into
mainfrom
feature/issue-39-error-on-existing-cf-raw-dir
May 29, 2026
Merged

jnwei merged 1 commit into
mainfrom
feature/issue-39-error-on-existing-cf-raw-dir

Conversation

@jnwei

@jnwei jnwei commented May 28, 2026

Copy link
Copy Markdown
Contributor

Summary
The existance of the raw colabfold directory, in particular, the raw/out.tar.gz file from a previous run can cause the colabfold pipeline to assume that the colabfold job has been previously completed and skips submitting a new job.

In the worst case scenario, if a previous inference job crashes, and a new one is submitted, the wrong alignments from the outdated out.tar.gz file will be parsed and create potentially silent issues for prediction.

This PR raises an FileExistsError in the case that the colabfold raw directory still exists, and instructs the user to delete the directory. At this time, we leave the task of deleting the directory on the user in case they want to inspect or save the raw files.

Changes

  • In preprocess_colabfold_msas add an error if the raw/ output directory exists
  • Add a new test TestColabFoldQueryRunner.test_preprocess_raises_if_raw_dir_exists to check for FileExistsError
  • Updates two previous tests as a result of the check:
    • TestColabFoldQueryRunner.test_empty_m8_file_handling : Replace the full preprocess_colabfold_msas call with add_msa_paths_to_iqs. I believe the intended purpose is to check the assignment of the templates alignments / entry ids upon receiving an empty template pdb70.m8 file. The rest of preprocess_colabfold_msas is already performed separately in this test in order to add additional assertions and checks.
    • TestColabFoldQueryRunner.test_features_on_multiple_queries_with_same_name: Delete the raw directory upon completion of the test loop.

Related Issues
#39

Testing

  • Passes all tests in openfold3/tests/core/data/tools/test_colabfold_msa_server.py

Other Notes

@jnwei
jnwei requested a review from jandom May 28, 2026 10:15
@jnwei

jnwei commented May 28, 2026

Copy link
Copy Markdown
Contributor Author

TestColabFoldQueryRunner:test_empty_m8_file_handling: Replace the full preprocess_colabfold_msas call with add_msa_paths_to_iqs. I believe the intended purpose is to check the assignment of the templates alignments / entry ids upon receiving an empty template pdb70.m8 file. The rest of preprocess_colabfold_msas is already performed separately in this test in order to add additional assertions and checks.

@qurat-ul-ain95 Could you verify that the above change to the test test_empty_m8_file_handling is correct. I think I have understood the logic of that test, but I'd appreciate your validation as well.

@jnwei jnwei linked an issue May 28, 2026 that may be closed by this pull request
@jnwei jnwei added the safe-to-test Internal only label used to indicate PRs that are ready for automated CI testing. label May 29, 2026
@jnwei
jnwei merged commit 6254913 into main May 29, 2026
13 checks passed
@jnwei
jnwei deleted the feature/issue-39-error-on-existing-cf-raw-dir branch May 29, 2026 02:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

safe-to-test Internal only label used to indicate PRs that are ready for automated CI testing.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Always delete raw Colabfold folder before processing

2 participants