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

How to get all angles and bond lengths of a residue? #4213

Open
LtECoD opened this issue Jan 12, 2023 · 7 comments
Open

How to get all angles and bond lengths of a residue? #4213

LtECoD opened this issue Jan 12, 2023 · 7 comments

Comments

@LtECoD
Copy link

LtECoD commented Jan 12, 2023

The Bio.PDB.internal_coords module provides APIs such as "get_angle" and "get_length" that could return a specific angle or a bond length. But I didn't find an easy way to get all angles and bond lengths in the source code and official tutorial. Whether this purpose can only be implemented by traversing every angle or bond?

@peterjc
Copy link
Member

peterjc commented Jan 12, 2023

Which bond/angles do you want? If you want all of them, then as you say traversing seems appropriate.

There may be a helper functions like .get_phi_psi_list(...) for special case, see my (very old) example at https://warwick.ac.uk/fac/sci/moac/people/students/peter_cock/python/ramachandran/calculate/ using MMTK and Biopython for this.

@LtECoD LtECoD closed this as completed Jan 12, 2023
@rob-miller
Copy link
Contributor

rob-miller commented Jan 12, 2023 via email

@LtECoD LtECoD reopened this Jan 13, 2023
@LtECoD
Copy link
Author

LtECoD commented Jan 13, 2023

For the GLY residue, call the get_length("N:CA") in the internal_coord returns None, but it works well for residue of other types and return normal bond length between N and CA. Is this a bug?

@LtECoD
Copy link
Author

LtECoD commented Jan 13, 2023

For the GLY residue, call the get_length("N:CA") in the internal_coord returns None, but it works well for residue of other types and return normal bond length between N and CA. Is this a bug?

Even when i set the gly_cbeta to true by

IC_Residue.gly_Cbeta = True 
chain.atom_to_internal_coordinates()

i still cannot get the N:CA bond length of GLY.

@LtECoD
Copy link
Author

LtECoD commented Jan 13, 2023

For the GLY residue, call the get_length("N:CA") in the internal_coord returns None, but it works well for residue of other types and return normal bond length between N and CA. Is this a bug?

It seems that N:CA length doesn't take effect in "internal_coord_to_atom_coordindates", since the atom coordinates keep unchanged after the N:CA length is set to other values.

@rob-miller
Copy link
Contributor

rob-miller commented Jan 13, 2023 via email

@rob-miller
Copy link
Contributor

However there is a bug related to this for set_length() on a backbone bond, causing some atom coordinates to not be updated as you found.
This fix has now been added to #3898, to work around it on the current code base you would need to change values directly in the IC_Chain.hedra dictionary. If you need/want to do this, you should know that the problem comes from multiple hedra specifying the same bond, e.g. N:CA or CA:C, and the value needs to be updated in all of them. Another option might be look at the #3898 fix to IC_Residue.pick_length() and monkey patch that on your installation.

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

3 participants