Skip to content

fix(msa): Be more robust to nulls in a3m files.#50

Merged
nscorley merged 3 commits into
RosettaCommons:stagingfrom
roccomoretti:roccomoretti/fix_a3m_null
Nov 29, 2025
Merged

fix(msa): Be more robust to nulls in a3m files.#50
nscorley merged 3 commits into
RosettaCommons:stagingfrom
roccomoretti:roccomoretti/fix_a3m_null

Conversation

@roccomoretti

Copy link
Copy Markdown
Member

The MMseqs2 server can return .a3m files with a null character at the end of the file. This currently messes up parsing. Strip this character out of the file, as it has no semantic meaning.

📋 PR Checklist

  • This PR is tagged as a draft if it is still under development and not ready for review.

    This avoids auto-triggering the slower tests in the CI and needlessly wasting resources.

  • I have ensured that all my commits follow angular commit message conventions.

    Format: <type>[optional scope]: <subject>
    Example: fix(af3): add missing crop transform to the af3 pipeline

    This affects semantic versioning as follows:

    • fix: patch version increment (0.0.1 → 0.0.2)
    • feat: minor version increment (0.0.1 → 0.1.0)
    • BREAKING CHANGE: major version increment (0.0.1 → 1.0.0)
    • All other types do not affect versioning

    The format ensures readable changelogs through auto-generation from commit messages.

  • I have run make format on the codebase before submitting the PR (this autoformats the code and lints it).

  • I have named the PR in angular PR message format as well (c.f. above), with a sensible tag line that summarizes all the changes in the PR.

    This is useful as the name of the PR is the default name of the commit that will be used if you merge with a squash & merge.
    Format: <type>[optional scope]: <subject>
    Example: fix(af3): add missing crop transform to the af3 pipeline


ℹ️ PR Description

What changes were made and why?

The MMseqs2 server can return .a3m files with a null character at the end of the file.
This currently messes up parsing. Strip this character out of the file, as it has no semantic meaning.

How were the changes tested?

The modifications were performed in conjunction with RF3, which allowed reading of an a3m file which previously caused a failure.

Writing of a unit test was considered, but it looks like no tests for the MSA parsing currently exist.

Additional Notes

Should address RosettaCommons/foundry#13

(Also, make format is changing much more than what I altered. If this part of anticipated PR process for new contributors, it would be best to keep production clean.)

The MMseqs2 server can return .a3m files with a null character at the end of the file.
This currently messes up parsing. Strip this character out of the file, as it has no semantic meaning.
@nscorley

nscorley commented Oct 2, 2025

Copy link
Copy Markdown
Collaborator

Thank you for this PR! The test failing is not from your changes -- it's something that changed with either biotite or the RCSB that we've replicated locally as well. I'll try and merge something to just skip those tests then we can merge this on top

