Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

apparent fencepost error in 'pdb traj' reading. #121

Open
lgsmith opened this issue Jul 26, 2024 · 0 comments
Open

apparent fencepost error in 'pdb traj' reading. #121

lgsmith opened this issue Jul 26, 2024 · 0 comments

Comments

@lgsmith
Copy link
Contributor

lgsmith commented Jul 26, 2024

Describe the bug

I get a:

terminate called after throwing an instance of 'std::out_of_range'
  what():  Bad index for an atom
Aborted (core dumped)

from trying to read to the end of a trajectory defined with the multipose pdb

To Reproduce

I attached an example pdb test-pose.txt (change the extension, obviously). When I try to read it like this:

import loos
from loos import pyloos
m = loos.createSystem('test-pose.pdb')
t = pyloos.Trajectory('test-pose.pdb', m)
print(len(t))
t[len(t) - 1]

I get the segfault. When I delete the last ENDMDL record, the file can be read through the final frame and the iterator exhausts normally. The issues don't arise until trying to reference the 'final' frame.

Expected behavior

Reading all 20 frames, then having the iterator know it's empty instead of thinking there are 21 and segfaulting.

LOOS version and platform

conda install 4.04
linux

Additional context

Alan and I slacked about this. It looks like the ENDMDL record queues the reader to expect another frame, but this PDB (created from a multipose sdf using openbabel) ends with:

ENDMDL
END
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

No branches or pull requests

1 participant