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

Indexing Using Serial ID #4

Open
HamiltonGeorge opened this issue Feb 1, 2023 · 0 comments
Open

Indexing Using Serial ID #4

HamiltonGeorge opened this issue Feb 1, 2023 · 0 comments

Comments

@HamiltonGeorge
Copy link

It seems that, while the documentation says the attachment ID is selected via the serial ID of an atom rather than atom index (https://rna-fretools.github.io/fretraj/getting_started/acv_calculation.html?highlight=serial), in the Volume class of cloud.py the atom index is used, leading to issues if the mdtraj atom_slice method is used or atoms are deleted from the trajectory and then AVs are calculated after, as the number of atoms changes.

For my purposes as a quick fix to make cloud.py use the serial IDs (which are maintained when doing atom_slice, while atom index is not), I edited line 823 of cloud.py to pull the atom index of the existing atom with atom.serial equal the supplied labels["Position"][site]["attach_id"]+1, and changed line 887 to this index-1. Without this change, ft.cloud.Volume returns an index error when the given serial ID is greater than the number of atoms in the atom_slice.

self.attach_id = [i.index for i in self.structure.top.atoms if i.serial == labels["Position"][site]["attach_id"]][0]+1

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