@nscorley nscorley merged commit f6fe986 into RosettaCommons:staging Nov 29, 2025
1 of 2 checks passed
nscorley pushed a commit that referenced this pull request Nov 29, 2025
…s mask (#50)

* fix: ensure that the Index condition's default annotation respects its mask

* fix: bugfix

* fix: switch to using -1 for masked indices, and add a class attribute for this value

---------

Co-authored-by: Rafi Brent <rafi.brent@gmail.com>
github-actions Bot pushed a commit that referenced this pull request Nov 29, 2025
# [1.1.0](v1.0.3...v1.1.0) (2025-11-29)

### Bug Fixes

* a couple of Condition updates ([#59](#59)) ([a0f173b](a0f173b))
* add a flag to optionally tolerate the situation of missing or multiple representative/center atoms per token ([#67](#67)) ([896ca38](896ca38))
* add errors for cases where parsing an AtomArrayPlus is problematic ([80d00e3](80d00e3))
* add padding for short residue names in sharding ([94abca1](94abca1))
* add raise_if_not_set to get_msa_dirs_from_env ([0f50eb2](0f50eb2))
* add raise_if_not_set to get_msa_dirs_from_env ([c7bfee6](c7bfee6))
* add within poly res idx on-the-fly option ([c80104b](c80104b))
* address code review issues in performance PR ([9cda94a](9cda94a))
* allow for deleting 2d annotations from AtomArrayPlus ([84e0084](84e0084))
* allow numpy masks in addition to query syntax in SampleSeed ([3468645](3468645))
* allow override in add global token id transform ([381a743](381a743))
* apptainer ([37fe7a2](37fe7a2))
* apptainer ([e3bd135](e3bd135))
* apptainer ([0647b20](0647b20))
* apptainer for CI ([670a82a](670a82a))
* bcif tests ([378d03a](378d03a))
* Be more robust to nulls in a3m files. ([a8552a4](a8552a4))
* better messages and assertions for removing design tasks with 0 frequency ([9b6391d](9b6391d))
* broken tests ([1fcc397](1fcc397))
* bug in default seq cond mask ([00484d4](00484d4))
* change default sequence condition behavior ([981d924](981d924))
* ci for internal ([5096b6c](5096b6c))
* ci workers ([f7da3cd](f7da3cd))
* circular import ([7eafda9](7eafda9))
* claude code review ([885eb53](885eb53))
* condition set mask and terminus conditions changes ([56f661c](56f661c))
* correct cache dir structure and add padding for short IDs ([b8645fc](b8645fc))
* correct sharding path construction for cached residue data ([79d388b](79d388b))
* **databases:** correcting uniontype call bug ([8a3e59e](8a3e59e))
* **databases:** correcting uniontype call bug ([ebc26db](ebc26db))
* datasets documentation, DSSP path ([1565a94](1565a94))
* docstring formatting ([ff296d6](ff296d6))
* documentation ([1e5b0d4](1e5b0d4))
* documentation, formatting ([dcdde14](dcdde14))
* downgrade biotite ([cab5bcf](cab5bcf))
* enable deletion of 2d annotations ([1f88391](1f88391))
* enable spawn multiprocessing ([36ac421](36ac421))
* ensure that parse preserves AtomArrayPlus status, and add a test for this ([681fdeb](681fdeb))
* ensure that the Index condition's default annotation respects its mask ([#50](#50)) ([e57be2a](e57be2a))
* Formatting ([f6fe986](f6fe986))
* general masks in SampleSeed ([53df9a6](53df9a6))
* give more informative error messages for ConditionalRoute or RandomRoute failures ([3b72b18](3b72b18))
* Handle non-uniform shard sizes in AseDBDataset ([e34eb51](e34eb51))
* infer array type of TokenEncoding where possible ([#68](#68)) ([a6a8fb1](a6a8fb1))
* informative Route error messages ([87b1fbc](87b1fbc))
* minor fixes ([f45fafb](f45fafb))
* minor fixes for encodings ([e043104](e043104))
* more informative error messages ([7861023](7861023))
* parse preserves atom array plus ([d1eef92](d1eef92))
* parser defaults ([570f3ce](570f3ce))
* reduce logging level in `load_atom_array_with_conditions_from_cif` ([#48](#48)) ([52f316d](52f316d))
* remove _spoof ([995a260](995a260))
* remove ambiguous Greek characters and improve test assertions ([bad6dff](bad6dff))
* remove ASE import so we dont introduce a dependency ([7e12a8a](7e12a8a))
* remove design tasks with zero frequency during sampling instead of erroring ([4586fa2](4586fa2))
* remove hardcoded environment-specific default path ([24bf03f](24bf03f))
* remove lineprofiler stuff ([83fb3c5](83fb3c5))
* remove print statements ([ecd9e5b](ecd9e5b))
* residue starts bug with dependent functions. ([04da354](04da354))
* residue starts bug with dependent functions. ([fc252a8](fc252a8))
* **rf3:** json-level atom selection for bonds argument ([a569a7c](a569a7c))
* ruff formatting after merge with dev ([71ddb86](71ddb86))
* sasa for empty aa ([c2b9302](c2b9302))
* shard cache on structure ID (PDB ID) instead of args hash ([e5c29fd](e5c29fd))
* Support AtomArrayPlus and AtomArrayPlusStack in parse_atom_array, with some restrictions ([#46](#46)) ([c1e3b00](c1e3b00))
* test requirements ([4c4c775](4c4c775))
* tests ([eb10ba6](eb10ba6))
* typing ([8d6e39d](8d6e39d))
* updates for ame ([6530818](6530818))
* use warnings.warn instead of print for missing ase ([b6f9c7a](b6f9c7a))

### Features

* add as_atom_array_plus_stack ([804c854](804c854))
* add Claude Hode GitHub workflow ([0f4e603](0f4e603))
* add customizable annotation names for SSE validity flag ([fd6be37](fd6be37))
* add DSSP secondary structure annotation ([f1cc785](f1cc785))
* add molprobity executable? ([b87f76b](b87f76b))
* add utomatic msa depth and ext determination ([874a1dd](874a1dd))
* adding Conditions, annotator, and io utils ([b08c935](b08c935))
* atom37 with atomization encoding ([d35be40](d35be40))
* atomworks MSA preprocessing (generate, filter, organize) ([ef6ac85](ef6ac85))
* backbone constants and annotators ([de5854c](de5854c))
* **databases:** add experimental data database functionality from datahub ([f69a499](f69a499))
* **databases:** add experimental data database functionality from datahub ([8b71614](8b71614))
* generalize encodings ([c886d09](c886d09))
* generalize encodings ([83c8684](83c8684))
* Make SampleDesignTask handle empty design_tasks gracefully ([c9e5900](c9e5900))
* misc fixes for design ([71decdf](71decdf))
* MSA preprocessing (organizing, generating, filtering) ([89eb73d](89eb73d))
* MSA preprocessing; zst support ([aa3c837](aa3c837))
* paired MSA feature (from Rafi) ([805a27a](805a27a))
* paired MSA feature (from Rafi) ([2df1511](2df1511))
* skip for large structures ([6f2f33c](6f2f33c))
* update to work with transition metals ([6f2a80a](6f2a80a))

### Performance Improvements

* don't actually check symmetry every time on symmetric conditions since there's just too much overhead ([6ae656a](6ae656a))
* improve cache loading and template building performance ([c144ec7](c144ec7))
* performance optimizations for parsing ([e8faf3e](e8faf3e))
* precalculate bond graph for GrowByHoppingAlongBondGraph ([fd85178](fd85178))
* res idx ([22703bf](22703bf))
* res idx optimization ([11b5d0d](11b5d0d))
* speed up 2d symmetrization check and stop actually checking symmetry every time and make some other stuff faster ([5c3127b](5c3127b))
* speed up apply_and_spread ([ac612a4](ac612a4))
* speed up bond_graph creation ([94f0512](94f0512))
@github-actions

Copy link
Copy Markdown
Contributor

🎉 This PR is included in version 1.1.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants