PDBLoader: Remove assumption of continuously defined atoms. #19242
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.
Related: #19225
I'm not yet sure about the semantics of
TER
records but at least the PR ensures that the mentioned file of the issue can be loaded.The problem was that
PDBLoader
assumed a continuous definition of atoms which is not always true because ofTER
records. These records terminate a chain of atoms and can be present in a PDB file multiple times. The PR removed this assumption making the loader more generic.However, it was also necessary to remove the
json.bonds
data which was previously part of the loader's result since its indices refer to wrong atoms in thejson.atoms
array ifTER
records are present.json.bonds
was not used in the examples once and I think making it public does not provide real benefits.