Skip to content

web_service: fix covalent position validation - #344

Open
dajiaohuang wants to merge 1 commit into
bytedance:mainfrom
dajiaohuang:fix/341-covalent-position-validation
Open

web_service: fix covalent position validation#344
dajiaohuang wants to merge 1 commit into
bytedance:mainfrom
dajiaohuang:fix/341-covalent-position-validation

Conversation

@dajiaohuang

Copy link
Copy Markdown

Summary

  • validate polymer covalent-bond positions against the actual sequence length
  • keep the existing positive-position check for every entity type
  • defer non-polymer upper-bound validation to the inference parser, which has parsed ligand residue and atom information
  • add a focused viewer regression test for a terminal protein residue bonded to a ligand

Root cause

ProtenixInputViewer.get_result() unwrapped each entity to its inner metadata dictionary and used len() on that dictionary. A polymer dictionary normally contains three fields, so valid sequence positions greater than 3 were rejected before featurization.

Testing

  • python -m pytest tests/test_web_service_covalent_bonds.py -q (1 passed)
  • python -m unittest tests.test_web_service_covalent_bonds -v (1 passed)
  • python -m py_compile protenix/web_service/viewer.py tests/test_web_service_covalent_bonds.py
  • python -m flake8 protenix/web_service/viewer.py tests/test_web_service_covalent_bonds.py --count --select=E9,F63,F7,F82 --show-source --statistics (0 errors)

Closes #341

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.

web_service: validate covalent positions against polymer sequence length

1 participant