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

Easy access to non-hybrid topologies for endstates #34

Open
tlhr opened this issue Sep 25, 2024 · 2 comments
Open

Easy access to non-hybrid topologies for endstates #34

tlhr opened this issue Sep 25, 2024 · 2 comments

Comments

@tlhr
Copy link

tlhr commented Sep 25, 2024

Is there an easy way to get access to a clean representation (non-hybrid) of the ligand trajectory at lambda[0] and lambda[-1]? Maybe I'm overcomplicating the indexing procedure, but actually it seems quite tedious.

In an ideal world I would envision something like an extra flag for the reader, e.g.:

u = mda.Universe('hybrid_system.pdb', 'simulation.nc', format=FEReader, state_id=0, hybrid=False)

This would make subsequent analyses a lot easier!

@tlhr
Copy link
Author

tlhr commented Sep 25, 2024

I just realized that I was indeed overcomplicating the indexing, it seems that the lambda state is stored in the bfactor field (with 0.25, 0.5, 0.75 corresponding to state A, both states, and state B respectively). So getting a clean trajectory just involves something like this:

atom_mapping_b = np.array([atom.ix for atom in u.atoms if atom.bfactor in (0.5, 0.75)])
state_b = u.atoms[atom_mapping_b]

Leaving this open to see what the feelings on a flag are, otherwise this can be closed!

@IAlibay
Copy link
Member

IAlibay commented Sep 25, 2024

Ah yes, thanks for raising this @tlhr - the bfactor hack is.. well kind of a hack, we probably need to find a better long term solution to this problem and/or make sure it's well documented!

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

2 participants